From be2c47c8542bff78fe3f9aeeaec3f55200e06aa6 Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Sat, 17 Jun 2017 15:49:42 -0700 Subject: [PATCH] Update to TypeScript 2.3.4 --- lib/lib-es6-ts.js | 2 +- lib/lib-ts.js | 2 +- lib/typescriptServices.d.ts | 1882 +- lib/typescriptServices.js | 44506 ++++++++++++++++++++-------------- package.json | 2 +- 5 files changed, 27058 insertions(+), 19336 deletions(-) diff --git a/lib/lib-es6-ts.js b/lib/lib-es6-ts.js index 68cdba5d..8fdf3725 100644 --- a/lib/lib-es6-ts.js +++ b/lib/lib-es6-ts.js @@ -5,5 +5,5 @@ // This is a generated file from lib.es6.d.ts -define([], function() { return { 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\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;\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 null prototype.\n * @param o Object to use as a prototype. May be null\n */\n create(o: 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 */\n create(o: T): T;\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: any, properties: PropertyDescriptorMap): 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): 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): 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: any): 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): RegExpMatchArray | null;\n\n /**\n * Matches a string with a regular expression, and returns an array containing the results of that search.\n * @param regexp A regular expression object that contains the regular expression pattern and applicable flags.\n */\n match(regexp: RegExp): RegExpMatchArray | null;\n\n /**\n * Replaces text in a string, using a regular expression or search string.\n * @param searchValue A string that represents the regular expression.\n * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.\n */\n replace(searchValue: string, replaceValue: string): string;\n\n /**\n * Replaces text in a string, using a regular expression or search string.\n * @param searchValue A string that represents the regular expression.\n * @param replacer A function that returns the replacement text.\n */\n replace(searchValue: string, replacer: (substring: string, ...args: any[]) => string): string;\n\n /**\n * Replaces text in a string, using a regular expression or search string.\n * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags.\n * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.\n */\n replace(searchValue: RegExp, replaceValue: string): string;\n\n /**\n * Replaces text in a string, using a regular expression or search string.\n * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags\n * @param replacer A function that returns the replacement text.\n */\n replace(searchValue: 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): number;\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: 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, limit?: number): string[];\n\n /**\n * Split a string into substrings using the specified separator and return them as an array.\n * @param separator A Regular Express 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: 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 number 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 number 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): RegExp;\n new (pattern: string, flags?: string): RegExp;\n (pattern: RegExp): 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 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: U[]): 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[][]): 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 | T[])[]): 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 /**\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, 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, 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 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 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: T[][]): 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 | T[])[]): 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 */\n splice(start: 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(this: [T, T, T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U, U, U];\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(this: [T, T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U, U];\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(this: [T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U];\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(this: [T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U];\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[]) => 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, 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, 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(\n onfulfilled?: ((value: T) => T | PromiseLike) | undefined | null,\n onrejected?: ((reason: any) => T | PromiseLike) | undefined | null): PromiseLike;\n\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(\n onfulfilled: ((value: T) => T | PromiseLike) | undefined | null,\n onrejected: (reason: any) => TResult | PromiseLike): PromiseLike;\n\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(\n onfulfilled: (value: T) => TResult | PromiseLike,\n onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): PromiseLike;\n\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(\n onfulfilled: (value: T) => TResult1 | PromiseLike,\n onrejected: (reason: any) => TResult2 | PromiseLike): PromiseLike;\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 * 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\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: ArrayBuffer;\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: ArrayBuffer, 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: ArrayBuffer;\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: Array) => 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: Array) => 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, 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, 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 index The index of the location to set.\n * @param value The value to set.\n */\n set(index: number, value: number): void;\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 (array: ArrayLike): Int8Array;\n new (buffer: ArrayBuffer, 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}\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: ArrayBuffer;\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: Array) => 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: Array) => 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, 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, 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 index The index of the location to set.\n * @param value The value to set.\n */\n set(index: number, value: number): void;\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 (array: ArrayLike): Uint8Array;\n new (buffer: ArrayBuffer, 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: ArrayBuffer;\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: Array) => 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: Array) => 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, 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, 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 index The index of the location to set.\n * @param value The value to set.\n */\n set(index: number, value: number): void;\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: Uint8ClampedArray, 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 (array: ArrayLike): Uint8ClampedArray;\n new (buffer: ArrayBuffer, 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: ArrayBuffer;\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: Array) => 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: Array) => 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 /**\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, 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, 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 index The index of the location to set.\n * @param value The value to set.\n */\n set(index: number, value: number): void;\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 (array: ArrayLike): Int16Array;\n new (buffer: ArrayBuffer, 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}\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: ArrayBuffer;\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: Array) => 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: Array) => 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, 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, 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 index The index of the location to set.\n * @param value The value to set.\n */\n set(index: number, value: number): void;\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 (array: ArrayLike): Uint16Array;\n new (buffer: ArrayBuffer, 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}\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: ArrayBuffer;\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: Array) => 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: Array) => 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, 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, 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 index The index of the location to set.\n * @param value The value to set.\n */\n set(index: number, value: number): void;\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 (array: ArrayLike): Int32Array;\n new (buffer: ArrayBuffer, 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}\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: ArrayBuffer;\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: Array) => 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: Array) => 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 /**\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, 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, 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 index The index of the location to set.\n * @param value The value to set.\n */\n set(index: number, value: number): void;\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 (array: ArrayLike): Uint32Array;\n new (buffer: ArrayBuffer, 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}\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: ArrayBuffer;\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: Array) => 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: Array) => 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, 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, 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 index The index of the location to set.\n * @param value The value to set.\n */\n set(index: number, value: number): void;\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 (array: ArrayLike): Float32Array;\n new (buffer: ArrayBuffer, 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}\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: ArrayBuffer;\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: Array) => 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: Array) => 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, 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, 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 index The index of the location to set.\n * @param value The value to set.\n */\n set(index: number, value: number): void;\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 (array: ArrayLike): Float64Array;\n new (buffer: ArrayBuffer, 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}\ndeclare const Float64Array: Float64ArrayConstructor;\n\n/////////////////////////////\n/// ECMAScript Internationalization API\n/////////////////////////////\n\ndeclare module 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: (value: T, index: number, obj: Array) => 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: Array) => 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 * @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): Array;\n\n\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): Array;\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[]): Array;\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) of x (e raised to the power of x, where e is the base of\n * 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: any, ...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: 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\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;\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: (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: Array) => 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 * T is 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?: [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?: [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?: T[]): 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?: T[]): WeakSet;\n readonly prototype: WeakSet;\n}\ndeclare var WeakSet: WeakSetConstructor;\n\n\ninterface GeneratorFunction extends Function { }\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 (...args: string[]): GeneratorFunction;\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 array of key, value pairs for every entry in the array\n */\n entries(): IterableIterator<[number, T]>;\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 ArrayConstructor {\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, mapfn: (v: T, k: number) => U, thisArg?: any): Array;\n \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): Array;\n}\n\ninterface ReadonlyArray {\n /** Iterator */\n [Symbol.iterator](): IterableIterator;\n\n /** \n * Returns an array of key, value pairs for every entry in the array\n */\n entries(): IterableIterator<[number, T]>;\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 IArguments {\n /** Iterator */\n [Symbol.iterator](): IterableIterator;\n}\n\ninterface Map {\n [Symbol.iterator](): IterableIterator<[K,V]>;\n entries(): IterableIterator<[K, V]>;\n keys(): IterableIterator;\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 [Symbol.iterator](): IterableIterator;\n entries(): IterableIterator<[T, T]>;\n keys(): IterableIterator;\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: any): IterableIterator;\n}\n\ninterface String {\n /** Iterator */\n [Symbol.iterator](): IterableIterator;\n}\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 [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\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 [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\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 [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\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 [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\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 [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\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 [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\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 [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\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 [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\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 [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/**\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) => T | PromiseLike) | undefined | null, onrejected?: ((reason: any) => T | PromiseLike) | undefined | null): Promise;\n\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) => T | PromiseLike) | undefined | null, onrejected: (reason: any) => TResult | PromiseLike): Promise;\n\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) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise;\n\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, onrejected: (reason: any) => TResult2 | PromiseLike): 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) => T | 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): Promise;\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): {} | 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;\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): {};\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: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean;\n function deleteProperty(target: any, propertyKey: PropertyKey): boolean;\n function get(target: any, propertyKey: PropertyKey, receiver?: any): any;\n function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor;\n function getPrototypeOf(target: any): any;\n function has(target: any, propertyKey: PropertyKey): boolean;\n function isExtensible(target: any): boolean;\n function ownKeys(target: any): Array;\n function preventExtensions(target: any): boolean;\n function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean;\n function setPrototypeOf(target: any, proto: any): boolean;\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(): Object;\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 extends Function {\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]: Function;\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 [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\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 readonly [Symbol.toStringTag]: \"ArrayBuffer\";\n}\n\ninterface DataView {\n readonly [Symbol.toStringTag]: \"DataView\";\n}\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 readonly [Symbol.toStringTag]: \"Int8Array\";\n}\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 readonly [Symbol.toStringTag]: \"UInt8Array\";\n}\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 readonly [Symbol.toStringTag]: \"Uint8ClampedArray\";\n}\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 readonly [Symbol.toStringTag]: \"Int16Array\";\n}\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 readonly [Symbol.toStringTag]: \"Uint16Array\";\n}\n\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 readonly [Symbol.toStringTag]: \"Int32Array\";\n}\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 readonly [Symbol.toStringTag]: \"Uint32Array\";\n}\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 readonly [Symbol.toStringTag]: \"Float32Array\";\n}\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 readonly [Symbol.toStringTag]: \"Float64Array\";\n}\n\n\n/////////////////////////////\n/// IE DOM APIs\n/////////////////////////////\n\ninterface Algorithm {\n name: string;\n}\n\ninterface AriaRequestEventInit extends EventInit {\n attributeName?: string;\n attributeValue?: string;\n}\n\ninterface CommandEventInit extends EventInit {\n commandName?: string;\n detail?: string;\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?: string | string[];\n ideal?: string | string[];\n}\n\ninterface CustomEventInit extends EventInit {\n detail?: any;\n}\n\ninterface DeviceAccelerationDict {\n x?: number;\n y?: number;\n z?: number;\n}\n\ninterface DeviceLightEventInit extends EventInit {\n value?: number;\n}\n\ninterface DeviceRotationRateDict {\n alpha?: number;\n beta?: number;\n gamma?: number;\n}\n\ninterface DoubleRange {\n max?: number;\n min?: number;\n}\n\ninterface EventInit {\n scoped?: boolean;\n bubbles?: boolean;\n cancelable?: boolean;\n}\n\ninterface EventModifierInit extends UIEventInit {\n ctrlKey?: boolean;\n shiftKey?: boolean;\n altKey?: 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}\n\ninterface ExceptionInformation {\n domain?: string;\n}\n\ninterface FocusEventInit extends UIEventInit {\n relatedTarget?: EventTarget;\n}\n\ninterface HashChangeEventInit extends EventInit {\n newURL?: string;\n oldURL?: string;\n}\n\ninterface IDBIndexParameters {\n multiEntry?: boolean;\n unique?: boolean;\n}\n\ninterface IDBObjectStoreParameters {\n autoIncrement?: boolean;\n keyPath?: IDBKeyPath;\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 rpDisplayName?: string;\n userDisplayName?: string;\n accountName?: string;\n userId?: string;\n accountImageUri?: string;\n}\n\ninterface MSAudioLocalClientEvent extends MSLocalClientEventBase {\n networkSendQualityEventRatio?: number;\n networkDelayEventRatio?: number;\n cpuInsufficientEventRatio?: number;\n deviceHalfDuplexAECEventRatio?: number;\n deviceRenderNotFunctioningEventRatio?: number;\n deviceCaptureNotFunctioningEventRatio?: number;\n deviceGlitchesEventRatio?: number;\n deviceLowSNREventRatio?: number;\n deviceLowSpeechLevelEventRatio?: number;\n deviceClippingEventRatio?: number;\n deviceEchoEventRatio?: number;\n deviceNearEndToEchoRatioEventRatio?: number;\n deviceRenderZeroVolumeEventRatio?: number;\n deviceRenderMuteEventRatio?: number;\n deviceMultipleEndpointsEventCount?: number;\n deviceHowlingEventCount?: number;\n}\n\ninterface MSAudioRecvPayload extends MSPayloadBase {\n samplingRate?: number;\n signal?: MSAudioRecvSignal;\n packetReorderRatio?: number;\n packetReorderDepthAvg?: number;\n packetReorderDepthMax?: number;\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 ratioConcealedSamplesAvg?: number;\n ratioStretchedSamplesAvg?: number;\n ratioCompressedSamplesAvg?: number;\n}\n\ninterface MSAudioRecvSignal {\n initialSignalLevelRMS?: number;\n recvSignalLevelCh1?: number;\n recvNoiseLevelCh1?: number;\n renderSignalLevel?: number;\n renderNoiseLevel?: number;\n renderLoopbackSignalLevel?: number;\n}\n\ninterface MSAudioSendPayload extends MSPayloadBase {\n samplingRate?: number;\n signal?: MSAudioSendSignal;\n audioFECUsed?: boolean;\n sendMutePercent?: number;\n}\n\ninterface MSAudioSendSignal {\n noiseLevel?: number;\n sendSignalLevelCh1?: number;\n sendNoiseLevelCh1?: number;\n}\n\ninterface MSConnectivity {\n iceType?: string;\n iceWarningFlags?: MSIceWarningFlags;\n relayAddress?: MSRelayAddress;\n}\n\ninterface MSCredentialFilter {\n accept?: MSCredentialSpec[];\n}\n\ninterface MSCredentialParameters {\n type?: string;\n}\n\ninterface MSCredentialSpec {\n type?: string;\n id?: string;\n}\n\ninterface MSDelay {\n roundTrip?: number;\n roundTripMax?: number;\n}\n\ninterface MSDescription extends RTCStats {\n connectivity?: MSConnectivity;\n transport?: string;\n networkconnectivity?: MSNetworkConnectivityInfo;\n localAddr?: MSIPAddressInfo;\n remoteAddr?: MSIPAddressInfo;\n deviceDevName?: string;\n reflexiveLocalIPAddr?: MSIPAddressInfo;\n}\n\ninterface MSFIDOCredentialParameters extends MSCredentialParameters {\n algorithm?: string | Algorithm;\n authenticators?: AAGUID[];\n}\n\ninterface MSIPAddressInfo {\n ipAddr?: string;\n port?: number;\n manufacturerMacAddrMask?: string;\n}\n\ninterface MSIceWarningFlags {\n turnTcpTimedOut?: boolean;\n turnUdpAllocateFailed?: boolean;\n turnUdpSendFailed?: boolean;\n turnTcpAllocateFailed?: boolean;\n turnTcpSendFailed?: boolean;\n udpLocalConnectivityFailed?: boolean;\n udpNatConnectivityFailed?: boolean;\n udpRelayConnectivityFailed?: boolean;\n tcpNatConnectivityFailed?: boolean;\n tcpRelayConnectivityFailed?: boolean;\n connCheckMessageIntegrityFailed?: boolean;\n allocationMessageIntegrityFailed?: boolean;\n connCheckOtherError?: boolean;\n turnAuthUnknownUsernameError?: boolean;\n noRelayServersConfigured?: boolean;\n multipleRelayServersAttempted?: boolean;\n portRangeExhausted?: boolean;\n alternateServerReceived?: boolean;\n pseudoTLSFailure?: boolean;\n turnTurnTcpConnectivityFailed?: boolean;\n useCandidateChecksFailed?: boolean;\n fipsAllocationFailure?: boolean;\n}\n\ninterface MSJitter {\n interArrival?: number;\n interArrivalMax?: number;\n interArrivalSD?: number;\n}\n\ninterface MSLocalClientEventBase extends RTCStats {\n networkReceiveQualityEventRatio?: number;\n networkBandwidthLowEventRatio?: number;\n}\n\ninterface MSNetwork extends RTCStats {\n jitter?: MSJitter;\n delay?: MSDelay;\n packetLoss?: MSPacketLoss;\n utilization?: MSUtilization;\n}\n\ninterface MSNetworkConnectivityInfo {\n vpn?: boolean;\n linkspeed?: number;\n networkConnectionDetails?: string;\n}\n\ninterface MSNetworkInterfaceType {\n interfaceTypeEthernet?: boolean;\n interfaceTypeWireless?: boolean;\n interfaceTypePPP?: boolean;\n interfaceTypeTunnel?: 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 MSRelayAddress {\n relayAddress?: string;\n port?: number;\n}\n\ninterface MSSignatureParameters {\n userPrompt?: string;\n}\n\ninterface MSTransportDiagnosticsStats extends RTCStats {\n baseAddress?: string;\n localAddress?: string;\n localSite?: string;\n networkName?: string;\n remoteAddress?: string;\n remoteSite?: string;\n localMR?: string;\n remoteMR?: string;\n iceWarningFlags?: MSIceWarningFlags;\n portRangeMin?: number;\n portRangeMax?: number;\n localMRTCPPort?: number;\n remoteMRTCPPort?: number;\n stunVer?: number;\n numConsentReqSent?: number;\n numConsentReqReceived?: number;\n numConsentRespSent?: number;\n numConsentRespReceived?: number;\n interfaces?: MSNetworkInterfaceType;\n baseInterface?: MSNetworkInterfaceType;\n protocol?: string;\n localInterface?: MSNetworkInterfaceType;\n localAddrType?: string;\n remoteAddrType?: string;\n iceRole?: string;\n rtpRtcpMux?: boolean;\n allocationTimeInMs?: number;\n msRtcEngineVersion?: string;\n}\n\ninterface MSUtilization {\n packets?: number;\n bandwidthEstimation?: number;\n bandwidthEstimationMin?: number;\n bandwidthEstimationMax?: number;\n bandwidthEstimationStdDev?: number;\n bandwidthEstimationAvg?: number;\n}\n\ninterface MSVideoPayload extends MSPayloadBase {\n resoluton?: string;\n videoBitRateAvg?: number;\n videoBitRateMax?: number;\n videoFrameRateAvg?: number;\n videoPacketLossRate?: number;\n durationSeconds?: number;\n}\n\ninterface MSVideoRecvPayload extends MSVideoPayload {\n videoFrameLossRate?: number;\n recvCodecType?: string;\n recvResolutionWidth?: number;\n recvResolutionHeight?: number;\n videoResolutions?: MSVideoResolutionDistribution;\n recvFrameRateAverage?: number;\n recvBitRateMaximum?: number;\n recvBitRateAverage?: number;\n recvVideoStreamsMax?: number;\n recvVideoStreamsMin?: number;\n recvVideoStreamsMode?: number;\n videoPostFECPLR?: number;\n lowBitRateCallPercent?: number;\n lowFrameRateCallPercent?: number;\n reorderBufferTotalPackets?: number;\n recvReorderBufferReorderedPackets?: number;\n recvReorderBufferPacketsDroppedDueToBufferExhaustion?: number;\n recvReorderBufferMaxSuccessfullyOrderedExtent?: number;\n recvReorderBufferMaxSuccessfullyOrderedLateTime?: number;\n recvReorderBufferPacketsDroppedDueToTimeout?: number;\n recvFpsHarmonicAverage?: number;\n recvNumResSwitches?: number;\n}\n\ninterface MSVideoResolutionDistribution {\n cifQuality?: number;\n vgaQuality?: number;\n h720Quality?: number;\n h1080Quality?: number;\n h1440Quality?: number;\n h2160Quality?: number;\n}\n\ninterface MSVideoSendPayload extends MSVideoPayload {\n sendFrameRateAverage?: number;\n sendBitRateMaximum?: number;\n sendBitRateAverage?: number;\n sendVideoStreamsMax?: number;\n sendResolutionWidth?: number;\n sendResolutionHeight?: number;\n}\n\ninterface MediaEncryptedEventInit extends EventInit {\n initDataType?: string;\n initData?: ArrayBuffer;\n}\n\ninterface MediaKeyMessageEventInit extends EventInit {\n messageType?: string;\n message?: ArrayBuffer;\n}\n\ninterface MediaKeySystemConfiguration {\n initDataTypes?: string[];\n audioCapabilities?: MediaKeySystemMediaCapability[];\n videoCapabilities?: MediaKeySystemMediaCapability[];\n distinctiveIdentifier?: string;\n persistentState?: string;\n}\n\ninterface MediaKeySystemMediaCapability {\n contentType?: string;\n robustness?: string;\n}\n\ninterface MediaStreamConstraints {\n video?: boolean | MediaTrackConstraints;\n audio?: boolean | MediaTrackConstraints;\n}\n\ninterface MediaStreamErrorEventInit extends EventInit {\n error?: MediaStreamError;\n}\n\ninterface MediaStreamTrackEventInit extends EventInit {\n track?: MediaStreamTrack;\n}\n\ninterface MediaTrackCapabilities {\n width?: number | LongRange;\n height?: number | LongRange;\n aspectRatio?: number | DoubleRange;\n frameRate?: number | DoubleRange;\n facingMode?: string;\n volume?: number | DoubleRange;\n sampleRate?: number | LongRange;\n sampleSize?: number | LongRange;\n echoCancellation?: boolean[];\n deviceId?: string;\n groupId?: string;\n}\n\ninterface MediaTrackConstraintSet {\n width?: number | ConstrainLongRange;\n height?: number | ConstrainLongRange;\n aspectRatio?: number | ConstrainDoubleRange;\n frameRate?: number | ConstrainDoubleRange;\n facingMode?: string | string[] | ConstrainDOMStringParameters;\n volume?: number | ConstrainDoubleRange;\n sampleRate?: number | ConstrainLongRange;\n sampleSize?: number | ConstrainLongRange;\n echoCancelation?: boolean | ConstrainBooleanParameters;\n deviceId?: string | string[] | ConstrainDOMStringParameters;\n groupId?: string | string[] | ConstrainDOMStringParameters;\n}\n\ninterface MediaTrackConstraints extends MediaTrackConstraintSet {\n advanced?: MediaTrackConstraintSet[];\n}\n\ninterface MediaTrackSettings {\n width?: number;\n height?: number;\n aspectRatio?: number;\n frameRate?: number;\n facingMode?: string;\n volume?: number;\n sampleRate?: number;\n sampleSize?: number;\n echoCancellation?: boolean;\n deviceId?: string;\n groupId?: string;\n}\n\ninterface MediaTrackSupportedConstraints {\n width?: boolean;\n height?: boolean;\n aspectRatio?: boolean;\n frameRate?: boolean;\n facingMode?: boolean;\n volume?: boolean;\n sampleRate?: boolean;\n sampleSize?: boolean;\n echoCancellation?: boolean;\n deviceId?: boolean;\n groupId?: boolean;\n}\n\ninterface MouseEventInit extends EventModifierInit {\n screenX?: number;\n screenY?: number;\n clientX?: number;\n clientY?: number;\n button?: number;\n buttons?: number;\n relatedTarget?: EventTarget;\n}\n\ninterface MsZoomToOptions {\n contentX?: number;\n contentY?: number;\n viewportX?: string;\n viewportY?: string;\n scaleFactor?: number;\n animate?: string;\n}\n\ninterface MutationObserverInit {\n childList?: boolean;\n attributes?: boolean;\n characterData?: boolean;\n subtree?: boolean;\n attributeOldValue?: boolean;\n characterDataOldValue?: boolean;\n attributeFilter?: string[];\n}\n\ninterface ObjectURLOptions {\n oneTimeOnly?: boolean;\n}\n\ninterface PeriodicWaveConstraints {\n disableNormalization?: boolean;\n}\n\ninterface PointerEventInit extends MouseEventInit {\n pointerId?: number;\n width?: number;\n height?: number;\n pressure?: number;\n tiltX?: number;\n tiltY?: number;\n pointerType?: string;\n isPrimary?: boolean;\n}\n\ninterface PositionOptions {\n enableHighAccuracy?: boolean;\n timeout?: number;\n maximumAge?: number;\n}\n\ninterface RTCDTMFToneChangeEventInit extends EventInit {\n tone?: string;\n}\n\ninterface RTCDtlsFingerprint {\n algorithm?: string;\n value?: string;\n}\n\ninterface RTCDtlsParameters {\n role?: string;\n fingerprints?: RTCDtlsFingerprint[];\n}\n\ninterface RTCIceCandidate {\n foundation?: string;\n priority?: number;\n ip?: string;\n protocol?: string;\n port?: number;\n type?: string;\n tcpType?: string;\n relatedAddress?: string;\n relatedPort?: number;\n}\n\ninterface RTCIceCandidateAttributes extends RTCStats {\n ipAddress?: string;\n portNumber?: number;\n transport?: string;\n candidateType?: string;\n priority?: number;\n addressSourceUrl?: string;\n}\n\ninterface RTCIceCandidateComplete {\n}\n\ninterface RTCIceCandidatePair {\n local?: RTCIceCandidate;\n remote?: RTCIceCandidate;\n}\n\ninterface RTCIceCandidatePairStats extends RTCStats {\n transportId?: string;\n localCandidateId?: string;\n remoteCandidateId?: string;\n state?: string;\n priority?: number;\n nominated?: boolean;\n writable?: boolean;\n readable?: boolean;\n bytesSent?: number;\n bytesReceived?: number;\n roundTripTime?: number;\n availableOutgoingBitrate?: number;\n availableIncomingBitrate?: number;\n}\n\ninterface RTCIceGatherOptions {\n gatherPolicy?: string;\n iceservers?: RTCIceServer[];\n}\n\ninterface RTCIceParameters {\n usernameFragment?: string;\n password?: string;\n}\n\ninterface RTCIceServer {\n urls?: any;\n username?: string;\n credential?: string;\n}\n\ninterface RTCInboundRTPStreamStats extends RTCRTPStreamStats {\n packetsReceived?: number;\n bytesReceived?: number;\n packetsLost?: number;\n jitter?: number;\n fractionLost?: number;\n}\n\ninterface RTCMediaStreamTrackStats extends RTCStats {\n trackIdentifier?: string;\n remoteSource?: boolean;\n ssrcIds?: string[];\n frameWidth?: number;\n frameHeight?: number;\n framesPerSecond?: number;\n framesSent?: number;\n framesReceived?: number;\n framesDecoded?: number;\n framesDropped?: number;\n framesCorrupted?: number;\n audioLevel?: number;\n echoReturnLoss?: number;\n echoReturnLossEnhancement?: number;\n}\n\ninterface RTCOutboundRTPStreamStats extends RTCRTPStreamStats {\n packetsSent?: number;\n bytesSent?: number;\n targetBitrate?: number;\n roundTripTime?: number;\n}\n\ninterface RTCRTPStreamStats extends RTCStats {\n ssrc?: string;\n associateStatsId?: string;\n isRemote?: boolean;\n mediaTrackId?: string;\n transportId?: string;\n codecId?: string;\n firCount?: number;\n pliCount?: number;\n nackCount?: number;\n sliCount?: number;\n}\n\ninterface RTCRtcpFeedback {\n type?: string;\n parameter?: string;\n}\n\ninterface RTCRtcpParameters {\n ssrc?: number;\n cname?: string;\n reducedSize?: boolean;\n mux?: boolean;\n}\n\ninterface RTCRtpCapabilities {\n codecs?: RTCRtpCodecCapability[];\n headerExtensions?: RTCRtpHeaderExtension[];\n fecMechanisms?: string[];\n}\n\ninterface RTCRtpCodecCapability {\n name?: string;\n kind?: string;\n clockRate?: number;\n preferredPayloadType?: number;\n maxptime?: number;\n numChannels?: number;\n rtcpFeedback?: RTCRtcpFeedback[];\n parameters?: any;\n options?: any;\n maxTemporalLayers?: number;\n maxSpatialLayers?: number;\n svcMultiStreamSupport?: boolean;\n}\n\ninterface RTCRtpCodecParameters {\n name?: string;\n payloadType?: any;\n clockRate?: number;\n maxptime?: number;\n numChannels?: number;\n rtcpFeedback?: RTCRtcpFeedback[];\n parameters?: any;\n}\n\ninterface RTCRtpContributingSource {\n timestamp?: number;\n csrc?: number;\n audioLevel?: number;\n}\n\ninterface RTCRtpEncodingParameters {\n ssrc?: number;\n codecPayloadType?: number;\n fec?: RTCRtpFecParameters;\n rtx?: RTCRtpRtxParameters;\n priority?: number;\n maxBitrate?: number;\n minQuality?: number;\n framerateBias?: number;\n resolutionScale?: number;\n framerateScale?: number;\n active?: boolean;\n encodingId?: string;\n dependencyEncodingIds?: string[];\n ssrcRange?: RTCSsrcRange;\n}\n\ninterface RTCRtpFecParameters {\n ssrc?: number;\n mechanism?: string;\n}\n\ninterface RTCRtpHeaderExtension {\n kind?: string;\n uri?: string;\n preferredId?: number;\n preferredEncrypt?: boolean;\n}\n\ninterface RTCRtpHeaderExtensionParameters {\n uri?: string;\n id?: number;\n encrypt?: boolean;\n}\n\ninterface RTCRtpParameters {\n muxId?: string;\n codecs?: RTCRtpCodecParameters[];\n headerExtensions?: RTCRtpHeaderExtensionParameters[];\n encodings?: RTCRtpEncodingParameters[];\n rtcp?: RTCRtcpParameters;\n}\n\ninterface RTCRtpRtxParameters {\n ssrc?: number;\n}\n\ninterface RTCRtpUnhandled {\n ssrc?: number;\n payloadType?: number;\n muxId?: string;\n}\n\ninterface RTCSrtpKeyParam {\n keyMethod?: string;\n keySalt?: string;\n lifetime?: string;\n mkiValue?: number;\n mkiLength?: number;\n}\n\ninterface RTCSrtpSdesParameters {\n tag?: number;\n cryptoSuite?: string;\n keyParams?: RTCSrtpKeyParam[];\n sessionParams?: string[];\n}\n\ninterface RTCSsrcRange {\n min?: number;\n max?: number;\n}\n\ninterface RTCStats {\n timestamp?: number;\n type?: string;\n id?: string;\n msType?: string;\n}\n\ninterface RTCStatsReport {\n}\n\ninterface RTCTransportStats extends RTCStats {\n bytesSent?: number;\n bytesReceived?: number;\n rtcpTransportStatsId?: string;\n activeConnection?: boolean;\n selectedCandidatePairId?: string;\n localCertificateId?: string;\n remoteCertificateId?: string;\n}\n\ninterface StoreExceptionsInformation extends ExceptionInformation {\n siteName?: string;\n explanationString?: string;\n detailURI?: string;\n}\n\ninterface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation {\n arrayOfDomainStrings?: string[];\n}\n\ninterface UIEventInit extends EventInit {\n view?: Window;\n detail?: number;\n}\n\ninterface WebGLContextAttributes {\n failIfMajorPerformanceCaveat?: boolean;\n alpha?: boolean;\n depth?: boolean;\n stencil?: boolean;\n antialias?: boolean;\n premultipliedAlpha?: boolean;\n preserveDrawingBuffer?: boolean;\n}\n\ninterface WebGLContextEventInit extends EventInit {\n statusMessage?: string;\n}\n\ninterface WheelEventInit extends MouseEventInit {\n deltaX?: number;\n deltaY?: number;\n deltaZ?: number;\n deltaMode?: number;\n}\n\ninterface EventListener {\n (evt: Event): void;\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 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 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(): AnimationEvent;\n}\n\ninterface ApplicationCacheEventMap {\n \"cached\": Event;\n \"checking\": Event;\n \"downloading\": Event;\n \"error\": ErrorEvent;\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: ErrorEvent) => 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 AriaRequestEvent extends Event {\n readonly attributeName: string;\n attributeValue: string | null;\n}\n\ndeclare var AriaRequestEvent: {\n prototype: AriaRequestEvent;\n new(type: string, eventInitDict?: AriaRequestEventInit): AriaRequestEvent;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var AudioBufferSourceNode: {\n prototype: AudioBufferSourceNode;\n new(): AudioBufferSourceNode;\n}\n\ninterface AudioContext extends EventTarget {\n readonly currentTime: number;\n readonly destination: AudioDestinationNode;\n readonly listener: AudioListener;\n readonly sampleRate: number;\n state: string;\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 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): PromiseLike;\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: string;\n channelInterpretation: string;\n readonly context: AudioContext;\n readonly numberOfInputs: number;\n readonly numberOfOutputs: number;\n connect(destination: AudioNode, output?: number, input?: 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): void;\n exponentialRampToValueAtTime(value: number, endTime: number): void;\n linearRampToValueAtTime(value: number, endTime: number): void;\n setTargetAtTime(target: number, startTime: number, timeConstant: number): void;\n setValueAtTime(value: number, startTime: number): void;\n setValueCurveAtTime(values: Float32Array, startTime: number, duration: number): void;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 Q: AudioParam;\n readonly detune: AudioParam;\n readonly frequency: AudioParam;\n readonly gain: AudioParam;\n type: string;\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 CDATASection extends Text {\n}\n\ndeclare var CDATASection: {\n prototype: CDATASection;\n new(): CDATASection;\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 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;\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 glyphOrientationHorizontal: string | null;\n glyphOrientationVertical: string | null;\n height: string | null;\n imeMode: string | null;\n justifyContent: string | null;\n kerning: string | null;\n left: string | null;\n readonly length: number;\n letterSpacing: string | null;\n lightingColor: 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 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 opacity: string | null;\n order: string | null;\n orphans: string | null;\n outline: string | null;\n outlineColor: 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 rubyAlign: string | null;\n rubyOverhang: string | null;\n rubyPosition: 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 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 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 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 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 href: 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 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 lineCap: string;\n lineDashOffset: number;\n lineJoin: string;\n lineWidth: number;\n miterLimit: number;\n msFillRule: string;\n msImageSmoothingEnabled: 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 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?: string): 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 drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void;\n fill(fillRule?: string): 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?: string): 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(): 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 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(): CloseEvent;\n}\n\ninterface CommandEvent extends Event {\n readonly commandName: string;\n readonly detail: string | null;\n}\n\ndeclare var CommandEvent: {\n prototype: CommandEvent;\n new(type: string, eventInitDict?: CommandEventInit): CommandEvent;\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?: string, ...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): void;\n groupCollapsed(groupTitle?: string): 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 CustomEvent extends Event {\n readonly detail: any;\n initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: any): 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(): 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): Document;\n createDocumentType(qualifiedName: string, publicId: string | null, systemId: string | null): 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;\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 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: TextTrackCue, ev: TextTrackCueEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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}\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}\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: string;\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(type: 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(): 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(): 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\": ProgressEvent;\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 * 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 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;\n /**\n * Gets the default character set from the current regional language settings.\n */\n readonly defaultCharset: string;\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 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;\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: ProgressEvent) => 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 readonly visibilityState: string;\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: Node): Node;\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 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 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): ElementListTagNameMap[K];\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: Node, deep: boolean): Node;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var Document: {\n prototype: Document;\n new(): Document;\n}\n\ninterface DocumentFragment extends Node, NodeSelector, ParentNode {\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 | null;\n readonly systemId: string | null;\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(): DragEvent;\n}\n\ninterface DynamicsCompressorNode extends AudioNode {\n readonly attack: AudioParam;\n readonly knee: AudioParam;\n readonly ratio: AudioParam;\n readonly reduction: AudioParam;\n readonly release: AudioParam;\n readonly threshold: AudioParam;\n}\n\ndeclare var DynamicsCompressorNode: {\n prototype: DynamicsCompressorNode;\n new(): DynamicsCompressorNode;\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 ElementEventMap extends GlobalEventHandlersEventMap {\n \"ariarequest\": AriaRequestEvent;\n \"command\": CommandEvent;\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 msContentZoomFactor: number;\n readonly msRegionOverflow: string;\n onariarequest: (this: Element, ev: AriaRequestEvent) => any;\n oncommand: (this: Element, ev: CommandEvent) => 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 readonly prefix: string | null;\n readonly scrollHeight: number;\n scrollLeft: number;\n scrollTop: number;\n readonly scrollWidth: number;\n readonly tagName: string;\n innerHTML: string;\n readonly assignedSlot: HTMLSlotElement | null;\n slot: string;\n readonly shadowRoot: ShadowRoot | null;\n getAttribute(name: string): string | null;\n getAttributeNS(namespaceURI: string, localName: string): string;\n getAttributeNode(name: string): Attr;\n getAttributeNodeNS(namespaceURI: string, localName: string): Attr;\n getBoundingClientRect(): ClientRect;\n getClientRects(): ClientRectList;\n getElementsByTagName(name: K): ElementListTagNameMap[K];\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(name?: string): void;\n removeAttributeNS(namespaceURI: string, localName: string): void;\n removeAttributeNode(oldAttr: Attr): Attr;\n requestFullscreen(): void;\n requestPointerLock(): void;\n setAttribute(name: 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 getElementsByClassName(classNames: string): NodeListOf;\n matches(selector: string): boolean;\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: string, insertedElement: Element): Element | null;\n insertAdjacentHTML(where: string, html: string): void;\n insertAdjacentText(where: string, text: string): void;\n attachShadow(shadowRootInitDict: ShadowRootInit): ShadowRoot;\n addEventListener(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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(): ErrorEvent;\n}\n\ninterface Event {\n readonly bubbles: boolean;\n cancelBubble: boolean;\n readonly cancelable: 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(type: 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, useCapture?: boolean): void;\n dispatchEvent(evt: Event): boolean;\n removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var EventTarget: {\n prototype: EventTarget;\n new(): EventTarget;\n}\n\ninterface External {\n}\n\ndeclare var External: {\n prototype: External;\n new(): External;\n}\n\ninterface File extends Blob {\n readonly lastModifiedDate: any;\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;\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: MSBaseReader, ev: MSBaseReaderEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 FormData {\n append(name: any, value: any, blobName?: 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(): 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 HTMLAllCollection extends HTMLCollection {\n namedItem(name: string): Element;\n}\n\ndeclare var HTMLAllCollection: {\n prototype: HTMLAllCollection;\n new(): HTMLAllCollection;\n}\n\ninterface HTMLAnchorElement extends HTMLElement {\n Methods: string;\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 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLAnchorElement: {\n prototype: HTMLAnchorElement;\n new(): HTMLAnchorElement;\n}\n\ninterface HTMLAppletElement extends HTMLElement {\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 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 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;\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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLAreaElement: {\n prototype: HTMLAreaElement;\n new(): HTMLAreaElement;\n}\n\ninterface HTMLAreasCollection extends HTMLCollection {\n /**\n * Adds an element to the areas, controlRange, or options collection.\n */\n add(element: HTMLElement, before?: HTMLElement | number): void;\n /**\n * Removes an element from the collection.\n */\n remove(index?: number): void;\n}\n\ndeclare var HTMLAreasCollection: {\n prototype: HTMLAreasCollection;\n new(): HTMLAreasCollection;\n}\n\ninterface HTMLAudioElement extends HTMLMediaElement {\n addEventListener(type: K, listener: (this: HTMLMediaElement, ev: HTMLMediaElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 clear: string;\n addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 \"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 onblur: (this: HTMLBodyElement, ev: FocusEvent) => any;\n onerror: (this: HTMLBodyElement, ev: ErrorEvent) => any;\n onfocus: (this: HTMLBodyElement, ev: FocusEvent) => any;\n onhashchange: (this: HTMLBodyElement, ev: HashChangeEvent) => any;\n onload: (this: HTMLBodyElement, ev: Event) => 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLCanvasElement: {\n prototype: HTMLCanvasElement;\n new(): HTMLCanvasElement;\n}\n\ninterface HTMLCollection {\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 /**\n * Retrieves a select object or an object from an options collection.\n */\n namedItem(name: string): Element;\n [index: number]: Element;\n}\n\ndeclare var HTMLCollection: {\n prototype: HTMLCollection;\n new(): HTMLCollection;\n}\n\ninterface HTMLDListElement extends HTMLElement {\n compact: boolean;\n addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLDListElement: {\n prototype: HTMLDListElement;\n new(): HTMLDListElement;\n}\n\ninterface HTMLDataListElement extends HTMLElement {\n options: HTMLCollectionOf;\n addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLDivElement: {\n prototype: HTMLDivElement;\n new(): HTMLDivElement;\n}\n\ninterface HTMLDocument extends Document {\n addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 innerHTML: string;\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 outerHTML: string;\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 setActive(): void;\n addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLFontElement: {\n prototype: HTMLFontElement;\n new(): HTMLFontElement;\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: HTMLCollection;\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 addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 * Raised when the object has been completely received from the server.\n */\n onload: (this: HTMLFrameElement, ev: Event) => any;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLFrameElement: {\n prototype: HTMLFrameElement;\n new(): HTMLFrameElement;\n}\n\ninterface HTMLFrameSetElementEventMap extends HTMLElementEventMap {\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 \"resize\": 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 /**\n * Fires when the object loses the input focus.\n */\n onblur: (this: HTMLFrameSetElement, ev: FocusEvent) => any;\n onerror: (this: HTMLFrameSetElement, ev: ErrorEvent) => any;\n /**\n * Fires when the object receives focus.\n */\n onfocus: (this: HTMLFrameSetElement, ev: FocusEvent) => any;\n onhashchange: (this: HTMLFrameSetElement, ev: HashChangeEvent) => any;\n onload: (this: HTMLFrameSetElement, ev: Event) => 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 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLHRElement: {\n prototype: HTMLHRElement;\n new(): HTMLHRElement;\n}\n\ninterface HTMLHeadElement extends HTMLElement {\n profile: string;\n addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 version: string;\n addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 /**\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 /**\n * Raised when the object has been completely received from the server.\n */\n onload: (this: HTMLIFrameElement, ev: Event) => any;\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 addEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLImageElement: {\n prototype: HTMLImageElement;\n new(): HTMLImageElement;\n create(): 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;\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 */\n setSelectionRange(start?: number, end?: number, direction?: string): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLInputElement: {\n prototype: HTMLInputElement;\n new(): HTMLInputElement;\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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLLIElement: {\n prototype: HTMLLIElement;\n new(): HTMLLIElement;\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;\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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\n addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\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(): void;\n setMediaKeys(mediaKeys: MediaKeys | null): PromiseLike;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLModElement: {\n prototype: HTMLModElement;\n new(): HTMLModElement;\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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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 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;\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 /**\n * Retrieves the contained object.\n */\n readonly object: any;\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 /**\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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLObjectElement: {\n prototype: HTMLObjectElement;\n new(): HTMLObjectElement;\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;\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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLOptionElement: {\n prototype: HTMLOptionElement;\n new(): HTMLOptionElement;\n create(): 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 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLParamElement: {\n prototype: HTMLParamElement;\n new(): HTMLParamElement;\n}\n\ninterface HTMLPictureElement extends HTMLElement {\n addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 /**\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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLSourceElement: {\n prototype: HTMLSourceElement;\n new(): HTMLSourceElement;\n}\n\ninterface HTMLSpanElement extends HTMLElement {\n addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLTableColElement: {\n prototype: HTMLTableColElement;\n new(): HTMLTableColElement;\n}\n\ninterface HTMLTableDataCellElement extends HTMLTableCellElement {\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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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}\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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\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 */\n setSelectionRange(start: number, end: number): void;\n addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLTextAreaElement: {\n prototype: HTMLTextAreaElement;\n new(): HTMLTextAreaElement;\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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLUListElement: {\n prototype: HTMLUListElement;\n new(): HTMLUListElement;\n}\n\ninterface HTMLUnknownElement extends HTMLElement {\n addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLVideoElement: {\n prototype: HTMLVideoElement;\n new(): HTMLVideoElement;\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(type: string, eventInitDict?: HashChangeEventInit): HashChangeEvent;\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 IDBCursor {\n readonly direction: string;\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\": ErrorEvent;\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: ErrorEvent) => 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?: string): IDBTransaction;\n addEventListener(type: \"versionchange\", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void;\n addEventListener(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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?: string): IDBRequest;\n openKeyCursor(range?: IDBKeyRange | IDBValidKey, direction?: string): 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?: string): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var IDBOpenDBRequest: {\n prototype: IDBOpenDBRequest;\n new(): IDBOpenDBRequest;\n}\n\ninterface IDBRequestEventMap {\n \"error\": ErrorEvent;\n \"success\": Event;\n}\n\ninterface IDBRequest extends EventTarget {\n readonly error: DOMError;\n onerror: (this: IDBRequest, ev: ErrorEvent) => any;\n onsuccess: (this: IDBRequest, ev: Event) => any;\n readonly readyState: string;\n readonly result: any;\n source: IDBObjectStore | IDBIndex | IDBCursor;\n readonly transaction: IDBTransaction;\n addEventListener(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var IDBRequest: {\n prototype: IDBRequest;\n new(): IDBRequest;\n}\n\ninterface IDBTransactionEventMap {\n \"abort\": Event;\n \"complete\": Event;\n \"error\": ErrorEvent;\n}\n\ninterface IDBTransaction extends EventTarget {\n readonly db: IDBDatabase;\n readonly error: DOMError;\n readonly mode: string;\n onabort: (this: IDBTransaction, ev: Event) => any;\n oncomplete: (this: IDBTransaction, ev: Event) => any;\n onerror: (this: IDBTransaction, ev: ErrorEvent) => 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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 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: string;\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 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): PromiseLike;\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\": ErrorEvent;\n}\n\ninterface MSAppAsyncOperation extends EventTarget {\n readonly error: DOMError;\n oncomplete: (this: MSAppAsyncOperation, ev: Event) => any;\n onerror: (this: MSAppAsyncOperation, ev: ErrorEvent) => 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: string;\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): PromiseLike;\n makeCredential(accountInfo: MSAccountInfo, params: MSCredentialParameters[], challenge?: string): PromiseLike;\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: string[];\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 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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): 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 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: MSBaseReader, ev: MSBaseReaderEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var MSStreamReader: {\n prototype: MSStreamReader;\n new(): MSStreamReader;\n}\n\ninterface MSWebViewAsyncOperationEventMap {\n \"complete\": Event;\n \"error\": ErrorEvent;\n}\n\ninterface MSWebViewAsyncOperation extends EventTarget {\n readonly error: DOMError;\n oncomplete: (this: MSWebViewAsyncOperation, ev: Event) => any;\n onerror: (this: MSWebViewAsyncOperation, ev: ErrorEvent) => 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 MediaDeviceInfo {\n readonly deviceId: string;\n readonly groupId: string;\n readonly kind: string;\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(): any;\n getSupportedConstraints(): MediaTrackSupportedConstraints;\n getUserMedia(constraints: MediaStreamConstraints): PromiseLike;\n addEventListener(type: K, listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: string;\n}\n\ndeclare var MediaKeyMessageEvent: {\n prototype: MediaKeyMessageEvent;\n new(type: string, eventInitDict?: MediaKeyMessageEventInit): MediaKeyMessageEvent;\n}\n\ninterface MediaKeySession extends EventTarget {\n readonly closed: PromiseLike;\n readonly expiration: number;\n readonly keyStatuses: MediaKeyStatusMap;\n readonly sessionId: string;\n close(): PromiseLike;\n generateRequest(initDataType: string, initData: any): PromiseLike;\n load(sessionId: string): PromiseLike;\n remove(): PromiseLike;\n update(response: any): PromiseLike;\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: any): string;\n has(keyId: any): boolean;\n}\n\ndeclare var MediaKeyStatusMap: {\n prototype: MediaKeyStatusMap;\n new(): MediaKeyStatusMap;\n}\n\ninterface MediaKeySystemAccess {\n readonly keySystem: string;\n createMediaKeys(): PromiseLike;\n getConfiguration(): MediaKeySystemConfiguration;\n}\n\ndeclare var MediaKeySystemAccess: {\n prototype: MediaKeySystemAccess;\n new(): MediaKeySystemAccess;\n}\n\ninterface MediaKeys {\n createSession(sessionType?: string): MediaKeySession;\n setServerCertificate(serverCertificate: any): PromiseLike;\n}\n\ndeclare var MediaKeys: {\n prototype: MediaKeys;\n new(): MediaKeys;\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\": TrackEvent;\n \"inactive\": Event;\n \"removetrack\": TrackEvent;\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: TrackEvent) => any;\n oninactive: (this: MediaStream, ev: Event) => any;\n onremovetrack: (this: MediaStream, ev: TrackEvent) => 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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(type: string, eventInitDict?: MediaStreamErrorEventInit): MediaStreamErrorEvent;\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: string;\n readonly remote: boolean;\n applyConstraints(constraints: MediaTrackConstraints): PromiseLike;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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(type: 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, ports?: any): void;\n start(): void;\n addEventListener(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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, NavigatorUserMedia {\n readonly appCodeName: string;\n readonly cookieEnabled: boolean;\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 webdriver: boolean;\n readonly hardwareConcurrency: number;\n getGamepads(): Gamepad[];\n javaEnabled(): boolean;\n msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void;\n requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: MediaKeySystemConfiguration[]): PromiseLike;\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: Node): Node;\n cloneNode(deep?: boolean): Node;\n compareDocumentPosition(other: Node): number;\n contains(child: Node): boolean;\n hasAttributes(): boolean;\n hasChildNodes(): boolean;\n insertBefore(newChild: Node, refChild: Node | null): Node;\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: Node): Node;\n replaceChild(newChild: Node, oldChild: Node): 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\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 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 OfflineAudioCompletionEvent extends Event {\n readonly renderedBuffer: AudioBuffer;\n}\n\ndeclare var OfflineAudioCompletionEvent: {\n prototype: OfflineAudioCompletionEvent;\n new(): OfflineAudioCompletionEvent;\n}\n\ninterface OfflineAudioContextEventMap {\n \"complete\": Event;\n}\n\ninterface OfflineAudioContext extends AudioContext {\n oncomplete: (this: OfflineAudioContext, ev: Event) => any;\n startRendering(): PromiseLike;\n addEventListener(type: K, listener: (this: OfflineAudioContext, ev: OfflineAudioContextEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: string;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: string;\n maxDistance: number;\n panningModel: string;\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 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 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 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 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: string;\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 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 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 PeriodicWave {\n}\n\ndeclare var PeriodicWave: {\n prototype: PeriodicWave;\n new(): PeriodicWave;\n}\n\ninterface PermissionRequest extends DeferredPermissionRequest {\n readonly state: string;\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(): 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 RTCDTMFToneChangeEvent extends Event {\n readonly tone: string;\n}\n\ndeclare var RTCDTMFToneChangeEvent: {\n prototype: RTCDTMFToneChangeEvent;\n new(type: string, eventInitDict: RTCDTMFToneChangeEventInit): RTCDTMFToneChangeEvent;\n}\n\ninterface RTCDtlsTransportEventMap {\n \"dtlsstatechange\": RTCDtlsTransportStateChangedEvent;\n \"error\": ErrorEvent;\n}\n\ninterface RTCDtlsTransport extends RTCStatsProvider {\n ondtlsstatechange: ((this: RTCDtlsTransport, ev: RTCDtlsTransportStateChangedEvent) => any) | null;\n onerror: ((this: RTCDtlsTransport, ev: ErrorEvent) => any) | null;\n readonly state: string;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var RTCDtlsTransport: {\n prototype: RTCDtlsTransport;\n new(transport: RTCIceTransport): RTCDtlsTransport;\n}\n\ninterface RTCDtlsTransportStateChangedEvent extends Event {\n readonly state: string;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var RTCDtmfSender: {\n prototype: RTCDtmfSender;\n new(sender: RTCRtpSender): RTCDtmfSender;\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\": ErrorEvent;\n \"localcandidate\": RTCIceGathererEvent;\n}\n\ninterface RTCIceGatherer extends RTCStatsProvider {\n readonly component: string;\n onerror: ((this: RTCIceGatherer, ev: ErrorEvent) => any) | null;\n onlocalcandidate: ((this: RTCIceGatherer, ev: RTCIceGathererEvent) => any) | null;\n createAssociatedGatherer(): RTCIceGatherer;\n getLocalCandidates(): RTCIceCandidate[];\n getLocalParameters(): RTCIceParameters;\n addEventListener(type: K, listener: (this: RTCIceGatherer, ev: RTCIceGathererEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var RTCIceGatherer: {\n prototype: RTCIceGatherer;\n new(options: RTCIceGatherOptions): RTCIceGatherer;\n}\n\ninterface RTCIceGathererEvent extends Event {\n readonly candidate: RTCIceCandidate | 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: string;\n readonly iceGatherer: RTCIceGatherer | null;\n oncandidatepairchange: ((this: RTCIceTransport, ev: RTCIceCandidatePairChangedEvent) => any) | null;\n onicestatechange: ((this: RTCIceTransport, ev: RTCIceTransportStateChangedEvent) => any) | null;\n readonly role: string;\n readonly state: string;\n addRemoteCandidate(remoteCandidate: RTCIceCandidate | RTCIceCandidateComplete): void;\n createAssociatedTransport(): RTCIceTransport;\n getNominatedCandidatePair(): RTCIceCandidatePair | null;\n getRemoteCandidates(): RTCIceCandidate[];\n getRemoteParameters(): RTCIceParameters | null;\n setRemoteCandidates(remoteCandidates: RTCIceCandidate[]): void;\n start(gatherer: RTCIceGatherer, remoteParameters: RTCIceParameters, role?: string): void;\n stop(): void;\n addEventListener(type: K, listener: (this: RTCIceTransport, ev: RTCIceTransportEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var RTCIceTransport: {\n prototype: RTCIceTransport;\n new(): RTCIceTransport;\n}\n\ninterface RTCIceTransportStateChangedEvent extends Event {\n readonly state: string;\n}\n\ndeclare var RTCIceTransportStateChangedEvent: {\n prototype: RTCIceTransportStateChangedEvent;\n new(): RTCIceTransportStateChangedEvent;\n}\n\ninterface RTCRtpReceiverEventMap {\n \"error\": ErrorEvent;\n}\n\ninterface RTCRtpReceiver extends RTCStatsProvider {\n onerror: ((this: RTCRtpReceiver, ev: ErrorEvent) => 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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\": ErrorEvent;\n \"ssrcconflict\": RTCSsrcConflictEvent;\n}\n\ninterface RTCRtpSender extends RTCStatsProvider {\n onerror: ((this: RTCRtpSender, ev: ErrorEvent) => 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 RTCSrtpSdesTransportEventMap {\n \"error\": ErrorEvent;\n}\n\ninterface RTCSrtpSdesTransport extends EventTarget {\n onerror: ((this: RTCSrtpSdesTransport, ev: ErrorEvent) => any) | null;\n readonly transport: RTCIceTransport;\n addEventListener(type: K, listener: (this: RTCSrtpSdesTransport, ev: RTCSrtpSdesTransportEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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(): PromiseLike;\n msGetStats(): PromiseLike;\n}\n\ndeclare var RTCStatsProvider: {\n prototype: RTCStatsProvider;\n new(): RTCStatsProvider;\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: string): boolean;\n extractContents(): DocumentFragment;\n getBoundingClientRect(): ClientRect;\n getClientRects(): ClientRectList;\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 SVGAElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference {\n readonly target: SVGAnimatedString;\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired {\n readonly cx: SVGAnimatedLength;\n readonly cy: SVGAnimatedLength;\n readonly r: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var SVGCircleElement: {\n prototype: SVGCircleElement;\n new(): SVGCircleElement;\n}\n\ninterface SVGClipPathElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGUnitTypes {\n readonly clipPathUnits: SVGAnimatedEnumeration;\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired {\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var SVGDefsElement: {\n prototype: SVGDefsElement;\n new(): SVGDefsElement;\n}\n\ninterface SVGDescElement extends SVGElement, SVGStylable, SVGLangSpace {\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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 viewportElement: SVGElement;\n xmlbase: string;\n className: any;\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired {\n readonly cx: SVGAnimatedLength;\n readonly cy: SVGAnimatedLength;\n readonly rx: SVGAnimatedLength;\n readonly ry: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var SVGFEFloodElement: {\n prototype: SVGFEFloodElement;\n new(): SVGFEFloodElement;\n}\n\ninterface SVGFEFuncAElement extends SVGComponentTransferFunctionElement {\n}\n\ndeclare var SVGFEFuncAElement: {\n prototype: SVGFEFuncAElement;\n new(): SVGFEFuncAElement;\n}\n\ninterface SVGFEFuncBElement extends SVGComponentTransferFunctionElement {\n}\n\ndeclare var SVGFEFuncBElement: {\n prototype: SVGFEFuncBElement;\n new(): SVGFEFuncBElement;\n}\n\ninterface SVGFEFuncGElement extends SVGComponentTransferFunctionElement {\n}\n\ndeclare var SVGFEFuncGElement: {\n prototype: SVGFEFuncGElement;\n new(): SVGFEFuncGElement;\n}\n\ninterface SVGFEFuncRElement extends SVGComponentTransferFunctionElement {\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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var SVGFEGaussianBlurElement: {\n prototype: SVGFEGaussianBlurElement;\n new(): SVGFEGaussianBlurElement;\n}\n\ninterface SVGFEImageElement extends SVGElement, SVGFilterPrimitiveStandardAttributes, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired {\n readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio;\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, SVGStylable, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired {\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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var SVGFilterElement: {\n prototype: SVGFilterElement;\n new(): SVGFilterElement;\n}\n\ninterface SVGForeignObjectElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired {\n readonly height: SVGAnimatedLength;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var SVGForeignObjectElement: {\n prototype: SVGForeignObjectElement;\n new(): SVGForeignObjectElement;\n}\n\ninterface SVGGElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired {\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var SVGGElement: {\n prototype: SVGGElement;\n new(): SVGGElement;\n}\n\ninterface SVGGradientElement extends SVGElement, SVGStylable, SVGExternalResourcesRequired, SVGURIReference, SVGUnitTypes {\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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 SVGImageElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired {\n readonly x1: SVGAnimatedLength;\n readonly x2: SVGAnimatedLength;\n readonly y1: SVGAnimatedLength;\n readonly y2: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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}\n\ndeclare var SVGLinearGradientElement: {\n prototype: SVGLinearGradientElement;\n new(): SVGLinearGradientElement;\n}\n\ninterface SVGMarkerElement extends SVGElement, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPathData {\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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox, SVGURIReference, SVGUnitTypes {\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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPoints {\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var SVGPolygonElement: {\n prototype: SVGPolygonElement;\n new(): SVGPolygonElement;\n}\n\ninterface SVGPolylineElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPoints {\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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}\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 SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired {\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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 SVGElement, DocumentEvent, SVGLocatable, SVGTests, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var SVGSVGElement: {\n prototype: SVGSVGElement;\n new(): SVGSVGElement;\n}\n\ninterface SVGScriptElement extends SVGElement, SVGExternalResourcesRequired, SVGURIReference {\n type: string;\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var SVGScriptElement: {\n prototype: SVGScriptElement;\n new(): SVGScriptElement;\n}\n\ninterface SVGStopElement extends SVGElement, SVGStylable {\n readonly offset: SVGAnimatedNumber;\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, SVGLangSpace {\n disabled: boolean;\n media: string;\n title: string;\n type: string;\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var SVGStyleElement: {\n prototype: SVGStyleElement;\n new(): SVGStyleElement;\n}\n\ninterface SVGSwitchElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired {\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var SVGSwitchElement: {\n prototype: SVGSwitchElement;\n new(): SVGSwitchElement;\n}\n\ninterface SVGSymbolElement extends SVGElement, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox {\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var SVGSymbolElement: {\n prototype: SVGSymbolElement;\n new(): SVGSymbolElement;\n}\n\ninterface SVGTSpanElement extends SVGTextPositioningElement {\n}\n\ndeclare var SVGTSpanElement: {\n prototype: SVGTSpanElement;\n new(): SVGTSpanElement;\n}\n\ninterface SVGTextContentElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired {\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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, SVGTransformable {\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}\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}\n\ndeclare var SVGTextPositioningElement: {\n prototype: SVGTextPositioningElement;\n new(): SVGTextPositioningElement;\n}\n\ninterface SVGTitleElement extends SVGElement, SVGStylable, SVGLangSpace {\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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 SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var SVGUseElement: {\n prototype: SVGUseElement;\n new(): SVGUseElement;\n}\n\ninterface SVGViewElement extends SVGElement, SVGExternalResourcesRequired, SVGFitToViewBox, SVGZoomAndPan {\n readonly viewTarget: SVGStringList;\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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 toString(): string;\n}\n\ndeclare var Selection: {\n prototype: Selection;\n new(): Selection;\n}\n\ninterface SourceBuffer extends EventTarget {\n appendWindowEnd: number;\n appendWindowStart: number;\n readonly audioTracks: AudioTrackList;\n readonly buffered: TimeRanges;\n mode: string;\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 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 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(): 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\": ErrorEvent;\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: ErrorEvent) => 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 ctrlKey: boolean;\n readonly metaKey: boolean;\n readonly shiftKey: boolean;\n readonly targetTouches: TouchList;\n readonly touches: TouchList;\n}\n\ndeclare var TouchEvent: {\n prototype: TouchEvent;\n new(): 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: any;\n}\n\ndeclare var TrackEvent: {\n prototype: TrackEvent;\n new(): 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(): 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(type: 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 username: string;\n toString(): string;\n}\n\ndeclare var URL: {\n prototype: URL;\n new(url: string, base?: string): URL;\n createObjectURL(object: any, options?: ObjectURLOptions): string;\n revokeObjectURL(url: string): void;\n}\n\ninterface UnviewableContentIdentifiedEvent extends NavigationEventWithReferrer {\n readonly mediaType: string;\n}\n\ndeclare var UnviewableContentIdentifiedEvent: {\n prototype: UnviewableContentIdentifiedEvent;\n new(): UnviewableContentIdentifiedEvent;\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}\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n [index: number]: VideoTrack;\n}\n\ndeclare var VideoTrackList: {\n prototype: VideoTrackList;\n new(): VideoTrackList;\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_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 WaveShaperNode extends AudioNode {\n curve: Float32Array | null;\n oversample: string;\n}\n\ndeclare var WaveShaperNode: {\n prototype: WaveShaperNode;\n new(): WaveShaperNode;\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(type: 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(name: 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): 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): void;\n texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels?: 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): void;\n texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels?: 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 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 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 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\": ErrorEvent;\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: ErrorEvent) => 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 \"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 \"unload\": Event;\n \"volumechange\": Event;\n \"waiting\": Event;\n}\n\ninterface Window extends EventTarget, WindowTimers, WindowSessionStorage, WindowLocalStorage, WindowConsole, GlobalEventHandlers, IDBEnvironment, WindowBase64 {\n readonly applicationCache: ApplicationCache;\n readonly clientInformation: Navigator;\n readonly closed: boolean;\n readonly crypto: Crypto;\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 length: number;\n readonly location: Location;\n readonly locationbar: BarProp;\n readonly menubar: BarProp;\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 scrollX: number;\n readonly scrollY: number;\n readonly scrollbars: BarProp;\n readonly self: Window;\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 Blob: typeof Blob;\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 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;\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 webkitCancelAnimationFrame(handle: number): void;\n webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint;\n webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint;\n webkitRequestAnimationFrame(callback: FrameRequestCallback): number;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, ports?: any): void;\n terminate(): void;\n addEventListener(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: Document, ev: DocumentEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: string;\n readonly responseXML: any;\n readonly status: number;\n readonly statusText: string;\n timeout: number;\n readonly upload: XMLHttpRequestUpload;\n withCredentials: boolean;\n msCaching?: string;\n readonly responseURL: 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 create(): XMLHttpRequest;\n}\n\ninterface XMLHttpRequestUpload extends EventTarget, XMLHttpRequestEventTarget {\n addEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\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 DOML2DeprecatedColorProperty {\n color: string;\n}\n\ninterface DOML2DeprecatedSizeProperty {\n size: number;\n}\n\ninterface DocumentEvent {\n createEvent(eventInterface:\"AnimationEvent\"): AnimationEvent;\n createEvent(eventInterface:\"AriaRequestEvent\"): AriaRequestEvent;\n createEvent(eventInterface:\"AudioProcessingEvent\"): AudioProcessingEvent;\n createEvent(eventInterface:\"BeforeUnloadEvent\"): BeforeUnloadEvent;\n createEvent(eventInterface:\"ClipboardEvent\"): ClipboardEvent;\n createEvent(eventInterface:\"CloseEvent\"): CloseEvent;\n createEvent(eventInterface:\"CommandEvent\"): CommandEvent;\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:\"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:\"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:\"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:\"RTCSsrcConflictEvent\"): RTCSsrcConflictEvent;\n createEvent(eventInterface:\"SVGZoomEvent\"): SVGZoomEvent;\n createEvent(eventInterface:\"SVGZoomEvents\"): SVGZoomEvent;\n createEvent(eventInterface:\"ScriptNotifyEvent\"): ScriptNotifyEvent;\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 ElementTraversal {\n readonly childElementCount: number;\n readonly firstElementChild: Element;\n readonly lastElementChild: Element;\n readonly nextElementSibling: Element;\n readonly previousElementSibling: Element;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 NavigatorContentUtils {\n}\n\ninterface NavigatorGeolocation {\n readonly geolocation: Geolocation;\n}\n\ninterface NavigatorID {\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): ElementTagNameMap[K] | null;\n querySelector(selectors: string): Element | null;\n querySelectorAll(selectors: K): ElementListTagNameMap[K];\n querySelectorAll(selectors: string): NodeListOf;\n}\n\ninterface RandomSource {\n getRandomValues(array: ArrayBufferView): ArrayBufferView;\n}\n\ninterface SVGAnimatedPathData {\n readonly pathSegList: SVGPathSegList;\n}\n\ninterface SVGAnimatedPoints {\n readonly animatedPoints: SVGPointList;\n readonly points: SVGPointList;\n}\n\ninterface SVGExternalResourcesRequired {\n readonly externalResourcesRequired: SVGAnimatedBoolean;\n}\n\ninterface SVGFilterPrimitiveStandardAttributes extends SVGStylable {\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 SVGLangSpace {\n xmllang: string;\n xmlspace: string;\n}\n\ninterface SVGLocatable {\n readonly farthestViewportElement: SVGElement;\n readonly nearestViewportElement: SVGElement;\n getBBox(): SVGRect;\n getCTM(): SVGMatrix;\n getScreenCTM(): SVGMatrix;\n getTransformToElement(element: SVGElement): SVGMatrix;\n}\n\ninterface SVGStylable {\n className: any;\n readonly style: CSSStyleDeclaration;\n}\n\ninterface SVGTests {\n readonly requiredExtensions: SVGStringList;\n readonly requiredFeatures: SVGStringList;\n readonly systemLanguage: SVGStringList;\n hasExtension(extension: string): boolean;\n}\n\ninterface SVGTransformable extends SVGLocatable {\n readonly transform: SVGAnimatedTransformList;\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: XMLHttpRequestEventTarget, ev: Event) => any;\n onerror: (this: XMLHttpRequestEventTarget, ev: ErrorEvent) => any;\n onload: (this: XMLHttpRequestEventTarget, ev: Event) => any;\n onloadend: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any;\n onloadstart: (this: XMLHttpRequestEventTarget, ev: Event) => any;\n onprogress: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any;\n ontimeout: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any;\n addEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\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 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 {\n type?: string;\n lastModified?: number;\n}\n\ninterface EventListenerObject {\n handleEvent(evt: Event): void;\n}\n\ninterface MessageEventInit extends EventInit {\n data?: any;\n origin?: string;\n lastEventId?: string;\n channel?: string;\n source?: any;\n ports?: MessagePort[];\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 {\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;\n readonly lastElementChild: Element;\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\ndeclare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;\n\ninterface ErrorEventHandler {\n (message: string, filename?: string, lineno?: number, colno?: number, error?:Error): void;\n}\ninterface PositionCallback {\n (position: Position): void;\n}\ninterface PositionErrorCallback {\n (error: PositionError): void;\n}\ninterface MediaQueryListListener {\n (mql: MediaQueryList): void;\n}\ninterface MSLaunchUriCallback {\n (): void;\n}\ninterface FrameRequestCallback {\n (time: number): void;\n}\ninterface MSUnsafeFunctionCallback {\n (): any;\n}\ninterface MSExecAtPriorityFunctionCallback {\n (...args: any[]): any;\n}\ninterface MutationCallback {\n (mutations: MutationRecord[], observer: MutationObserver): void;\n}\ninterface DecodeSuccessCallback {\n (decodedData: AudioBuffer): void;\n}\ninterface DecodeErrorCallback {\n (error: DOMException): void;\n}\ninterface FunctionStringCallback {\n (data: string): void;\n}\ninterface NavigatorUserMediaSuccessCallback {\n (stream: MediaStream): void;\n}\ninterface NavigatorUserMediaErrorCallback {\n (error: MediaStreamError): void;\n}\ninterface ForEachCallback {\n (keyId: any, status: string): void;\n}\ninterface HTMLElementTagNameMap {\n \"a\": HTMLAnchorElement;\n \"applet\": HTMLAppletElement;\n \"area\": HTMLAreaElement;\n \"audio\": HTMLAudioElement;\n \"base\": HTMLBaseElement;\n \"basefont\": HTMLBaseFontElement;\n \"blockquote\": HTMLQuoteElement;\n \"body\": HTMLBodyElement;\n \"br\": HTMLBRElement;\n \"button\": HTMLButtonElement;\n \"canvas\": HTMLCanvasElement;\n \"caption\": HTMLTableCaptionElement;\n \"col\": HTMLTableColElement;\n \"colgroup\": HTMLTableColElement;\n \"datalist\": HTMLDataListElement;\n \"del\": HTMLModElement;\n \"dir\": HTMLDirectoryElement;\n \"div\": HTMLDivElement;\n \"dl\": HTMLDListElement;\n \"embed\": HTMLEmbedElement;\n \"fieldset\": HTMLFieldSetElement;\n \"font\": HTMLFontElement;\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 \"hr\": HTMLHRElement;\n \"html\": HTMLHtmlElement;\n \"iframe\": HTMLIFrameElement;\n \"img\": HTMLImageElement;\n \"input\": HTMLInputElement;\n \"ins\": HTMLModElement;\n \"isindex\": HTMLUnknownElement;\n \"label\": HTMLLabelElement;\n \"legend\": HTMLLegendElement;\n \"li\": HTMLLIElement;\n \"link\": HTMLLinkElement;\n \"listing\": HTMLPreElement;\n \"map\": HTMLMapElement;\n \"marquee\": HTMLMarqueeElement;\n \"menu\": HTMLMenuElement;\n \"meta\": HTMLMetaElement;\n \"meter\": HTMLMeterElement;\n \"nextid\": HTMLUnknownElement;\n \"object\": HTMLObjectElement;\n \"ol\": HTMLOListElement;\n \"optgroup\": HTMLOptGroupElement;\n \"option\": HTMLOptionElement;\n \"p\": HTMLParagraphElement;\n \"param\": HTMLParamElement;\n \"picture\": HTMLPictureElement;\n \"pre\": HTMLPreElement;\n \"progress\": HTMLProgressElement;\n \"q\": HTMLQuoteElement;\n \"script\": HTMLScriptElement;\n \"select\": HTMLSelectElement;\n \"source\": HTMLSourceElement;\n \"span\": HTMLSpanElement;\n \"style\": HTMLStyleElement;\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 \"title\": HTMLTitleElement;\n \"tr\": HTMLTableRowElement;\n \"track\": HTMLTrackElement;\n \"ul\": HTMLUListElement;\n \"video\": HTMLVideoElement;\n \"x-ms-webview\": MSHTMLWebViewElement;\n \"xmp\": HTMLPreElement;\n}\n\ninterface ElementTagNameMap {\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 \"circle\": SVGCircleElement;\n \"cite\": HTMLElement;\n \"clippath\": SVGClipPathElement;\n \"code\": HTMLElement;\n \"col\": HTMLTableColElement;\n \"colgroup\": HTMLTableColElement;\n \"datalist\": HTMLDataListElement;\n \"dd\": HTMLElement;\n \"defs\": SVGDefsElement;\n \"del\": HTMLModElement;\n \"desc\": SVGDescElement;\n \"dfn\": HTMLElement;\n \"dir\": HTMLDirectoryElement;\n \"div\": HTMLDivElement;\n \"dl\": HTMLDListElement;\n \"dt\": HTMLElement;\n \"ellipse\": SVGEllipseElement;\n \"em\": HTMLElement;\n \"embed\": HTMLEmbedElement;\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 \"fieldset\": HTMLFieldSetElement;\n \"figcaption\": HTMLElement;\n \"figure\": HTMLElement;\n \"filter\": SVGFilterElement;\n \"font\": HTMLFontElement;\n \"footer\": HTMLElement;\n \"foreignobject\": SVGForeignObjectElement;\n \"form\": HTMLFormElement;\n \"frame\": HTMLFrameElement;\n \"frameset\": HTMLFrameSetElement;\n \"g\": SVGGElement;\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 \"image\": SVGImageElement;\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 \"line\": SVGLineElement;\n \"lineargradient\": SVGLinearGradientElement;\n \"link\": HTMLLinkElement;\n \"listing\": HTMLPreElement;\n \"map\": HTMLMapElement;\n \"mark\": HTMLElement;\n \"marker\": SVGMarkerElement;\n \"marquee\": HTMLMarqueeElement;\n \"mask\": SVGMaskElement;\n \"menu\": HTMLMenuElement;\n \"meta\": HTMLMetaElement;\n \"metadata\": SVGMetadataElement;\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 \"p\": HTMLParagraphElement;\n \"param\": HTMLParamElement;\n \"path\": SVGPathElement;\n \"pattern\": SVGPatternElement;\n \"picture\": HTMLPictureElement;\n \"plaintext\": HTMLElement;\n \"polygon\": SVGPolygonElement;\n \"polyline\": SVGPolylineElement;\n \"pre\": HTMLPreElement;\n \"progress\": HTMLProgressElement;\n \"q\": HTMLQuoteElement;\n \"radialgradient\": SVGRadialGradientElement;\n \"rect\": SVGRectElement;\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 \"stop\": SVGStopElement;\n \"strike\": HTMLElement;\n \"strong\": HTMLElement;\n \"style\": HTMLStyleElement;\n \"sub\": HTMLElement;\n \"sup\": HTMLElement;\n \"svg\": SVGSVGElement;\n \"switch\": SVGSwitchElement;\n \"symbol\": SVGSymbolElement;\n \"table\": HTMLTableElement;\n \"tbody\": HTMLTableSectionElement;\n \"td\": HTMLTableDataCellElement;\n \"template\": HTMLTemplateElement;\n \"text\": SVGTextElement;\n \"textpath\": SVGTextPathElement;\n \"textarea\": HTMLTextAreaElement;\n \"tfoot\": HTMLTableSectionElement;\n \"th\": HTMLTableHeaderCellElement;\n \"thead\": HTMLTableSectionElement;\n \"title\": HTMLTitleElement;\n \"tr\": HTMLTableRowElement;\n \"track\": HTMLTrackElement;\n \"tspan\": SVGTSpanElement;\n \"tt\": HTMLElement;\n \"u\": HTMLElement;\n \"ul\": HTMLUListElement;\n \"use\": SVGUseElement;\n \"var\": HTMLElement;\n \"video\": HTMLVideoElement;\n \"view\": SVGViewElement;\n \"wbr\": HTMLElement;\n \"x-ms-webview\": MSHTMLWebViewElement;\n \"xmp\": HTMLPreElement;\n}\n\ninterface ElementListTagNameMap {\n \"a\": NodeListOf;\n \"abbr\": NodeListOf;\n \"acronym\": NodeListOf;\n \"address\": NodeListOf;\n \"applet\": NodeListOf;\n \"area\": NodeListOf;\n \"article\": NodeListOf;\n \"aside\": NodeListOf;\n \"audio\": NodeListOf;\n \"b\": NodeListOf;\n \"base\": NodeListOf;\n \"basefont\": NodeListOf;\n \"bdo\": NodeListOf;\n \"big\": NodeListOf;\n \"blockquote\": NodeListOf;\n \"body\": NodeListOf;\n \"br\": NodeListOf;\n \"button\": NodeListOf;\n \"canvas\": NodeListOf;\n \"caption\": NodeListOf;\n \"center\": NodeListOf;\n \"circle\": NodeListOf;\n \"cite\": NodeListOf;\n \"clippath\": NodeListOf;\n \"code\": NodeListOf;\n \"col\": NodeListOf;\n \"colgroup\": NodeListOf;\n \"datalist\": NodeListOf;\n \"dd\": NodeListOf;\n \"defs\": NodeListOf;\n \"del\": NodeListOf;\n \"desc\": NodeListOf;\n \"dfn\": NodeListOf;\n \"dir\": NodeListOf;\n \"div\": NodeListOf;\n \"dl\": NodeListOf;\n \"dt\": NodeListOf;\n \"ellipse\": NodeListOf;\n \"em\": NodeListOf;\n \"embed\": NodeListOf;\n \"feblend\": NodeListOf;\n \"fecolormatrix\": NodeListOf;\n \"fecomponenttransfer\": NodeListOf;\n \"fecomposite\": NodeListOf;\n \"feconvolvematrix\": NodeListOf;\n \"fediffuselighting\": NodeListOf;\n \"fedisplacementmap\": NodeListOf;\n \"fedistantlight\": NodeListOf;\n \"feflood\": NodeListOf;\n \"fefunca\": NodeListOf;\n \"fefuncb\": NodeListOf;\n \"fefuncg\": NodeListOf;\n \"fefuncr\": NodeListOf;\n \"fegaussianblur\": NodeListOf;\n \"feimage\": NodeListOf;\n \"femerge\": NodeListOf;\n \"femergenode\": NodeListOf;\n \"femorphology\": NodeListOf;\n \"feoffset\": NodeListOf;\n \"fepointlight\": NodeListOf;\n \"fespecularlighting\": NodeListOf;\n \"fespotlight\": NodeListOf;\n \"fetile\": NodeListOf;\n \"feturbulence\": NodeListOf;\n \"fieldset\": NodeListOf;\n \"figcaption\": NodeListOf;\n \"figure\": NodeListOf;\n \"filter\": NodeListOf;\n \"font\": NodeListOf;\n \"footer\": NodeListOf;\n \"foreignobject\": NodeListOf;\n \"form\": NodeListOf;\n \"frame\": NodeListOf;\n \"frameset\": NodeListOf;\n \"g\": NodeListOf;\n \"h1\": NodeListOf;\n \"h2\": NodeListOf;\n \"h3\": NodeListOf;\n \"h4\": NodeListOf;\n \"h5\": NodeListOf;\n \"h6\": NodeListOf;\n \"head\": NodeListOf;\n \"header\": NodeListOf;\n \"hgroup\": NodeListOf;\n \"hr\": NodeListOf;\n \"html\": NodeListOf;\n \"i\": NodeListOf;\n \"iframe\": NodeListOf;\n \"image\": NodeListOf;\n \"img\": NodeListOf;\n \"input\": NodeListOf;\n \"ins\": NodeListOf;\n \"isindex\": NodeListOf;\n \"kbd\": NodeListOf;\n \"keygen\": NodeListOf;\n \"label\": NodeListOf;\n \"legend\": NodeListOf;\n \"li\": NodeListOf;\n \"line\": NodeListOf;\n \"lineargradient\": NodeListOf;\n \"link\": NodeListOf;\n \"listing\": NodeListOf;\n \"map\": NodeListOf;\n \"mark\": NodeListOf;\n \"marker\": NodeListOf;\n \"marquee\": NodeListOf;\n \"mask\": NodeListOf;\n \"menu\": NodeListOf;\n \"meta\": NodeListOf;\n \"metadata\": NodeListOf;\n \"meter\": NodeListOf;\n \"nav\": NodeListOf;\n \"nextid\": NodeListOf;\n \"nobr\": NodeListOf;\n \"noframes\": NodeListOf;\n \"noscript\": NodeListOf;\n \"object\": NodeListOf;\n \"ol\": NodeListOf;\n \"optgroup\": NodeListOf;\n \"option\": NodeListOf;\n \"p\": NodeListOf;\n \"param\": NodeListOf;\n \"path\": NodeListOf;\n \"pattern\": NodeListOf;\n \"picture\": NodeListOf;\n \"plaintext\": NodeListOf;\n \"polygon\": NodeListOf;\n \"polyline\": NodeListOf;\n \"pre\": NodeListOf;\n \"progress\": NodeListOf;\n \"q\": NodeListOf;\n \"radialgradient\": NodeListOf;\n \"rect\": NodeListOf;\n \"rt\": NodeListOf;\n \"ruby\": NodeListOf;\n \"s\": NodeListOf;\n \"samp\": NodeListOf;\n \"script\": NodeListOf;\n \"section\": NodeListOf;\n \"select\": NodeListOf;\n \"small\": NodeListOf;\n \"source\": NodeListOf;\n \"span\": NodeListOf;\n \"stop\": NodeListOf;\n \"strike\": NodeListOf;\n \"strong\": NodeListOf;\n \"style\": NodeListOf;\n \"sub\": NodeListOf;\n \"sup\": NodeListOf;\n \"svg\": NodeListOf;\n \"switch\": NodeListOf;\n \"symbol\": NodeListOf;\n \"table\": NodeListOf;\n \"tbody\": NodeListOf;\n \"td\": NodeListOf;\n \"template\": NodeListOf;\n \"text\": NodeListOf;\n \"textpath\": NodeListOf;\n \"textarea\": NodeListOf;\n \"tfoot\": NodeListOf;\n \"th\": NodeListOf;\n \"thead\": NodeListOf;\n \"title\": NodeListOf;\n \"tr\": NodeListOf;\n \"track\": NodeListOf;\n \"tspan\": NodeListOf;\n \"tt\": NodeListOf;\n \"u\": NodeListOf;\n \"ul\": NodeListOf;\n \"use\": NodeListOf;\n \"var\": NodeListOf;\n \"video\": NodeListOf;\n \"view\": NodeListOf;\n \"wbr\": NodeListOf;\n \"x-ms-webview\": NodeListOf;\n \"xmp\": NodeListOf;\n}\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 clientInformation: Navigator;\ndeclare var closed: boolean;\ndeclare var crypto: Crypto;\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 length: number;\ndeclare var location: Location;\ndeclare var locationbar: BarProp;\ndeclare var menubar: BarProp;\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 scrollX: number;\ndeclare var scrollY: number;\ndeclare var scrollbars: BarProp;\ndeclare var self: Window;\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 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;\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 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 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 removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void;\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 addEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, useCapture?: boolean): void;\ndeclare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\ntype AAGUID = string;\ntype AlgorithmIdentifier = string | Algorithm;\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 = RTCIceCandidate | RTCIceCandidateComplete;\ntype RTCTransport = RTCDtlsTransport | RTCSrtpSdesTransport;\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\";\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 * 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 (collection: any): 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: any): VBArray;\n new (safeArray: any): VBArray;\n}\n\ndeclare var VBArray: VBArrayConstructor;\n\n/**\n * Automation date (VT_DATE)\n */\ninterface VarDate { }\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 NodeList {\n [Symbol.iterator](): IterableIterator\n}\n\ninterface NodeListOf {\n [Symbol.iterator](): IterableIterator\n}\n"}; }); +define([], function() { return { 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\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;\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: any): 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 number 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 number 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 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: U[]): 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[][]): 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 | T[])[]): 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 /**\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: (this: void, value: T, index: number, array: ReadonlyArray) => boolean): boolean;\n every(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => boolean, thisArg: undefined): boolean;\n every(callbackfn: (this: Z, value: T, index: number, array: ReadonlyArray) => boolean, thisArg: Z): 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: (this: void, value: T, index: number, array: ReadonlyArray) => boolean): boolean;\n some(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => boolean, thisArg: undefined): boolean;\n some(callbackfn: (this: Z, value: T, index: number, array: ReadonlyArray) => boolean, thisArg: Z): 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: (this: void, value: T, index: number, array: ReadonlyArray) => void): void;\n forEach(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => void, thisArg: undefined): void;\n forEach(callbackfn: (this: Z, value: T, index: number, array: ReadonlyArray) => void, thisArg: Z): 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: (this: void, value: T, index: number, array: ReadonlyArray) => U): U[];\n map(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => U, thisArg: undefined): U[];\n map(callbackfn: (this: Z, value: T, index: number, array: ReadonlyArray) => U, thisArg: Z): 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: (this: void, value: T, index: number, array: ReadonlyArray) => value is S): S[];\n filter(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => value is S, thisArg: undefined): S[];\n filter(callbackfn: (this: Z, value: T, index: number, array: ReadonlyArray) => value is S, thisArg: Z): 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: (this: void, value: T, index: number, array: ReadonlyArray) => any): T[];\n filter(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => any, thisArg: undefined): T[];\n filter(callbackfn: (this: Z, value: T, index: number, array: ReadonlyArray) => any, thisArg: Z): 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, 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, 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 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 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: T[][]): 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 | T[])[]): 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: (this: void, value: T, index: number, array: T[]) => boolean): boolean;\n every(callbackfn: (this: void, value: T, index: number, array: T[]) => boolean, thisArg: undefined): boolean;\n every(callbackfn: (this: Z, value: T, index: number, array: T[]) => boolean, thisArg: Z): 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: (this: void, value: T, index: number, array: T[]) => boolean): boolean;\n some(callbackfn: (this: void, value: T, index: number, array: T[]) => boolean, thisArg: undefined): boolean;\n some(callbackfn: (this: Z, value: T, index: number, array: T[]) => boolean, thisArg: Z): 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: (this: void, value: T, index: number, array: T[]) => void): void;\n forEach(callbackfn: (this: void, value: T, index: number, array: T[]) => void, thisArg: undefined): void;\n forEach(callbackfn: (this: Z, value: T, index: number, array: T[]) => void, thisArg: Z): 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(this: [T, T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U, U, U, U];\n map(this: [T, T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U, U, U];\n map(this: [T, T, T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U, U, U];\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(this: [T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U, U, U];\n map(this: [T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U, U];\n map(this: [T, T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U, U];\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(this: [T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U, U];\n map(this: [T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U];\n map(this: [T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U];\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(this: [T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U];\n map(this: [T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U];\n map(this: [T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U];\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: (this: void, value: T, index: number, array: T[]) => U): U[];\n map(callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): U[];\n map(callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): 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: (this: void, value: T, index: number, array: T[]) => any): T[];\n filter(callbackfn: (this: void, value: T, index: number, array: T[]) => any, thisArg: undefined): T[];\n filter(callbackfn: (this: Z, value: T, index: number, array: T[]) => any, thisArg: Z): 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, 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, 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\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: ArrayBuffer;\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: ArrayBuffer, 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: ArrayBuffer;\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: (this: void, value: number, index: number, array: Int8Array) => boolean): boolean;\n every(callbackfn: (this: void, value: number, index: number, array: Int8Array) => boolean, thisArg: undefined): boolean;\n every(callbackfn: (this: Z, value: number, index: number, array: Int8Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, array: Int8Array) => any): Int8Array;\n filter(callbackfn: (this: void, value: number, index: number, array: Int8Array) => any, thisArg: undefined): Int8Array;\n filter(callbackfn: (this: Z, value: number, index: number, array: Int8Array) => any, thisArg: Z): 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: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined;\n find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined;\n find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, obj: Array) => boolean): number;\n findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number;\n findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, array: Int8Array) => void): void;\n forEach(callbackfn: (this: void, value: number, index: number, array: Int8Array) => void, thisArg: undefined): void;\n forEach(callbackfn: (this: Z, value: number, index: number, array: Int8Array) => void, thisArg: Z): 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: (this: void, value: number, index: number, array: Int8Array) => number): Int8Array;\n map(callbackfn: (this: void, value: number, index: number, array: Int8Array) => number, thisArg: undefined): Int8Array;\n map(callbackfn: (this: Z, value: number, index: number, array: Int8Array) => number, thisArg: Z): 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, 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, 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: (this: void, value: number, index: number, array: Int8Array) => boolean): boolean;\n some(callbackfn: (this: void, value: number, index: number, array: Int8Array) => boolean, thisArg: undefined): boolean;\n some(callbackfn: (this: Z, value: number, index: number, array: Int8Array) => boolean, thisArg: Z): 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 (array: ArrayLike): Int8Array;\n new (buffer: ArrayBuffer, 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: (this: void, v: number, k: number) => number): Int8Array;\n from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int8Array;\n from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int8Array;\n\n from(arrayLike: ArrayLike): Int8Array;\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: ArrayBuffer;\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: (this: void, value: number, index: number, array: Uint8Array) => boolean): boolean;\n every(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => boolean, thisArg: undefined): boolean;\n every(callbackfn: (this: Z, value: number, index: number, array: Uint8Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, array: Uint8Array) => any): Uint8Array;\n filter(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => any, thisArg: undefined): Uint8Array;\n filter(callbackfn: (this: Z, value: number, index: number, array: Uint8Array) => any, thisArg: Z): 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: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined;\n find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined;\n find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, obj: Array) => boolean): number;\n findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number;\n findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, array: Uint8Array) => void): void;\n forEach(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => void, thisArg: undefined): void;\n forEach(callbackfn: (this: Z, value: number, index: number, array: Uint8Array) => void, thisArg: Z): 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: (this: void, value: number, index: number, array: Uint8Array) => number): Uint8Array;\n map(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => number, thisArg: undefined): Uint8Array;\n map(callbackfn: (this: Z, value: number, index: number, array: Uint8Array) => number, thisArg: Z): 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, 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, 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: (this: void, value: number, index: number, array: Uint8Array) => boolean): boolean;\n some(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => boolean, thisArg: undefined): boolean;\n some(callbackfn: (this: Z, value: number, index: number, array: Uint8Array) => boolean, thisArg: Z): 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 (array: ArrayLike): Uint8Array;\n new (buffer: ArrayBuffer, 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: (this: void, v: number, k: number) => number): Uint8Array;\n from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint8Array;\n from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint8Array;\n\n from(arrayLike: ArrayLike): 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: ArrayBuffer;\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: (this: void, value: number, index: number, array: Uint8ClampedArray) => boolean): boolean;\n every(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg: undefined): boolean;\n every(callbackfn: (this: Z, value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, array: Uint8ClampedArray) => any): Uint8ClampedArray;\n filter(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => any, thisArg: undefined): Uint8ClampedArray;\n filter(callbackfn: (this: Z, value: number, index: number, array: Uint8ClampedArray) => any, thisArg: Z): 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: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined;\n find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined;\n find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, obj: Array) => boolean): number;\n findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number;\n findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, array: Uint8ClampedArray) => void): void;\n forEach(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => void, thisArg: undefined): void;\n forEach(callbackfn: (this: Z, value: number, index: number, array: Uint8ClampedArray) => void, thisArg: Z): 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: (this: void, value: number, index: number, array: Uint8ClampedArray) => number): Uint8ClampedArray;\n map(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => number, thisArg: undefined): Uint8ClampedArray;\n map(callbackfn: (this: Z, value: number, index: number, array: Uint8ClampedArray) => number, thisArg: Z): 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, 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, 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: (this: void, value: number, index: number, array: Uint8ClampedArray) => boolean): boolean;\n some(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg: undefined): boolean;\n some(callbackfn: (this: Z, value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg: Z): 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 (array: ArrayLike): Uint8ClampedArray;\n new (buffer: ArrayBuffer, 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: (this: void, v: number, k: number) => number): Uint8ClampedArray;\n from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint8ClampedArray;\n from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint8ClampedArray;\n\n from(arrayLike: ArrayLike): 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: ArrayBuffer;\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: (this: void, value: number, index: number, array: Int16Array) => boolean): boolean;\n every(callbackfn: (this: void, value: number, index: number, array: Int16Array) => boolean, thisArg: undefined): boolean;\n every(callbackfn: (this: Z, value: number, index: number, array: Int16Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, array: Int16Array) => any): Int16Array;\n filter(callbackfn: (this: void, value: number, index: number, array: Int16Array) => any, thisArg: undefined): Int16Array;\n filter(callbackfn: (this: Z, value: number, index: number, array: Int16Array) => any, thisArg: Z): 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: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined;\n find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined;\n find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, obj: Array) => boolean): number;\n findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number;\n findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, array: Int16Array) => void): void;\n forEach(callbackfn: (this: void, value: number, index: number, array: Int16Array) => void, thisArg: undefined): void;\n forEach(callbackfn: (this: Z, value: number, index: number, array: Int16Array) => void, thisArg: Z): 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: (this: void, value: number, index: number, array: Int16Array) => number): Int16Array;\n map(callbackfn: (this: void, value: number, index: number, array: Int16Array) => number, thisArg: undefined): Int16Array;\n map(callbackfn: (this: Z, value: number, index: number, array: Int16Array) => number, thisArg: Z): 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, 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, 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: (this: void, value: number, index: number, array: Int16Array) => boolean): boolean;\n some(callbackfn: (this: void, value: number, index: number, array: Int16Array) => boolean, thisArg: undefined): boolean;\n some(callbackfn: (this: Z, value: number, index: number, array: Int16Array) => boolean, thisArg: Z): 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 (array: ArrayLike): Int16Array;\n new (buffer: ArrayBuffer, 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: (this: void, v: number, k: number) => number): Int16Array;\n from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int16Array;\n from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int16Array;\n\n from(arrayLike: ArrayLike): Int16Array;\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: ArrayBuffer;\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: (this: void, value: number, index: number, array: Uint16Array) => boolean): boolean;\n every(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => boolean, thisArg: undefined): boolean;\n every(callbackfn: (this: Z, value: number, index: number, array: Uint16Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, array: Uint16Array) => any): Uint16Array;\n filter(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => any, thisArg: undefined): Uint16Array;\n filter(callbackfn: (this: Z, value: number, index: number, array: Uint16Array) => any, thisArg: Z): 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: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined;\n find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined;\n find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, obj: Array) => boolean): number;\n findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number;\n findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, array: Uint16Array) => void): void;\n forEach(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => void, thisArg: undefined): void;\n forEach(callbackfn: (this: Z, value: number, index: number, array: Uint16Array) => void, thisArg: Z): 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: (this: void, value: number, index: number, array: Uint16Array) => number): Uint16Array;\n map(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => number, thisArg: undefined): Uint16Array;\n map(callbackfn: (this: Z, value: number, index: number, array: Uint16Array) => number, thisArg: Z): 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, 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, 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: (this: void, value: number, index: number, array: Uint16Array) => boolean): boolean;\n some(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => boolean, thisArg: undefined): boolean;\n some(callbackfn: (this: Z, value: number, index: number, array: Uint16Array) => boolean, thisArg: Z): 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 (array: ArrayLike): Uint16Array;\n new (buffer: ArrayBuffer, 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: (this: void, v: number, k: number) => number): Uint16Array;\n from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint16Array;\n from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint16Array;\n\n from(arrayLike: ArrayLike): Uint16Array;\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: ArrayBuffer;\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: (this: void, value: number, index: number, array: Int32Array) => boolean): boolean;\n every(callbackfn: (this: void, value: number, index: number, array: Int32Array) => boolean, thisArg: undefined): boolean;\n every(callbackfn: (this: Z, value: number, index: number, array: Int32Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, array: Int32Array) => any): Int32Array;\n filter(callbackfn: (this: void, value: number, index: number, array: Int32Array) => any, thisArg: undefined): Int32Array;\n filter(callbackfn: (this: Z, value: number, index: number, array: Int32Array) => any, thisArg: Z): 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: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined;\n find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined;\n find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, obj: Array) => boolean): number;\n findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number;\n findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, array: Int32Array) => void): void;\n forEach(callbackfn: (this: void, value: number, index: number, array: Int32Array) => void, thisArg: undefined): void;\n forEach(callbackfn: (this: Z, value: number, index: number, array: Int32Array) => void, thisArg: Z): 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: (this: void, value: number, index: number, array: Int32Array) => number): Int32Array;\n map(callbackfn: (this: void, value: number, index: number, array: Int32Array) => number, thisArg: undefined): Int32Array;\n map(callbackfn: (this: Z, value: number, index: number, array: Int32Array) => number, thisArg: Z): 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, 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, 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: (this: void, value: number, index: number, array: Int32Array) => boolean): boolean;\n some(callbackfn: (this: void, value: number, index: number, array: Int32Array) => boolean, thisArg: undefined): boolean;\n some(callbackfn: (this: Z, value: number, index: number, array: Int32Array) => boolean, thisArg: Z): 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 (array: ArrayLike): Int32Array;\n new (buffer: ArrayBuffer, 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: (this: void, v: number, k: number) => number): Int32Array;\n from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int32Array;\n from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int32Array;\n\n from(arrayLike: ArrayLike): Int32Array;\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: ArrayBuffer;\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: (this: void, value: number, index: number, array: Uint32Array) => boolean): boolean;\n every(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => boolean, thisArg: undefined): boolean;\n every(callbackfn: (this: Z, value: number, index: number, array: Uint32Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, array: Uint32Array) => any): Uint32Array;\n filter(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => any, thisArg: undefined): Uint32Array;\n filter(callbackfn: (this: Z, value: number, index: number, array: Uint32Array) => any, thisArg: Z): 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: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined;\n find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined;\n find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, obj: Array) => boolean): number;\n findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number;\n findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, array: Uint32Array) => void): void;\n forEach(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => void, thisArg: undefined): void;\n forEach(callbackfn: (this: Z, value: number, index: number, array: Uint32Array) => void, thisArg: Z): 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: (this: void, value: number, index: number, array: Uint32Array) => number): Uint32Array;\n map(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => number, thisArg: undefined): Uint32Array;\n map(callbackfn: (this: Z, value: number, index: number, array: Uint32Array) => number, thisArg: Z): 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, 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, 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: (this: void, value: number, index: number, array: Uint32Array) => boolean): boolean;\n some(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => boolean, thisArg: undefined): boolean;\n some(callbackfn: (this: Z, value: number, index: number, array: Uint32Array) => boolean, thisArg: Z): 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 (array: ArrayLike): Uint32Array;\n new (buffer: ArrayBuffer, 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: (this: void, v: number, k: number) => number): Uint32Array;\n from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint32Array;\n from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint32Array;\n\n from(arrayLike: ArrayLike): Uint32Array;\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: ArrayBuffer;\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: (this: void, value: number, index: number, array: Float32Array) => boolean): boolean;\n every(callbackfn: (this: void, value: number, index: number, array: Float32Array) => boolean, thisArg: undefined): boolean;\n every(callbackfn: (this: Z, value: number, index: number, array: Float32Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, array: Float32Array) => any): Float32Array;\n filter(callbackfn: (this: void, value: number, index: number, array: Float32Array) => any, thisArg: undefined): Float32Array;\n filter(callbackfn: (this: Z, value: number, index: number, array: Float32Array) => any, thisArg: Z): 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: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined;\n find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined;\n find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, obj: Array) => boolean): number;\n findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number;\n findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, array: Float32Array) => void): void;\n forEach(callbackfn: (this: void, value: number, index: number, array: Float32Array) => void, thisArg: undefined): void;\n forEach(callbackfn: (this: Z, value: number, index: number, array: Float32Array) => void, thisArg: Z): 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: (this: void, value: number, index: number, array: Float32Array) => number): Float32Array;\n map(callbackfn: (this: void, value: number, index: number, array: Float32Array) => number, thisArg: undefined): Float32Array;\n map(callbackfn: (this: Z, value: number, index: number, array: Float32Array) => number, thisArg: Z): 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, 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, 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: (this: void, value: number, index: number, array: Float32Array) => boolean): boolean;\n some(callbackfn: (this: void, value: number, index: number, array: Float32Array) => boolean, thisArg: undefined): boolean;\n some(callbackfn: (this: Z, value: number, index: number, array: Float32Array) => boolean, thisArg: Z): 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 (array: ArrayLike): Float32Array;\n new (buffer: ArrayBuffer, 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: (this: void, v: number, k: number) => number): Float32Array;\n from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Float32Array;\n from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Float32Array;\n\n from(arrayLike: ArrayLike): Float32Array;\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: ArrayBuffer;\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: (this: void, value: number, index: number, array: Float64Array) => boolean): boolean;\n every(callbackfn: (this: void, value: number, index: number, array: Float64Array) => boolean, thisArg: undefined): boolean;\n every(callbackfn: (this: Z, value: number, index: number, array: Float64Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, array: Float64Array) => any): Float64Array;\n filter(callbackfn: (this: void, value: number, index: number, array: Float64Array) => any, thisArg: undefined): Float64Array;\n filter(callbackfn: (this: Z, value: number, index: number, array: Float64Array) => any, thisArg: Z): 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: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined;\n find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined;\n find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, obj: Array) => boolean): number;\n findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number;\n findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, array: Float64Array) => void): void;\n forEach(callbackfn: (this: void, value: number, index: number, array: Float64Array) => void, thisArg: undefined): void;\n forEach(callbackfn: (this: Z, value: number, index: number, array: Float64Array) => void, thisArg: Z): 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: (this: void, value: number, index: number, array: Float64Array) => number): Float64Array;\n map(callbackfn: (this: void, value: number, index: number, array: Float64Array) => number, thisArg: undefined): Float64Array;\n map(callbackfn: (this: Z, value: number, index: number, array: Float64Array) => number, thisArg: Z): 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, 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, 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: (this: void, value: number, index: number, array: Float64Array) => boolean): boolean;\n some(callbackfn: (this: void, value: number, index: number, array: Float64Array) => boolean, thisArg: undefined): boolean;\n some(callbackfn: (this: Z, value: number, index: number, array: Float64Array) => boolean, thisArg: Z): 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 (array: ArrayLike): Float64Array;\n new (buffer: ArrayBuffer, 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: (this: void, v: number, k: number) => number): Float64Array;\n from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Float64Array;\n from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Float64Array;\n\n from(arrayLike: ArrayLike): Float64Array;\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: Array) => boolean): T | undefined;\n find(predicate: (this: void, value: T, index: number, obj: Array) => boolean, thisArg: undefined): T | undefined;\n find(predicate: (this: Z, value: T, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: T, index: number, obj: Array) => boolean): number;\n findIndex(predicate: (this: void, value: T, index: number, obj: Array) => boolean, thisArg: undefined): number;\n findIndex(predicate: (this: Z, value: T, index: number, obj: Array) => boolean, thisArg: Z): 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 * @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: (this: void, v: T, k: number) => U): Array;\n from(arrayLike: ArrayLike, mapfn: (this: void, v: T, k: number) => U, thisArg: undefined): Array;\n from(arrayLike: ArrayLike, mapfn: (this: Z, v: T, k: number) => U, thisArg: Z): Array;\n\n\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): Array;\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[]): Array;\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) of x (e raised to the power of x, where e is the base of\n * 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;\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) => boolean): T | undefined;\n find(predicate: (this: void, value: T, index: number, obj: ReadonlyArray) => boolean, thisArg: undefined): T | undefined;\n find(predicate: (this: Z, value: T, index: number, obj: ReadonlyArray) => boolean, thisArg: Z): 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: (this: void, value: T, index: number, obj: Array) => boolean): number;\n findIndex(predicate: (this: void, value: T, index: number, obj: Array) => boolean, thisArg: undefined): number;\n findIndex(predicate: (this: Z, value: T, index: number, obj: Array) => boolean, thisArg: Z): 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 * T is 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?: [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?: [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?: T[]): 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?: T[]): 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 array of key, value pairs for every entry in the array\n */\n entries(): IterableIterator<[number, T]>;\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 ArrayConstructor {\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, mapfn: (this: void, v: T, k: number) => U): Array;\n from(iterable: Iterable, mapfn: (this: void, v: T, k: number) => U, thisArg: undefined): Array;\n from(iterable: Iterable, mapfn: (this: Z, v: T, k: number) => U, thisArg: Z): Array;\n\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): Array;\n}\n\ninterface ReadonlyArray {\n /** Iterator */\n [Symbol.iterator](): IterableIterator;\n\n /**\n * Returns an array of key, value pairs for every entry in the array\n */\n entries(): IterableIterator<[number, T]>;\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 IArguments {\n /** Iterator */\n [Symbol.iterator](): IterableIterator;\n}\n\ninterface Map {\n [Symbol.iterator](): IterableIterator<[K, V]>;\n entries(): IterableIterator<[K, V]>;\n keys(): IterableIterator;\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 [Symbol.iterator](): IterableIterator;\n entries(): IterableIterator<[T, T]>;\n keys(): IterableIterator;\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\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 [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: (this: void, v: number, k: number) => number): Int8Array;\n from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int8Array;\n from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int8Array;\n\n from(arrayLike: Iterable): Int8Array;\n}\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 [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: (this: void, v: number, k: number) => number): Uint8Array;\n from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint8Array;\n from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint8Array;\n\n from(arrayLike: Iterable): Uint8Array;\n}\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 [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: (this: void, v: number, k: number) => number): Uint8ClampedArray;\n from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint8ClampedArray;\n from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint8ClampedArray;\n\n from(arrayLike: Iterable): Uint8ClampedArray;\n}\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 [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: (this: void, v: number, k: number) => number): Int16Array;\n from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int16Array;\n from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int16Array;\n\n from(arrayLike: Iterable): Int16Array;\n}\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 [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: (this: void, v: number, k: number) => number): Uint16Array;\n from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint16Array;\n from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint16Array;\n\n from(arrayLike: Iterable): Uint16Array;\n}\n\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 [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: (this: void, v: number, k: number) => number): Int32Array;\n from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int32Array;\n from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int32Array;\n\n from(arrayLike: Iterable): Int32Array;\n}\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 [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: (this: void, v: number, k: number) => number): Uint32Array;\n from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint32Array;\n from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint32Array;\n\n from(arrayLike: Iterable): Uint32Array;\n}\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 [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: (this: void, v: number, k: number) => number): Float32Array;\n from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Float32Array;\n from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Float32Array;\n\n from(arrayLike: Iterable): Float32Array;\n}\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 [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: (this: void, v: number, k: number) => number): Float64Array;\n from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Float64Array;\n from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Float64Array;\n\n from(arrayLike: Iterable): 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;\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;\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): Array;\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]: Function;\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 [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\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 readonly [Symbol.toStringTag]: \"ArrayBuffer\";\n}\n\ninterface DataView {\n readonly [Symbol.toStringTag]: \"DataView\";\n}\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 readonly [Symbol.toStringTag]: \"Int8Array\";\n}\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 readonly [Symbol.toStringTag]: \"UInt8Array\";\n}\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 readonly [Symbol.toStringTag]: \"Uint8ClampedArray\";\n}\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 readonly [Symbol.toStringTag]: \"Int16Array\";\n}\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 readonly [Symbol.toStringTag]: \"Uint16Array\";\n}\n\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 readonly [Symbol.toStringTag]: \"Int32Array\";\n}\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 readonly [Symbol.toStringTag]: \"Uint32Array\";\n}\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 readonly [Symbol.toStringTag]: \"Float32Array\";\n}\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 readonly [Symbol.toStringTag]: \"Float64Array\";\n}\n\n\n\n/////////////////////////////\n/// IE DOM APIs\n/////////////////////////////\n\ninterface Account {\n rpDisplayName?: string;\n displayName?: string;\n id?: string;\n name?: string;\n imageURL?: 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 timeoutSeconds?: number;\n rpId?: USVString;\n allowList?: ScopedCredentialDescriptor[];\n extensions?: WebAuthnExtensions;\n}\n\ninterface CacheQueryOptions {\n ignoreSearch?: boolean;\n ignoreMethod?: boolean;\n ignoreVary?: boolean;\n cacheName?: string;\n}\n\ninterface ClientData {\n challenge?: string;\n origin?: string;\n rpId?: string;\n hashAlg?: string | Algorithm;\n tokenBinding?: string;\n extensions?: WebAuthnExtensions;\n}\n\ninterface CloseEventInit extends EventInit {\n wasClean?: boolean;\n code?: number;\n reason?: string;\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?: any;\n}\n\ninterface DOMRectInit {\n x?: any;\n y?: any;\n width?: any;\n height?: any;\n}\n\ninterface DeviceAccelerationDict {\n x?: number;\n y?: number;\n z?: number;\n}\n\ninterface DeviceLightEventInit extends EventInit {\n value?: number;\n}\n\ninterface DeviceMotionEventInit extends EventInit {\n acceleration?: DeviceAccelerationDict;\n accelerationIncludingGravity?: DeviceAccelerationDict;\n rotationRate?: DeviceRotationRateDict;\n interval?: number;\n}\n\ninterface DeviceOrientationEventInit extends EventInit {\n alpha?: number;\n beta?: number;\n gamma?: number;\n absolute?: boolean;\n}\n\ninterface DeviceRotationRateDict {\n alpha?: number;\n beta?: number;\n gamma?: number;\n}\n\ninterface DoubleRange {\n max?: number;\n min?: number;\n}\n\ninterface ErrorEventInit extends EventInit {\n message?: string;\n filename?: string;\n lineno?: number;\n colno?: number;\n error?: any;\n}\n\ninterface EventInit {\n scoped?: boolean;\n bubbles?: boolean;\n cancelable?: boolean;\n}\n\ninterface EventModifierInit extends UIEventInit {\n ctrlKey?: boolean;\n shiftKey?: boolean;\n altKey?: 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}\n\ninterface ExceptionInformation {\n domain?: string;\n}\n\ninterface FocusEventInit extends UIEventInit {\n relatedTarget?: EventTarget;\n}\n\ninterface FocusNavigationEventInit extends EventInit {\n navigationReason?: string;\n originLeft?: number;\n originTop?: number;\n originWidth?: number;\n originHeight?: number;\n}\n\ninterface FocusNavigationOrigin {\n originLeft?: number;\n originTop?: number;\n originWidth?: number;\n originHeight?: 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 IDBIndexParameters {\n multiEntry?: boolean;\n unique?: boolean;\n}\n\ninterface IDBObjectStoreParameters {\n autoIncrement?: boolean;\n keyPath?: IDBKeyPath;\n}\n\ninterface IntersectionObserverEntryInit {\n time?: number;\n rootBounds?: DOMRectInit;\n boundingClientRect?: DOMRectInit;\n intersectionRect?: DOMRectInit;\n target?: Element;\n}\n\ninterface IntersectionObserverInit {\n root?: Element;\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 MSAccountInfo {\n rpDisplayName?: string;\n userDisplayName?: string;\n accountName?: string;\n userId?: string;\n accountImageUri?: string;\n}\n\ninterface MSAudioLocalClientEvent extends MSLocalClientEventBase {\n networkSendQualityEventRatio?: number;\n networkDelayEventRatio?: number;\n cpuInsufficientEventRatio?: number;\n deviceHalfDuplexAECEventRatio?: number;\n deviceRenderNotFunctioningEventRatio?: number;\n deviceCaptureNotFunctioningEventRatio?: number;\n deviceGlitchesEventRatio?: number;\n deviceLowSNREventRatio?: number;\n deviceLowSpeechLevelEventRatio?: number;\n deviceClippingEventRatio?: number;\n deviceEchoEventRatio?: number;\n deviceNearEndToEchoRatioEventRatio?: number;\n deviceRenderZeroVolumeEventRatio?: number;\n deviceRenderMuteEventRatio?: number;\n deviceMultipleEndpointsEventCount?: number;\n deviceHowlingEventCount?: number;\n}\n\ninterface MSAudioRecvPayload extends MSPayloadBase {\n samplingRate?: number;\n signal?: MSAudioRecvSignal;\n packetReorderRatio?: number;\n packetReorderDepthAvg?: number;\n packetReorderDepthMax?: number;\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 ratioConcealedSamplesAvg?: number;\n ratioStretchedSamplesAvg?: number;\n ratioCompressedSamplesAvg?: number;\n}\n\ninterface MSAudioRecvSignal {\n initialSignalLevelRMS?: number;\n recvSignalLevelCh1?: number;\n recvNoiseLevelCh1?: number;\n renderSignalLevel?: number;\n renderNoiseLevel?: number;\n renderLoopbackSignalLevel?: number;\n}\n\ninterface MSAudioSendPayload extends MSPayloadBase {\n samplingRate?: number;\n signal?: MSAudioSendSignal;\n audioFECUsed?: boolean;\n sendMutePercent?: number;\n}\n\ninterface MSAudioSendSignal {\n noiseLevel?: number;\n sendSignalLevelCh1?: number;\n sendNoiseLevelCh1?: 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 type?: MSCredentialType;\n id?: string;\n}\n\ninterface MSDelay {\n roundTrip?: number;\n roundTripMax?: number;\n}\n\ninterface MSDescription extends RTCStats {\n connectivity?: MSConnectivity;\n transport?: RTCIceProtocol;\n networkconnectivity?: MSNetworkConnectivityInfo;\n localAddr?: MSIPAddressInfo;\n remoteAddr?: MSIPAddressInfo;\n deviceDevName?: string;\n reflexiveLocalIPAddr?: MSIPAddressInfo;\n}\n\ninterface MSFIDOCredentialParameters extends MSCredentialParameters {\n algorithm?: string | Algorithm;\n authenticators?: AAGUID[];\n}\n\ninterface MSIPAddressInfo {\n ipAddr?: string;\n port?: number;\n manufacturerMacAddrMask?: string;\n}\n\ninterface MSIceWarningFlags {\n turnTcpTimedOut?: boolean;\n turnUdpAllocateFailed?: boolean;\n turnUdpSendFailed?: boolean;\n turnTcpAllocateFailed?: boolean;\n turnTcpSendFailed?: boolean;\n udpLocalConnectivityFailed?: boolean;\n udpNatConnectivityFailed?: boolean;\n udpRelayConnectivityFailed?: boolean;\n tcpNatConnectivityFailed?: boolean;\n tcpRelayConnectivityFailed?: boolean;\n connCheckMessageIntegrityFailed?: boolean;\n allocationMessageIntegrityFailed?: boolean;\n connCheckOtherError?: boolean;\n turnAuthUnknownUsernameError?: boolean;\n noRelayServersConfigured?: boolean;\n multipleRelayServersAttempted?: boolean;\n portRangeExhausted?: boolean;\n alternateServerReceived?: boolean;\n pseudoTLSFailure?: boolean;\n turnTurnTcpConnectivityFailed?: boolean;\n useCandidateChecksFailed?: boolean;\n fipsAllocationFailure?: boolean;\n}\n\ninterface MSJitter {\n interArrival?: number;\n interArrivalMax?: number;\n interArrivalSD?: number;\n}\n\ninterface MSLocalClientEventBase extends RTCStats {\n networkReceiveQualityEventRatio?: number;\n networkBandwidthLowEventRatio?: number;\n}\n\ninterface MSNetwork extends RTCStats {\n jitter?: MSJitter;\n delay?: MSDelay;\n packetLoss?: MSPacketLoss;\n utilization?: MSUtilization;\n}\n\ninterface MSNetworkConnectivityInfo {\n vpn?: boolean;\n linkspeed?: number;\n networkConnectionDetails?: string;\n}\n\ninterface MSNetworkInterfaceType {\n interfaceTypeEthernet?: boolean;\n interfaceTypeWireless?: boolean;\n interfaceTypePPP?: boolean;\n interfaceTypeTunnel?: 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 min?: number;\n max?: number;\n}\n\ninterface MSRelayAddress {\n relayAddress?: string;\n port?: number;\n}\n\ninterface MSSignatureParameters {\n userPrompt?: string;\n}\n\ninterface MSTransportDiagnosticsStats extends RTCStats {\n baseAddress?: string;\n localAddress?: string;\n localSite?: string;\n networkName?: string;\n remoteAddress?: string;\n remoteSite?: string;\n localMR?: string;\n remoteMR?: string;\n iceWarningFlags?: MSIceWarningFlags;\n portRangeMin?: number;\n portRangeMax?: number;\n localMRTCPPort?: number;\n remoteMRTCPPort?: number;\n stunVer?: number;\n numConsentReqSent?: number;\n numConsentReqReceived?: number;\n numConsentRespSent?: number;\n numConsentRespReceived?: number;\n interfaces?: MSNetworkInterfaceType;\n baseInterface?: MSNetworkInterfaceType;\n protocol?: RTCIceProtocol;\n localInterface?: MSNetworkInterfaceType;\n localAddrType?: MSIceAddrType;\n remoteAddrType?: MSIceAddrType;\n iceRole?: RTCIceRole;\n rtpRtcpMux?: boolean;\n allocationTimeInMs?: number;\n msRtcEngineVersion?: string;\n}\n\ninterface MSUtilization {\n packets?: number;\n bandwidthEstimation?: number;\n bandwidthEstimationMin?: number;\n bandwidthEstimationMax?: number;\n bandwidthEstimationStdDev?: number;\n bandwidthEstimationAvg?: number;\n}\n\ninterface MSVideoPayload extends MSPayloadBase {\n resolution?: string;\n videoBitRateAvg?: number;\n videoBitRateMax?: number;\n videoFrameRateAvg?: number;\n videoPacketLossRate?: number;\n durationSeconds?: number;\n}\n\ninterface MSVideoRecvPayload extends MSVideoPayload {\n videoFrameLossRate?: number;\n recvCodecType?: string;\n recvResolutionWidth?: number;\n recvResolutionHeight?: number;\n videoResolutions?: MSVideoResolutionDistribution;\n recvFrameRateAverage?: number;\n recvBitRateMaximum?: number;\n recvBitRateAverage?: number;\n recvVideoStreamsMax?: number;\n recvVideoStreamsMin?: number;\n recvVideoStreamsMode?: number;\n videoPostFECPLR?: number;\n lowBitRateCallPercent?: number;\n lowFrameRateCallPercent?: number;\n reorderBufferTotalPackets?: number;\n recvReorderBufferReorderedPackets?: number;\n recvReorderBufferPacketsDroppedDueToBufferExhaustion?: number;\n recvReorderBufferMaxSuccessfullyOrderedExtent?: number;\n recvReorderBufferMaxSuccessfullyOrderedLateTime?: number;\n recvReorderBufferPacketsDroppedDueToTimeout?: number;\n recvFpsHarmonicAverage?: number;\n recvNumResSwitches?: number;\n}\n\ninterface MSVideoResolutionDistribution {\n cifQuality?: number;\n vgaQuality?: number;\n h720Quality?: number;\n h1080Quality?: number;\n h1440Quality?: number;\n h2160Quality?: number;\n}\n\ninterface MSVideoSendPayload extends MSVideoPayload {\n sendFrameRateAverage?: number;\n sendBitRateMaximum?: number;\n sendBitRateAverage?: number;\n sendVideoStreamsMax?: number;\n sendResolutionWidth?: number;\n sendResolutionHeight?: number;\n}\n\ninterface MediaEncryptedEventInit extends EventInit {\n initDataType?: string;\n initData?: ArrayBuffer;\n}\n\ninterface MediaKeyMessageEventInit extends EventInit {\n messageType?: MediaKeyMessageType;\n message?: ArrayBuffer;\n}\n\ninterface MediaKeySystemConfiguration {\n initDataTypes?: string[];\n audioCapabilities?: MediaKeySystemMediaCapability[];\n videoCapabilities?: MediaKeySystemMediaCapability[];\n distinctiveIdentifier?: MediaKeysRequirement;\n persistentState?: MediaKeysRequirement;\n}\n\ninterface MediaKeySystemMediaCapability {\n contentType?: string;\n robustness?: string;\n}\n\ninterface MediaStreamConstraints {\n video?: boolean | MediaTrackConstraints;\n audio?: boolean | MediaTrackConstraints;\n}\n\ninterface MediaStreamErrorEventInit extends EventInit {\n error?: MediaStreamError;\n}\n\ninterface MediaStreamEventInit extends EventInit {\n stream?: MediaStream;\n}\n\ninterface MediaStreamTrackEventInit extends EventInit {\n track?: MediaStreamTrack;\n}\n\ninterface MediaTrackCapabilities {\n width?: number | LongRange;\n height?: number | LongRange;\n aspectRatio?: number | DoubleRange;\n frameRate?: number | DoubleRange;\n facingMode?: string;\n volume?: number | DoubleRange;\n sampleRate?: number | LongRange;\n sampleSize?: number | LongRange;\n echoCancellation?: boolean[];\n deviceId?: string;\n groupId?: string;\n}\n\ninterface MediaTrackConstraintSet {\n width?: number | ConstrainLongRange;\n height?: number | ConstrainLongRange;\n aspectRatio?: number | ConstrainDoubleRange;\n frameRate?: number | ConstrainDoubleRange;\n facingMode?: string | string[] | ConstrainDOMStringParameters;\n volume?: number | ConstrainDoubleRange;\n sampleRate?: number | ConstrainLongRange;\n sampleSize?: number | ConstrainLongRange;\n echoCancelation?: boolean | ConstrainBooleanParameters;\n deviceId?: string | string[] | ConstrainDOMStringParameters;\n groupId?: string | string[] | ConstrainDOMStringParameters;\n}\n\ninterface MediaTrackConstraints extends MediaTrackConstraintSet {\n advanced?: MediaTrackConstraintSet[];\n}\n\ninterface MediaTrackSettings {\n width?: number;\n height?: number;\n aspectRatio?: number;\n frameRate?: number;\n facingMode?: string;\n volume?: number;\n sampleRate?: number;\n sampleSize?: number;\n echoCancellation?: boolean;\n deviceId?: string;\n groupId?: string;\n}\n\ninterface MediaTrackSupportedConstraints {\n width?: boolean;\n height?: boolean;\n aspectRatio?: boolean;\n frameRate?: boolean;\n facingMode?: boolean;\n volume?: boolean;\n sampleRate?: boolean;\n sampleSize?: boolean;\n echoCancellation?: boolean;\n deviceId?: boolean;\n groupId?: boolean;\n}\n\ninterface MessageEventInit extends EventInit {\n lastEventId?: string;\n channel?: string;\n data?: any;\n origin?: string;\n source?: Window;\n ports?: MessagePort[];\n}\n\ninterface MouseEventInit extends EventModifierInit {\n screenX?: number;\n screenY?: number;\n clientX?: number;\n clientY?: number;\n button?: number;\n buttons?: number;\n relatedTarget?: EventTarget;\n}\n\ninterface MsZoomToOptions {\n contentX?: number;\n contentY?: number;\n viewportX?: string;\n viewportY?: string;\n scaleFactor?: number;\n animate?: string;\n}\n\ninterface MutationObserverInit {\n childList?: boolean;\n attributes?: boolean;\n characterData?: boolean;\n subtree?: boolean;\n attributeOldValue?: boolean;\n characterDataOldValue?: boolean;\n attributeFilter?: string[];\n}\n\ninterface NotificationOptions {\n dir?: NotificationDirection;\n lang?: string;\n body?: string;\n tag?: string;\n icon?: string;\n}\n\ninterface ObjectURLOptions {\n oneTimeOnly?: boolean;\n}\n\ninterface PaymentCurrencyAmount {\n currency?: string;\n value?: string;\n currencySystem?: string;\n}\n\ninterface PaymentDetails {\n total?: PaymentItem;\n displayItems?: PaymentItem[];\n shippingOptions?: PaymentShippingOption[];\n modifiers?: PaymentDetailsModifier[];\n error?: string;\n}\n\ninterface PaymentDetailsModifier {\n supportedMethods?: string[];\n total?: PaymentItem;\n additionalDisplayItems?: PaymentItem[];\n data?: any;\n}\n\ninterface PaymentItem {\n label?: string;\n amount?: PaymentCurrencyAmount;\n pending?: boolean;\n}\n\ninterface PaymentMethodData {\n supportedMethods?: string[];\n data?: any;\n}\n\ninterface PaymentOptions {\n requestPayerName?: boolean;\n requestPayerEmail?: boolean;\n requestPayerPhone?: boolean;\n requestShipping?: boolean;\n shippingType?: string;\n}\n\ninterface PaymentRequestUpdateEventInit extends EventInit {\n}\n\ninterface PaymentShippingOption {\n id?: string;\n label?: string;\n amount?: PaymentCurrencyAmount;\n selected?: boolean;\n}\n\ninterface PeriodicWaveConstraints {\n disableNormalization?: boolean;\n}\n\ninterface PointerEventInit extends MouseEventInit {\n pointerId?: number;\n width?: number;\n height?: number;\n pressure?: number;\n tiltX?: number;\n tiltY?: number;\n pointerType?: string;\n isPrimary?: boolean;\n}\n\ninterface PopStateEventInit extends EventInit {\n state?: any;\n}\n\ninterface PositionOptions {\n enableHighAccuracy?: boolean;\n timeout?: number;\n maximumAge?: number;\n}\n\ninterface ProgressEventInit extends EventInit {\n lengthComputable?: boolean;\n loaded?: number;\n total?: number;\n}\n\ninterface PushSubscriptionOptionsInit {\n userVisibleOnly?: boolean;\n applicationServerKey?: any;\n}\n\ninterface RTCConfiguration {\n iceServers?: RTCIceServer[];\n iceTransportPolicy?: RTCIceTransportPolicy;\n bundlePolicy?: RTCBundlePolicy;\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 role?: RTCDtlsRole;\n fingerprints?: RTCDtlsFingerprint[];\n}\n\ninterface RTCIceCandidateAttributes extends RTCStats {\n ipAddress?: string;\n portNumber?: number;\n transport?: string;\n candidateType?: RTCStatsIceCandidateType;\n priority?: number;\n addressSourceUrl?: string;\n}\n\ninterface RTCIceCandidateComplete {\n}\n\ninterface RTCIceCandidateDictionary {\n foundation?: string;\n priority?: number;\n ip?: string;\n protocol?: RTCIceProtocol;\n port?: number;\n type?: RTCIceCandidateType;\n tcpType?: RTCIceTcpCandidateType;\n relatedAddress?: string;\n relatedPort?: number;\n msMTurnSessionId?: string;\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 transportId?: string;\n localCandidateId?: string;\n remoteCandidateId?: string;\n state?: RTCStatsIceCandidatePairState;\n priority?: number;\n nominated?: boolean;\n writable?: boolean;\n readable?: boolean;\n bytesSent?: number;\n bytesReceived?: number;\n roundTripTime?: number;\n availableOutgoingBitrate?: number;\n availableIncomingBitrate?: number;\n}\n\ninterface RTCIceGatherOptions {\n gatherPolicy?: RTCIceGatherPolicy;\n iceservers?: RTCIceServer[];\n portRange?: MSPortRange;\n}\n\ninterface RTCIceParameters {\n usernameFragment?: string;\n password?: string;\n iceLite?: boolean;\n}\n\ninterface RTCIceServer {\n urls?: any;\n username?: string;\n credential?: string;\n}\n\ninterface RTCInboundRTPStreamStats extends RTCRTPStreamStats {\n packetsReceived?: number;\n bytesReceived?: number;\n packetsLost?: number;\n jitter?: number;\n fractionLost?: number;\n}\n\ninterface RTCMediaStreamTrackStats extends RTCStats {\n trackIdentifier?: string;\n remoteSource?: boolean;\n ssrcIds?: string[];\n frameWidth?: number;\n frameHeight?: number;\n framesPerSecond?: number;\n framesSent?: number;\n framesReceived?: number;\n framesDecoded?: number;\n framesDropped?: number;\n framesCorrupted?: number;\n audioLevel?: number;\n echoReturnLoss?: number;\n echoReturnLossEnhancement?: number;\n}\n\ninterface RTCOfferOptions {\n offerToReceiveVideo?: number;\n offerToReceiveAudio?: number;\n voiceActivityDetection?: boolean;\n iceRestart?: boolean;\n}\n\ninterface RTCOutboundRTPStreamStats extends RTCRTPStreamStats {\n packetsSent?: number;\n bytesSent?: number;\n targetBitrate?: number;\n roundTripTime?: number;\n}\n\ninterface RTCPeerConnectionIceEventInit extends EventInit {\n candidate?: RTCIceCandidate;\n}\n\ninterface RTCRTPStreamStats extends RTCStats {\n ssrc?: string;\n associateStatsId?: string;\n isRemote?: boolean;\n mediaTrackId?: string;\n transportId?: string;\n codecId?: string;\n firCount?: number;\n pliCount?: number;\n nackCount?: number;\n sliCount?: number;\n}\n\ninterface RTCRtcpFeedback {\n type?: string;\n parameter?: string;\n}\n\ninterface RTCRtcpParameters {\n ssrc?: number;\n cname?: string;\n reducedSize?: boolean;\n mux?: boolean;\n}\n\ninterface RTCRtpCapabilities {\n codecs?: RTCRtpCodecCapability[];\n headerExtensions?: RTCRtpHeaderExtension[];\n fecMechanisms?: string[];\n}\n\ninterface RTCRtpCodecCapability {\n name?: string;\n kind?: string;\n clockRate?: number;\n preferredPayloadType?: number;\n maxptime?: number;\n ptime?: number;\n numChannels?: number;\n rtcpFeedback?: RTCRtcpFeedback[];\n parameters?: any;\n options?: any;\n maxTemporalLayers?: number;\n maxSpatialLayers?: number;\n svcMultiStreamSupport?: boolean;\n}\n\ninterface RTCRtpCodecParameters {\n name?: string;\n payloadType?: any;\n clockRate?: number;\n maxptime?: number;\n ptime?: number;\n numChannels?: number;\n rtcpFeedback?: RTCRtcpFeedback[];\n parameters?: any;\n}\n\ninterface RTCRtpContributingSource {\n timestamp?: number;\n csrc?: number;\n audioLevel?: number;\n}\n\ninterface RTCRtpEncodingParameters {\n ssrc?: number;\n codecPayloadType?: number;\n fec?: RTCRtpFecParameters;\n rtx?: RTCRtpRtxParameters;\n priority?: number;\n maxBitrate?: number;\n minQuality?: number;\n resolutionScale?: number;\n framerateScale?: number;\n maxFramerate?: number;\n active?: boolean;\n encodingId?: string;\n dependencyEncodingIds?: string[];\n ssrcRange?: RTCSsrcRange;\n}\n\ninterface RTCRtpFecParameters {\n ssrc?: number;\n mechanism?: string;\n}\n\ninterface RTCRtpHeaderExtension {\n kind?: string;\n uri?: string;\n preferredId?: number;\n preferredEncrypt?: boolean;\n}\n\ninterface RTCRtpHeaderExtensionParameters {\n uri?: string;\n id?: number;\n encrypt?: boolean;\n}\n\ninterface RTCRtpParameters {\n muxId?: string;\n codecs?: RTCRtpCodecParameters[];\n headerExtensions?: RTCRtpHeaderExtensionParameters[];\n encodings?: RTCRtpEncodingParameters[];\n rtcp?: RTCRtcpParameters;\n degradationPreference?: RTCDegradationPreference;\n}\n\ninterface RTCRtpRtxParameters {\n ssrc?: number;\n}\n\ninterface RTCRtpUnhandled {\n ssrc?: number;\n payloadType?: number;\n muxId?: string;\n}\n\ninterface RTCSessionDescriptionInit {\n type?: RTCSdpType;\n sdp?: string;\n}\n\ninterface RTCSrtpKeyParam {\n keyMethod?: string;\n keySalt?: string;\n lifetime?: string;\n mkiValue?: number;\n mkiLength?: number;\n}\n\ninterface RTCSrtpSdesParameters {\n tag?: number;\n cryptoSuite?: string;\n keyParams?: RTCSrtpKeyParam[];\n sessionParams?: string[];\n}\n\ninterface RTCSsrcRange {\n min?: number;\n max?: number;\n}\n\ninterface RTCStats {\n timestamp?: number;\n type?: RTCStatsType;\n id?: string;\n msType?: MSStatsType;\n}\n\ninterface RTCStatsReport {\n}\n\ninterface RTCTransportStats extends RTCStats {\n bytesSent?: number;\n bytesReceived?: number;\n rtcpTransportStatsId?: string;\n activeConnection?: boolean;\n selectedCandidatePairId?: string;\n localCertificateId?: string;\n remoteCertificateId?: string;\n}\n\ninterface RegistrationOptions {\n scope?: string;\n}\n\ninterface RequestInit {\n method?: string;\n headers?: any;\n body?: any;\n referrer?: string;\n referrerPolicy?: ReferrerPolicy;\n mode?: RequestMode;\n credentials?: RequestCredentials;\n cache?: RequestCache;\n redirect?: RequestRedirect;\n integrity?: string;\n keepalive?: boolean;\n window?: any;\n}\n\ninterface ResponseInit {\n status?: number;\n statusText?: string;\n headers?: any;\n}\n\ninterface ScopedCredentialDescriptor {\n type?: ScopedCredentialType;\n id?: any;\n transports?: Transport[];\n}\n\ninterface ScopedCredentialOptions {\n timeoutSeconds?: number;\n rpId?: USVString;\n excludeList?: ScopedCredentialDescriptor[];\n extensions?: WebAuthnExtensions;\n}\n\ninterface ScopedCredentialParameters {\n type?: ScopedCredentialType;\n algorithm?: string | Algorithm;\n}\n\ninterface ServiceWorkerMessageEventInit extends EventInit {\n data?: any;\n origin?: string;\n lastEventId?: string;\n source?: ServiceWorker | MessagePort;\n ports?: MessagePort[];\n}\n\ninterface SpeechSynthesisEventInit extends EventInit {\n utterance?: SpeechSynthesisUtterance;\n charIndex?: number;\n elapsedTime?: number;\n name?: string;\n}\n\ninterface StoreExceptionsInformation extends ExceptionInformation {\n siteName?: string;\n explanationString?: string;\n detailURI?: string;\n}\n\ninterface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation {\n arrayOfDomainStrings?: string[];\n}\n\ninterface TrackEventInit extends EventInit {\n track?: VideoTrack | AudioTrack | TextTrack;\n}\n\ninterface TransitionEventInit extends EventInit {\n propertyName?: string;\n elapsedTime?: number;\n}\n\ninterface UIEventInit extends EventInit {\n view?: Window;\n detail?: number;\n}\n\ninterface WebAuthnExtensions {\n}\n\ninterface WebGLContextAttributes {\n failIfMajorPerformanceCaveat?: boolean;\n alpha?: boolean;\n depth?: boolean;\n stencil?: boolean;\n antialias?: boolean;\n premultipliedAlpha?: boolean;\n preserveDrawingBuffer?: boolean;\n}\n\ninterface WebGLContextEventInit extends EventInit {\n statusMessage?: string;\n}\n\ninterface WheelEventInit extends MouseEventInit {\n deltaX?: number;\n deltaY?: number;\n deltaZ?: number;\n deltaMode?: 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 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 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 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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 CDATASection extends Text {\n}\n\ndeclare var CDATASection: {\n prototype: CDATASection;\n new(): CDATASection;\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 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;\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 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 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 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 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 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 Cache {\n add(request: RequestInfo): Promise;\n addAll(requests: RequestInfo[]): Promise;\n delete(request: RequestInfo, options?: CacheQueryOptions): Promise;\n keys(request?: RequestInfo, options?: CacheQueryOptions): any;\n match(request: RequestInfo, options?: CacheQueryOptions): Promise;\n matchAll(request?: RequestInfo, options?: CacheQueryOptions): any;\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(): any;\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 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 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 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 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): void;\n groupCollapsed(groupTitle?: string): 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 CustomEvent extends Event {\n readonly detail: any;\n initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: any): 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(): 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 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 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 * 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 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;\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 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;\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 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 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 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): ElementListTagNameMap[K];\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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(): 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_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 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 getAttributeNS(namespaceURI: string, localName: string): string;\n getAttributeNode(name: string): Attr;\n getAttributeNodeNS(namespaceURI: string, localName: string): Attr;\n getBoundingClientRect(): ClientRect;\n getClientRects(): ClientRectList;\n getElementsByTagName(name: K): ElementListTagNameMap[K];\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 removeAttributeNS(namespaceURI: string, localName: string): void;\n removeAttributeNode(oldAttr: Attr): Attr;\n requestFullscreen(): void;\n requestPointerLock(): void;\n setAttribute(name: 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 getElementsByClassName(classNames: string): NodeListOf;\n matches(selector: string): boolean;\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: string, insertedElement: Element): Element | null;\n insertAdjacentHTML(where: string, html: string): void;\n insertAdjacentText(where: string, text: string): void;\n attachShadow(shadowRootInitDict: ShadowRootInit): ShadowRoot;\n addEventListener(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 cancelBubble: boolean;\n readonly cancelable: 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 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: any;\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;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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 Methods: string;\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 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLAnchorElement: {\n prototype: HTMLAnchorElement;\n new(): HTMLAnchorElement;\n}\n\ninterface HTMLAppletElement extends HTMLElement {\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 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 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;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 clear: string;\n addEventListener(type: K, listener: (this: HTMLBRElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 onblur: (this: HTMLBodyElement, ev: FocusEvent) => any;\n onerror: (this: HTMLBodyElement, ev: ErrorEvent) => any;\n onfocus: (this: HTMLBodyElement, ev: FocusEvent) => any;\n onhashchange: (this: HTMLBodyElement, ev: HashChangeEvent) => any;\n onload: (this: HTMLBodyElement, ev: Event) => 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 onscroll: (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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 HTMLDListElement extends HTMLElement {\n compact: boolean;\n addEventListener(type: K, listener: (this: HTMLDListElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 addEventListener(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 * Raised when the object has been completely received from the server.\n */\n onload: (this: HTMLFrameElement, ev: Event) => any;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 /**\n * Fires when the object loses the input focus.\n */\n onblur: (this: HTMLFrameSetElement, ev: FocusEvent) => any;\n onerror: (this: HTMLFrameSetElement, ev: ErrorEvent) => any;\n /**\n * Fires when the object receives focus.\n */\n onfocus: (this: HTMLFrameSetElement, ev: FocusEvent) => any;\n onhashchange: (this: HTMLFrameSetElement, ev: HashChangeEvent) => any;\n onload: (this: HTMLFrameSetElement, ev: Event) => 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 onscroll: (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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLHRElement: {\n prototype: HTMLHRElement;\n new(): HTMLHRElement;\n}\n\ninterface HTMLHeadElement extends HTMLElement {\n profile: string;\n addEventListener(type: K, listener: (this: HTMLHeadElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 version: string;\n addEventListener(type: K, listener: (this: HTMLHtmlElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 /**\n * Raised when the object has been completely received from the server.\n */\n onload: (this: HTMLIFrameElement, ev: Event) => any;\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 addEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\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 */\n setSelectionRange(start?: number, end?: number, direction?: string): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLInputElement: {\n prototype: HTMLInputElement;\n new(): HTMLInputElement;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLLIElement: {\n prototype: HTMLLIElement;\n new(): HTMLLIElement;\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;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\n addEventListener(type: K, listener: (this: HTMLLegendElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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(): void;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLModElement: {\n prototype: HTMLModElement;\n new(): HTMLModElement;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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 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;\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 /**\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLObjectElement: {\n prototype: HTMLObjectElement;\n new(): HTMLObjectElement;\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;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\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 */\n setSelectionRange(start: number, end: number): void;\n addEventListener(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLVideoElement: {\n prototype: HTMLVideoElement;\n new(): HTMLVideoElement;\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?: any): 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 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?: string): IDBTransaction;\n addEventListener(type: \"versionchange\", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void;\n addEventListener(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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?: string): IDBRequest;\n openKeyCursor(range?: IDBKeyRange | IDBValidKey, direction?: string): 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?: string): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: DOMError;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: DOMError;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\n readonly intersectionRatio: number;\n readonly intersectionRect: ClientRect;\n readonly rootBounds: ClientRect;\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 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 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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): 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 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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(): any;\n getSupportedConstraints(): MediaTrackSupportedConstraints;\n getUserMedia(constraints: MediaStreamConstraints): Promise;\n addEventListener(type: K, listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: any): Promise;\n load(sessionId: string): Promise;\n remove(): Promise;\n update(response: any): 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: any): MediaKeyStatus;\n has(keyId: any): 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: any): 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(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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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 hardwareConcurrency: number;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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 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 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 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 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 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 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 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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;\n getClientRects(): ClientRectList;\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 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 clone(): Response;\n}\n\ndeclare var Response: {\n prototype: Response;\n new(body?: any, init?: ResponseInit): Response;\n}\n\ninterface SVGAElement extends SVGGraphicsElement, SVGURIReference {\n readonly target: SVGAnimatedString;\n addEventListener(type: K, listener: (this: SVGAElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var SVGTSpanElement: {\n prototype: SVGTSpanElement;\n new(): SVGTSpanElement;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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(): any;\n register(scriptURL: USVString, options?: RegistrationOptions): Promise;\n addEventListener(type: K, listener: (this: ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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): any;\n showNotification(title: string, options?: NotificationOptions): Promise;\n unregister(): Promise;\n update(): Promise;\n addEventListener(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 SyncManager {\n getTags(): any;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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;\n createObjectURL(object: any, options?: ObjectURLOptions): string;\n revokeObjectURL(url: string): void;\n}\n\ninterface UnviewableContentIdentifiedEvent extends NavigationEventWithReferrer {\n readonly mediaType: string;\n}\n\ndeclare var UnviewableContentIdentifiedEvent: {\n prototype: UnviewableContentIdentifiedEvent;\n new(): UnviewableContentIdentifiedEvent;\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}\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n [index: number]: VideoTrack;\n}\n\ndeclare var VideoTrackList: {\n prototype: VideoTrackList;\n new(): VideoTrackList;\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_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 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: any, options?: AssertionOptions): Promise;\n makeCredential(accountInformation: Account, cryptoParameters: ScopedCredentialParameters[], attestationChallenge: any, 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 | 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(name: 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 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 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: 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 \"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 \"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 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 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 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 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;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var webkitRTCPeerConnection: {\n prototype: webkitRTCPeerConnection;\n new(configuration: RTCConfiguration): webkitRTCPeerConnection;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 DOML2DeprecatedColorProperty {\n color: string;\n}\n\ninterface DOML2DeprecatedSizeProperty {\n size: number;\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 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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): ElementTagNameMap[K] | null;\n querySelector(selectors: string): Element | null;\n querySelectorAll(selectors: K): ElementListTagNameMap[K];\n querySelectorAll(selectors: string): NodeListOf;\n}\n\ninterface RandomSource {\n getRandomValues(array: ArrayBufferView): ArrayBufferView;\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: XMLHttpRequestEventTarget, ev: Event) => any;\n onerror: (this: XMLHttpRequestEventTarget, ev: ErrorEvent) => any;\n onload: (this: XMLHttpRequestEventTarget, ev: Event) => any;\n onloadend: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any;\n onloadstart: (this: XMLHttpRequestEventTarget, ev: Event) => any;\n onprogress: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any;\n ontimeout: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any;\n addEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\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 {\n type?: string;\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 {\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\ndeclare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;\n\ninterface ErrorEventHandler {\n (message: string, filename?: string, lineno?: number, colno?: number, error?:Error): void;\n}\ninterface PositionCallback {\n (position: Position): void;\n}\ninterface PositionErrorCallback {\n (error: PositionError): void;\n}\ninterface MediaQueryListListener {\n (mql: MediaQueryList): void;\n}\ninterface MSLaunchUriCallback {\n (): void;\n}\ninterface FrameRequestCallback {\n (time: number): void;\n}\ninterface MSUnsafeFunctionCallback {\n (): any;\n}\ninterface MSExecAtPriorityFunctionCallback {\n (...args: any[]): any;\n}\ninterface MutationCallback {\n (mutations: MutationRecord[], observer: MutationObserver): void;\n}\ninterface DecodeSuccessCallback {\n (decodedData: AudioBuffer): void;\n}\ninterface DecodeErrorCallback {\n (error: DOMException): void;\n}\ninterface VoidFunction {\n (): void;\n}\ninterface RTCSessionDescriptionCallback {\n (sdp: RTCSessionDescription): void;\n}\ninterface RTCPeerConnectionErrorCallback {\n (error: DOMError): void;\n}\ninterface RTCStatsCallback {\n (report: RTCStatsReport): void;\n}\ninterface FunctionStringCallback {\n (data: string): void;\n}\ninterface NavigatorUserMediaSuccessCallback {\n (stream: MediaStream): void;\n}\ninterface NavigatorUserMediaErrorCallback {\n (error: MediaStreamError): void;\n}\ninterface ForEachCallback {\n (keyId: any, status: MediaKeyStatus): void;\n}\ninterface NotificationPermissionCallback {\n (permission: NotificationPermission): void;\n}\ninterface IntersectionObserverCallback {\n (entries: IntersectionObserverEntry[], observer: IntersectionObserver): void;\n}\ninterface HTMLElementTagNameMap {\n \"a\": HTMLAnchorElement;\n \"applet\": HTMLAppletElement;\n \"area\": HTMLAreaElement;\n \"audio\": HTMLAudioElement;\n \"base\": HTMLBaseElement;\n \"basefont\": HTMLBaseFontElement;\n \"blockquote\": HTMLQuoteElement;\n \"body\": HTMLBodyElement;\n \"br\": HTMLBRElement;\n \"button\": HTMLButtonElement;\n \"canvas\": HTMLCanvasElement;\n \"caption\": HTMLTableCaptionElement;\n \"col\": HTMLTableColElement;\n \"colgroup\": HTMLTableColElement;\n \"data\": HTMLDataElement;\n \"datalist\": HTMLDataListElement;\n \"del\": HTMLModElement;\n \"dir\": HTMLDirectoryElement;\n \"div\": HTMLDivElement;\n \"dl\": HTMLDListElement;\n \"embed\": HTMLEmbedElement;\n \"fieldset\": HTMLFieldSetElement;\n \"font\": HTMLFontElement;\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 \"hr\": HTMLHRElement;\n \"html\": HTMLHtmlElement;\n \"iframe\": HTMLIFrameElement;\n \"img\": HTMLImageElement;\n \"input\": HTMLInputElement;\n \"ins\": HTMLModElement;\n \"isindex\": HTMLUnknownElement;\n \"label\": HTMLLabelElement;\n \"legend\": HTMLLegendElement;\n \"li\": HTMLLIElement;\n \"link\": HTMLLinkElement;\n \"listing\": HTMLPreElement;\n \"map\": HTMLMapElement;\n \"marquee\": HTMLMarqueeElement;\n \"menu\": HTMLMenuElement;\n \"meta\": HTMLMetaElement;\n \"meter\": HTMLMeterElement;\n \"nextid\": HTMLUnknownElement;\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 \"pre\": HTMLPreElement;\n \"progress\": HTMLProgressElement;\n \"q\": HTMLQuoteElement;\n \"script\": HTMLScriptElement;\n \"select\": HTMLSelectElement;\n \"source\": HTMLSourceElement;\n \"span\": HTMLSpanElement;\n \"style\": HTMLStyleElement;\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 \"ul\": HTMLUListElement;\n \"video\": HTMLVideoElement;\n \"x-ms-webview\": MSHTMLWebViewElement;\n \"xmp\": HTMLPreElement;\n}\n\ninterface ElementTagNameMap {\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 \"circle\": SVGCircleElement;\n \"cite\": HTMLElement;\n \"clippath\": SVGClipPathElement;\n \"code\": HTMLElement;\n \"col\": HTMLTableColElement;\n \"colgroup\": HTMLTableColElement;\n \"data\": HTMLDataElement;\n \"datalist\": HTMLDataListElement;\n \"dd\": HTMLElement;\n \"defs\": SVGDefsElement;\n \"del\": HTMLModElement;\n \"desc\": SVGDescElement;\n \"dfn\": HTMLElement;\n \"dir\": HTMLDirectoryElement;\n \"div\": HTMLDivElement;\n \"dl\": HTMLDListElement;\n \"dt\": HTMLElement;\n \"ellipse\": SVGEllipseElement;\n \"em\": HTMLElement;\n \"embed\": HTMLEmbedElement;\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 \"fieldset\": HTMLFieldSetElement;\n \"figcaption\": HTMLElement;\n \"figure\": HTMLElement;\n \"filter\": SVGFilterElement;\n \"font\": HTMLFontElement;\n \"footer\": HTMLElement;\n \"foreignobject\": SVGForeignObjectElement;\n \"form\": HTMLFormElement;\n \"frame\": HTMLFrameElement;\n \"frameset\": HTMLFrameSetElement;\n \"g\": SVGGElement;\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 \"image\": SVGImageElement;\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 \"line\": SVGLineElement;\n \"lineargradient\": SVGLinearGradientElement;\n \"link\": HTMLLinkElement;\n \"listing\": HTMLPreElement;\n \"map\": HTMLMapElement;\n \"mark\": HTMLElement;\n \"marker\": SVGMarkerElement;\n \"marquee\": HTMLMarqueeElement;\n \"mask\": SVGMaskElement;\n \"menu\": HTMLMenuElement;\n \"meta\": HTMLMetaElement;\n \"metadata\": SVGMetadataElement;\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 \"path\": SVGPathElement;\n \"pattern\": SVGPatternElement;\n \"picture\": HTMLPictureElement;\n \"plaintext\": HTMLElement;\n \"polygon\": SVGPolygonElement;\n \"polyline\": SVGPolylineElement;\n \"pre\": HTMLPreElement;\n \"progress\": HTMLProgressElement;\n \"q\": HTMLQuoteElement;\n \"radialgradient\": SVGRadialGradientElement;\n \"rect\": SVGRectElement;\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 \"stop\": SVGStopElement;\n \"strike\": HTMLElement;\n \"strong\": HTMLElement;\n \"style\": HTMLStyleElement;\n \"sub\": HTMLElement;\n \"sup\": HTMLElement;\n \"svg\": SVGSVGElement;\n \"switch\": SVGSwitchElement;\n \"symbol\": SVGSymbolElement;\n \"table\": HTMLTableElement;\n \"tbody\": HTMLTableSectionElement;\n \"td\": HTMLTableDataCellElement;\n \"template\": HTMLTemplateElement;\n \"text\": SVGTextElement;\n \"textpath\": SVGTextPathElement;\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 \"tspan\": SVGTSpanElement;\n \"tt\": HTMLElement;\n \"u\": HTMLElement;\n \"ul\": HTMLUListElement;\n \"use\": SVGUseElement;\n \"var\": HTMLElement;\n \"video\": HTMLVideoElement;\n \"view\": SVGViewElement;\n \"wbr\": HTMLElement;\n \"x-ms-webview\": MSHTMLWebViewElement;\n \"xmp\": HTMLPreElement;\n}\n\ninterface ElementListTagNameMap {\n \"a\": NodeListOf;\n \"abbr\": NodeListOf;\n \"acronym\": NodeListOf;\n \"address\": NodeListOf;\n \"applet\": NodeListOf;\n \"area\": NodeListOf;\n \"article\": NodeListOf;\n \"aside\": NodeListOf;\n \"audio\": NodeListOf;\n \"b\": NodeListOf;\n \"base\": NodeListOf;\n \"basefont\": NodeListOf;\n \"bdo\": NodeListOf;\n \"big\": NodeListOf;\n \"blockquote\": NodeListOf;\n \"body\": NodeListOf;\n \"br\": NodeListOf;\n \"button\": NodeListOf;\n \"canvas\": NodeListOf;\n \"caption\": NodeListOf;\n \"center\": NodeListOf;\n \"circle\": NodeListOf;\n \"cite\": NodeListOf;\n \"clippath\": NodeListOf;\n \"code\": NodeListOf;\n \"col\": NodeListOf;\n \"colgroup\": NodeListOf;\n \"data\": NodeListOf;\n \"datalist\": NodeListOf;\n \"dd\": NodeListOf;\n \"defs\": NodeListOf;\n \"del\": NodeListOf;\n \"desc\": NodeListOf;\n \"dfn\": NodeListOf;\n \"dir\": NodeListOf;\n \"div\": NodeListOf;\n \"dl\": NodeListOf;\n \"dt\": NodeListOf;\n \"ellipse\": NodeListOf;\n \"em\": NodeListOf;\n \"embed\": NodeListOf;\n \"feblend\": NodeListOf;\n \"fecolormatrix\": NodeListOf;\n \"fecomponenttransfer\": NodeListOf;\n \"fecomposite\": NodeListOf;\n \"feconvolvematrix\": NodeListOf;\n \"fediffuselighting\": NodeListOf;\n \"fedisplacementmap\": NodeListOf;\n \"fedistantlight\": NodeListOf;\n \"feflood\": NodeListOf;\n \"fefunca\": NodeListOf;\n \"fefuncb\": NodeListOf;\n \"fefuncg\": NodeListOf;\n \"fefuncr\": NodeListOf;\n \"fegaussianblur\": NodeListOf;\n \"feimage\": NodeListOf;\n \"femerge\": NodeListOf;\n \"femergenode\": NodeListOf;\n \"femorphology\": NodeListOf;\n \"feoffset\": NodeListOf;\n \"fepointlight\": NodeListOf;\n \"fespecularlighting\": NodeListOf;\n \"fespotlight\": NodeListOf;\n \"fetile\": NodeListOf;\n \"feturbulence\": NodeListOf;\n \"fieldset\": NodeListOf;\n \"figcaption\": NodeListOf;\n \"figure\": NodeListOf;\n \"filter\": NodeListOf;\n \"font\": NodeListOf;\n \"footer\": NodeListOf;\n \"foreignobject\": NodeListOf;\n \"form\": NodeListOf;\n \"frame\": NodeListOf;\n \"frameset\": NodeListOf;\n \"g\": NodeListOf;\n \"h1\": NodeListOf;\n \"h2\": NodeListOf;\n \"h3\": NodeListOf;\n \"h4\": NodeListOf;\n \"h5\": NodeListOf;\n \"h6\": NodeListOf;\n \"head\": NodeListOf;\n \"header\": NodeListOf;\n \"hgroup\": NodeListOf;\n \"hr\": NodeListOf;\n \"html\": NodeListOf;\n \"i\": NodeListOf;\n \"iframe\": NodeListOf;\n \"image\": NodeListOf;\n \"img\": NodeListOf;\n \"input\": NodeListOf;\n \"ins\": NodeListOf;\n \"isindex\": NodeListOf;\n \"kbd\": NodeListOf;\n \"keygen\": NodeListOf;\n \"label\": NodeListOf;\n \"legend\": NodeListOf;\n \"li\": NodeListOf;\n \"line\": NodeListOf;\n \"lineargradient\": NodeListOf;\n \"link\": NodeListOf;\n \"listing\": NodeListOf;\n \"map\": NodeListOf;\n \"mark\": NodeListOf;\n \"marker\": NodeListOf;\n \"marquee\": NodeListOf;\n \"mask\": NodeListOf;\n \"menu\": NodeListOf;\n \"meta\": NodeListOf;\n \"metadata\": NodeListOf;\n \"meter\": NodeListOf;\n \"nav\": NodeListOf;\n \"nextid\": NodeListOf;\n \"nobr\": NodeListOf;\n \"noframes\": NodeListOf;\n \"noscript\": NodeListOf;\n \"object\": NodeListOf;\n \"ol\": NodeListOf;\n \"optgroup\": NodeListOf;\n \"option\": NodeListOf;\n \"output\": NodeListOf;\n \"p\": NodeListOf;\n \"param\": NodeListOf;\n \"path\": NodeListOf;\n \"pattern\": NodeListOf;\n \"picture\": NodeListOf;\n \"plaintext\": NodeListOf;\n \"polygon\": NodeListOf;\n \"polyline\": NodeListOf;\n \"pre\": NodeListOf;\n \"progress\": NodeListOf;\n \"q\": NodeListOf;\n \"radialgradient\": NodeListOf;\n \"rect\": NodeListOf;\n \"rt\": NodeListOf;\n \"ruby\": NodeListOf;\n \"s\": NodeListOf;\n \"samp\": NodeListOf;\n \"script\": NodeListOf;\n \"section\": NodeListOf;\n \"select\": NodeListOf;\n \"small\": NodeListOf;\n \"source\": NodeListOf;\n \"span\": NodeListOf;\n \"stop\": NodeListOf;\n \"strike\": NodeListOf;\n \"strong\": NodeListOf;\n \"style\": NodeListOf;\n \"sub\": NodeListOf;\n \"sup\": NodeListOf;\n \"svg\": NodeListOf;\n \"switch\": NodeListOf;\n \"symbol\": NodeListOf;\n \"table\": NodeListOf;\n \"tbody\": NodeListOf;\n \"td\": NodeListOf;\n \"template\": NodeListOf;\n \"text\": NodeListOf;\n \"textpath\": NodeListOf;\n \"textarea\": NodeListOf;\n \"tfoot\": NodeListOf;\n \"th\": NodeListOf;\n \"thead\": NodeListOf;\n \"time\": NodeListOf;\n \"title\": NodeListOf;\n \"tr\": NodeListOf;\n \"track\": NodeListOf;\n \"tspan\": NodeListOf;\n \"tt\": NodeListOf;\n \"u\": NodeListOf;\n \"ul\": NodeListOf;\n \"use\": NodeListOf;\n \"var\": NodeListOf;\n \"video\": NodeListOf;\n \"view\": NodeListOf;\n \"wbr\": NodeListOf;\n \"x-ms-webview\": NodeListOf;\n \"xmp\": NodeListOf;\n}\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 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;\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 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 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;\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 removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\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, useCapture?: boolean): void;\ndeclare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\ntype AAGUID = string;\ntype AlgorithmIdentifier = string | Algorithm;\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 HeadersInit = any;\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 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 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\";\ntype PaymentComplete = \"success\" | \"fail\" | \"\";\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 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 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 * 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 (collection: any): 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: any): VBArray;\n new (safeArray: any): VBArray;\n}\n\ndeclare var VBArray: VBArrayConstructor;\n\n/**\n * Automation date (VT_DATE)\n */\ninterface VarDate { }\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 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 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 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/lib/lib-ts.js b/lib/lib-ts.js index 86841cea..96b25caf 100644 --- a/lib/lib-ts.js +++ b/lib/lib-ts.js @@ -5,5 +5,5 @@ // This is a generated file from lib.d.ts -define([], function() { return { 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\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;\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 null prototype.\n * @param o Object to use as a prototype. May be null\n */\n create(o: 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 */\n create(o: T): T;\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: any, properties: PropertyDescriptorMap): 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): 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): 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: any): 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): RegExpMatchArray | null;\n\n /**\n * Matches a string with a regular expression, and returns an array containing the results of that search.\n * @param regexp A regular expression object that contains the regular expression pattern and applicable flags.\n */\n match(regexp: RegExp): RegExpMatchArray | null;\n\n /**\n * Replaces text in a string, using a regular expression or search string.\n * @param searchValue A string that represents the regular expression.\n * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.\n */\n replace(searchValue: string, replaceValue: string): string;\n\n /**\n * Replaces text in a string, using a regular expression or search string.\n * @param searchValue A string that represents the regular expression.\n * @param replacer A function that returns the replacement text.\n */\n replace(searchValue: string, replacer: (substring: string, ...args: any[]) => string): string;\n\n /**\n * Replaces text in a string, using a regular expression or search string.\n * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags.\n * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.\n */\n replace(searchValue: RegExp, replaceValue: string): string;\n\n /**\n * Replaces text in a string, using a regular expression or search string.\n * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags\n * @param replacer A function that returns the replacement text.\n */\n replace(searchValue: 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): number;\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: 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, limit?: number): string[];\n\n /**\n * Split a string into substrings using the specified separator and return them as an array.\n * @param separator A Regular Express 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: 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 number 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 number 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): RegExp;\n new (pattern: string, flags?: string): RegExp;\n (pattern: RegExp): 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 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: U[]): 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[][]): 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 | T[])[]): 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 /**\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, 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, 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 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 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: T[][]): 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 | T[])[]): 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 */\n splice(start: 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(this: [T, T, T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U, U, U];\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(this: [T, T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U, U];\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(this: [T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U];\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(this: [T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U];\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[]) => 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, 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, 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(\n onfulfilled?: ((value: T) => T | PromiseLike) | undefined | null,\n onrejected?: ((reason: any) => T | PromiseLike) | undefined | null): PromiseLike;\n\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(\n onfulfilled: ((value: T) => T | PromiseLike) | undefined | null,\n onrejected: (reason: any) => TResult | PromiseLike): PromiseLike;\n\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(\n onfulfilled: (value: T) => TResult | PromiseLike,\n onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): PromiseLike;\n\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(\n onfulfilled: (value: T) => TResult1 | PromiseLike,\n onrejected: (reason: any) => TResult2 | PromiseLike): PromiseLike;\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 * 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\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: ArrayBuffer;\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: ArrayBuffer, 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: ArrayBuffer;\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: Array) => 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: Array) => 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, 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, 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 index The index of the location to set.\n * @param value The value to set.\n */\n set(index: number, value: number): void;\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 (array: ArrayLike): Int8Array;\n new (buffer: ArrayBuffer, 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}\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: ArrayBuffer;\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: Array) => 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: Array) => 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, 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, 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 index The index of the location to set.\n * @param value The value to set.\n */\n set(index: number, value: number): void;\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 (array: ArrayLike): Uint8Array;\n new (buffer: ArrayBuffer, 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: ArrayBuffer;\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: Array) => 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: Array) => 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, 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, 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 index The index of the location to set.\n * @param value The value to set.\n */\n set(index: number, value: number): void;\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: Uint8ClampedArray, 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 (array: ArrayLike): Uint8ClampedArray;\n new (buffer: ArrayBuffer, 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: ArrayBuffer;\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: Array) => 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: Array) => 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 /**\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, 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, 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 index The index of the location to set.\n * @param value The value to set.\n */\n set(index: number, value: number): void;\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 (array: ArrayLike): Int16Array;\n new (buffer: ArrayBuffer, 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}\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: ArrayBuffer;\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: Array) => 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: Array) => 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, 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, 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 index The index of the location to set.\n * @param value The value to set.\n */\n set(index: number, value: number): void;\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 (array: ArrayLike): Uint16Array;\n new (buffer: ArrayBuffer, 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}\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: ArrayBuffer;\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: Array) => 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: Array) => 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, 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, 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 index The index of the location to set.\n * @param value The value to set.\n */\n set(index: number, value: number): void;\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 (array: ArrayLike): Int32Array;\n new (buffer: ArrayBuffer, 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}\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: ArrayBuffer;\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: Array) => 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: Array) => 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 /**\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, 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, 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 index The index of the location to set.\n * @param value The value to set.\n */\n set(index: number, value: number): void;\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 (array: ArrayLike): Uint32Array;\n new (buffer: ArrayBuffer, 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}\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: ArrayBuffer;\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: Array) => 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: Array) => 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, 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, 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 index The index of the location to set.\n * @param value The value to set.\n */\n set(index: number, value: number): void;\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 (array: ArrayLike): Float32Array;\n new (buffer: ArrayBuffer, 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}\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: ArrayBuffer;\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: Array) => 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: Array) => 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, 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, 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 index The index of the location to set.\n * @param value The value to set.\n */\n set(index: number, value: number): void;\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 (array: ArrayLike): Float64Array;\n new (buffer: ArrayBuffer, 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}\ndeclare const Float64Array: Float64ArrayConstructor;\n\n/////////////////////////////\n/// ECMAScript Internationalization API\n/////////////////////////////\n\ndeclare module 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/// IE DOM APIs\n/////////////////////////////\n\ninterface Algorithm {\n name: string;\n}\n\ninterface AriaRequestEventInit extends EventInit {\n attributeName?: string;\n attributeValue?: string;\n}\n\ninterface CommandEventInit extends EventInit {\n commandName?: string;\n detail?: string;\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?: string | string[];\n ideal?: string | string[];\n}\n\ninterface CustomEventInit extends EventInit {\n detail?: any;\n}\n\ninterface DeviceAccelerationDict {\n x?: number;\n y?: number;\n z?: number;\n}\n\ninterface DeviceLightEventInit extends EventInit {\n value?: number;\n}\n\ninterface DeviceRotationRateDict {\n alpha?: number;\n beta?: number;\n gamma?: number;\n}\n\ninterface DoubleRange {\n max?: number;\n min?: number;\n}\n\ninterface EventInit {\n scoped?: boolean;\n bubbles?: boolean;\n cancelable?: boolean;\n}\n\ninterface EventModifierInit extends UIEventInit {\n ctrlKey?: boolean;\n shiftKey?: boolean;\n altKey?: 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}\n\ninterface ExceptionInformation {\n domain?: string;\n}\n\ninterface FocusEventInit extends UIEventInit {\n relatedTarget?: EventTarget;\n}\n\ninterface HashChangeEventInit extends EventInit {\n newURL?: string;\n oldURL?: string;\n}\n\ninterface IDBIndexParameters {\n multiEntry?: boolean;\n unique?: boolean;\n}\n\ninterface IDBObjectStoreParameters {\n autoIncrement?: boolean;\n keyPath?: IDBKeyPath;\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 rpDisplayName?: string;\n userDisplayName?: string;\n accountName?: string;\n userId?: string;\n accountImageUri?: string;\n}\n\ninterface MSAudioLocalClientEvent extends MSLocalClientEventBase {\n networkSendQualityEventRatio?: number;\n networkDelayEventRatio?: number;\n cpuInsufficientEventRatio?: number;\n deviceHalfDuplexAECEventRatio?: number;\n deviceRenderNotFunctioningEventRatio?: number;\n deviceCaptureNotFunctioningEventRatio?: number;\n deviceGlitchesEventRatio?: number;\n deviceLowSNREventRatio?: number;\n deviceLowSpeechLevelEventRatio?: number;\n deviceClippingEventRatio?: number;\n deviceEchoEventRatio?: number;\n deviceNearEndToEchoRatioEventRatio?: number;\n deviceRenderZeroVolumeEventRatio?: number;\n deviceRenderMuteEventRatio?: number;\n deviceMultipleEndpointsEventCount?: number;\n deviceHowlingEventCount?: number;\n}\n\ninterface MSAudioRecvPayload extends MSPayloadBase {\n samplingRate?: number;\n signal?: MSAudioRecvSignal;\n packetReorderRatio?: number;\n packetReorderDepthAvg?: number;\n packetReorderDepthMax?: number;\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 ratioConcealedSamplesAvg?: number;\n ratioStretchedSamplesAvg?: number;\n ratioCompressedSamplesAvg?: number;\n}\n\ninterface MSAudioRecvSignal {\n initialSignalLevelRMS?: number;\n recvSignalLevelCh1?: number;\n recvNoiseLevelCh1?: number;\n renderSignalLevel?: number;\n renderNoiseLevel?: number;\n renderLoopbackSignalLevel?: number;\n}\n\ninterface MSAudioSendPayload extends MSPayloadBase {\n samplingRate?: number;\n signal?: MSAudioSendSignal;\n audioFECUsed?: boolean;\n sendMutePercent?: number;\n}\n\ninterface MSAudioSendSignal {\n noiseLevel?: number;\n sendSignalLevelCh1?: number;\n sendNoiseLevelCh1?: number;\n}\n\ninterface MSConnectivity {\n iceType?: string;\n iceWarningFlags?: MSIceWarningFlags;\n relayAddress?: MSRelayAddress;\n}\n\ninterface MSCredentialFilter {\n accept?: MSCredentialSpec[];\n}\n\ninterface MSCredentialParameters {\n type?: string;\n}\n\ninterface MSCredentialSpec {\n type?: string;\n id?: string;\n}\n\ninterface MSDelay {\n roundTrip?: number;\n roundTripMax?: number;\n}\n\ninterface MSDescription extends RTCStats {\n connectivity?: MSConnectivity;\n transport?: string;\n networkconnectivity?: MSNetworkConnectivityInfo;\n localAddr?: MSIPAddressInfo;\n remoteAddr?: MSIPAddressInfo;\n deviceDevName?: string;\n reflexiveLocalIPAddr?: MSIPAddressInfo;\n}\n\ninterface MSFIDOCredentialParameters extends MSCredentialParameters {\n algorithm?: string | Algorithm;\n authenticators?: AAGUID[];\n}\n\ninterface MSIPAddressInfo {\n ipAddr?: string;\n port?: number;\n manufacturerMacAddrMask?: string;\n}\n\ninterface MSIceWarningFlags {\n turnTcpTimedOut?: boolean;\n turnUdpAllocateFailed?: boolean;\n turnUdpSendFailed?: boolean;\n turnTcpAllocateFailed?: boolean;\n turnTcpSendFailed?: boolean;\n udpLocalConnectivityFailed?: boolean;\n udpNatConnectivityFailed?: boolean;\n udpRelayConnectivityFailed?: boolean;\n tcpNatConnectivityFailed?: boolean;\n tcpRelayConnectivityFailed?: boolean;\n connCheckMessageIntegrityFailed?: boolean;\n allocationMessageIntegrityFailed?: boolean;\n connCheckOtherError?: boolean;\n turnAuthUnknownUsernameError?: boolean;\n noRelayServersConfigured?: boolean;\n multipleRelayServersAttempted?: boolean;\n portRangeExhausted?: boolean;\n alternateServerReceived?: boolean;\n pseudoTLSFailure?: boolean;\n turnTurnTcpConnectivityFailed?: boolean;\n useCandidateChecksFailed?: boolean;\n fipsAllocationFailure?: boolean;\n}\n\ninterface MSJitter {\n interArrival?: number;\n interArrivalMax?: number;\n interArrivalSD?: number;\n}\n\ninterface MSLocalClientEventBase extends RTCStats {\n networkReceiveQualityEventRatio?: number;\n networkBandwidthLowEventRatio?: number;\n}\n\ninterface MSNetwork extends RTCStats {\n jitter?: MSJitter;\n delay?: MSDelay;\n packetLoss?: MSPacketLoss;\n utilization?: MSUtilization;\n}\n\ninterface MSNetworkConnectivityInfo {\n vpn?: boolean;\n linkspeed?: number;\n networkConnectionDetails?: string;\n}\n\ninterface MSNetworkInterfaceType {\n interfaceTypeEthernet?: boolean;\n interfaceTypeWireless?: boolean;\n interfaceTypePPP?: boolean;\n interfaceTypeTunnel?: 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 MSRelayAddress {\n relayAddress?: string;\n port?: number;\n}\n\ninterface MSSignatureParameters {\n userPrompt?: string;\n}\n\ninterface MSTransportDiagnosticsStats extends RTCStats {\n baseAddress?: string;\n localAddress?: string;\n localSite?: string;\n networkName?: string;\n remoteAddress?: string;\n remoteSite?: string;\n localMR?: string;\n remoteMR?: string;\n iceWarningFlags?: MSIceWarningFlags;\n portRangeMin?: number;\n portRangeMax?: number;\n localMRTCPPort?: number;\n remoteMRTCPPort?: number;\n stunVer?: number;\n numConsentReqSent?: number;\n numConsentReqReceived?: number;\n numConsentRespSent?: number;\n numConsentRespReceived?: number;\n interfaces?: MSNetworkInterfaceType;\n baseInterface?: MSNetworkInterfaceType;\n protocol?: string;\n localInterface?: MSNetworkInterfaceType;\n localAddrType?: string;\n remoteAddrType?: string;\n iceRole?: string;\n rtpRtcpMux?: boolean;\n allocationTimeInMs?: number;\n msRtcEngineVersion?: string;\n}\n\ninterface MSUtilization {\n packets?: number;\n bandwidthEstimation?: number;\n bandwidthEstimationMin?: number;\n bandwidthEstimationMax?: number;\n bandwidthEstimationStdDev?: number;\n bandwidthEstimationAvg?: number;\n}\n\ninterface MSVideoPayload extends MSPayloadBase {\n resoluton?: string;\n videoBitRateAvg?: number;\n videoBitRateMax?: number;\n videoFrameRateAvg?: number;\n videoPacketLossRate?: number;\n durationSeconds?: number;\n}\n\ninterface MSVideoRecvPayload extends MSVideoPayload {\n videoFrameLossRate?: number;\n recvCodecType?: string;\n recvResolutionWidth?: number;\n recvResolutionHeight?: number;\n videoResolutions?: MSVideoResolutionDistribution;\n recvFrameRateAverage?: number;\n recvBitRateMaximum?: number;\n recvBitRateAverage?: number;\n recvVideoStreamsMax?: number;\n recvVideoStreamsMin?: number;\n recvVideoStreamsMode?: number;\n videoPostFECPLR?: number;\n lowBitRateCallPercent?: number;\n lowFrameRateCallPercent?: number;\n reorderBufferTotalPackets?: number;\n recvReorderBufferReorderedPackets?: number;\n recvReorderBufferPacketsDroppedDueToBufferExhaustion?: number;\n recvReorderBufferMaxSuccessfullyOrderedExtent?: number;\n recvReorderBufferMaxSuccessfullyOrderedLateTime?: number;\n recvReorderBufferPacketsDroppedDueToTimeout?: number;\n recvFpsHarmonicAverage?: number;\n recvNumResSwitches?: number;\n}\n\ninterface MSVideoResolutionDistribution {\n cifQuality?: number;\n vgaQuality?: number;\n h720Quality?: number;\n h1080Quality?: number;\n h1440Quality?: number;\n h2160Quality?: number;\n}\n\ninterface MSVideoSendPayload extends MSVideoPayload {\n sendFrameRateAverage?: number;\n sendBitRateMaximum?: number;\n sendBitRateAverage?: number;\n sendVideoStreamsMax?: number;\n sendResolutionWidth?: number;\n sendResolutionHeight?: number;\n}\n\ninterface MediaEncryptedEventInit extends EventInit {\n initDataType?: string;\n initData?: ArrayBuffer;\n}\n\ninterface MediaKeyMessageEventInit extends EventInit {\n messageType?: string;\n message?: ArrayBuffer;\n}\n\ninterface MediaKeySystemConfiguration {\n initDataTypes?: string[];\n audioCapabilities?: MediaKeySystemMediaCapability[];\n videoCapabilities?: MediaKeySystemMediaCapability[];\n distinctiveIdentifier?: string;\n persistentState?: string;\n}\n\ninterface MediaKeySystemMediaCapability {\n contentType?: string;\n robustness?: string;\n}\n\ninterface MediaStreamConstraints {\n video?: boolean | MediaTrackConstraints;\n audio?: boolean | MediaTrackConstraints;\n}\n\ninterface MediaStreamErrorEventInit extends EventInit {\n error?: MediaStreamError;\n}\n\ninterface MediaStreamTrackEventInit extends EventInit {\n track?: MediaStreamTrack;\n}\n\ninterface MediaTrackCapabilities {\n width?: number | LongRange;\n height?: number | LongRange;\n aspectRatio?: number | DoubleRange;\n frameRate?: number | DoubleRange;\n facingMode?: string;\n volume?: number | DoubleRange;\n sampleRate?: number | LongRange;\n sampleSize?: number | LongRange;\n echoCancellation?: boolean[];\n deviceId?: string;\n groupId?: string;\n}\n\ninterface MediaTrackConstraintSet {\n width?: number | ConstrainLongRange;\n height?: number | ConstrainLongRange;\n aspectRatio?: number | ConstrainDoubleRange;\n frameRate?: number | ConstrainDoubleRange;\n facingMode?: string | string[] | ConstrainDOMStringParameters;\n volume?: number | ConstrainDoubleRange;\n sampleRate?: number | ConstrainLongRange;\n sampleSize?: number | ConstrainLongRange;\n echoCancelation?: boolean | ConstrainBooleanParameters;\n deviceId?: string | string[] | ConstrainDOMStringParameters;\n groupId?: string | string[] | ConstrainDOMStringParameters;\n}\n\ninterface MediaTrackConstraints extends MediaTrackConstraintSet {\n advanced?: MediaTrackConstraintSet[];\n}\n\ninterface MediaTrackSettings {\n width?: number;\n height?: number;\n aspectRatio?: number;\n frameRate?: number;\n facingMode?: string;\n volume?: number;\n sampleRate?: number;\n sampleSize?: number;\n echoCancellation?: boolean;\n deviceId?: string;\n groupId?: string;\n}\n\ninterface MediaTrackSupportedConstraints {\n width?: boolean;\n height?: boolean;\n aspectRatio?: boolean;\n frameRate?: boolean;\n facingMode?: boolean;\n volume?: boolean;\n sampleRate?: boolean;\n sampleSize?: boolean;\n echoCancellation?: boolean;\n deviceId?: boolean;\n groupId?: boolean;\n}\n\ninterface MouseEventInit extends EventModifierInit {\n screenX?: number;\n screenY?: number;\n clientX?: number;\n clientY?: number;\n button?: number;\n buttons?: number;\n relatedTarget?: EventTarget;\n}\n\ninterface MsZoomToOptions {\n contentX?: number;\n contentY?: number;\n viewportX?: string;\n viewportY?: string;\n scaleFactor?: number;\n animate?: string;\n}\n\ninterface MutationObserverInit {\n childList?: boolean;\n attributes?: boolean;\n characterData?: boolean;\n subtree?: boolean;\n attributeOldValue?: boolean;\n characterDataOldValue?: boolean;\n attributeFilter?: string[];\n}\n\ninterface ObjectURLOptions {\n oneTimeOnly?: boolean;\n}\n\ninterface PeriodicWaveConstraints {\n disableNormalization?: boolean;\n}\n\ninterface PointerEventInit extends MouseEventInit {\n pointerId?: number;\n width?: number;\n height?: number;\n pressure?: number;\n tiltX?: number;\n tiltY?: number;\n pointerType?: string;\n isPrimary?: boolean;\n}\n\ninterface PositionOptions {\n enableHighAccuracy?: boolean;\n timeout?: number;\n maximumAge?: number;\n}\n\ninterface RTCDTMFToneChangeEventInit extends EventInit {\n tone?: string;\n}\n\ninterface RTCDtlsFingerprint {\n algorithm?: string;\n value?: string;\n}\n\ninterface RTCDtlsParameters {\n role?: string;\n fingerprints?: RTCDtlsFingerprint[];\n}\n\ninterface RTCIceCandidate {\n foundation?: string;\n priority?: number;\n ip?: string;\n protocol?: string;\n port?: number;\n type?: string;\n tcpType?: string;\n relatedAddress?: string;\n relatedPort?: number;\n}\n\ninterface RTCIceCandidateAttributes extends RTCStats {\n ipAddress?: string;\n portNumber?: number;\n transport?: string;\n candidateType?: string;\n priority?: number;\n addressSourceUrl?: string;\n}\n\ninterface RTCIceCandidateComplete {\n}\n\ninterface RTCIceCandidatePair {\n local?: RTCIceCandidate;\n remote?: RTCIceCandidate;\n}\n\ninterface RTCIceCandidatePairStats extends RTCStats {\n transportId?: string;\n localCandidateId?: string;\n remoteCandidateId?: string;\n state?: string;\n priority?: number;\n nominated?: boolean;\n writable?: boolean;\n readable?: boolean;\n bytesSent?: number;\n bytesReceived?: number;\n roundTripTime?: number;\n availableOutgoingBitrate?: number;\n availableIncomingBitrate?: number;\n}\n\ninterface RTCIceGatherOptions {\n gatherPolicy?: string;\n iceservers?: RTCIceServer[];\n}\n\ninterface RTCIceParameters {\n usernameFragment?: string;\n password?: string;\n}\n\ninterface RTCIceServer {\n urls?: any;\n username?: string;\n credential?: string;\n}\n\ninterface RTCInboundRTPStreamStats extends RTCRTPStreamStats {\n packetsReceived?: number;\n bytesReceived?: number;\n packetsLost?: number;\n jitter?: number;\n fractionLost?: number;\n}\n\ninterface RTCMediaStreamTrackStats extends RTCStats {\n trackIdentifier?: string;\n remoteSource?: boolean;\n ssrcIds?: string[];\n frameWidth?: number;\n frameHeight?: number;\n framesPerSecond?: number;\n framesSent?: number;\n framesReceived?: number;\n framesDecoded?: number;\n framesDropped?: number;\n framesCorrupted?: number;\n audioLevel?: number;\n echoReturnLoss?: number;\n echoReturnLossEnhancement?: number;\n}\n\ninterface RTCOutboundRTPStreamStats extends RTCRTPStreamStats {\n packetsSent?: number;\n bytesSent?: number;\n targetBitrate?: number;\n roundTripTime?: number;\n}\n\ninterface RTCRTPStreamStats extends RTCStats {\n ssrc?: string;\n associateStatsId?: string;\n isRemote?: boolean;\n mediaTrackId?: string;\n transportId?: string;\n codecId?: string;\n firCount?: number;\n pliCount?: number;\n nackCount?: number;\n sliCount?: number;\n}\n\ninterface RTCRtcpFeedback {\n type?: string;\n parameter?: string;\n}\n\ninterface RTCRtcpParameters {\n ssrc?: number;\n cname?: string;\n reducedSize?: boolean;\n mux?: boolean;\n}\n\ninterface RTCRtpCapabilities {\n codecs?: RTCRtpCodecCapability[];\n headerExtensions?: RTCRtpHeaderExtension[];\n fecMechanisms?: string[];\n}\n\ninterface RTCRtpCodecCapability {\n name?: string;\n kind?: string;\n clockRate?: number;\n preferredPayloadType?: number;\n maxptime?: number;\n numChannels?: number;\n rtcpFeedback?: RTCRtcpFeedback[];\n parameters?: any;\n options?: any;\n maxTemporalLayers?: number;\n maxSpatialLayers?: number;\n svcMultiStreamSupport?: boolean;\n}\n\ninterface RTCRtpCodecParameters {\n name?: string;\n payloadType?: any;\n clockRate?: number;\n maxptime?: number;\n numChannels?: number;\n rtcpFeedback?: RTCRtcpFeedback[];\n parameters?: any;\n}\n\ninterface RTCRtpContributingSource {\n timestamp?: number;\n csrc?: number;\n audioLevel?: number;\n}\n\ninterface RTCRtpEncodingParameters {\n ssrc?: number;\n codecPayloadType?: number;\n fec?: RTCRtpFecParameters;\n rtx?: RTCRtpRtxParameters;\n priority?: number;\n maxBitrate?: number;\n minQuality?: number;\n framerateBias?: number;\n resolutionScale?: number;\n framerateScale?: number;\n active?: boolean;\n encodingId?: string;\n dependencyEncodingIds?: string[];\n ssrcRange?: RTCSsrcRange;\n}\n\ninterface RTCRtpFecParameters {\n ssrc?: number;\n mechanism?: string;\n}\n\ninterface RTCRtpHeaderExtension {\n kind?: string;\n uri?: string;\n preferredId?: number;\n preferredEncrypt?: boolean;\n}\n\ninterface RTCRtpHeaderExtensionParameters {\n uri?: string;\n id?: number;\n encrypt?: boolean;\n}\n\ninterface RTCRtpParameters {\n muxId?: string;\n codecs?: RTCRtpCodecParameters[];\n headerExtensions?: RTCRtpHeaderExtensionParameters[];\n encodings?: RTCRtpEncodingParameters[];\n rtcp?: RTCRtcpParameters;\n}\n\ninterface RTCRtpRtxParameters {\n ssrc?: number;\n}\n\ninterface RTCRtpUnhandled {\n ssrc?: number;\n payloadType?: number;\n muxId?: string;\n}\n\ninterface RTCSrtpKeyParam {\n keyMethod?: string;\n keySalt?: string;\n lifetime?: string;\n mkiValue?: number;\n mkiLength?: number;\n}\n\ninterface RTCSrtpSdesParameters {\n tag?: number;\n cryptoSuite?: string;\n keyParams?: RTCSrtpKeyParam[];\n sessionParams?: string[];\n}\n\ninterface RTCSsrcRange {\n min?: number;\n max?: number;\n}\n\ninterface RTCStats {\n timestamp?: number;\n type?: string;\n id?: string;\n msType?: string;\n}\n\ninterface RTCStatsReport {\n}\n\ninterface RTCTransportStats extends RTCStats {\n bytesSent?: number;\n bytesReceived?: number;\n rtcpTransportStatsId?: string;\n activeConnection?: boolean;\n selectedCandidatePairId?: string;\n localCertificateId?: string;\n remoteCertificateId?: string;\n}\n\ninterface StoreExceptionsInformation extends ExceptionInformation {\n siteName?: string;\n explanationString?: string;\n detailURI?: string;\n}\n\ninterface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation {\n arrayOfDomainStrings?: string[];\n}\n\ninterface UIEventInit extends EventInit {\n view?: Window;\n detail?: number;\n}\n\ninterface WebGLContextAttributes {\n failIfMajorPerformanceCaveat?: boolean;\n alpha?: boolean;\n depth?: boolean;\n stencil?: boolean;\n antialias?: boolean;\n premultipliedAlpha?: boolean;\n preserveDrawingBuffer?: boolean;\n}\n\ninterface WebGLContextEventInit extends EventInit {\n statusMessage?: string;\n}\n\ninterface WheelEventInit extends MouseEventInit {\n deltaX?: number;\n deltaY?: number;\n deltaZ?: number;\n deltaMode?: number;\n}\n\ninterface EventListener {\n (evt: Event): void;\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 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 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(): AnimationEvent;\n}\n\ninterface ApplicationCacheEventMap {\n \"cached\": Event;\n \"checking\": Event;\n \"downloading\": Event;\n \"error\": ErrorEvent;\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: ErrorEvent) => 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 AriaRequestEvent extends Event {\n readonly attributeName: string;\n attributeValue: string | null;\n}\n\ndeclare var AriaRequestEvent: {\n prototype: AriaRequestEvent;\n new(type: string, eventInitDict?: AriaRequestEventInit): AriaRequestEvent;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var AudioBufferSourceNode: {\n prototype: AudioBufferSourceNode;\n new(): AudioBufferSourceNode;\n}\n\ninterface AudioContext extends EventTarget {\n readonly currentTime: number;\n readonly destination: AudioDestinationNode;\n readonly listener: AudioListener;\n readonly sampleRate: number;\n state: string;\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 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): PromiseLike;\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: string;\n channelInterpretation: string;\n readonly context: AudioContext;\n readonly numberOfInputs: number;\n readonly numberOfOutputs: number;\n connect(destination: AudioNode, output?: number, input?: 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): void;\n exponentialRampToValueAtTime(value: number, endTime: number): void;\n linearRampToValueAtTime(value: number, endTime: number): void;\n setTargetAtTime(target: number, startTime: number, timeConstant: number): void;\n setValueAtTime(value: number, startTime: number): void;\n setValueCurveAtTime(values: Float32Array, startTime: number, duration: number): void;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 Q: AudioParam;\n readonly detune: AudioParam;\n readonly frequency: AudioParam;\n readonly gain: AudioParam;\n type: string;\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 CDATASection extends Text {\n}\n\ndeclare var CDATASection: {\n prototype: CDATASection;\n new(): CDATASection;\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 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;\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 glyphOrientationHorizontal: string | null;\n glyphOrientationVertical: string | null;\n height: string | null;\n imeMode: string | null;\n justifyContent: string | null;\n kerning: string | null;\n left: string | null;\n readonly length: number;\n letterSpacing: string | null;\n lightingColor: 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 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 opacity: string | null;\n order: string | null;\n orphans: string | null;\n outline: string | null;\n outlineColor: 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 rubyAlign: string | null;\n rubyOverhang: string | null;\n rubyPosition: 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 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 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 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 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 href: 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 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 lineCap: string;\n lineDashOffset: number;\n lineJoin: string;\n lineWidth: number;\n miterLimit: number;\n msFillRule: string;\n msImageSmoothingEnabled: 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 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?: string): 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 drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void;\n fill(fillRule?: string): 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?: string): 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(): 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 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(): CloseEvent;\n}\n\ninterface CommandEvent extends Event {\n readonly commandName: string;\n readonly detail: string | null;\n}\n\ndeclare var CommandEvent: {\n prototype: CommandEvent;\n new(type: string, eventInitDict?: CommandEventInit): CommandEvent;\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?: string, ...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): void;\n groupCollapsed(groupTitle?: string): 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 CustomEvent extends Event {\n readonly detail: any;\n initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: any): 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(): 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): Document;\n createDocumentType(qualifiedName: string, publicId: string | null, systemId: string | null): 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;\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 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: TextTrackCue, ev: TextTrackCueEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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}\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}\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: string;\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(type: 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(): 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(): 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\": ProgressEvent;\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 * 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 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;\n /**\n * Gets the default character set from the current regional language settings.\n */\n readonly defaultCharset: string;\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 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;\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: ProgressEvent) => 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 readonly visibilityState: string;\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: Node): Node;\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 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 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): ElementListTagNameMap[K];\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: Node, deep: boolean): Node;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var Document: {\n prototype: Document;\n new(): Document;\n}\n\ninterface DocumentFragment extends Node, NodeSelector, ParentNode {\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 | null;\n readonly systemId: string | null;\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(): DragEvent;\n}\n\ninterface DynamicsCompressorNode extends AudioNode {\n readonly attack: AudioParam;\n readonly knee: AudioParam;\n readonly ratio: AudioParam;\n readonly reduction: AudioParam;\n readonly release: AudioParam;\n readonly threshold: AudioParam;\n}\n\ndeclare var DynamicsCompressorNode: {\n prototype: DynamicsCompressorNode;\n new(): DynamicsCompressorNode;\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 ElementEventMap extends GlobalEventHandlersEventMap {\n \"ariarequest\": AriaRequestEvent;\n \"command\": CommandEvent;\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 msContentZoomFactor: number;\n readonly msRegionOverflow: string;\n onariarequest: (this: Element, ev: AriaRequestEvent) => any;\n oncommand: (this: Element, ev: CommandEvent) => 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 readonly prefix: string | null;\n readonly scrollHeight: number;\n scrollLeft: number;\n scrollTop: number;\n readonly scrollWidth: number;\n readonly tagName: string;\n innerHTML: string;\n readonly assignedSlot: HTMLSlotElement | null;\n slot: string;\n readonly shadowRoot: ShadowRoot | null;\n getAttribute(name: string): string | null;\n getAttributeNS(namespaceURI: string, localName: string): string;\n getAttributeNode(name: string): Attr;\n getAttributeNodeNS(namespaceURI: string, localName: string): Attr;\n getBoundingClientRect(): ClientRect;\n getClientRects(): ClientRectList;\n getElementsByTagName(name: K): ElementListTagNameMap[K];\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(name?: string): void;\n removeAttributeNS(namespaceURI: string, localName: string): void;\n removeAttributeNode(oldAttr: Attr): Attr;\n requestFullscreen(): void;\n requestPointerLock(): void;\n setAttribute(name: 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 getElementsByClassName(classNames: string): NodeListOf;\n matches(selector: string): boolean;\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: string, insertedElement: Element): Element | null;\n insertAdjacentHTML(where: string, html: string): void;\n insertAdjacentText(where: string, text: string): void;\n attachShadow(shadowRootInitDict: ShadowRootInit): ShadowRoot;\n addEventListener(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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(): ErrorEvent;\n}\n\ninterface Event {\n readonly bubbles: boolean;\n cancelBubble: boolean;\n readonly cancelable: 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(type: 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, useCapture?: boolean): void;\n dispatchEvent(evt: Event): boolean;\n removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var EventTarget: {\n prototype: EventTarget;\n new(): EventTarget;\n}\n\ninterface External {\n}\n\ndeclare var External: {\n prototype: External;\n new(): External;\n}\n\ninterface File extends Blob {\n readonly lastModifiedDate: any;\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;\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: MSBaseReader, ev: MSBaseReaderEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 FormData {\n append(name: any, value: any, blobName?: 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(): 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 HTMLAllCollection extends HTMLCollection {\n namedItem(name: string): Element;\n}\n\ndeclare var HTMLAllCollection: {\n prototype: HTMLAllCollection;\n new(): HTMLAllCollection;\n}\n\ninterface HTMLAnchorElement extends HTMLElement {\n Methods: string;\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 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLAnchorElement: {\n prototype: HTMLAnchorElement;\n new(): HTMLAnchorElement;\n}\n\ninterface HTMLAppletElement extends HTMLElement {\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 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 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;\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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLAreaElement: {\n prototype: HTMLAreaElement;\n new(): HTMLAreaElement;\n}\n\ninterface HTMLAreasCollection extends HTMLCollection {\n /**\n * Adds an element to the areas, controlRange, or options collection.\n */\n add(element: HTMLElement, before?: HTMLElement | number): void;\n /**\n * Removes an element from the collection.\n */\n remove(index?: number): void;\n}\n\ndeclare var HTMLAreasCollection: {\n prototype: HTMLAreasCollection;\n new(): HTMLAreasCollection;\n}\n\ninterface HTMLAudioElement extends HTMLMediaElement {\n addEventListener(type: K, listener: (this: HTMLMediaElement, ev: HTMLMediaElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 clear: string;\n addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 \"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 onblur: (this: HTMLBodyElement, ev: FocusEvent) => any;\n onerror: (this: HTMLBodyElement, ev: ErrorEvent) => any;\n onfocus: (this: HTMLBodyElement, ev: FocusEvent) => any;\n onhashchange: (this: HTMLBodyElement, ev: HashChangeEvent) => any;\n onload: (this: HTMLBodyElement, ev: Event) => 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLCanvasElement: {\n prototype: HTMLCanvasElement;\n new(): HTMLCanvasElement;\n}\n\ninterface HTMLCollection {\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 /**\n * Retrieves a select object or an object from an options collection.\n */\n namedItem(name: string): Element;\n [index: number]: Element;\n}\n\ndeclare var HTMLCollection: {\n prototype: HTMLCollection;\n new(): HTMLCollection;\n}\n\ninterface HTMLDListElement extends HTMLElement {\n compact: boolean;\n addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLDListElement: {\n prototype: HTMLDListElement;\n new(): HTMLDListElement;\n}\n\ninterface HTMLDataListElement extends HTMLElement {\n options: HTMLCollectionOf;\n addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLDivElement: {\n prototype: HTMLDivElement;\n new(): HTMLDivElement;\n}\n\ninterface HTMLDocument extends Document {\n addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 innerHTML: string;\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 outerHTML: string;\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 setActive(): void;\n addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLFontElement: {\n prototype: HTMLFontElement;\n new(): HTMLFontElement;\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: HTMLCollection;\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 addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 * Raised when the object has been completely received from the server.\n */\n onload: (this: HTMLFrameElement, ev: Event) => any;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLFrameElement: {\n prototype: HTMLFrameElement;\n new(): HTMLFrameElement;\n}\n\ninterface HTMLFrameSetElementEventMap extends HTMLElementEventMap {\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 \"resize\": 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 /**\n * Fires when the object loses the input focus.\n */\n onblur: (this: HTMLFrameSetElement, ev: FocusEvent) => any;\n onerror: (this: HTMLFrameSetElement, ev: ErrorEvent) => any;\n /**\n * Fires when the object receives focus.\n */\n onfocus: (this: HTMLFrameSetElement, ev: FocusEvent) => any;\n onhashchange: (this: HTMLFrameSetElement, ev: HashChangeEvent) => any;\n onload: (this: HTMLFrameSetElement, ev: Event) => 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 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLHRElement: {\n prototype: HTMLHRElement;\n new(): HTMLHRElement;\n}\n\ninterface HTMLHeadElement extends HTMLElement {\n profile: string;\n addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 version: string;\n addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 /**\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 /**\n * Raised when the object has been completely received from the server.\n */\n onload: (this: HTMLIFrameElement, ev: Event) => any;\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 addEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLImageElement: {\n prototype: HTMLImageElement;\n new(): HTMLImageElement;\n create(): 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;\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 */\n setSelectionRange(start?: number, end?: number, direction?: string): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLInputElement: {\n prototype: HTMLInputElement;\n new(): HTMLInputElement;\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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLLIElement: {\n prototype: HTMLLIElement;\n new(): HTMLLIElement;\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;\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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\n addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\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(): void;\n setMediaKeys(mediaKeys: MediaKeys | null): PromiseLike;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLModElement: {\n prototype: HTMLModElement;\n new(): HTMLModElement;\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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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 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;\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 /**\n * Retrieves the contained object.\n */\n readonly object: any;\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 /**\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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLObjectElement: {\n prototype: HTMLObjectElement;\n new(): HTMLObjectElement;\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;\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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLOptionElement: {\n prototype: HTMLOptionElement;\n new(): HTMLOptionElement;\n create(): 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 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLParamElement: {\n prototype: HTMLParamElement;\n new(): HTMLParamElement;\n}\n\ninterface HTMLPictureElement extends HTMLElement {\n addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 /**\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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLSourceElement: {\n prototype: HTMLSourceElement;\n new(): HTMLSourceElement;\n}\n\ninterface HTMLSpanElement extends HTMLElement {\n addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLTableColElement: {\n prototype: HTMLTableColElement;\n new(): HTMLTableColElement;\n}\n\ninterface HTMLTableDataCellElement extends HTMLTableCellElement {\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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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}\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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\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 */\n setSelectionRange(start: number, end: number): void;\n addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLTextAreaElement: {\n prototype: HTMLTextAreaElement;\n new(): HTMLTextAreaElement;\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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLUListElement: {\n prototype: HTMLUListElement;\n new(): HTMLUListElement;\n}\n\ninterface HTMLUnknownElement extends HTMLElement {\n addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLVideoElement: {\n prototype: HTMLVideoElement;\n new(): HTMLVideoElement;\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(type: string, eventInitDict?: HashChangeEventInit): HashChangeEvent;\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 IDBCursor {\n readonly direction: string;\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\": ErrorEvent;\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: ErrorEvent) => 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?: string): IDBTransaction;\n addEventListener(type: \"versionchange\", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void;\n addEventListener(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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?: string): IDBRequest;\n openKeyCursor(range?: IDBKeyRange | IDBValidKey, direction?: string): 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?: string): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var IDBOpenDBRequest: {\n prototype: IDBOpenDBRequest;\n new(): IDBOpenDBRequest;\n}\n\ninterface IDBRequestEventMap {\n \"error\": ErrorEvent;\n \"success\": Event;\n}\n\ninterface IDBRequest extends EventTarget {\n readonly error: DOMError;\n onerror: (this: IDBRequest, ev: ErrorEvent) => any;\n onsuccess: (this: IDBRequest, ev: Event) => any;\n readonly readyState: string;\n readonly result: any;\n source: IDBObjectStore | IDBIndex | IDBCursor;\n readonly transaction: IDBTransaction;\n addEventListener(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var IDBRequest: {\n prototype: IDBRequest;\n new(): IDBRequest;\n}\n\ninterface IDBTransactionEventMap {\n \"abort\": Event;\n \"complete\": Event;\n \"error\": ErrorEvent;\n}\n\ninterface IDBTransaction extends EventTarget {\n readonly db: IDBDatabase;\n readonly error: DOMError;\n readonly mode: string;\n onabort: (this: IDBTransaction, ev: Event) => any;\n oncomplete: (this: IDBTransaction, ev: Event) => any;\n onerror: (this: IDBTransaction, ev: ErrorEvent) => 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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 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: string;\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 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): PromiseLike;\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\": ErrorEvent;\n}\n\ninterface MSAppAsyncOperation extends EventTarget {\n readonly error: DOMError;\n oncomplete: (this: MSAppAsyncOperation, ev: Event) => any;\n onerror: (this: MSAppAsyncOperation, ev: ErrorEvent) => 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: string;\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): PromiseLike;\n makeCredential(accountInfo: MSAccountInfo, params: MSCredentialParameters[], challenge?: string): PromiseLike;\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: string[];\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 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: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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): 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 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: MSBaseReader, ev: MSBaseReaderEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var MSStreamReader: {\n prototype: MSStreamReader;\n new(): MSStreamReader;\n}\n\ninterface MSWebViewAsyncOperationEventMap {\n \"complete\": Event;\n \"error\": ErrorEvent;\n}\n\ninterface MSWebViewAsyncOperation extends EventTarget {\n readonly error: DOMError;\n oncomplete: (this: MSWebViewAsyncOperation, ev: Event) => any;\n onerror: (this: MSWebViewAsyncOperation, ev: ErrorEvent) => 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 MediaDeviceInfo {\n readonly deviceId: string;\n readonly groupId: string;\n readonly kind: string;\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(): any;\n getSupportedConstraints(): MediaTrackSupportedConstraints;\n getUserMedia(constraints: MediaStreamConstraints): PromiseLike;\n addEventListener(type: K, listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: string;\n}\n\ndeclare var MediaKeyMessageEvent: {\n prototype: MediaKeyMessageEvent;\n new(type: string, eventInitDict?: MediaKeyMessageEventInit): MediaKeyMessageEvent;\n}\n\ninterface MediaKeySession extends EventTarget {\n readonly closed: PromiseLike;\n readonly expiration: number;\n readonly keyStatuses: MediaKeyStatusMap;\n readonly sessionId: string;\n close(): PromiseLike;\n generateRequest(initDataType: string, initData: any): PromiseLike;\n load(sessionId: string): PromiseLike;\n remove(): PromiseLike;\n update(response: any): PromiseLike;\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: any): string;\n has(keyId: any): boolean;\n}\n\ndeclare var MediaKeyStatusMap: {\n prototype: MediaKeyStatusMap;\n new(): MediaKeyStatusMap;\n}\n\ninterface MediaKeySystemAccess {\n readonly keySystem: string;\n createMediaKeys(): PromiseLike;\n getConfiguration(): MediaKeySystemConfiguration;\n}\n\ndeclare var MediaKeySystemAccess: {\n prototype: MediaKeySystemAccess;\n new(): MediaKeySystemAccess;\n}\n\ninterface MediaKeys {\n createSession(sessionType?: string): MediaKeySession;\n setServerCertificate(serverCertificate: any): PromiseLike;\n}\n\ndeclare var MediaKeys: {\n prototype: MediaKeys;\n new(): MediaKeys;\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\": TrackEvent;\n \"inactive\": Event;\n \"removetrack\": TrackEvent;\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: TrackEvent) => any;\n oninactive: (this: MediaStream, ev: Event) => any;\n onremovetrack: (this: MediaStream, ev: TrackEvent) => 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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(type: string, eventInitDict?: MediaStreamErrorEventInit): MediaStreamErrorEvent;\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: string;\n readonly remote: boolean;\n applyConstraints(constraints: MediaTrackConstraints): PromiseLike;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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(type: 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, ports?: any): void;\n start(): void;\n addEventListener(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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, NavigatorUserMedia {\n readonly appCodeName: string;\n readonly cookieEnabled: boolean;\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 webdriver: boolean;\n readonly hardwareConcurrency: number;\n getGamepads(): Gamepad[];\n javaEnabled(): boolean;\n msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void;\n requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: MediaKeySystemConfiguration[]): PromiseLike;\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: Node): Node;\n cloneNode(deep?: boolean): Node;\n compareDocumentPosition(other: Node): number;\n contains(child: Node): boolean;\n hasAttributes(): boolean;\n hasChildNodes(): boolean;\n insertBefore(newChild: Node, refChild: Node | null): Node;\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: Node): Node;\n replaceChild(newChild: Node, oldChild: Node): 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\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 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 OfflineAudioCompletionEvent extends Event {\n readonly renderedBuffer: AudioBuffer;\n}\n\ndeclare var OfflineAudioCompletionEvent: {\n prototype: OfflineAudioCompletionEvent;\n new(): OfflineAudioCompletionEvent;\n}\n\ninterface OfflineAudioContextEventMap {\n \"complete\": Event;\n}\n\ninterface OfflineAudioContext extends AudioContext {\n oncomplete: (this: OfflineAudioContext, ev: Event) => any;\n startRendering(): PromiseLike;\n addEventListener(type: K, listener: (this: OfflineAudioContext, ev: OfflineAudioContextEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: string;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: string;\n maxDistance: number;\n panningModel: string;\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 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 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 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 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: string;\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 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 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 PeriodicWave {\n}\n\ndeclare var PeriodicWave: {\n prototype: PeriodicWave;\n new(): PeriodicWave;\n}\n\ninterface PermissionRequest extends DeferredPermissionRequest {\n readonly state: string;\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(): 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 RTCDTMFToneChangeEvent extends Event {\n readonly tone: string;\n}\n\ndeclare var RTCDTMFToneChangeEvent: {\n prototype: RTCDTMFToneChangeEvent;\n new(type: string, eventInitDict: RTCDTMFToneChangeEventInit): RTCDTMFToneChangeEvent;\n}\n\ninterface RTCDtlsTransportEventMap {\n \"dtlsstatechange\": RTCDtlsTransportStateChangedEvent;\n \"error\": ErrorEvent;\n}\n\ninterface RTCDtlsTransport extends RTCStatsProvider {\n ondtlsstatechange: ((this: RTCDtlsTransport, ev: RTCDtlsTransportStateChangedEvent) => any) | null;\n onerror: ((this: RTCDtlsTransport, ev: ErrorEvent) => any) | null;\n readonly state: string;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var RTCDtlsTransport: {\n prototype: RTCDtlsTransport;\n new(transport: RTCIceTransport): RTCDtlsTransport;\n}\n\ninterface RTCDtlsTransportStateChangedEvent extends Event {\n readonly state: string;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var RTCDtmfSender: {\n prototype: RTCDtmfSender;\n new(sender: RTCRtpSender): RTCDtmfSender;\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\": ErrorEvent;\n \"localcandidate\": RTCIceGathererEvent;\n}\n\ninterface RTCIceGatherer extends RTCStatsProvider {\n readonly component: string;\n onerror: ((this: RTCIceGatherer, ev: ErrorEvent) => any) | null;\n onlocalcandidate: ((this: RTCIceGatherer, ev: RTCIceGathererEvent) => any) | null;\n createAssociatedGatherer(): RTCIceGatherer;\n getLocalCandidates(): RTCIceCandidate[];\n getLocalParameters(): RTCIceParameters;\n addEventListener(type: K, listener: (this: RTCIceGatherer, ev: RTCIceGathererEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var RTCIceGatherer: {\n prototype: RTCIceGatherer;\n new(options: RTCIceGatherOptions): RTCIceGatherer;\n}\n\ninterface RTCIceGathererEvent extends Event {\n readonly candidate: RTCIceCandidate | 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: string;\n readonly iceGatherer: RTCIceGatherer | null;\n oncandidatepairchange: ((this: RTCIceTransport, ev: RTCIceCandidatePairChangedEvent) => any) | null;\n onicestatechange: ((this: RTCIceTransport, ev: RTCIceTransportStateChangedEvent) => any) | null;\n readonly role: string;\n readonly state: string;\n addRemoteCandidate(remoteCandidate: RTCIceCandidate | RTCIceCandidateComplete): void;\n createAssociatedTransport(): RTCIceTransport;\n getNominatedCandidatePair(): RTCIceCandidatePair | null;\n getRemoteCandidates(): RTCIceCandidate[];\n getRemoteParameters(): RTCIceParameters | null;\n setRemoteCandidates(remoteCandidates: RTCIceCandidate[]): void;\n start(gatherer: RTCIceGatherer, remoteParameters: RTCIceParameters, role?: string): void;\n stop(): void;\n addEventListener(type: K, listener: (this: RTCIceTransport, ev: RTCIceTransportEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var RTCIceTransport: {\n prototype: RTCIceTransport;\n new(): RTCIceTransport;\n}\n\ninterface RTCIceTransportStateChangedEvent extends Event {\n readonly state: string;\n}\n\ndeclare var RTCIceTransportStateChangedEvent: {\n prototype: RTCIceTransportStateChangedEvent;\n new(): RTCIceTransportStateChangedEvent;\n}\n\ninterface RTCRtpReceiverEventMap {\n \"error\": ErrorEvent;\n}\n\ninterface RTCRtpReceiver extends RTCStatsProvider {\n onerror: ((this: RTCRtpReceiver, ev: ErrorEvent) => 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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\": ErrorEvent;\n \"ssrcconflict\": RTCSsrcConflictEvent;\n}\n\ninterface RTCRtpSender extends RTCStatsProvider {\n onerror: ((this: RTCRtpSender, ev: ErrorEvent) => 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 RTCSrtpSdesTransportEventMap {\n \"error\": ErrorEvent;\n}\n\ninterface RTCSrtpSdesTransport extends EventTarget {\n onerror: ((this: RTCSrtpSdesTransport, ev: ErrorEvent) => any) | null;\n readonly transport: RTCIceTransport;\n addEventListener(type: K, listener: (this: RTCSrtpSdesTransport, ev: RTCSrtpSdesTransportEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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(): PromiseLike;\n msGetStats(): PromiseLike;\n}\n\ndeclare var RTCStatsProvider: {\n prototype: RTCStatsProvider;\n new(): RTCStatsProvider;\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: string): boolean;\n extractContents(): DocumentFragment;\n getBoundingClientRect(): ClientRect;\n getClientRects(): ClientRectList;\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 SVGAElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference {\n readonly target: SVGAnimatedString;\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired {\n readonly cx: SVGAnimatedLength;\n readonly cy: SVGAnimatedLength;\n readonly r: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var SVGCircleElement: {\n prototype: SVGCircleElement;\n new(): SVGCircleElement;\n}\n\ninterface SVGClipPathElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGUnitTypes {\n readonly clipPathUnits: SVGAnimatedEnumeration;\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired {\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var SVGDefsElement: {\n prototype: SVGDefsElement;\n new(): SVGDefsElement;\n}\n\ninterface SVGDescElement extends SVGElement, SVGStylable, SVGLangSpace {\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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 viewportElement: SVGElement;\n xmlbase: string;\n className: any;\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired {\n readonly cx: SVGAnimatedLength;\n readonly cy: SVGAnimatedLength;\n readonly rx: SVGAnimatedLength;\n readonly ry: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var SVGFEFloodElement: {\n prototype: SVGFEFloodElement;\n new(): SVGFEFloodElement;\n}\n\ninterface SVGFEFuncAElement extends SVGComponentTransferFunctionElement {\n}\n\ndeclare var SVGFEFuncAElement: {\n prototype: SVGFEFuncAElement;\n new(): SVGFEFuncAElement;\n}\n\ninterface SVGFEFuncBElement extends SVGComponentTransferFunctionElement {\n}\n\ndeclare var SVGFEFuncBElement: {\n prototype: SVGFEFuncBElement;\n new(): SVGFEFuncBElement;\n}\n\ninterface SVGFEFuncGElement extends SVGComponentTransferFunctionElement {\n}\n\ndeclare var SVGFEFuncGElement: {\n prototype: SVGFEFuncGElement;\n new(): SVGFEFuncGElement;\n}\n\ninterface SVGFEFuncRElement extends SVGComponentTransferFunctionElement {\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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var SVGFEGaussianBlurElement: {\n prototype: SVGFEGaussianBlurElement;\n new(): SVGFEGaussianBlurElement;\n}\n\ninterface SVGFEImageElement extends SVGElement, SVGFilterPrimitiveStandardAttributes, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired {\n readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio;\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, SVGStylable, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired {\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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var SVGFilterElement: {\n prototype: SVGFilterElement;\n new(): SVGFilterElement;\n}\n\ninterface SVGForeignObjectElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired {\n readonly height: SVGAnimatedLength;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var SVGForeignObjectElement: {\n prototype: SVGForeignObjectElement;\n new(): SVGForeignObjectElement;\n}\n\ninterface SVGGElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired {\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var SVGGElement: {\n prototype: SVGGElement;\n new(): SVGGElement;\n}\n\ninterface SVGGradientElement extends SVGElement, SVGStylable, SVGExternalResourcesRequired, SVGURIReference, SVGUnitTypes {\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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 SVGImageElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired {\n readonly x1: SVGAnimatedLength;\n readonly x2: SVGAnimatedLength;\n readonly y1: SVGAnimatedLength;\n readonly y2: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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}\n\ndeclare var SVGLinearGradientElement: {\n prototype: SVGLinearGradientElement;\n new(): SVGLinearGradientElement;\n}\n\ninterface SVGMarkerElement extends SVGElement, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPathData {\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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox, SVGURIReference, SVGUnitTypes {\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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPoints {\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var SVGPolygonElement: {\n prototype: SVGPolygonElement;\n new(): SVGPolygonElement;\n}\n\ninterface SVGPolylineElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPoints {\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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}\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 SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired {\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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 SVGElement, DocumentEvent, SVGLocatable, SVGTests, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var SVGSVGElement: {\n prototype: SVGSVGElement;\n new(): SVGSVGElement;\n}\n\ninterface SVGScriptElement extends SVGElement, SVGExternalResourcesRequired, SVGURIReference {\n type: string;\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var SVGScriptElement: {\n prototype: SVGScriptElement;\n new(): SVGScriptElement;\n}\n\ninterface SVGStopElement extends SVGElement, SVGStylable {\n readonly offset: SVGAnimatedNumber;\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, SVGLangSpace {\n disabled: boolean;\n media: string;\n title: string;\n type: string;\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var SVGStyleElement: {\n prototype: SVGStyleElement;\n new(): SVGStyleElement;\n}\n\ninterface SVGSwitchElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired {\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var SVGSwitchElement: {\n prototype: SVGSwitchElement;\n new(): SVGSwitchElement;\n}\n\ninterface SVGSymbolElement extends SVGElement, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox {\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var SVGSymbolElement: {\n prototype: SVGSymbolElement;\n new(): SVGSymbolElement;\n}\n\ninterface SVGTSpanElement extends SVGTextPositioningElement {\n}\n\ndeclare var SVGTSpanElement: {\n prototype: SVGTSpanElement;\n new(): SVGTSpanElement;\n}\n\ninterface SVGTextContentElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired {\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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, SVGTransformable {\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}\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}\n\ndeclare var SVGTextPositioningElement: {\n prototype: SVGTextPositioningElement;\n new(): SVGTextPositioningElement;\n}\n\ninterface SVGTitleElement extends SVGElement, SVGStylable, SVGLangSpace {\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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 SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, 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: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var SVGUseElement: {\n prototype: SVGUseElement;\n new(): SVGUseElement;\n}\n\ninterface SVGViewElement extends SVGElement, SVGExternalResourcesRequired, SVGFitToViewBox, SVGZoomAndPan {\n readonly viewTarget: SVGStringList;\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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 toString(): string;\n}\n\ndeclare var Selection: {\n prototype: Selection;\n new(): Selection;\n}\n\ninterface SourceBuffer extends EventTarget {\n appendWindowEnd: number;\n appendWindowStart: number;\n readonly audioTracks: AudioTrackList;\n readonly buffered: TimeRanges;\n mode: string;\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 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 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(): 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\": ErrorEvent;\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: ErrorEvent) => 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 ctrlKey: boolean;\n readonly metaKey: boolean;\n readonly shiftKey: boolean;\n readonly targetTouches: TouchList;\n readonly touches: TouchList;\n}\n\ndeclare var TouchEvent: {\n prototype: TouchEvent;\n new(): 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: any;\n}\n\ndeclare var TrackEvent: {\n prototype: TrackEvent;\n new(): 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(): 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(type: 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 username: string;\n toString(): string;\n}\n\ndeclare var URL: {\n prototype: URL;\n new(url: string, base?: string): URL;\n createObjectURL(object: any, options?: ObjectURLOptions): string;\n revokeObjectURL(url: string): void;\n}\n\ninterface UnviewableContentIdentifiedEvent extends NavigationEventWithReferrer {\n readonly mediaType: string;\n}\n\ndeclare var UnviewableContentIdentifiedEvent: {\n prototype: UnviewableContentIdentifiedEvent;\n new(): UnviewableContentIdentifiedEvent;\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}\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n [index: number]: VideoTrack;\n}\n\ndeclare var VideoTrackList: {\n prototype: VideoTrackList;\n new(): VideoTrackList;\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_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 WaveShaperNode extends AudioNode {\n curve: Float32Array | null;\n oversample: string;\n}\n\ndeclare var WaveShaperNode: {\n prototype: WaveShaperNode;\n new(): WaveShaperNode;\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(type: 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(name: 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): 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): void;\n texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels?: 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): void;\n texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels?: 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 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 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 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\": ErrorEvent;\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: ErrorEvent) => 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 \"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 \"unload\": Event;\n \"volumechange\": Event;\n \"waiting\": Event;\n}\n\ninterface Window extends EventTarget, WindowTimers, WindowSessionStorage, WindowLocalStorage, WindowConsole, GlobalEventHandlers, IDBEnvironment, WindowBase64 {\n readonly applicationCache: ApplicationCache;\n readonly clientInformation: Navigator;\n readonly closed: boolean;\n readonly crypto: Crypto;\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 length: number;\n readonly location: Location;\n readonly locationbar: BarProp;\n readonly menubar: BarProp;\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 scrollX: number;\n readonly scrollY: number;\n readonly scrollbars: BarProp;\n readonly self: Window;\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 Blob: typeof Blob;\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 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;\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 webkitCancelAnimationFrame(handle: number): void;\n webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint;\n webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint;\n webkitRequestAnimationFrame(callback: FrameRequestCallback): number;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, ports?: any): void;\n terminate(): void;\n addEventListener(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: Document, ev: DocumentEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: string;\n readonly responseXML: any;\n readonly status: number;\n readonly statusText: string;\n timeout: number;\n readonly upload: XMLHttpRequestUpload;\n withCredentials: boolean;\n msCaching?: string;\n readonly responseURL: 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 create(): XMLHttpRequest;\n}\n\ninterface XMLHttpRequestUpload extends EventTarget, XMLHttpRequestEventTarget {\n addEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\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 DOML2DeprecatedColorProperty {\n color: string;\n}\n\ninterface DOML2DeprecatedSizeProperty {\n size: number;\n}\n\ninterface DocumentEvent {\n createEvent(eventInterface:\"AnimationEvent\"): AnimationEvent;\n createEvent(eventInterface:\"AriaRequestEvent\"): AriaRequestEvent;\n createEvent(eventInterface:\"AudioProcessingEvent\"): AudioProcessingEvent;\n createEvent(eventInterface:\"BeforeUnloadEvent\"): BeforeUnloadEvent;\n createEvent(eventInterface:\"ClipboardEvent\"): ClipboardEvent;\n createEvent(eventInterface:\"CloseEvent\"): CloseEvent;\n createEvent(eventInterface:\"CommandEvent\"): CommandEvent;\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:\"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:\"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:\"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:\"RTCSsrcConflictEvent\"): RTCSsrcConflictEvent;\n createEvent(eventInterface:\"SVGZoomEvent\"): SVGZoomEvent;\n createEvent(eventInterface:\"SVGZoomEvents\"): SVGZoomEvent;\n createEvent(eventInterface:\"ScriptNotifyEvent\"): ScriptNotifyEvent;\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 ElementTraversal {\n readonly childElementCount: number;\n readonly firstElementChild: Element;\n readonly lastElementChild: Element;\n readonly nextElementSibling: Element;\n readonly previousElementSibling: Element;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 NavigatorContentUtils {\n}\n\ninterface NavigatorGeolocation {\n readonly geolocation: Geolocation;\n}\n\ninterface NavigatorID {\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): ElementTagNameMap[K] | null;\n querySelector(selectors: string): Element | null;\n querySelectorAll(selectors: K): ElementListTagNameMap[K];\n querySelectorAll(selectors: string): NodeListOf;\n}\n\ninterface RandomSource {\n getRandomValues(array: ArrayBufferView): ArrayBufferView;\n}\n\ninterface SVGAnimatedPathData {\n readonly pathSegList: SVGPathSegList;\n}\n\ninterface SVGAnimatedPoints {\n readonly animatedPoints: SVGPointList;\n readonly points: SVGPointList;\n}\n\ninterface SVGExternalResourcesRequired {\n readonly externalResourcesRequired: SVGAnimatedBoolean;\n}\n\ninterface SVGFilterPrimitiveStandardAttributes extends SVGStylable {\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 SVGLangSpace {\n xmllang: string;\n xmlspace: string;\n}\n\ninterface SVGLocatable {\n readonly farthestViewportElement: SVGElement;\n readonly nearestViewportElement: SVGElement;\n getBBox(): SVGRect;\n getCTM(): SVGMatrix;\n getScreenCTM(): SVGMatrix;\n getTransformToElement(element: SVGElement): SVGMatrix;\n}\n\ninterface SVGStylable {\n className: any;\n readonly style: CSSStyleDeclaration;\n}\n\ninterface SVGTests {\n readonly requiredExtensions: SVGStringList;\n readonly requiredFeatures: SVGStringList;\n readonly systemLanguage: SVGStringList;\n hasExtension(extension: string): boolean;\n}\n\ninterface SVGTransformable extends SVGLocatable {\n readonly transform: SVGAnimatedTransformList;\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: XMLHttpRequestEventTarget, ev: Event) => any;\n onerror: (this: XMLHttpRequestEventTarget, ev: ErrorEvent) => any;\n onload: (this: XMLHttpRequestEventTarget, ev: Event) => any;\n onloadend: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any;\n onloadstart: (this: XMLHttpRequestEventTarget, ev: Event) => any;\n onprogress: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any;\n ontimeout: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any;\n addEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\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 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 {\n type?: string;\n lastModified?: number;\n}\n\ninterface EventListenerObject {\n handleEvent(evt: Event): void;\n}\n\ninterface MessageEventInit extends EventInit {\n data?: any;\n origin?: string;\n lastEventId?: string;\n channel?: string;\n source?: any;\n ports?: MessagePort[];\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 {\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;\n readonly lastElementChild: Element;\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\ndeclare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;\n\ninterface ErrorEventHandler {\n (message: string, filename?: string, lineno?: number, colno?: number, error?:Error): void;\n}\ninterface PositionCallback {\n (position: Position): void;\n}\ninterface PositionErrorCallback {\n (error: PositionError): void;\n}\ninterface MediaQueryListListener {\n (mql: MediaQueryList): void;\n}\ninterface MSLaunchUriCallback {\n (): void;\n}\ninterface FrameRequestCallback {\n (time: number): void;\n}\ninterface MSUnsafeFunctionCallback {\n (): any;\n}\ninterface MSExecAtPriorityFunctionCallback {\n (...args: any[]): any;\n}\ninterface MutationCallback {\n (mutations: MutationRecord[], observer: MutationObserver): void;\n}\ninterface DecodeSuccessCallback {\n (decodedData: AudioBuffer): void;\n}\ninterface DecodeErrorCallback {\n (error: DOMException): void;\n}\ninterface FunctionStringCallback {\n (data: string): void;\n}\ninterface NavigatorUserMediaSuccessCallback {\n (stream: MediaStream): void;\n}\ninterface NavigatorUserMediaErrorCallback {\n (error: MediaStreamError): void;\n}\ninterface ForEachCallback {\n (keyId: any, status: string): void;\n}\ninterface HTMLElementTagNameMap {\n \"a\": HTMLAnchorElement;\n \"applet\": HTMLAppletElement;\n \"area\": HTMLAreaElement;\n \"audio\": HTMLAudioElement;\n \"base\": HTMLBaseElement;\n \"basefont\": HTMLBaseFontElement;\n \"blockquote\": HTMLQuoteElement;\n \"body\": HTMLBodyElement;\n \"br\": HTMLBRElement;\n \"button\": HTMLButtonElement;\n \"canvas\": HTMLCanvasElement;\n \"caption\": HTMLTableCaptionElement;\n \"col\": HTMLTableColElement;\n \"colgroup\": HTMLTableColElement;\n \"datalist\": HTMLDataListElement;\n \"del\": HTMLModElement;\n \"dir\": HTMLDirectoryElement;\n \"div\": HTMLDivElement;\n \"dl\": HTMLDListElement;\n \"embed\": HTMLEmbedElement;\n \"fieldset\": HTMLFieldSetElement;\n \"font\": HTMLFontElement;\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 \"hr\": HTMLHRElement;\n \"html\": HTMLHtmlElement;\n \"iframe\": HTMLIFrameElement;\n \"img\": HTMLImageElement;\n \"input\": HTMLInputElement;\n \"ins\": HTMLModElement;\n \"isindex\": HTMLUnknownElement;\n \"label\": HTMLLabelElement;\n \"legend\": HTMLLegendElement;\n \"li\": HTMLLIElement;\n \"link\": HTMLLinkElement;\n \"listing\": HTMLPreElement;\n \"map\": HTMLMapElement;\n \"marquee\": HTMLMarqueeElement;\n \"menu\": HTMLMenuElement;\n \"meta\": HTMLMetaElement;\n \"meter\": HTMLMeterElement;\n \"nextid\": HTMLUnknownElement;\n \"object\": HTMLObjectElement;\n \"ol\": HTMLOListElement;\n \"optgroup\": HTMLOptGroupElement;\n \"option\": HTMLOptionElement;\n \"p\": HTMLParagraphElement;\n \"param\": HTMLParamElement;\n \"picture\": HTMLPictureElement;\n \"pre\": HTMLPreElement;\n \"progress\": HTMLProgressElement;\n \"q\": HTMLQuoteElement;\n \"script\": HTMLScriptElement;\n \"select\": HTMLSelectElement;\n \"source\": HTMLSourceElement;\n \"span\": HTMLSpanElement;\n \"style\": HTMLStyleElement;\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 \"title\": HTMLTitleElement;\n \"tr\": HTMLTableRowElement;\n \"track\": HTMLTrackElement;\n \"ul\": HTMLUListElement;\n \"video\": HTMLVideoElement;\n \"x-ms-webview\": MSHTMLWebViewElement;\n \"xmp\": HTMLPreElement;\n}\n\ninterface ElementTagNameMap {\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 \"circle\": SVGCircleElement;\n \"cite\": HTMLElement;\n \"clippath\": SVGClipPathElement;\n \"code\": HTMLElement;\n \"col\": HTMLTableColElement;\n \"colgroup\": HTMLTableColElement;\n \"datalist\": HTMLDataListElement;\n \"dd\": HTMLElement;\n \"defs\": SVGDefsElement;\n \"del\": HTMLModElement;\n \"desc\": SVGDescElement;\n \"dfn\": HTMLElement;\n \"dir\": HTMLDirectoryElement;\n \"div\": HTMLDivElement;\n \"dl\": HTMLDListElement;\n \"dt\": HTMLElement;\n \"ellipse\": SVGEllipseElement;\n \"em\": HTMLElement;\n \"embed\": HTMLEmbedElement;\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 \"fieldset\": HTMLFieldSetElement;\n \"figcaption\": HTMLElement;\n \"figure\": HTMLElement;\n \"filter\": SVGFilterElement;\n \"font\": HTMLFontElement;\n \"footer\": HTMLElement;\n \"foreignobject\": SVGForeignObjectElement;\n \"form\": HTMLFormElement;\n \"frame\": HTMLFrameElement;\n \"frameset\": HTMLFrameSetElement;\n \"g\": SVGGElement;\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 \"image\": SVGImageElement;\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 \"line\": SVGLineElement;\n \"lineargradient\": SVGLinearGradientElement;\n \"link\": HTMLLinkElement;\n \"listing\": HTMLPreElement;\n \"map\": HTMLMapElement;\n \"mark\": HTMLElement;\n \"marker\": SVGMarkerElement;\n \"marquee\": HTMLMarqueeElement;\n \"mask\": SVGMaskElement;\n \"menu\": HTMLMenuElement;\n \"meta\": HTMLMetaElement;\n \"metadata\": SVGMetadataElement;\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 \"p\": HTMLParagraphElement;\n \"param\": HTMLParamElement;\n \"path\": SVGPathElement;\n \"pattern\": SVGPatternElement;\n \"picture\": HTMLPictureElement;\n \"plaintext\": HTMLElement;\n \"polygon\": SVGPolygonElement;\n \"polyline\": SVGPolylineElement;\n \"pre\": HTMLPreElement;\n \"progress\": HTMLProgressElement;\n \"q\": HTMLQuoteElement;\n \"radialgradient\": SVGRadialGradientElement;\n \"rect\": SVGRectElement;\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 \"stop\": SVGStopElement;\n \"strike\": HTMLElement;\n \"strong\": HTMLElement;\n \"style\": HTMLStyleElement;\n \"sub\": HTMLElement;\n \"sup\": HTMLElement;\n \"svg\": SVGSVGElement;\n \"switch\": SVGSwitchElement;\n \"symbol\": SVGSymbolElement;\n \"table\": HTMLTableElement;\n \"tbody\": HTMLTableSectionElement;\n \"td\": HTMLTableDataCellElement;\n \"template\": HTMLTemplateElement;\n \"text\": SVGTextElement;\n \"textpath\": SVGTextPathElement;\n \"textarea\": HTMLTextAreaElement;\n \"tfoot\": HTMLTableSectionElement;\n \"th\": HTMLTableHeaderCellElement;\n \"thead\": HTMLTableSectionElement;\n \"title\": HTMLTitleElement;\n \"tr\": HTMLTableRowElement;\n \"track\": HTMLTrackElement;\n \"tspan\": SVGTSpanElement;\n \"tt\": HTMLElement;\n \"u\": HTMLElement;\n \"ul\": HTMLUListElement;\n \"use\": SVGUseElement;\n \"var\": HTMLElement;\n \"video\": HTMLVideoElement;\n \"view\": SVGViewElement;\n \"wbr\": HTMLElement;\n \"x-ms-webview\": MSHTMLWebViewElement;\n \"xmp\": HTMLPreElement;\n}\n\ninterface ElementListTagNameMap {\n \"a\": NodeListOf;\n \"abbr\": NodeListOf;\n \"acronym\": NodeListOf;\n \"address\": NodeListOf;\n \"applet\": NodeListOf;\n \"area\": NodeListOf;\n \"article\": NodeListOf;\n \"aside\": NodeListOf;\n \"audio\": NodeListOf;\n \"b\": NodeListOf;\n \"base\": NodeListOf;\n \"basefont\": NodeListOf;\n \"bdo\": NodeListOf;\n \"big\": NodeListOf;\n \"blockquote\": NodeListOf;\n \"body\": NodeListOf;\n \"br\": NodeListOf;\n \"button\": NodeListOf;\n \"canvas\": NodeListOf;\n \"caption\": NodeListOf;\n \"center\": NodeListOf;\n \"circle\": NodeListOf;\n \"cite\": NodeListOf;\n \"clippath\": NodeListOf;\n \"code\": NodeListOf;\n \"col\": NodeListOf;\n \"colgroup\": NodeListOf;\n \"datalist\": NodeListOf;\n \"dd\": NodeListOf;\n \"defs\": NodeListOf;\n \"del\": NodeListOf;\n \"desc\": NodeListOf;\n \"dfn\": NodeListOf;\n \"dir\": NodeListOf;\n \"div\": NodeListOf;\n \"dl\": NodeListOf;\n \"dt\": NodeListOf;\n \"ellipse\": NodeListOf;\n \"em\": NodeListOf;\n \"embed\": NodeListOf;\n \"feblend\": NodeListOf;\n \"fecolormatrix\": NodeListOf;\n \"fecomponenttransfer\": NodeListOf;\n \"fecomposite\": NodeListOf;\n \"feconvolvematrix\": NodeListOf;\n \"fediffuselighting\": NodeListOf;\n \"fedisplacementmap\": NodeListOf;\n \"fedistantlight\": NodeListOf;\n \"feflood\": NodeListOf;\n \"fefunca\": NodeListOf;\n \"fefuncb\": NodeListOf;\n \"fefuncg\": NodeListOf;\n \"fefuncr\": NodeListOf;\n \"fegaussianblur\": NodeListOf;\n \"feimage\": NodeListOf;\n \"femerge\": NodeListOf;\n \"femergenode\": NodeListOf;\n \"femorphology\": NodeListOf;\n \"feoffset\": NodeListOf;\n \"fepointlight\": NodeListOf;\n \"fespecularlighting\": NodeListOf;\n \"fespotlight\": NodeListOf;\n \"fetile\": NodeListOf;\n \"feturbulence\": NodeListOf;\n \"fieldset\": NodeListOf;\n \"figcaption\": NodeListOf;\n \"figure\": NodeListOf;\n \"filter\": NodeListOf;\n \"font\": NodeListOf;\n \"footer\": NodeListOf;\n \"foreignobject\": NodeListOf;\n \"form\": NodeListOf;\n \"frame\": NodeListOf;\n \"frameset\": NodeListOf;\n \"g\": NodeListOf;\n \"h1\": NodeListOf;\n \"h2\": NodeListOf;\n \"h3\": NodeListOf;\n \"h4\": NodeListOf;\n \"h5\": NodeListOf;\n \"h6\": NodeListOf;\n \"head\": NodeListOf;\n \"header\": NodeListOf;\n \"hgroup\": NodeListOf;\n \"hr\": NodeListOf;\n \"html\": NodeListOf;\n \"i\": NodeListOf;\n \"iframe\": NodeListOf;\n \"image\": NodeListOf;\n \"img\": NodeListOf;\n \"input\": NodeListOf;\n \"ins\": NodeListOf;\n \"isindex\": NodeListOf;\n \"kbd\": NodeListOf;\n \"keygen\": NodeListOf;\n \"label\": NodeListOf;\n \"legend\": NodeListOf;\n \"li\": NodeListOf;\n \"line\": NodeListOf;\n \"lineargradient\": NodeListOf;\n \"link\": NodeListOf;\n \"listing\": NodeListOf;\n \"map\": NodeListOf;\n \"mark\": NodeListOf;\n \"marker\": NodeListOf;\n \"marquee\": NodeListOf;\n \"mask\": NodeListOf;\n \"menu\": NodeListOf;\n \"meta\": NodeListOf;\n \"metadata\": NodeListOf;\n \"meter\": NodeListOf;\n \"nav\": NodeListOf;\n \"nextid\": NodeListOf;\n \"nobr\": NodeListOf;\n \"noframes\": NodeListOf;\n \"noscript\": NodeListOf;\n \"object\": NodeListOf;\n \"ol\": NodeListOf;\n \"optgroup\": NodeListOf;\n \"option\": NodeListOf;\n \"p\": NodeListOf;\n \"param\": NodeListOf;\n \"path\": NodeListOf;\n \"pattern\": NodeListOf;\n \"picture\": NodeListOf;\n \"plaintext\": NodeListOf;\n \"polygon\": NodeListOf;\n \"polyline\": NodeListOf;\n \"pre\": NodeListOf;\n \"progress\": NodeListOf;\n \"q\": NodeListOf;\n \"radialgradient\": NodeListOf;\n \"rect\": NodeListOf;\n \"rt\": NodeListOf;\n \"ruby\": NodeListOf;\n \"s\": NodeListOf;\n \"samp\": NodeListOf;\n \"script\": NodeListOf;\n \"section\": NodeListOf;\n \"select\": NodeListOf;\n \"small\": NodeListOf;\n \"source\": NodeListOf;\n \"span\": NodeListOf;\n \"stop\": NodeListOf;\n \"strike\": NodeListOf;\n \"strong\": NodeListOf;\n \"style\": NodeListOf;\n \"sub\": NodeListOf;\n \"sup\": NodeListOf;\n \"svg\": NodeListOf;\n \"switch\": NodeListOf;\n \"symbol\": NodeListOf;\n \"table\": NodeListOf;\n \"tbody\": NodeListOf;\n \"td\": NodeListOf;\n \"template\": NodeListOf;\n \"text\": NodeListOf;\n \"textpath\": NodeListOf;\n \"textarea\": NodeListOf;\n \"tfoot\": NodeListOf;\n \"th\": NodeListOf;\n \"thead\": NodeListOf;\n \"title\": NodeListOf;\n \"tr\": NodeListOf;\n \"track\": NodeListOf;\n \"tspan\": NodeListOf;\n \"tt\": NodeListOf;\n \"u\": NodeListOf;\n \"ul\": NodeListOf;\n \"use\": NodeListOf;\n \"var\": NodeListOf;\n \"video\": NodeListOf;\n \"view\": NodeListOf;\n \"wbr\": NodeListOf;\n \"x-ms-webview\": NodeListOf;\n \"xmp\": NodeListOf;\n}\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 clientInformation: Navigator;\ndeclare var closed: boolean;\ndeclare var crypto: Crypto;\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 length: number;\ndeclare var location: Location;\ndeclare var locationbar: BarProp;\ndeclare var menubar: BarProp;\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 scrollX: number;\ndeclare var scrollY: number;\ndeclare var scrollbars: BarProp;\ndeclare var self: Window;\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 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;\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 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 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 removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void;\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 addEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, useCapture?: boolean): void;\ndeclare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\ntype AAGUID = string;\ntype AlgorithmIdentifier = string | Algorithm;\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 = RTCIceCandidate | RTCIceCandidateComplete;\ntype RTCTransport = RTCDtlsTransport | RTCSrtpSdesTransport;\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\";\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 * 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 (collection: any): 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: any): VBArray;\n new (safeArray: any): VBArray;\n}\n\ndeclare var VBArray: VBArrayConstructor;\n\n/**\n * Automation date (VT_DATE)\n */\ninterface VarDate { }\n\ninterface DateConstructor {\n new (vd: VarDate): Date;\n}\n\ninterface Date {\n getVarDate: () => VarDate;\n}\n"}; }); +define([], function() { return { 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\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;\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: any): 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 number 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 number 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 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: U[]): 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[][]): 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 | T[])[]): 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 /**\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: (this: void, value: T, index: number, array: ReadonlyArray) => boolean): boolean;\n every(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => boolean, thisArg: undefined): boolean;\n every(callbackfn: (this: Z, value: T, index: number, array: ReadonlyArray) => boolean, thisArg: Z): 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: (this: void, value: T, index: number, array: ReadonlyArray) => boolean): boolean;\n some(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => boolean, thisArg: undefined): boolean;\n some(callbackfn: (this: Z, value: T, index: number, array: ReadonlyArray) => boolean, thisArg: Z): 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: (this: void, value: T, index: number, array: ReadonlyArray) => void): void;\n forEach(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => void, thisArg: undefined): void;\n forEach(callbackfn: (this: Z, value: T, index: number, array: ReadonlyArray) => void, thisArg: Z): 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: (this: void, value: T, index: number, array: ReadonlyArray) => U): U[];\n map(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => U, thisArg: undefined): U[];\n map(callbackfn: (this: Z, value: T, index: number, array: ReadonlyArray) => U, thisArg: Z): 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: (this: void, value: T, index: number, array: ReadonlyArray) => value is S): S[];\n filter(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => value is S, thisArg: undefined): S[];\n filter(callbackfn: (this: Z, value: T, index: number, array: ReadonlyArray) => value is S, thisArg: Z): 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: (this: void, value: T, index: number, array: ReadonlyArray) => any): T[];\n filter(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => any, thisArg: undefined): T[];\n filter(callbackfn: (this: Z, value: T, index: number, array: ReadonlyArray) => any, thisArg: Z): 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, 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, 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 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 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: T[][]): 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 | T[])[]): 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: (this: void, value: T, index: number, array: T[]) => boolean): boolean;\n every(callbackfn: (this: void, value: T, index: number, array: T[]) => boolean, thisArg: undefined): boolean;\n every(callbackfn: (this: Z, value: T, index: number, array: T[]) => boolean, thisArg: Z): 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: (this: void, value: T, index: number, array: T[]) => boolean): boolean;\n some(callbackfn: (this: void, value: T, index: number, array: T[]) => boolean, thisArg: undefined): boolean;\n some(callbackfn: (this: Z, value: T, index: number, array: T[]) => boolean, thisArg: Z): 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: (this: void, value: T, index: number, array: T[]) => void): void;\n forEach(callbackfn: (this: void, value: T, index: number, array: T[]) => void, thisArg: undefined): void;\n forEach(callbackfn: (this: Z, value: T, index: number, array: T[]) => void, thisArg: Z): 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(this: [T, T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U, U, U, U];\n map(this: [T, T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U, U, U];\n map(this: [T, T, T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U, U, U];\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(this: [T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U, U, U];\n map(this: [T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U, U];\n map(this: [T, T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U, U];\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(this: [T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U, U];\n map(this: [T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U];\n map(this: [T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U];\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(this: [T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U];\n map(this: [T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U];\n map(this: [T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U];\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: (this: void, value: T, index: number, array: T[]) => U): U[];\n map(callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): U[];\n map(callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): 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: (this: void, value: T, index: number, array: T[]) => any): T[];\n filter(callbackfn: (this: void, value: T, index: number, array: T[]) => any, thisArg: undefined): T[];\n filter(callbackfn: (this: Z, value: T, index: number, array: T[]) => any, thisArg: Z): 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, 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, 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\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: ArrayBuffer;\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: ArrayBuffer, 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: ArrayBuffer;\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: (this: void, value: number, index: number, array: Int8Array) => boolean): boolean;\n every(callbackfn: (this: void, value: number, index: number, array: Int8Array) => boolean, thisArg: undefined): boolean;\n every(callbackfn: (this: Z, value: number, index: number, array: Int8Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, array: Int8Array) => any): Int8Array;\n filter(callbackfn: (this: void, value: number, index: number, array: Int8Array) => any, thisArg: undefined): Int8Array;\n filter(callbackfn: (this: Z, value: number, index: number, array: Int8Array) => any, thisArg: Z): 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: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined;\n find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined;\n find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, obj: Array) => boolean): number;\n findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number;\n findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, array: Int8Array) => void): void;\n forEach(callbackfn: (this: void, value: number, index: number, array: Int8Array) => void, thisArg: undefined): void;\n forEach(callbackfn: (this: Z, value: number, index: number, array: Int8Array) => void, thisArg: Z): 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: (this: void, value: number, index: number, array: Int8Array) => number): Int8Array;\n map(callbackfn: (this: void, value: number, index: number, array: Int8Array) => number, thisArg: undefined): Int8Array;\n map(callbackfn: (this: Z, value: number, index: number, array: Int8Array) => number, thisArg: Z): 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, 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, 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: (this: void, value: number, index: number, array: Int8Array) => boolean): boolean;\n some(callbackfn: (this: void, value: number, index: number, array: Int8Array) => boolean, thisArg: undefined): boolean;\n some(callbackfn: (this: Z, value: number, index: number, array: Int8Array) => boolean, thisArg: Z): 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 (array: ArrayLike): Int8Array;\n new (buffer: ArrayBuffer, 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: (this: void, v: number, k: number) => number): Int8Array;\n from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int8Array;\n from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int8Array;\n\n from(arrayLike: ArrayLike): Int8Array;\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: ArrayBuffer;\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: (this: void, value: number, index: number, array: Uint8Array) => boolean): boolean;\n every(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => boolean, thisArg: undefined): boolean;\n every(callbackfn: (this: Z, value: number, index: number, array: Uint8Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, array: Uint8Array) => any): Uint8Array;\n filter(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => any, thisArg: undefined): Uint8Array;\n filter(callbackfn: (this: Z, value: number, index: number, array: Uint8Array) => any, thisArg: Z): 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: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined;\n find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined;\n find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, obj: Array) => boolean): number;\n findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number;\n findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, array: Uint8Array) => void): void;\n forEach(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => void, thisArg: undefined): void;\n forEach(callbackfn: (this: Z, value: number, index: number, array: Uint8Array) => void, thisArg: Z): 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: (this: void, value: number, index: number, array: Uint8Array) => number): Uint8Array;\n map(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => number, thisArg: undefined): Uint8Array;\n map(callbackfn: (this: Z, value: number, index: number, array: Uint8Array) => number, thisArg: Z): 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, 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, 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: (this: void, value: number, index: number, array: Uint8Array) => boolean): boolean;\n some(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => boolean, thisArg: undefined): boolean;\n some(callbackfn: (this: Z, value: number, index: number, array: Uint8Array) => boolean, thisArg: Z): 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 (array: ArrayLike): Uint8Array;\n new (buffer: ArrayBuffer, 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: (this: void, v: number, k: number) => number): Uint8Array;\n from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint8Array;\n from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint8Array;\n\n from(arrayLike: ArrayLike): 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: ArrayBuffer;\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: (this: void, value: number, index: number, array: Uint8ClampedArray) => boolean): boolean;\n every(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg: undefined): boolean;\n every(callbackfn: (this: Z, value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, array: Uint8ClampedArray) => any): Uint8ClampedArray;\n filter(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => any, thisArg: undefined): Uint8ClampedArray;\n filter(callbackfn: (this: Z, value: number, index: number, array: Uint8ClampedArray) => any, thisArg: Z): 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: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined;\n find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined;\n find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, obj: Array) => boolean): number;\n findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number;\n findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, array: Uint8ClampedArray) => void): void;\n forEach(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => void, thisArg: undefined): void;\n forEach(callbackfn: (this: Z, value: number, index: number, array: Uint8ClampedArray) => void, thisArg: Z): 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: (this: void, value: number, index: number, array: Uint8ClampedArray) => number): Uint8ClampedArray;\n map(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => number, thisArg: undefined): Uint8ClampedArray;\n map(callbackfn: (this: Z, value: number, index: number, array: Uint8ClampedArray) => number, thisArg: Z): 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, 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, 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: (this: void, value: number, index: number, array: Uint8ClampedArray) => boolean): boolean;\n some(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg: undefined): boolean;\n some(callbackfn: (this: Z, value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg: Z): 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 (array: ArrayLike): Uint8ClampedArray;\n new (buffer: ArrayBuffer, 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: (this: void, v: number, k: number) => number): Uint8ClampedArray;\n from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint8ClampedArray;\n from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint8ClampedArray;\n\n from(arrayLike: ArrayLike): 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: ArrayBuffer;\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: (this: void, value: number, index: number, array: Int16Array) => boolean): boolean;\n every(callbackfn: (this: void, value: number, index: number, array: Int16Array) => boolean, thisArg: undefined): boolean;\n every(callbackfn: (this: Z, value: number, index: number, array: Int16Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, array: Int16Array) => any): Int16Array;\n filter(callbackfn: (this: void, value: number, index: number, array: Int16Array) => any, thisArg: undefined): Int16Array;\n filter(callbackfn: (this: Z, value: number, index: number, array: Int16Array) => any, thisArg: Z): 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: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined;\n find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined;\n find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, obj: Array) => boolean): number;\n findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number;\n findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, array: Int16Array) => void): void;\n forEach(callbackfn: (this: void, value: number, index: number, array: Int16Array) => void, thisArg: undefined): void;\n forEach(callbackfn: (this: Z, value: number, index: number, array: Int16Array) => void, thisArg: Z): 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: (this: void, value: number, index: number, array: Int16Array) => number): Int16Array;\n map(callbackfn: (this: void, value: number, index: number, array: Int16Array) => number, thisArg: undefined): Int16Array;\n map(callbackfn: (this: Z, value: number, index: number, array: Int16Array) => number, thisArg: Z): 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, 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, 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: (this: void, value: number, index: number, array: Int16Array) => boolean): boolean;\n some(callbackfn: (this: void, value: number, index: number, array: Int16Array) => boolean, thisArg: undefined): boolean;\n some(callbackfn: (this: Z, value: number, index: number, array: Int16Array) => boolean, thisArg: Z): 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 (array: ArrayLike): Int16Array;\n new (buffer: ArrayBuffer, 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: (this: void, v: number, k: number) => number): Int16Array;\n from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int16Array;\n from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int16Array;\n\n from(arrayLike: ArrayLike): Int16Array;\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: ArrayBuffer;\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: (this: void, value: number, index: number, array: Uint16Array) => boolean): boolean;\n every(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => boolean, thisArg: undefined): boolean;\n every(callbackfn: (this: Z, value: number, index: number, array: Uint16Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, array: Uint16Array) => any): Uint16Array;\n filter(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => any, thisArg: undefined): Uint16Array;\n filter(callbackfn: (this: Z, value: number, index: number, array: Uint16Array) => any, thisArg: Z): 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: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined;\n find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined;\n find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, obj: Array) => boolean): number;\n findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number;\n findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, array: Uint16Array) => void): void;\n forEach(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => void, thisArg: undefined): void;\n forEach(callbackfn: (this: Z, value: number, index: number, array: Uint16Array) => void, thisArg: Z): 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: (this: void, value: number, index: number, array: Uint16Array) => number): Uint16Array;\n map(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => number, thisArg: undefined): Uint16Array;\n map(callbackfn: (this: Z, value: number, index: number, array: Uint16Array) => number, thisArg: Z): 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, 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, 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: (this: void, value: number, index: number, array: Uint16Array) => boolean): boolean;\n some(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => boolean, thisArg: undefined): boolean;\n some(callbackfn: (this: Z, value: number, index: number, array: Uint16Array) => boolean, thisArg: Z): 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 (array: ArrayLike): Uint16Array;\n new (buffer: ArrayBuffer, 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: (this: void, v: number, k: number) => number): Uint16Array;\n from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint16Array;\n from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint16Array;\n\n from(arrayLike: ArrayLike): Uint16Array;\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: ArrayBuffer;\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: (this: void, value: number, index: number, array: Int32Array) => boolean): boolean;\n every(callbackfn: (this: void, value: number, index: number, array: Int32Array) => boolean, thisArg: undefined): boolean;\n every(callbackfn: (this: Z, value: number, index: number, array: Int32Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, array: Int32Array) => any): Int32Array;\n filter(callbackfn: (this: void, value: number, index: number, array: Int32Array) => any, thisArg: undefined): Int32Array;\n filter(callbackfn: (this: Z, value: number, index: number, array: Int32Array) => any, thisArg: Z): 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: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined;\n find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined;\n find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, obj: Array) => boolean): number;\n findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number;\n findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, array: Int32Array) => void): void;\n forEach(callbackfn: (this: void, value: number, index: number, array: Int32Array) => void, thisArg: undefined): void;\n forEach(callbackfn: (this: Z, value: number, index: number, array: Int32Array) => void, thisArg: Z): 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: (this: void, value: number, index: number, array: Int32Array) => number): Int32Array;\n map(callbackfn: (this: void, value: number, index: number, array: Int32Array) => number, thisArg: undefined): Int32Array;\n map(callbackfn: (this: Z, value: number, index: number, array: Int32Array) => number, thisArg: Z): 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, 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, 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: (this: void, value: number, index: number, array: Int32Array) => boolean): boolean;\n some(callbackfn: (this: void, value: number, index: number, array: Int32Array) => boolean, thisArg: undefined): boolean;\n some(callbackfn: (this: Z, value: number, index: number, array: Int32Array) => boolean, thisArg: Z): 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 (array: ArrayLike): Int32Array;\n new (buffer: ArrayBuffer, 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: (this: void, v: number, k: number) => number): Int32Array;\n from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int32Array;\n from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int32Array;\n\n from(arrayLike: ArrayLike): Int32Array;\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: ArrayBuffer;\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: (this: void, value: number, index: number, array: Uint32Array) => boolean): boolean;\n every(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => boolean, thisArg: undefined): boolean;\n every(callbackfn: (this: Z, value: number, index: number, array: Uint32Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, array: Uint32Array) => any): Uint32Array;\n filter(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => any, thisArg: undefined): Uint32Array;\n filter(callbackfn: (this: Z, value: number, index: number, array: Uint32Array) => any, thisArg: Z): 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: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined;\n find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined;\n find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, obj: Array) => boolean): number;\n findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number;\n findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, array: Uint32Array) => void): void;\n forEach(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => void, thisArg: undefined): void;\n forEach(callbackfn: (this: Z, value: number, index: number, array: Uint32Array) => void, thisArg: Z): 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: (this: void, value: number, index: number, array: Uint32Array) => number): Uint32Array;\n map(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => number, thisArg: undefined): Uint32Array;\n map(callbackfn: (this: Z, value: number, index: number, array: Uint32Array) => number, thisArg: Z): 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, 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, 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: (this: void, value: number, index: number, array: Uint32Array) => boolean): boolean;\n some(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => boolean, thisArg: undefined): boolean;\n some(callbackfn: (this: Z, value: number, index: number, array: Uint32Array) => boolean, thisArg: Z): 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 (array: ArrayLike): Uint32Array;\n new (buffer: ArrayBuffer, 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: (this: void, v: number, k: number) => number): Uint32Array;\n from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint32Array;\n from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint32Array;\n\n from(arrayLike: ArrayLike): Uint32Array;\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: ArrayBuffer;\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: (this: void, value: number, index: number, array: Float32Array) => boolean): boolean;\n every(callbackfn: (this: void, value: number, index: number, array: Float32Array) => boolean, thisArg: undefined): boolean;\n every(callbackfn: (this: Z, value: number, index: number, array: Float32Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, array: Float32Array) => any): Float32Array;\n filter(callbackfn: (this: void, value: number, index: number, array: Float32Array) => any, thisArg: undefined): Float32Array;\n filter(callbackfn: (this: Z, value: number, index: number, array: Float32Array) => any, thisArg: Z): 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: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined;\n find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined;\n find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, obj: Array) => boolean): number;\n findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number;\n findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, array: Float32Array) => void): void;\n forEach(callbackfn: (this: void, value: number, index: number, array: Float32Array) => void, thisArg: undefined): void;\n forEach(callbackfn: (this: Z, value: number, index: number, array: Float32Array) => void, thisArg: Z): 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: (this: void, value: number, index: number, array: Float32Array) => number): Float32Array;\n map(callbackfn: (this: void, value: number, index: number, array: Float32Array) => number, thisArg: undefined): Float32Array;\n map(callbackfn: (this: Z, value: number, index: number, array: Float32Array) => number, thisArg: Z): 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, 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, 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: (this: void, value: number, index: number, array: Float32Array) => boolean): boolean;\n some(callbackfn: (this: void, value: number, index: number, array: Float32Array) => boolean, thisArg: undefined): boolean;\n some(callbackfn: (this: Z, value: number, index: number, array: Float32Array) => boolean, thisArg: Z): 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 (array: ArrayLike): Float32Array;\n new (buffer: ArrayBuffer, 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: (this: void, v: number, k: number) => number): Float32Array;\n from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Float32Array;\n from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Float32Array;\n\n from(arrayLike: ArrayLike): Float32Array;\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: ArrayBuffer;\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: (this: void, value: number, index: number, array: Float64Array) => boolean): boolean;\n every(callbackfn: (this: void, value: number, index: number, array: Float64Array) => boolean, thisArg: undefined): boolean;\n every(callbackfn: (this: Z, value: number, index: number, array: Float64Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, array: Float64Array) => any): Float64Array;\n filter(callbackfn: (this: void, value: number, index: number, array: Float64Array) => any, thisArg: undefined): Float64Array;\n filter(callbackfn: (this: Z, value: number, index: number, array: Float64Array) => any, thisArg: Z): 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: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined;\n find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined;\n find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, obj: Array) => boolean): number;\n findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number;\n findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): 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: (this: void, value: number, index: number, array: Float64Array) => void): void;\n forEach(callbackfn: (this: void, value: number, index: number, array: Float64Array) => void, thisArg: undefined): void;\n forEach(callbackfn: (this: Z, value: number, index: number, array: Float64Array) => void, thisArg: Z): 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: (this: void, value: number, index: number, array: Float64Array) => number): Float64Array;\n map(callbackfn: (this: void, value: number, index: number, array: Float64Array) => number, thisArg: undefined): Float64Array;\n map(callbackfn: (this: Z, value: number, index: number, array: Float64Array) => number, thisArg: Z): 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, 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, 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: (this: void, value: number, index: number, array: Float64Array) => boolean): boolean;\n some(callbackfn: (this: void, value: number, index: number, array: Float64Array) => boolean, thisArg: undefined): boolean;\n some(callbackfn: (this: Z, value: number, index: number, array: Float64Array) => boolean, thisArg: Z): 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 (array: ArrayLike): Float64Array;\n new (buffer: ArrayBuffer, 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: (this: void, v: number, k: number) => number): Float64Array;\n from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Float64Array;\n from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Float64Array;\n\n from(arrayLike: ArrayLike): Float64Array;\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/// IE DOM APIs\n/////////////////////////////\n\ninterface Account {\n rpDisplayName?: string;\n displayName?: string;\n id?: string;\n name?: string;\n imageURL?: 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 timeoutSeconds?: number;\n rpId?: USVString;\n allowList?: ScopedCredentialDescriptor[];\n extensions?: WebAuthnExtensions;\n}\n\ninterface CacheQueryOptions {\n ignoreSearch?: boolean;\n ignoreMethod?: boolean;\n ignoreVary?: boolean;\n cacheName?: string;\n}\n\ninterface ClientData {\n challenge?: string;\n origin?: string;\n rpId?: string;\n hashAlg?: string | Algorithm;\n tokenBinding?: string;\n extensions?: WebAuthnExtensions;\n}\n\ninterface CloseEventInit extends EventInit {\n wasClean?: boolean;\n code?: number;\n reason?: string;\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?: any;\n}\n\ninterface DOMRectInit {\n x?: any;\n y?: any;\n width?: any;\n height?: any;\n}\n\ninterface DeviceAccelerationDict {\n x?: number;\n y?: number;\n z?: number;\n}\n\ninterface DeviceLightEventInit extends EventInit {\n value?: number;\n}\n\ninterface DeviceMotionEventInit extends EventInit {\n acceleration?: DeviceAccelerationDict;\n accelerationIncludingGravity?: DeviceAccelerationDict;\n rotationRate?: DeviceRotationRateDict;\n interval?: number;\n}\n\ninterface DeviceOrientationEventInit extends EventInit {\n alpha?: number;\n beta?: number;\n gamma?: number;\n absolute?: boolean;\n}\n\ninterface DeviceRotationRateDict {\n alpha?: number;\n beta?: number;\n gamma?: number;\n}\n\ninterface DoubleRange {\n max?: number;\n min?: number;\n}\n\ninterface ErrorEventInit extends EventInit {\n message?: string;\n filename?: string;\n lineno?: number;\n colno?: number;\n error?: any;\n}\n\ninterface EventInit {\n scoped?: boolean;\n bubbles?: boolean;\n cancelable?: boolean;\n}\n\ninterface EventModifierInit extends UIEventInit {\n ctrlKey?: boolean;\n shiftKey?: boolean;\n altKey?: 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}\n\ninterface ExceptionInformation {\n domain?: string;\n}\n\ninterface FocusEventInit extends UIEventInit {\n relatedTarget?: EventTarget;\n}\n\ninterface FocusNavigationEventInit extends EventInit {\n navigationReason?: string;\n originLeft?: number;\n originTop?: number;\n originWidth?: number;\n originHeight?: number;\n}\n\ninterface FocusNavigationOrigin {\n originLeft?: number;\n originTop?: number;\n originWidth?: number;\n originHeight?: 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 IDBIndexParameters {\n multiEntry?: boolean;\n unique?: boolean;\n}\n\ninterface IDBObjectStoreParameters {\n autoIncrement?: boolean;\n keyPath?: IDBKeyPath;\n}\n\ninterface IntersectionObserverEntryInit {\n time?: number;\n rootBounds?: DOMRectInit;\n boundingClientRect?: DOMRectInit;\n intersectionRect?: DOMRectInit;\n target?: Element;\n}\n\ninterface IntersectionObserverInit {\n root?: Element;\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 MSAccountInfo {\n rpDisplayName?: string;\n userDisplayName?: string;\n accountName?: string;\n userId?: string;\n accountImageUri?: string;\n}\n\ninterface MSAudioLocalClientEvent extends MSLocalClientEventBase {\n networkSendQualityEventRatio?: number;\n networkDelayEventRatio?: number;\n cpuInsufficientEventRatio?: number;\n deviceHalfDuplexAECEventRatio?: number;\n deviceRenderNotFunctioningEventRatio?: number;\n deviceCaptureNotFunctioningEventRatio?: number;\n deviceGlitchesEventRatio?: number;\n deviceLowSNREventRatio?: number;\n deviceLowSpeechLevelEventRatio?: number;\n deviceClippingEventRatio?: number;\n deviceEchoEventRatio?: number;\n deviceNearEndToEchoRatioEventRatio?: number;\n deviceRenderZeroVolumeEventRatio?: number;\n deviceRenderMuteEventRatio?: number;\n deviceMultipleEndpointsEventCount?: number;\n deviceHowlingEventCount?: number;\n}\n\ninterface MSAudioRecvPayload extends MSPayloadBase {\n samplingRate?: number;\n signal?: MSAudioRecvSignal;\n packetReorderRatio?: number;\n packetReorderDepthAvg?: number;\n packetReorderDepthMax?: number;\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 ratioConcealedSamplesAvg?: number;\n ratioStretchedSamplesAvg?: number;\n ratioCompressedSamplesAvg?: number;\n}\n\ninterface MSAudioRecvSignal {\n initialSignalLevelRMS?: number;\n recvSignalLevelCh1?: number;\n recvNoiseLevelCh1?: number;\n renderSignalLevel?: number;\n renderNoiseLevel?: number;\n renderLoopbackSignalLevel?: number;\n}\n\ninterface MSAudioSendPayload extends MSPayloadBase {\n samplingRate?: number;\n signal?: MSAudioSendSignal;\n audioFECUsed?: boolean;\n sendMutePercent?: number;\n}\n\ninterface MSAudioSendSignal {\n noiseLevel?: number;\n sendSignalLevelCh1?: number;\n sendNoiseLevelCh1?: 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 type?: MSCredentialType;\n id?: string;\n}\n\ninterface MSDelay {\n roundTrip?: number;\n roundTripMax?: number;\n}\n\ninterface MSDescription extends RTCStats {\n connectivity?: MSConnectivity;\n transport?: RTCIceProtocol;\n networkconnectivity?: MSNetworkConnectivityInfo;\n localAddr?: MSIPAddressInfo;\n remoteAddr?: MSIPAddressInfo;\n deviceDevName?: string;\n reflexiveLocalIPAddr?: MSIPAddressInfo;\n}\n\ninterface MSFIDOCredentialParameters extends MSCredentialParameters {\n algorithm?: string | Algorithm;\n authenticators?: AAGUID[];\n}\n\ninterface MSIPAddressInfo {\n ipAddr?: string;\n port?: number;\n manufacturerMacAddrMask?: string;\n}\n\ninterface MSIceWarningFlags {\n turnTcpTimedOut?: boolean;\n turnUdpAllocateFailed?: boolean;\n turnUdpSendFailed?: boolean;\n turnTcpAllocateFailed?: boolean;\n turnTcpSendFailed?: boolean;\n udpLocalConnectivityFailed?: boolean;\n udpNatConnectivityFailed?: boolean;\n udpRelayConnectivityFailed?: boolean;\n tcpNatConnectivityFailed?: boolean;\n tcpRelayConnectivityFailed?: boolean;\n connCheckMessageIntegrityFailed?: boolean;\n allocationMessageIntegrityFailed?: boolean;\n connCheckOtherError?: boolean;\n turnAuthUnknownUsernameError?: boolean;\n noRelayServersConfigured?: boolean;\n multipleRelayServersAttempted?: boolean;\n portRangeExhausted?: boolean;\n alternateServerReceived?: boolean;\n pseudoTLSFailure?: boolean;\n turnTurnTcpConnectivityFailed?: boolean;\n useCandidateChecksFailed?: boolean;\n fipsAllocationFailure?: boolean;\n}\n\ninterface MSJitter {\n interArrival?: number;\n interArrivalMax?: number;\n interArrivalSD?: number;\n}\n\ninterface MSLocalClientEventBase extends RTCStats {\n networkReceiveQualityEventRatio?: number;\n networkBandwidthLowEventRatio?: number;\n}\n\ninterface MSNetwork extends RTCStats {\n jitter?: MSJitter;\n delay?: MSDelay;\n packetLoss?: MSPacketLoss;\n utilization?: MSUtilization;\n}\n\ninterface MSNetworkConnectivityInfo {\n vpn?: boolean;\n linkspeed?: number;\n networkConnectionDetails?: string;\n}\n\ninterface MSNetworkInterfaceType {\n interfaceTypeEthernet?: boolean;\n interfaceTypeWireless?: boolean;\n interfaceTypePPP?: boolean;\n interfaceTypeTunnel?: 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 min?: number;\n max?: number;\n}\n\ninterface MSRelayAddress {\n relayAddress?: string;\n port?: number;\n}\n\ninterface MSSignatureParameters {\n userPrompt?: string;\n}\n\ninterface MSTransportDiagnosticsStats extends RTCStats {\n baseAddress?: string;\n localAddress?: string;\n localSite?: string;\n networkName?: string;\n remoteAddress?: string;\n remoteSite?: string;\n localMR?: string;\n remoteMR?: string;\n iceWarningFlags?: MSIceWarningFlags;\n portRangeMin?: number;\n portRangeMax?: number;\n localMRTCPPort?: number;\n remoteMRTCPPort?: number;\n stunVer?: number;\n numConsentReqSent?: number;\n numConsentReqReceived?: number;\n numConsentRespSent?: number;\n numConsentRespReceived?: number;\n interfaces?: MSNetworkInterfaceType;\n baseInterface?: MSNetworkInterfaceType;\n protocol?: RTCIceProtocol;\n localInterface?: MSNetworkInterfaceType;\n localAddrType?: MSIceAddrType;\n remoteAddrType?: MSIceAddrType;\n iceRole?: RTCIceRole;\n rtpRtcpMux?: boolean;\n allocationTimeInMs?: number;\n msRtcEngineVersion?: string;\n}\n\ninterface MSUtilization {\n packets?: number;\n bandwidthEstimation?: number;\n bandwidthEstimationMin?: number;\n bandwidthEstimationMax?: number;\n bandwidthEstimationStdDev?: number;\n bandwidthEstimationAvg?: number;\n}\n\ninterface MSVideoPayload extends MSPayloadBase {\n resolution?: string;\n videoBitRateAvg?: number;\n videoBitRateMax?: number;\n videoFrameRateAvg?: number;\n videoPacketLossRate?: number;\n durationSeconds?: number;\n}\n\ninterface MSVideoRecvPayload extends MSVideoPayload {\n videoFrameLossRate?: number;\n recvCodecType?: string;\n recvResolutionWidth?: number;\n recvResolutionHeight?: number;\n videoResolutions?: MSVideoResolutionDistribution;\n recvFrameRateAverage?: number;\n recvBitRateMaximum?: number;\n recvBitRateAverage?: number;\n recvVideoStreamsMax?: number;\n recvVideoStreamsMin?: number;\n recvVideoStreamsMode?: number;\n videoPostFECPLR?: number;\n lowBitRateCallPercent?: number;\n lowFrameRateCallPercent?: number;\n reorderBufferTotalPackets?: number;\n recvReorderBufferReorderedPackets?: number;\n recvReorderBufferPacketsDroppedDueToBufferExhaustion?: number;\n recvReorderBufferMaxSuccessfullyOrderedExtent?: number;\n recvReorderBufferMaxSuccessfullyOrderedLateTime?: number;\n recvReorderBufferPacketsDroppedDueToTimeout?: number;\n recvFpsHarmonicAverage?: number;\n recvNumResSwitches?: number;\n}\n\ninterface MSVideoResolutionDistribution {\n cifQuality?: number;\n vgaQuality?: number;\n h720Quality?: number;\n h1080Quality?: number;\n h1440Quality?: number;\n h2160Quality?: number;\n}\n\ninterface MSVideoSendPayload extends MSVideoPayload {\n sendFrameRateAverage?: number;\n sendBitRateMaximum?: number;\n sendBitRateAverage?: number;\n sendVideoStreamsMax?: number;\n sendResolutionWidth?: number;\n sendResolutionHeight?: number;\n}\n\ninterface MediaEncryptedEventInit extends EventInit {\n initDataType?: string;\n initData?: ArrayBuffer;\n}\n\ninterface MediaKeyMessageEventInit extends EventInit {\n messageType?: MediaKeyMessageType;\n message?: ArrayBuffer;\n}\n\ninterface MediaKeySystemConfiguration {\n initDataTypes?: string[];\n audioCapabilities?: MediaKeySystemMediaCapability[];\n videoCapabilities?: MediaKeySystemMediaCapability[];\n distinctiveIdentifier?: MediaKeysRequirement;\n persistentState?: MediaKeysRequirement;\n}\n\ninterface MediaKeySystemMediaCapability {\n contentType?: string;\n robustness?: string;\n}\n\ninterface MediaStreamConstraints {\n video?: boolean | MediaTrackConstraints;\n audio?: boolean | MediaTrackConstraints;\n}\n\ninterface MediaStreamErrorEventInit extends EventInit {\n error?: MediaStreamError;\n}\n\ninterface MediaStreamEventInit extends EventInit {\n stream?: MediaStream;\n}\n\ninterface MediaStreamTrackEventInit extends EventInit {\n track?: MediaStreamTrack;\n}\n\ninterface MediaTrackCapabilities {\n width?: number | LongRange;\n height?: number | LongRange;\n aspectRatio?: number | DoubleRange;\n frameRate?: number | DoubleRange;\n facingMode?: string;\n volume?: number | DoubleRange;\n sampleRate?: number | LongRange;\n sampleSize?: number | LongRange;\n echoCancellation?: boolean[];\n deviceId?: string;\n groupId?: string;\n}\n\ninterface MediaTrackConstraintSet {\n width?: number | ConstrainLongRange;\n height?: number | ConstrainLongRange;\n aspectRatio?: number | ConstrainDoubleRange;\n frameRate?: number | ConstrainDoubleRange;\n facingMode?: string | string[] | ConstrainDOMStringParameters;\n volume?: number | ConstrainDoubleRange;\n sampleRate?: number | ConstrainLongRange;\n sampleSize?: number | ConstrainLongRange;\n echoCancelation?: boolean | ConstrainBooleanParameters;\n deviceId?: string | string[] | ConstrainDOMStringParameters;\n groupId?: string | string[] | ConstrainDOMStringParameters;\n}\n\ninterface MediaTrackConstraints extends MediaTrackConstraintSet {\n advanced?: MediaTrackConstraintSet[];\n}\n\ninterface MediaTrackSettings {\n width?: number;\n height?: number;\n aspectRatio?: number;\n frameRate?: number;\n facingMode?: string;\n volume?: number;\n sampleRate?: number;\n sampleSize?: number;\n echoCancellation?: boolean;\n deviceId?: string;\n groupId?: string;\n}\n\ninterface MediaTrackSupportedConstraints {\n width?: boolean;\n height?: boolean;\n aspectRatio?: boolean;\n frameRate?: boolean;\n facingMode?: boolean;\n volume?: boolean;\n sampleRate?: boolean;\n sampleSize?: boolean;\n echoCancellation?: boolean;\n deviceId?: boolean;\n groupId?: boolean;\n}\n\ninterface MessageEventInit extends EventInit {\n lastEventId?: string;\n channel?: string;\n data?: any;\n origin?: string;\n source?: Window;\n ports?: MessagePort[];\n}\n\ninterface MouseEventInit extends EventModifierInit {\n screenX?: number;\n screenY?: number;\n clientX?: number;\n clientY?: number;\n button?: number;\n buttons?: number;\n relatedTarget?: EventTarget;\n}\n\ninterface MsZoomToOptions {\n contentX?: number;\n contentY?: number;\n viewportX?: string;\n viewportY?: string;\n scaleFactor?: number;\n animate?: string;\n}\n\ninterface MutationObserverInit {\n childList?: boolean;\n attributes?: boolean;\n characterData?: boolean;\n subtree?: boolean;\n attributeOldValue?: boolean;\n characterDataOldValue?: boolean;\n attributeFilter?: string[];\n}\n\ninterface NotificationOptions {\n dir?: NotificationDirection;\n lang?: string;\n body?: string;\n tag?: string;\n icon?: string;\n}\n\ninterface ObjectURLOptions {\n oneTimeOnly?: boolean;\n}\n\ninterface PaymentCurrencyAmount {\n currency?: string;\n value?: string;\n currencySystem?: string;\n}\n\ninterface PaymentDetails {\n total?: PaymentItem;\n displayItems?: PaymentItem[];\n shippingOptions?: PaymentShippingOption[];\n modifiers?: PaymentDetailsModifier[];\n error?: string;\n}\n\ninterface PaymentDetailsModifier {\n supportedMethods?: string[];\n total?: PaymentItem;\n additionalDisplayItems?: PaymentItem[];\n data?: any;\n}\n\ninterface PaymentItem {\n label?: string;\n amount?: PaymentCurrencyAmount;\n pending?: boolean;\n}\n\ninterface PaymentMethodData {\n supportedMethods?: string[];\n data?: any;\n}\n\ninterface PaymentOptions {\n requestPayerName?: boolean;\n requestPayerEmail?: boolean;\n requestPayerPhone?: boolean;\n requestShipping?: boolean;\n shippingType?: string;\n}\n\ninterface PaymentRequestUpdateEventInit extends EventInit {\n}\n\ninterface PaymentShippingOption {\n id?: string;\n label?: string;\n amount?: PaymentCurrencyAmount;\n selected?: boolean;\n}\n\ninterface PeriodicWaveConstraints {\n disableNormalization?: boolean;\n}\n\ninterface PointerEventInit extends MouseEventInit {\n pointerId?: number;\n width?: number;\n height?: number;\n pressure?: number;\n tiltX?: number;\n tiltY?: number;\n pointerType?: string;\n isPrimary?: boolean;\n}\n\ninterface PopStateEventInit extends EventInit {\n state?: any;\n}\n\ninterface PositionOptions {\n enableHighAccuracy?: boolean;\n timeout?: number;\n maximumAge?: number;\n}\n\ninterface ProgressEventInit extends EventInit {\n lengthComputable?: boolean;\n loaded?: number;\n total?: number;\n}\n\ninterface PushSubscriptionOptionsInit {\n userVisibleOnly?: boolean;\n applicationServerKey?: any;\n}\n\ninterface RTCConfiguration {\n iceServers?: RTCIceServer[];\n iceTransportPolicy?: RTCIceTransportPolicy;\n bundlePolicy?: RTCBundlePolicy;\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 role?: RTCDtlsRole;\n fingerprints?: RTCDtlsFingerprint[];\n}\n\ninterface RTCIceCandidateAttributes extends RTCStats {\n ipAddress?: string;\n portNumber?: number;\n transport?: string;\n candidateType?: RTCStatsIceCandidateType;\n priority?: number;\n addressSourceUrl?: string;\n}\n\ninterface RTCIceCandidateComplete {\n}\n\ninterface RTCIceCandidateDictionary {\n foundation?: string;\n priority?: number;\n ip?: string;\n protocol?: RTCIceProtocol;\n port?: number;\n type?: RTCIceCandidateType;\n tcpType?: RTCIceTcpCandidateType;\n relatedAddress?: string;\n relatedPort?: number;\n msMTurnSessionId?: string;\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 transportId?: string;\n localCandidateId?: string;\n remoteCandidateId?: string;\n state?: RTCStatsIceCandidatePairState;\n priority?: number;\n nominated?: boolean;\n writable?: boolean;\n readable?: boolean;\n bytesSent?: number;\n bytesReceived?: number;\n roundTripTime?: number;\n availableOutgoingBitrate?: number;\n availableIncomingBitrate?: number;\n}\n\ninterface RTCIceGatherOptions {\n gatherPolicy?: RTCIceGatherPolicy;\n iceservers?: RTCIceServer[];\n portRange?: MSPortRange;\n}\n\ninterface RTCIceParameters {\n usernameFragment?: string;\n password?: string;\n iceLite?: boolean;\n}\n\ninterface RTCIceServer {\n urls?: any;\n username?: string;\n credential?: string;\n}\n\ninterface RTCInboundRTPStreamStats extends RTCRTPStreamStats {\n packetsReceived?: number;\n bytesReceived?: number;\n packetsLost?: number;\n jitter?: number;\n fractionLost?: number;\n}\n\ninterface RTCMediaStreamTrackStats extends RTCStats {\n trackIdentifier?: string;\n remoteSource?: boolean;\n ssrcIds?: string[];\n frameWidth?: number;\n frameHeight?: number;\n framesPerSecond?: number;\n framesSent?: number;\n framesReceived?: number;\n framesDecoded?: number;\n framesDropped?: number;\n framesCorrupted?: number;\n audioLevel?: number;\n echoReturnLoss?: number;\n echoReturnLossEnhancement?: number;\n}\n\ninterface RTCOfferOptions {\n offerToReceiveVideo?: number;\n offerToReceiveAudio?: number;\n voiceActivityDetection?: boolean;\n iceRestart?: boolean;\n}\n\ninterface RTCOutboundRTPStreamStats extends RTCRTPStreamStats {\n packetsSent?: number;\n bytesSent?: number;\n targetBitrate?: number;\n roundTripTime?: number;\n}\n\ninterface RTCPeerConnectionIceEventInit extends EventInit {\n candidate?: RTCIceCandidate;\n}\n\ninterface RTCRTPStreamStats extends RTCStats {\n ssrc?: string;\n associateStatsId?: string;\n isRemote?: boolean;\n mediaTrackId?: string;\n transportId?: string;\n codecId?: string;\n firCount?: number;\n pliCount?: number;\n nackCount?: number;\n sliCount?: number;\n}\n\ninterface RTCRtcpFeedback {\n type?: string;\n parameter?: string;\n}\n\ninterface RTCRtcpParameters {\n ssrc?: number;\n cname?: string;\n reducedSize?: boolean;\n mux?: boolean;\n}\n\ninterface RTCRtpCapabilities {\n codecs?: RTCRtpCodecCapability[];\n headerExtensions?: RTCRtpHeaderExtension[];\n fecMechanisms?: string[];\n}\n\ninterface RTCRtpCodecCapability {\n name?: string;\n kind?: string;\n clockRate?: number;\n preferredPayloadType?: number;\n maxptime?: number;\n ptime?: number;\n numChannels?: number;\n rtcpFeedback?: RTCRtcpFeedback[];\n parameters?: any;\n options?: any;\n maxTemporalLayers?: number;\n maxSpatialLayers?: number;\n svcMultiStreamSupport?: boolean;\n}\n\ninterface RTCRtpCodecParameters {\n name?: string;\n payloadType?: any;\n clockRate?: number;\n maxptime?: number;\n ptime?: number;\n numChannels?: number;\n rtcpFeedback?: RTCRtcpFeedback[];\n parameters?: any;\n}\n\ninterface RTCRtpContributingSource {\n timestamp?: number;\n csrc?: number;\n audioLevel?: number;\n}\n\ninterface RTCRtpEncodingParameters {\n ssrc?: number;\n codecPayloadType?: number;\n fec?: RTCRtpFecParameters;\n rtx?: RTCRtpRtxParameters;\n priority?: number;\n maxBitrate?: number;\n minQuality?: number;\n resolutionScale?: number;\n framerateScale?: number;\n maxFramerate?: number;\n active?: boolean;\n encodingId?: string;\n dependencyEncodingIds?: string[];\n ssrcRange?: RTCSsrcRange;\n}\n\ninterface RTCRtpFecParameters {\n ssrc?: number;\n mechanism?: string;\n}\n\ninterface RTCRtpHeaderExtension {\n kind?: string;\n uri?: string;\n preferredId?: number;\n preferredEncrypt?: boolean;\n}\n\ninterface RTCRtpHeaderExtensionParameters {\n uri?: string;\n id?: number;\n encrypt?: boolean;\n}\n\ninterface RTCRtpParameters {\n muxId?: string;\n codecs?: RTCRtpCodecParameters[];\n headerExtensions?: RTCRtpHeaderExtensionParameters[];\n encodings?: RTCRtpEncodingParameters[];\n rtcp?: RTCRtcpParameters;\n degradationPreference?: RTCDegradationPreference;\n}\n\ninterface RTCRtpRtxParameters {\n ssrc?: number;\n}\n\ninterface RTCRtpUnhandled {\n ssrc?: number;\n payloadType?: number;\n muxId?: string;\n}\n\ninterface RTCSessionDescriptionInit {\n type?: RTCSdpType;\n sdp?: string;\n}\n\ninterface RTCSrtpKeyParam {\n keyMethod?: string;\n keySalt?: string;\n lifetime?: string;\n mkiValue?: number;\n mkiLength?: number;\n}\n\ninterface RTCSrtpSdesParameters {\n tag?: number;\n cryptoSuite?: string;\n keyParams?: RTCSrtpKeyParam[];\n sessionParams?: string[];\n}\n\ninterface RTCSsrcRange {\n min?: number;\n max?: number;\n}\n\ninterface RTCStats {\n timestamp?: number;\n type?: RTCStatsType;\n id?: string;\n msType?: MSStatsType;\n}\n\ninterface RTCStatsReport {\n}\n\ninterface RTCTransportStats extends RTCStats {\n bytesSent?: number;\n bytesReceived?: number;\n rtcpTransportStatsId?: string;\n activeConnection?: boolean;\n selectedCandidatePairId?: string;\n localCertificateId?: string;\n remoteCertificateId?: string;\n}\n\ninterface RegistrationOptions {\n scope?: string;\n}\n\ninterface RequestInit {\n method?: string;\n headers?: any;\n body?: any;\n referrer?: string;\n referrerPolicy?: ReferrerPolicy;\n mode?: RequestMode;\n credentials?: RequestCredentials;\n cache?: RequestCache;\n redirect?: RequestRedirect;\n integrity?: string;\n keepalive?: boolean;\n window?: any;\n}\n\ninterface ResponseInit {\n status?: number;\n statusText?: string;\n headers?: any;\n}\n\ninterface ScopedCredentialDescriptor {\n type?: ScopedCredentialType;\n id?: any;\n transports?: Transport[];\n}\n\ninterface ScopedCredentialOptions {\n timeoutSeconds?: number;\n rpId?: USVString;\n excludeList?: ScopedCredentialDescriptor[];\n extensions?: WebAuthnExtensions;\n}\n\ninterface ScopedCredentialParameters {\n type?: ScopedCredentialType;\n algorithm?: string | Algorithm;\n}\n\ninterface ServiceWorkerMessageEventInit extends EventInit {\n data?: any;\n origin?: string;\n lastEventId?: string;\n source?: ServiceWorker | MessagePort;\n ports?: MessagePort[];\n}\n\ninterface SpeechSynthesisEventInit extends EventInit {\n utterance?: SpeechSynthesisUtterance;\n charIndex?: number;\n elapsedTime?: number;\n name?: string;\n}\n\ninterface StoreExceptionsInformation extends ExceptionInformation {\n siteName?: string;\n explanationString?: string;\n detailURI?: string;\n}\n\ninterface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation {\n arrayOfDomainStrings?: string[];\n}\n\ninterface TrackEventInit extends EventInit {\n track?: VideoTrack | AudioTrack | TextTrack;\n}\n\ninterface TransitionEventInit extends EventInit {\n propertyName?: string;\n elapsedTime?: number;\n}\n\ninterface UIEventInit extends EventInit {\n view?: Window;\n detail?: number;\n}\n\ninterface WebAuthnExtensions {\n}\n\ninterface WebGLContextAttributes {\n failIfMajorPerformanceCaveat?: boolean;\n alpha?: boolean;\n depth?: boolean;\n stencil?: boolean;\n antialias?: boolean;\n premultipliedAlpha?: boolean;\n preserveDrawingBuffer?: boolean;\n}\n\ninterface WebGLContextEventInit extends EventInit {\n statusMessage?: string;\n}\n\ninterface WheelEventInit extends MouseEventInit {\n deltaX?: number;\n deltaY?: number;\n deltaZ?: number;\n deltaMode?: 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 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 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 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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 CDATASection extends Text {\n}\n\ndeclare var CDATASection: {\n prototype: CDATASection;\n new(): CDATASection;\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 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;\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 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 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 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 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 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 Cache {\n add(request: RequestInfo): Promise;\n addAll(requests: RequestInfo[]): Promise;\n delete(request: RequestInfo, options?: CacheQueryOptions): Promise;\n keys(request?: RequestInfo, options?: CacheQueryOptions): any;\n match(request: RequestInfo, options?: CacheQueryOptions): Promise;\n matchAll(request?: RequestInfo, options?: CacheQueryOptions): any;\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(): any;\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 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 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 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 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): void;\n groupCollapsed(groupTitle?: string): 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 CustomEvent extends Event {\n readonly detail: any;\n initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: any): 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(): 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 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 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 * 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 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;\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 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;\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 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 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 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): ElementListTagNameMap[K];\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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(): 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_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 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 getAttributeNS(namespaceURI: string, localName: string): string;\n getAttributeNode(name: string): Attr;\n getAttributeNodeNS(namespaceURI: string, localName: string): Attr;\n getBoundingClientRect(): ClientRect;\n getClientRects(): ClientRectList;\n getElementsByTagName(name: K): ElementListTagNameMap[K];\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 removeAttributeNS(namespaceURI: string, localName: string): void;\n removeAttributeNode(oldAttr: Attr): Attr;\n requestFullscreen(): void;\n requestPointerLock(): void;\n setAttribute(name: 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 getElementsByClassName(classNames: string): NodeListOf;\n matches(selector: string): boolean;\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: string, insertedElement: Element): Element | null;\n insertAdjacentHTML(where: string, html: string): void;\n insertAdjacentText(where: string, text: string): void;\n attachShadow(shadowRootInitDict: ShadowRootInit): ShadowRoot;\n addEventListener(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 cancelBubble: boolean;\n readonly cancelable: 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 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: any;\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;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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 Methods: string;\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 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLAnchorElement: {\n prototype: HTMLAnchorElement;\n new(): HTMLAnchorElement;\n}\n\ninterface HTMLAppletElement extends HTMLElement {\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 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 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;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 clear: string;\n addEventListener(type: K, listener: (this: HTMLBRElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 onblur: (this: HTMLBodyElement, ev: FocusEvent) => any;\n onerror: (this: HTMLBodyElement, ev: ErrorEvent) => any;\n onfocus: (this: HTMLBodyElement, ev: FocusEvent) => any;\n onhashchange: (this: HTMLBodyElement, ev: HashChangeEvent) => any;\n onload: (this: HTMLBodyElement, ev: Event) => 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 onscroll: (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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 HTMLDListElement extends HTMLElement {\n compact: boolean;\n addEventListener(type: K, listener: (this: HTMLDListElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 addEventListener(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 * Raised when the object has been completely received from the server.\n */\n onload: (this: HTMLFrameElement, ev: Event) => any;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 /**\n * Fires when the object loses the input focus.\n */\n onblur: (this: HTMLFrameSetElement, ev: FocusEvent) => any;\n onerror: (this: HTMLFrameSetElement, ev: ErrorEvent) => any;\n /**\n * Fires when the object receives focus.\n */\n onfocus: (this: HTMLFrameSetElement, ev: FocusEvent) => any;\n onhashchange: (this: HTMLFrameSetElement, ev: HashChangeEvent) => any;\n onload: (this: HTMLFrameSetElement, ev: Event) => 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 onscroll: (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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLHRElement: {\n prototype: HTMLHRElement;\n new(): HTMLHRElement;\n}\n\ninterface HTMLHeadElement extends HTMLElement {\n profile: string;\n addEventListener(type: K, listener: (this: HTMLHeadElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 version: string;\n addEventListener(type: K, listener: (this: HTMLHtmlElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 /**\n * Raised when the object has been completely received from the server.\n */\n onload: (this: HTMLIFrameElement, ev: Event) => any;\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 addEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\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 */\n setSelectionRange(start?: number, end?: number, direction?: string): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLInputElement: {\n prototype: HTMLInputElement;\n new(): HTMLInputElement;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLLIElement: {\n prototype: HTMLLIElement;\n new(): HTMLLIElement;\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;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\n addEventListener(type: K, listener: (this: HTMLLegendElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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(): void;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLModElement: {\n prototype: HTMLModElement;\n new(): HTMLModElement;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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 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;\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 /**\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLObjectElement: {\n prototype: HTMLObjectElement;\n new(): HTMLObjectElement;\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;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\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 */\n setSelectionRange(start: number, end: number): void;\n addEventListener(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var HTMLVideoElement: {\n prototype: HTMLVideoElement;\n new(): HTMLVideoElement;\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?: any): 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 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?: string): IDBTransaction;\n addEventListener(type: \"versionchange\", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void;\n addEventListener(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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?: string): IDBRequest;\n openKeyCursor(range?: IDBKeyRange | IDBValidKey, direction?: string): 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?: string): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: DOMError;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: DOMError;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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;\n readonly intersectionRatio: number;\n readonly intersectionRect: ClientRect;\n readonly rootBounds: ClientRect;\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 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 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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): 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 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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(): any;\n getSupportedConstraints(): MediaTrackSupportedConstraints;\n getUserMedia(constraints: MediaStreamConstraints): Promise;\n addEventListener(type: K, listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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: any): Promise;\n load(sessionId: string): Promise;\n remove(): Promise;\n update(response: any): 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: any): MediaKeyStatus;\n has(keyId: any): 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: any): 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(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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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 hardwareConcurrency: number;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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 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 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 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 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 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 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 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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;\n getClientRects(): ClientRectList;\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 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 clone(): Response;\n}\n\ndeclare var Response: {\n prototype: Response;\n new(body?: any, init?: ResponseInit): Response;\n}\n\ninterface SVGAElement extends SVGGraphicsElement, SVGURIReference {\n readonly target: SVGAnimatedString;\n addEventListener(type: K, listener: (this: SVGAElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var SVGTSpanElement: {\n prototype: SVGTSpanElement;\n new(): SVGTSpanElement;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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(): any;\n register(scriptURL: USVString, options?: RegistrationOptions): Promise;\n addEventListener(type: K, listener: (this: ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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): any;\n showNotification(title: string, options?: NotificationOptions): Promise;\n unregister(): Promise;\n update(): Promise;\n addEventListener(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 SyncManager {\n getTags(): any;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 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;\n createObjectURL(object: any, options?: ObjectURLOptions): string;\n revokeObjectURL(url: string): void;\n}\n\ninterface UnviewableContentIdentifiedEvent extends NavigationEventWithReferrer {\n readonly mediaType: string;\n}\n\ndeclare var UnviewableContentIdentifiedEvent: {\n prototype: UnviewableContentIdentifiedEvent;\n new(): UnviewableContentIdentifiedEvent;\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}\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n [index: number]: VideoTrack;\n}\n\ndeclare var VideoTrackList: {\n prototype: VideoTrackList;\n new(): VideoTrackList;\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_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 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: any, options?: AssertionOptions): Promise;\n makeCredential(accountInformation: Account, cryptoParameters: ScopedCredentialParameters[], attestationChallenge: any, 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 | 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(name: 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 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 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: 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 \"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 \"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 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 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 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 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;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\n}\n\ndeclare var webkitRTCPeerConnection: {\n prototype: webkitRTCPeerConnection;\n new(configuration: RTCConfiguration): webkitRTCPeerConnection;\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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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 DOML2DeprecatedColorProperty {\n color: string;\n}\n\ninterface DOML2DeprecatedSizeProperty {\n size: number;\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 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): 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): ElementTagNameMap[K] | null;\n querySelector(selectors: string): Element | null;\n querySelectorAll(selectors: K): ElementListTagNameMap[K];\n querySelectorAll(selectors: string): NodeListOf;\n}\n\ninterface RandomSource {\n getRandomValues(array: ArrayBufferView): ArrayBufferView;\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: XMLHttpRequestEventTarget, ev: Event) => any;\n onerror: (this: XMLHttpRequestEventTarget, ev: ErrorEvent) => any;\n onload: (this: XMLHttpRequestEventTarget, ev: Event) => any;\n onloadend: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any;\n onloadstart: (this: XMLHttpRequestEventTarget, ev: Event) => any;\n onprogress: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any;\n ontimeout: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any;\n addEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, useCapture?: boolean): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\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 {\n type?: string;\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 {\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\ndeclare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;\n\ninterface ErrorEventHandler {\n (message: string, filename?: string, lineno?: number, colno?: number, error?:Error): void;\n}\ninterface PositionCallback {\n (position: Position): void;\n}\ninterface PositionErrorCallback {\n (error: PositionError): void;\n}\ninterface MediaQueryListListener {\n (mql: MediaQueryList): void;\n}\ninterface MSLaunchUriCallback {\n (): void;\n}\ninterface FrameRequestCallback {\n (time: number): void;\n}\ninterface MSUnsafeFunctionCallback {\n (): any;\n}\ninterface MSExecAtPriorityFunctionCallback {\n (...args: any[]): any;\n}\ninterface MutationCallback {\n (mutations: MutationRecord[], observer: MutationObserver): void;\n}\ninterface DecodeSuccessCallback {\n (decodedData: AudioBuffer): void;\n}\ninterface DecodeErrorCallback {\n (error: DOMException): void;\n}\ninterface VoidFunction {\n (): void;\n}\ninterface RTCSessionDescriptionCallback {\n (sdp: RTCSessionDescription): void;\n}\ninterface RTCPeerConnectionErrorCallback {\n (error: DOMError): void;\n}\ninterface RTCStatsCallback {\n (report: RTCStatsReport): void;\n}\ninterface FunctionStringCallback {\n (data: string): void;\n}\ninterface NavigatorUserMediaSuccessCallback {\n (stream: MediaStream): void;\n}\ninterface NavigatorUserMediaErrorCallback {\n (error: MediaStreamError): void;\n}\ninterface ForEachCallback {\n (keyId: any, status: MediaKeyStatus): void;\n}\ninterface NotificationPermissionCallback {\n (permission: NotificationPermission): void;\n}\ninterface IntersectionObserverCallback {\n (entries: IntersectionObserverEntry[], observer: IntersectionObserver): void;\n}\ninterface HTMLElementTagNameMap {\n \"a\": HTMLAnchorElement;\n \"applet\": HTMLAppletElement;\n \"area\": HTMLAreaElement;\n \"audio\": HTMLAudioElement;\n \"base\": HTMLBaseElement;\n \"basefont\": HTMLBaseFontElement;\n \"blockquote\": HTMLQuoteElement;\n \"body\": HTMLBodyElement;\n \"br\": HTMLBRElement;\n \"button\": HTMLButtonElement;\n \"canvas\": HTMLCanvasElement;\n \"caption\": HTMLTableCaptionElement;\n \"col\": HTMLTableColElement;\n \"colgroup\": HTMLTableColElement;\n \"data\": HTMLDataElement;\n \"datalist\": HTMLDataListElement;\n \"del\": HTMLModElement;\n \"dir\": HTMLDirectoryElement;\n \"div\": HTMLDivElement;\n \"dl\": HTMLDListElement;\n \"embed\": HTMLEmbedElement;\n \"fieldset\": HTMLFieldSetElement;\n \"font\": HTMLFontElement;\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 \"hr\": HTMLHRElement;\n \"html\": HTMLHtmlElement;\n \"iframe\": HTMLIFrameElement;\n \"img\": HTMLImageElement;\n \"input\": HTMLInputElement;\n \"ins\": HTMLModElement;\n \"isindex\": HTMLUnknownElement;\n \"label\": HTMLLabelElement;\n \"legend\": HTMLLegendElement;\n \"li\": HTMLLIElement;\n \"link\": HTMLLinkElement;\n \"listing\": HTMLPreElement;\n \"map\": HTMLMapElement;\n \"marquee\": HTMLMarqueeElement;\n \"menu\": HTMLMenuElement;\n \"meta\": HTMLMetaElement;\n \"meter\": HTMLMeterElement;\n \"nextid\": HTMLUnknownElement;\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 \"pre\": HTMLPreElement;\n \"progress\": HTMLProgressElement;\n \"q\": HTMLQuoteElement;\n \"script\": HTMLScriptElement;\n \"select\": HTMLSelectElement;\n \"source\": HTMLSourceElement;\n \"span\": HTMLSpanElement;\n \"style\": HTMLStyleElement;\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 \"ul\": HTMLUListElement;\n \"video\": HTMLVideoElement;\n \"x-ms-webview\": MSHTMLWebViewElement;\n \"xmp\": HTMLPreElement;\n}\n\ninterface ElementTagNameMap {\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 \"circle\": SVGCircleElement;\n \"cite\": HTMLElement;\n \"clippath\": SVGClipPathElement;\n \"code\": HTMLElement;\n \"col\": HTMLTableColElement;\n \"colgroup\": HTMLTableColElement;\n \"data\": HTMLDataElement;\n \"datalist\": HTMLDataListElement;\n \"dd\": HTMLElement;\n \"defs\": SVGDefsElement;\n \"del\": HTMLModElement;\n \"desc\": SVGDescElement;\n \"dfn\": HTMLElement;\n \"dir\": HTMLDirectoryElement;\n \"div\": HTMLDivElement;\n \"dl\": HTMLDListElement;\n \"dt\": HTMLElement;\n \"ellipse\": SVGEllipseElement;\n \"em\": HTMLElement;\n \"embed\": HTMLEmbedElement;\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 \"fieldset\": HTMLFieldSetElement;\n \"figcaption\": HTMLElement;\n \"figure\": HTMLElement;\n \"filter\": SVGFilterElement;\n \"font\": HTMLFontElement;\n \"footer\": HTMLElement;\n \"foreignobject\": SVGForeignObjectElement;\n \"form\": HTMLFormElement;\n \"frame\": HTMLFrameElement;\n \"frameset\": HTMLFrameSetElement;\n \"g\": SVGGElement;\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 \"image\": SVGImageElement;\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 \"line\": SVGLineElement;\n \"lineargradient\": SVGLinearGradientElement;\n \"link\": HTMLLinkElement;\n \"listing\": HTMLPreElement;\n \"map\": HTMLMapElement;\n \"mark\": HTMLElement;\n \"marker\": SVGMarkerElement;\n \"marquee\": HTMLMarqueeElement;\n \"mask\": SVGMaskElement;\n \"menu\": HTMLMenuElement;\n \"meta\": HTMLMetaElement;\n \"metadata\": SVGMetadataElement;\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 \"path\": SVGPathElement;\n \"pattern\": SVGPatternElement;\n \"picture\": HTMLPictureElement;\n \"plaintext\": HTMLElement;\n \"polygon\": SVGPolygonElement;\n \"polyline\": SVGPolylineElement;\n \"pre\": HTMLPreElement;\n \"progress\": HTMLProgressElement;\n \"q\": HTMLQuoteElement;\n \"radialgradient\": SVGRadialGradientElement;\n \"rect\": SVGRectElement;\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 \"stop\": SVGStopElement;\n \"strike\": HTMLElement;\n \"strong\": HTMLElement;\n \"style\": HTMLStyleElement;\n \"sub\": HTMLElement;\n \"sup\": HTMLElement;\n \"svg\": SVGSVGElement;\n \"switch\": SVGSwitchElement;\n \"symbol\": SVGSymbolElement;\n \"table\": HTMLTableElement;\n \"tbody\": HTMLTableSectionElement;\n \"td\": HTMLTableDataCellElement;\n \"template\": HTMLTemplateElement;\n \"text\": SVGTextElement;\n \"textpath\": SVGTextPathElement;\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 \"tspan\": SVGTSpanElement;\n \"tt\": HTMLElement;\n \"u\": HTMLElement;\n \"ul\": HTMLUListElement;\n \"use\": SVGUseElement;\n \"var\": HTMLElement;\n \"video\": HTMLVideoElement;\n \"view\": SVGViewElement;\n \"wbr\": HTMLElement;\n \"x-ms-webview\": MSHTMLWebViewElement;\n \"xmp\": HTMLPreElement;\n}\n\ninterface ElementListTagNameMap {\n \"a\": NodeListOf;\n \"abbr\": NodeListOf;\n \"acronym\": NodeListOf;\n \"address\": NodeListOf;\n \"applet\": NodeListOf;\n \"area\": NodeListOf;\n \"article\": NodeListOf;\n \"aside\": NodeListOf;\n \"audio\": NodeListOf;\n \"b\": NodeListOf;\n \"base\": NodeListOf;\n \"basefont\": NodeListOf;\n \"bdo\": NodeListOf;\n \"big\": NodeListOf;\n \"blockquote\": NodeListOf;\n \"body\": NodeListOf;\n \"br\": NodeListOf;\n \"button\": NodeListOf;\n \"canvas\": NodeListOf;\n \"caption\": NodeListOf;\n \"center\": NodeListOf;\n \"circle\": NodeListOf;\n \"cite\": NodeListOf;\n \"clippath\": NodeListOf;\n \"code\": NodeListOf;\n \"col\": NodeListOf;\n \"colgroup\": NodeListOf;\n \"data\": NodeListOf;\n \"datalist\": NodeListOf;\n \"dd\": NodeListOf;\n \"defs\": NodeListOf;\n \"del\": NodeListOf;\n \"desc\": NodeListOf;\n \"dfn\": NodeListOf;\n \"dir\": NodeListOf;\n \"div\": NodeListOf;\n \"dl\": NodeListOf;\n \"dt\": NodeListOf;\n \"ellipse\": NodeListOf;\n \"em\": NodeListOf;\n \"embed\": NodeListOf;\n \"feblend\": NodeListOf;\n \"fecolormatrix\": NodeListOf;\n \"fecomponenttransfer\": NodeListOf;\n \"fecomposite\": NodeListOf;\n \"feconvolvematrix\": NodeListOf;\n \"fediffuselighting\": NodeListOf;\n \"fedisplacementmap\": NodeListOf;\n \"fedistantlight\": NodeListOf;\n \"feflood\": NodeListOf;\n \"fefunca\": NodeListOf;\n \"fefuncb\": NodeListOf;\n \"fefuncg\": NodeListOf;\n \"fefuncr\": NodeListOf;\n \"fegaussianblur\": NodeListOf;\n \"feimage\": NodeListOf;\n \"femerge\": NodeListOf;\n \"femergenode\": NodeListOf;\n \"femorphology\": NodeListOf;\n \"feoffset\": NodeListOf;\n \"fepointlight\": NodeListOf;\n \"fespecularlighting\": NodeListOf;\n \"fespotlight\": NodeListOf;\n \"fetile\": NodeListOf;\n \"feturbulence\": NodeListOf;\n \"fieldset\": NodeListOf;\n \"figcaption\": NodeListOf;\n \"figure\": NodeListOf;\n \"filter\": NodeListOf;\n \"font\": NodeListOf;\n \"footer\": NodeListOf;\n \"foreignobject\": NodeListOf;\n \"form\": NodeListOf;\n \"frame\": NodeListOf;\n \"frameset\": NodeListOf;\n \"g\": NodeListOf;\n \"h1\": NodeListOf;\n \"h2\": NodeListOf;\n \"h3\": NodeListOf;\n \"h4\": NodeListOf;\n \"h5\": NodeListOf;\n \"h6\": NodeListOf;\n \"head\": NodeListOf;\n \"header\": NodeListOf;\n \"hgroup\": NodeListOf;\n \"hr\": NodeListOf;\n \"html\": NodeListOf;\n \"i\": NodeListOf;\n \"iframe\": NodeListOf;\n \"image\": NodeListOf;\n \"img\": NodeListOf;\n \"input\": NodeListOf;\n \"ins\": NodeListOf;\n \"isindex\": NodeListOf;\n \"kbd\": NodeListOf;\n \"keygen\": NodeListOf;\n \"label\": NodeListOf;\n \"legend\": NodeListOf;\n \"li\": NodeListOf;\n \"line\": NodeListOf;\n \"lineargradient\": NodeListOf;\n \"link\": NodeListOf;\n \"listing\": NodeListOf;\n \"map\": NodeListOf;\n \"mark\": NodeListOf;\n \"marker\": NodeListOf;\n \"marquee\": NodeListOf;\n \"mask\": NodeListOf;\n \"menu\": NodeListOf;\n \"meta\": NodeListOf;\n \"metadata\": NodeListOf;\n \"meter\": NodeListOf;\n \"nav\": NodeListOf;\n \"nextid\": NodeListOf;\n \"nobr\": NodeListOf;\n \"noframes\": NodeListOf;\n \"noscript\": NodeListOf;\n \"object\": NodeListOf;\n \"ol\": NodeListOf;\n \"optgroup\": NodeListOf;\n \"option\": NodeListOf;\n \"output\": NodeListOf;\n \"p\": NodeListOf;\n \"param\": NodeListOf;\n \"path\": NodeListOf;\n \"pattern\": NodeListOf;\n \"picture\": NodeListOf;\n \"plaintext\": NodeListOf;\n \"polygon\": NodeListOf;\n \"polyline\": NodeListOf;\n \"pre\": NodeListOf;\n \"progress\": NodeListOf;\n \"q\": NodeListOf;\n \"radialgradient\": NodeListOf;\n \"rect\": NodeListOf;\n \"rt\": NodeListOf;\n \"ruby\": NodeListOf;\n \"s\": NodeListOf;\n \"samp\": NodeListOf;\n \"script\": NodeListOf;\n \"section\": NodeListOf;\n \"select\": NodeListOf;\n \"small\": NodeListOf;\n \"source\": NodeListOf;\n \"span\": NodeListOf;\n \"stop\": NodeListOf;\n \"strike\": NodeListOf;\n \"strong\": NodeListOf;\n \"style\": NodeListOf;\n \"sub\": NodeListOf;\n \"sup\": NodeListOf;\n \"svg\": NodeListOf;\n \"switch\": NodeListOf;\n \"symbol\": NodeListOf;\n \"table\": NodeListOf;\n \"tbody\": NodeListOf;\n \"td\": NodeListOf;\n \"template\": NodeListOf;\n \"text\": NodeListOf;\n \"textpath\": NodeListOf;\n \"textarea\": NodeListOf;\n \"tfoot\": NodeListOf;\n \"th\": NodeListOf;\n \"thead\": NodeListOf;\n \"time\": NodeListOf;\n \"title\": NodeListOf;\n \"tr\": NodeListOf;\n \"track\": NodeListOf;\n \"tspan\": NodeListOf;\n \"tt\": NodeListOf;\n \"u\": NodeListOf;\n \"ul\": NodeListOf;\n \"use\": NodeListOf;\n \"var\": NodeListOf;\n \"video\": NodeListOf;\n \"view\": NodeListOf;\n \"wbr\": NodeListOf;\n \"x-ms-webview\": NodeListOf;\n \"xmp\": NodeListOf;\n}\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 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;\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 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 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;\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 removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\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, useCapture?: boolean): void;\ndeclare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;\ntype AAGUID = string;\ntype AlgorithmIdentifier = string | Algorithm;\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 HeadersInit = any;\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 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 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\";\ntype PaymentComplete = \"success\" | \"fail\" | \"\";\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 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 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 * 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 (collection: any): 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: any): VBArray;\n new (safeArray: any): VBArray;\n}\n\ndeclare var VBArray: VBArrayConstructor;\n\n/**\n * Automation date (VT_DATE)\n */\ninterface VarDate { }\n\ninterface DateConstructor {\n new (vd: VarDate): Date;\n}\n\ninterface Date {\n getVarDate: () => VarDate;\n}\n"}; }); diff --git a/lib/typescriptServices.d.ts b/lib/typescriptServices.d.ts index 5b72478e..aae14b4c 100644 --- a/lib/typescriptServices.d.ts +++ b/lib/typescriptServices.d.ts @@ -14,11 +14,36 @@ and limitations under the License. ***************************************************************************** */ declare namespace ts { + /** + * Type of objects whose values are all of the same type. + * The `in` and `for-in` operators can *not* be safely used, + * since `Object.prototype` may be modified by outside code. + */ interface MapLike { [index: string]: T; } - interface Map extends MapLike { - __mapBrand: any; + /** ES6 Map interface. */ + interface Map { + get(key: string): T | undefined; + has(key: string): boolean; + set(key: string, value: T): this; + delete(key: string): boolean; + clear(): void; + forEach(action: (value: T, key: string) => void): void; + readonly size: number; + keys(): Iterator; + values(): Iterator; + entries(): Iterator<[string, T]>; + } + /** ES6 Iterator type. */ + interface Iterator { + next(): { + value: T; + done: false; + } | { + value: never; + done: true; + }; } type Path = string & { __pathBrand: any; @@ -48,322 +73,324 @@ declare namespace ts { NumericLiteral = 8, StringLiteral = 9, JsxText = 10, - RegularExpressionLiteral = 11, - NoSubstitutionTemplateLiteral = 12, - TemplateHead = 13, - TemplateMiddle = 14, - TemplateTail = 15, - OpenBraceToken = 16, - CloseBraceToken = 17, - OpenParenToken = 18, - CloseParenToken = 19, - OpenBracketToken = 20, - CloseBracketToken = 21, - DotToken = 22, - DotDotDotToken = 23, - SemicolonToken = 24, - CommaToken = 25, - LessThanToken = 26, - LessThanSlashToken = 27, - GreaterThanToken = 28, - LessThanEqualsToken = 29, - GreaterThanEqualsToken = 30, - EqualsEqualsToken = 31, - ExclamationEqualsToken = 32, - EqualsEqualsEqualsToken = 33, - ExclamationEqualsEqualsToken = 34, - EqualsGreaterThanToken = 35, - PlusToken = 36, - MinusToken = 37, - AsteriskToken = 38, - AsteriskAsteriskToken = 39, - SlashToken = 40, - PercentToken = 41, - PlusPlusToken = 42, - MinusMinusToken = 43, - LessThanLessThanToken = 44, - GreaterThanGreaterThanToken = 45, - GreaterThanGreaterThanGreaterThanToken = 46, - AmpersandToken = 47, - BarToken = 48, - CaretToken = 49, - ExclamationToken = 50, - TildeToken = 51, - AmpersandAmpersandToken = 52, - BarBarToken = 53, - QuestionToken = 54, - ColonToken = 55, - AtToken = 56, - EqualsToken = 57, - PlusEqualsToken = 58, - MinusEqualsToken = 59, - AsteriskEqualsToken = 60, - AsteriskAsteriskEqualsToken = 61, - SlashEqualsToken = 62, - PercentEqualsToken = 63, - LessThanLessThanEqualsToken = 64, - GreaterThanGreaterThanEqualsToken = 65, - GreaterThanGreaterThanGreaterThanEqualsToken = 66, - AmpersandEqualsToken = 67, - BarEqualsToken = 68, - CaretEqualsToken = 69, - Identifier = 70, - BreakKeyword = 71, - CaseKeyword = 72, - CatchKeyword = 73, - ClassKeyword = 74, - ConstKeyword = 75, - ContinueKeyword = 76, - DebuggerKeyword = 77, - DefaultKeyword = 78, - DeleteKeyword = 79, - DoKeyword = 80, - ElseKeyword = 81, - EnumKeyword = 82, - ExportKeyword = 83, - ExtendsKeyword = 84, - FalseKeyword = 85, - FinallyKeyword = 86, - ForKeyword = 87, - FunctionKeyword = 88, - IfKeyword = 89, - ImportKeyword = 90, - InKeyword = 91, - InstanceOfKeyword = 92, - NewKeyword = 93, - NullKeyword = 94, - ReturnKeyword = 95, - SuperKeyword = 96, - SwitchKeyword = 97, - ThisKeyword = 98, - ThrowKeyword = 99, - TrueKeyword = 100, - TryKeyword = 101, - TypeOfKeyword = 102, - VarKeyword = 103, - VoidKeyword = 104, - WhileKeyword = 105, - WithKeyword = 106, - ImplementsKeyword = 107, - InterfaceKeyword = 108, - LetKeyword = 109, - PackageKeyword = 110, - PrivateKeyword = 111, - ProtectedKeyword = 112, - PublicKeyword = 113, - StaticKeyword = 114, - YieldKeyword = 115, - AbstractKeyword = 116, - AsKeyword = 117, - AnyKeyword = 118, - AsyncKeyword = 119, - AwaitKeyword = 120, - BooleanKeyword = 121, - ConstructorKeyword = 122, - DeclareKeyword = 123, - GetKeyword = 124, - IsKeyword = 125, - KeyOfKeyword = 126, - ModuleKeyword = 127, - NamespaceKeyword = 128, - NeverKeyword = 129, - ReadonlyKeyword = 130, - RequireKeyword = 131, - NumberKeyword = 132, - SetKeyword = 133, - StringKeyword = 134, - SymbolKeyword = 135, - TypeKeyword = 136, - UndefinedKeyword = 137, - FromKeyword = 138, - GlobalKeyword = 139, - OfKeyword = 140, - QualifiedName = 141, - ComputedPropertyName = 142, - TypeParameter = 143, - Parameter = 144, - Decorator = 145, - PropertySignature = 146, - PropertyDeclaration = 147, - MethodSignature = 148, - MethodDeclaration = 149, - Constructor = 150, - GetAccessor = 151, - SetAccessor = 152, - CallSignature = 153, - ConstructSignature = 154, - IndexSignature = 155, - TypePredicate = 156, - TypeReference = 157, - FunctionType = 158, - ConstructorType = 159, - TypeQuery = 160, - TypeLiteral = 161, - ArrayType = 162, - TupleType = 163, - UnionType = 164, - IntersectionType = 165, - ParenthesizedType = 166, - ThisType = 167, - TypeOperator = 168, - IndexedAccessType = 169, - MappedType = 170, - LiteralType = 171, - ObjectBindingPattern = 172, - ArrayBindingPattern = 173, - BindingElement = 174, - ArrayLiteralExpression = 175, - ObjectLiteralExpression = 176, - PropertyAccessExpression = 177, - ElementAccessExpression = 178, - CallExpression = 179, - NewExpression = 180, - TaggedTemplateExpression = 181, - TypeAssertionExpression = 182, - ParenthesizedExpression = 183, - FunctionExpression = 184, - ArrowFunction = 185, - DeleteExpression = 186, - TypeOfExpression = 187, - VoidExpression = 188, - AwaitExpression = 189, - PrefixUnaryExpression = 190, - PostfixUnaryExpression = 191, - BinaryExpression = 192, - ConditionalExpression = 193, - TemplateExpression = 194, - YieldExpression = 195, - SpreadElement = 196, - ClassExpression = 197, - OmittedExpression = 198, - ExpressionWithTypeArguments = 199, - AsExpression = 200, - NonNullExpression = 201, - TemplateSpan = 202, - SemicolonClassElement = 203, - Block = 204, - VariableStatement = 205, - EmptyStatement = 206, - ExpressionStatement = 207, - IfStatement = 208, - DoStatement = 209, - WhileStatement = 210, - ForStatement = 211, - ForInStatement = 212, - ForOfStatement = 213, - ContinueStatement = 214, - BreakStatement = 215, - ReturnStatement = 216, - WithStatement = 217, - SwitchStatement = 218, - LabeledStatement = 219, - ThrowStatement = 220, - TryStatement = 221, - DebuggerStatement = 222, - VariableDeclaration = 223, - VariableDeclarationList = 224, - FunctionDeclaration = 225, - ClassDeclaration = 226, - InterfaceDeclaration = 227, - TypeAliasDeclaration = 228, - EnumDeclaration = 229, - ModuleDeclaration = 230, - ModuleBlock = 231, - CaseBlock = 232, - NamespaceExportDeclaration = 233, - ImportEqualsDeclaration = 234, - ImportDeclaration = 235, - ImportClause = 236, - NamespaceImport = 237, - NamedImports = 238, - ImportSpecifier = 239, - ExportAssignment = 240, - ExportDeclaration = 241, - NamedExports = 242, - ExportSpecifier = 243, - MissingDeclaration = 244, - ExternalModuleReference = 245, - JsxElement = 246, - JsxSelfClosingElement = 247, - JsxOpeningElement = 248, - JsxClosingElement = 249, - JsxAttribute = 250, - JsxSpreadAttribute = 251, - JsxExpression = 252, - CaseClause = 253, - DefaultClause = 254, - HeritageClause = 255, - CatchClause = 256, - PropertyAssignment = 257, - ShorthandPropertyAssignment = 258, - SpreadAssignment = 259, - EnumMember = 260, - SourceFile = 261, - JSDocTypeExpression = 262, - JSDocAllType = 263, - JSDocUnknownType = 264, - JSDocArrayType = 265, - JSDocUnionType = 266, - JSDocTupleType = 267, - JSDocNullableType = 268, - JSDocNonNullableType = 269, - JSDocRecordType = 270, - JSDocRecordMember = 271, - JSDocTypeReference = 272, - JSDocOptionalType = 273, - JSDocFunctionType = 274, - JSDocVariadicType = 275, - JSDocConstructorType = 276, - JSDocThisType = 277, - JSDocComment = 278, - JSDocTag = 279, - JSDocAugmentsTag = 280, - JSDocParameterTag = 281, - JSDocReturnTag = 282, - JSDocTypeTag = 283, - JSDocTemplateTag = 284, - JSDocTypedefTag = 285, - JSDocPropertyTag = 286, - JSDocTypeLiteral = 287, - JSDocLiteralType = 288, - JSDocNullKeyword = 289, - JSDocUndefinedKeyword = 290, - JSDocNeverKeyword = 291, - SyntaxList = 292, - NotEmittedStatement = 293, - PartiallyEmittedExpression = 294, - MergeDeclarationMarker = 295, - EndOfDeclarationMarker = 296, - Count = 297, - FirstAssignment = 57, - LastAssignment = 69, - FirstCompoundAssignment = 58, - LastCompoundAssignment = 69, - FirstReservedWord = 71, - LastReservedWord = 106, - FirstKeyword = 71, - LastKeyword = 140, - FirstFutureReservedWord = 107, - LastFutureReservedWord = 115, - FirstTypeNode = 156, - LastTypeNode = 171, - FirstPunctuation = 16, - LastPunctuation = 69, + JsxTextAllWhiteSpaces = 11, + RegularExpressionLiteral = 12, + NoSubstitutionTemplateLiteral = 13, + TemplateHead = 14, + TemplateMiddle = 15, + TemplateTail = 16, + OpenBraceToken = 17, + CloseBraceToken = 18, + OpenParenToken = 19, + CloseParenToken = 20, + OpenBracketToken = 21, + CloseBracketToken = 22, + DotToken = 23, + DotDotDotToken = 24, + SemicolonToken = 25, + CommaToken = 26, + LessThanToken = 27, + LessThanSlashToken = 28, + GreaterThanToken = 29, + LessThanEqualsToken = 30, + GreaterThanEqualsToken = 31, + EqualsEqualsToken = 32, + ExclamationEqualsToken = 33, + EqualsEqualsEqualsToken = 34, + ExclamationEqualsEqualsToken = 35, + EqualsGreaterThanToken = 36, + PlusToken = 37, + MinusToken = 38, + AsteriskToken = 39, + AsteriskAsteriskToken = 40, + SlashToken = 41, + PercentToken = 42, + PlusPlusToken = 43, + MinusMinusToken = 44, + LessThanLessThanToken = 45, + GreaterThanGreaterThanToken = 46, + GreaterThanGreaterThanGreaterThanToken = 47, + AmpersandToken = 48, + BarToken = 49, + CaretToken = 50, + ExclamationToken = 51, + TildeToken = 52, + AmpersandAmpersandToken = 53, + BarBarToken = 54, + QuestionToken = 55, + ColonToken = 56, + AtToken = 57, + EqualsToken = 58, + PlusEqualsToken = 59, + MinusEqualsToken = 60, + AsteriskEqualsToken = 61, + AsteriskAsteriskEqualsToken = 62, + SlashEqualsToken = 63, + PercentEqualsToken = 64, + LessThanLessThanEqualsToken = 65, + GreaterThanGreaterThanEqualsToken = 66, + GreaterThanGreaterThanGreaterThanEqualsToken = 67, + AmpersandEqualsToken = 68, + BarEqualsToken = 69, + CaretEqualsToken = 70, + Identifier = 71, + BreakKeyword = 72, + CaseKeyword = 73, + CatchKeyword = 74, + ClassKeyword = 75, + ConstKeyword = 76, + ContinueKeyword = 77, + DebuggerKeyword = 78, + DefaultKeyword = 79, + DeleteKeyword = 80, + DoKeyword = 81, + ElseKeyword = 82, + EnumKeyword = 83, + ExportKeyword = 84, + ExtendsKeyword = 85, + FalseKeyword = 86, + FinallyKeyword = 87, + ForKeyword = 88, + FunctionKeyword = 89, + IfKeyword = 90, + ImportKeyword = 91, + InKeyword = 92, + InstanceOfKeyword = 93, + NewKeyword = 94, + NullKeyword = 95, + ReturnKeyword = 96, + SuperKeyword = 97, + SwitchKeyword = 98, + ThisKeyword = 99, + ThrowKeyword = 100, + TrueKeyword = 101, + TryKeyword = 102, + TypeOfKeyword = 103, + VarKeyword = 104, + VoidKeyword = 105, + WhileKeyword = 106, + WithKeyword = 107, + ImplementsKeyword = 108, + InterfaceKeyword = 109, + LetKeyword = 110, + PackageKeyword = 111, + PrivateKeyword = 112, + ProtectedKeyword = 113, + PublicKeyword = 114, + StaticKeyword = 115, + YieldKeyword = 116, + AbstractKeyword = 117, + AsKeyword = 118, + AnyKeyword = 119, + AsyncKeyword = 120, + AwaitKeyword = 121, + BooleanKeyword = 122, + 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, + FromKeyword = 140, + GlobalKeyword = 141, + OfKeyword = 142, + QualifiedName = 143, + ComputedPropertyName = 144, + TypeParameter = 145, + Parameter = 146, + Decorator = 147, + PropertySignature = 148, + PropertyDeclaration = 149, + MethodSignature = 150, + MethodDeclaration = 151, + Constructor = 152, + GetAccessor = 153, + SetAccessor = 154, + CallSignature = 155, + ConstructSignature = 156, + IndexSignature = 157, + TypePredicate = 158, + TypeReference = 159, + FunctionType = 160, + ConstructorType = 161, + TypeQuery = 162, + TypeLiteral = 163, + ArrayType = 164, + TupleType = 165, + UnionType = 166, + IntersectionType = 167, + ParenthesizedType = 168, + ThisType = 169, + TypeOperator = 170, + IndexedAccessType = 171, + MappedType = 172, + LiteralType = 173, + ObjectBindingPattern = 174, + ArrayBindingPattern = 175, + BindingElement = 176, + ArrayLiteralExpression = 177, + ObjectLiteralExpression = 178, + PropertyAccessExpression = 179, + ElementAccessExpression = 180, + CallExpression = 181, + NewExpression = 182, + TaggedTemplateExpression = 183, + TypeAssertionExpression = 184, + ParenthesizedExpression = 185, + FunctionExpression = 186, + ArrowFunction = 187, + DeleteExpression = 188, + TypeOfExpression = 189, + VoidExpression = 190, + AwaitExpression = 191, + PrefixUnaryExpression = 192, + PostfixUnaryExpression = 193, + BinaryExpression = 194, + ConditionalExpression = 195, + TemplateExpression = 196, + YieldExpression = 197, + SpreadElement = 198, + ClassExpression = 199, + OmittedExpression = 200, + ExpressionWithTypeArguments = 201, + AsExpression = 202, + NonNullExpression = 203, + MetaProperty = 204, + TemplateSpan = 205, + SemicolonClassElement = 206, + Block = 207, + VariableStatement = 208, + EmptyStatement = 209, + ExpressionStatement = 210, + IfStatement = 211, + DoStatement = 212, + WhileStatement = 213, + ForStatement = 214, + ForInStatement = 215, + ForOfStatement = 216, + ContinueStatement = 217, + BreakStatement = 218, + ReturnStatement = 219, + WithStatement = 220, + SwitchStatement = 221, + LabeledStatement = 222, + ThrowStatement = 223, + TryStatement = 224, + DebuggerStatement = 225, + VariableDeclaration = 226, + VariableDeclarationList = 227, + FunctionDeclaration = 228, + ClassDeclaration = 229, + InterfaceDeclaration = 230, + TypeAliasDeclaration = 231, + EnumDeclaration = 232, + ModuleDeclaration = 233, + ModuleBlock = 234, + CaseBlock = 235, + NamespaceExportDeclaration = 236, + ImportEqualsDeclaration = 237, + ImportDeclaration = 238, + ImportClause = 239, + NamespaceImport = 240, + NamedImports = 241, + ImportSpecifier = 242, + ExportAssignment = 243, + ExportDeclaration = 244, + NamedExports = 245, + ExportSpecifier = 246, + MissingDeclaration = 247, + ExternalModuleReference = 248, + JsxElement = 249, + JsxSelfClosingElement = 250, + JsxOpeningElement = 251, + JsxClosingElement = 252, + JsxAttribute = 253, + JsxAttributes = 254, + JsxSpreadAttribute = 255, + JsxExpression = 256, + CaseClause = 257, + DefaultClause = 258, + HeritageClause = 259, + CatchClause = 260, + PropertyAssignment = 261, + ShorthandPropertyAssignment = 262, + SpreadAssignment = 263, + EnumMember = 264, + SourceFile = 265, + Bundle = 266, + JSDocTypeExpression = 267, + JSDocAllType = 268, + JSDocUnknownType = 269, + JSDocArrayType = 270, + JSDocUnionType = 271, + JSDocTupleType = 272, + JSDocNullableType = 273, + JSDocNonNullableType = 274, + JSDocRecordType = 275, + JSDocRecordMember = 276, + JSDocTypeReference = 277, + JSDocOptionalType = 278, + JSDocFunctionType = 279, + JSDocVariadicType = 280, + JSDocConstructorType = 281, + JSDocThisType = 282, + JSDocComment = 283, + JSDocTag = 284, + JSDocAugmentsTag = 285, + JSDocParameterTag = 286, + JSDocReturnTag = 287, + JSDocTypeTag = 288, + JSDocTemplateTag = 289, + JSDocTypedefTag = 290, + JSDocPropertyTag = 291, + JSDocTypeLiteral = 292, + JSDocLiteralType = 293, + SyntaxList = 294, + NotEmittedStatement = 295, + PartiallyEmittedExpression = 296, + MergeDeclarationMarker = 297, + EndOfDeclarationMarker = 298, + Count = 299, + FirstAssignment = 58, + LastAssignment = 70, + FirstCompoundAssignment = 59, + LastCompoundAssignment = 70, + FirstReservedWord = 72, + LastReservedWord = 107, + FirstKeyword = 72, + LastKeyword = 142, + FirstFutureReservedWord = 108, + LastFutureReservedWord = 116, + FirstTypeNode = 158, + LastTypeNode = 173, + FirstPunctuation = 17, + LastPunctuation = 70, FirstToken = 0, - LastToken = 140, + LastToken = 142, FirstTriviaToken = 2, LastTriviaToken = 7, FirstLiteralToken = 8, - LastLiteralToken = 12, - FirstTemplateToken = 12, - LastTemplateToken = 15, - FirstBinaryOperator = 26, - LastBinaryOperator = 69, - FirstNode = 141, - FirstJSDocNode = 262, - LastJSDocNode = 288, - FirstJSDocTagNode = 278, - LastJSDocTagNode = 291, + LastLiteralToken = 13, + FirstTemplateToken = 13, + LastTemplateToken = 16, + FirstBinaryOperator = 27, + LastBinaryOperator = 70, + FirstNode = 143, + FirstJSDocNode = 267, + LastJSDocNode = 293, + FirstJSDocTagNode = 283, + LastJSDocTagNode = 293, } enum NodeFlags { None = 0, @@ -442,6 +469,7 @@ declare namespace ts { type EndOfFileToken = Token; type AtToken = Token; type ReadonlyToken = Token; + type AwaitKeywordToken = Token; type Modifier = Token | Token | Token | Token | Token | Token | Token | Token | Token | Token | Token; type ModifiersArray = NodeArray; interface Identifier extends PrimaryExpression { @@ -465,7 +493,10 @@ declare namespace ts { _declarationBrand: any; name?: DeclarationName; } - interface DeclarationStatement extends Declaration, Statement { + interface NamedDeclaration extends Declaration { + name?: DeclarationName; + } + interface DeclarationStatement extends NamedDeclaration, Statement { name?: Identifier | StringLiteral | NumericLiteral; } interface ComputedPropertyName extends Node { @@ -476,13 +507,15 @@ declare namespace ts { kind: SyntaxKind.Decorator; expression: LeftHandSideExpression; } - interface TypeParameterDeclaration extends Declaration { + interface TypeParameterDeclaration extends NamedDeclaration { kind: SyntaxKind.TypeParameter; + parent?: DeclarationWithTypeParameters; name: Identifier; constraint?: TypeNode; + default?: TypeNode; expression?: Expression; } - interface SignatureDeclaration extends Declaration { + interface SignatureDeclaration extends NamedDeclaration { name?: PropertyName; typeParameters?: NodeArray; parameters: NodeArray; @@ -495,27 +528,30 @@ declare namespace ts { kind: SyntaxKind.ConstructSignature; } type BindingName = Identifier | BindingPattern; - interface VariableDeclaration extends Declaration { + interface VariableDeclaration extends NamedDeclaration { kind: SyntaxKind.VariableDeclaration; - parent?: VariableDeclarationList; + parent?: VariableDeclarationList | CatchClause; name: BindingName; type?: TypeNode; initializer?: Expression; } interface VariableDeclarationList extends Node { kind: SyntaxKind.VariableDeclarationList; + parent?: VariableStatement | ForStatement | ForOfStatement | ForInStatement; declarations: NodeArray; } - interface ParameterDeclaration extends Declaration { + interface ParameterDeclaration extends NamedDeclaration { kind: SyntaxKind.Parameter; + parent?: SignatureDeclaration; dotDotDotToken?: DotDotDotToken; name: BindingName; questionToken?: QuestionToken; type?: TypeNode; initializer?: Expression; } - interface BindingElement extends Declaration { + interface BindingElement extends NamedDeclaration { kind: SyntaxKind.BindingElement; + parent?: BindingPattern; propertyName?: PropertyName; dotDotDotToken?: DotDotDotToken; name: BindingName; @@ -535,11 +571,11 @@ declare namespace ts { type?: TypeNode; initializer?: Expression; } - interface ObjectLiteralElement extends Declaration { + interface ObjectLiteralElement extends NamedDeclaration { _objectLiteralBrandBrand: any; name?: PropertyName; } - type ObjectLiteralElementLike = PropertyAssignment | ShorthandPropertyAssignment | MethodDeclaration | AccessorDeclaration | SpreadAssignment; + type ObjectLiteralElementLike = PropertyAssignment | ShorthandPropertyAssignment | SpreadAssignment | MethodDeclaration | AccessorDeclaration; interface PropertyAssignment extends ObjectLiteralElement { kind: SyntaxKind.PropertyAssignment; name: PropertyName; @@ -557,7 +593,7 @@ declare namespace ts { kind: SyntaxKind.SpreadAssignment; expression: Expression; } - interface VariableLikeDeclaration extends Declaration { + interface VariableLikeDeclaration extends NamedDeclaration { propertyName?: PropertyName; dotDotDotToken?: DotDotDotToken; name: DeclarationName; @@ -565,15 +601,17 @@ declare namespace ts { type?: TypeNode; initializer?: Expression; } - interface PropertyLikeDeclaration extends Declaration { + interface PropertyLikeDeclaration extends NamedDeclaration { name: PropertyName; } interface ObjectBindingPattern extends Node { kind: SyntaxKind.ObjectBindingPattern; + parent?: VariableDeclaration | ParameterDeclaration | BindingElement; elements: NodeArray; } interface ArrayBindingPattern extends Node { kind: SyntaxKind.ArrayBindingPattern; + parent?: VariableDeclaration | ParameterDeclaration | BindingElement; elements: NodeArray; } type BindingPattern = ObjectBindingPattern | ArrayBindingPattern; @@ -608,41 +646,45 @@ declare namespace ts { } interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement { kind: SyntaxKind.Constructor; + parent?: ClassDeclaration | ClassExpression; body?: FunctionBody; } + /** For when we encounter a semicolon in a class declaration. ES6 allows these as class elements. */ interface SemicolonClassElement extends ClassElement { kind: SyntaxKind.SemicolonClassElement; + parent?: ClassDeclaration | ClassExpression; } interface GetAccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { kind: SyntaxKind.GetAccessor; + parent?: ClassDeclaration | ClassExpression | ObjectLiteralExpression; name: PropertyName; body: FunctionBody; } interface SetAccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { kind: SyntaxKind.SetAccessor; + parent?: ClassDeclaration | ClassExpression | ObjectLiteralExpression; name: PropertyName; body: FunctionBody; } type AccessorDeclaration = GetAccessorDeclaration | SetAccessorDeclaration; interface IndexSignatureDeclaration extends SignatureDeclaration, ClassElement, TypeElement { kind: SyntaxKind.IndexSignature; + parent?: ClassDeclaration | ClassExpression | InterfaceDeclaration | TypeLiteralNode; } interface TypeNode extends Node { _typeNodeBrand: any; } interface KeywordTypeNode extends TypeNode { - kind: SyntaxKind.AnyKeyword | SyntaxKind.NumberKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.VoidKeyword; + kind: SyntaxKind.AnyKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.VoidKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.NullKeyword | SyntaxKind.NeverKeyword; } interface ThisTypeNode extends TypeNode { kind: SyntaxKind.ThisType; } - interface FunctionOrConstructorTypeNode extends TypeNode, SignatureDeclaration { - kind: SyntaxKind.FunctionType | SyntaxKind.ConstructorType; - } - interface FunctionTypeNode extends FunctionOrConstructorTypeNode { + type FunctionOrConstructorTypeNode = FunctionTypeNode | ConstructorTypeNode; + interface FunctionTypeNode extends TypeNode, SignatureDeclaration { kind: SyntaxKind.FunctionType; } - interface ConstructorTypeNode extends FunctionOrConstructorTypeNode { + interface ConstructorTypeNode extends TypeNode, SignatureDeclaration { kind: SyntaxKind.ConstructorType; } interface TypeReferenceNode extends TypeNode { @@ -671,15 +713,14 @@ declare namespace ts { kind: SyntaxKind.TupleType; elementTypes: NodeArray; } - interface UnionOrIntersectionTypeNode extends TypeNode { - kind: SyntaxKind.UnionType | SyntaxKind.IntersectionType; + type UnionOrIntersectionTypeNode = UnionTypeNode | IntersectionTypeNode; + interface UnionTypeNode extends TypeNode { + kind: SyntaxKind.UnionType; types: NodeArray; } - interface UnionTypeNode extends UnionOrIntersectionTypeNode { - kind: SyntaxKind.UnionType; - } - interface IntersectionTypeNode extends UnionOrIntersectionTypeNode { + interface IntersectionTypeNode extends TypeNode { kind: SyntaxKind.IntersectionType; + types: NodeArray; } interface ParenthesizedTypeNode extends TypeNode { kind: SyntaxKind.ParenthesizedType; @@ -697,6 +738,7 @@ declare namespace ts { } interface MappedTypeNode extends TypeNode, Declaration { kind: SyntaxKind.MappedType; + parent?: TypeAliasDeclaration; readonlyToken?: ReadonlyToken; typeParameter: TypeParameterDeclaration; questionToken?: QuestionToken; @@ -711,11 +753,14 @@ declare namespace ts { } interface Expression extends Node { _expressionBrand: any; - contextualType?: Type; } interface OmittedExpression extends Expression { kind: SyntaxKind.OmittedExpression; } + interface PartiallyEmittedExpression extends LeftHandSideExpression { + kind: SyntaxKind.PartiallyEmittedExpression; + expression: Expression; + } interface UnaryExpression extends Expression { _unaryExpressionBrand: any; } @@ -743,13 +788,13 @@ declare namespace ts { interface PrimaryExpression extends MemberExpression { _primaryExpressionBrand: any; } - interface NullLiteral extends PrimaryExpression { + interface NullLiteral extends PrimaryExpression, TypeNode { kind: SyntaxKind.NullKeyword; } - interface BooleanLiteral extends PrimaryExpression { + interface BooleanLiteral extends PrimaryExpression, TypeNode { kind: SyntaxKind.TrueKeyword | SyntaxKind.FalseKeyword; } - interface ThisExpression extends PrimaryExpression { + interface ThisExpression extends PrimaryExpression, KeywordTypeNode { kind: SyntaxKind.ThisKeyword; } interface SuperExpression extends PrimaryExpression { @@ -857,16 +902,18 @@ declare namespace ts { } interface NumericLiteral extends LiteralExpression { kind: SyntaxKind.NumericLiteral; - trailingComment?: string; } interface TemplateHead extends LiteralLikeNode { kind: SyntaxKind.TemplateHead; + parent?: TemplateExpression; } interface TemplateMiddle extends LiteralLikeNode { kind: SyntaxKind.TemplateMiddle; + parent?: TemplateSpan; } interface TemplateTail extends LiteralLikeNode { kind: SyntaxKind.TemplateTail; + parent?: TemplateSpan; } type TemplateLiteral = TemplateExpression | NoSubstitutionTemplateLiteral; interface TemplateExpression extends PrimaryExpression { @@ -876,6 +923,7 @@ declare namespace ts { } interface TemplateSpan extends Node { kind: SyntaxKind.TemplateSpan; + parent?: TemplateExpression; expression: Expression; literal: TemplateMiddle | TemplateTail; } @@ -892,20 +940,20 @@ declare namespace ts { expression: Expression; } /** - * This interface is a base interface for ObjectLiteralExpression and JSXAttributes to extend from. JSXAttributes is similar to - * ObjectLiteralExpression in that it contains array of properties; however, JSXAttributes' properties can only be - * JSXAttribute or JSXSpreadAttribute. ObjectLiteralExpression, on the other hand, can only have properties of type - * ObjectLiteralElement (e.g. PropertyAssignment, ShorthandPropertyAssignment etc.) - **/ + * This interface is a base interface for ObjectLiteralExpression and JSXAttributes to extend from. JSXAttributes is similar to + * ObjectLiteralExpression in that it contains array of properties; however, JSXAttributes' properties can only be + * JSXAttribute or JSXSpreadAttribute. ObjectLiteralExpression, on the other hand, can only have properties of type + * ObjectLiteralElement (e.g. PropertyAssignment, ShorthandPropertyAssignment etc.) + */ interface ObjectLiteralExpressionBase extends PrimaryExpression, Declaration { properties: NodeArray; } interface ObjectLiteralExpression extends ObjectLiteralExpressionBase { kind: SyntaxKind.ObjectLiteralExpression; } - type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression; + type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression | ParenthesizedExpression; type EntityNameOrEntityNameExpression = EntityName | EntityNameExpression; - interface PropertyAccessExpression extends MemberExpression, Declaration { + interface PropertyAccessExpression extends MemberExpression, NamedDeclaration { kind: SyntaxKind.PropertyAccessExpression; expression: LeftHandSideExpression; name: Identifier; @@ -938,6 +986,7 @@ declare namespace ts { } interface ExpressionWithTypeArguments extends TypeNode { kind: SyntaxKind.ExpressionWithTypeArguments; + parent?: HeritageClause; expression: LeftHandSideExpression; typeArguments?: NodeArray; } @@ -945,14 +994,14 @@ declare namespace ts { kind: SyntaxKind.NewExpression; expression: LeftHandSideExpression; typeArguments?: NodeArray; - arguments: NodeArray; + arguments?: NodeArray; } interface TaggedTemplateExpression extends MemberExpression { kind: SyntaxKind.TaggedTemplateExpression; tag: LeftHandSideExpression; template: TemplateLiteral; } - type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression | Decorator; + type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression | Decorator | JsxOpeningLikeElement; interface AsExpression extends Expression { kind: SyntaxKind.AsExpression; expression: Expression; @@ -968,49 +1017,68 @@ declare namespace ts { kind: SyntaxKind.NonNullExpression; expression: Expression; } + interface MetaProperty extends PrimaryExpression { + kind: SyntaxKind.MetaProperty; + keywordToken: SyntaxKind; + name: Identifier; + } interface JsxElement extends PrimaryExpression { kind: SyntaxKind.JsxElement; openingElement: JsxOpeningElement; children: NodeArray; closingElement: JsxClosingElement; } + type JsxOpeningLikeElement = JsxSelfClosingElement | JsxOpeningElement; + type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute; type JsxTagNameExpression = PrimaryExpression | PropertyAccessExpression; + interface JsxAttributes extends ObjectLiteralExpressionBase { + parent?: JsxOpeningLikeElement; + } interface JsxOpeningElement extends Expression { kind: SyntaxKind.JsxOpeningElement; + parent?: JsxElement; tagName: JsxTagNameExpression; - attributes: NodeArray; + attributes: JsxAttributes; } interface JsxSelfClosingElement extends PrimaryExpression { kind: SyntaxKind.JsxSelfClosingElement; tagName: JsxTagNameExpression; - attributes: NodeArray; + attributes: JsxAttributes; } - type JsxOpeningLikeElement = JsxSelfClosingElement | JsxOpeningElement; - type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute; - interface JsxAttribute extends Node { + interface JsxAttribute extends ObjectLiteralElement { kind: SyntaxKind.JsxAttribute; + parent?: JsxAttributes; name: Identifier; initializer?: StringLiteral | JsxExpression; } - interface JsxSpreadAttribute extends Node { + interface JsxSpreadAttribute extends ObjectLiteralElement { kind: SyntaxKind.JsxSpreadAttribute; + parent?: JsxAttributes; expression: Expression; } interface JsxClosingElement extends Node { kind: SyntaxKind.JsxClosingElement; + parent?: JsxElement; tagName: JsxTagNameExpression; } interface JsxExpression extends Expression { kind: SyntaxKind.JsxExpression; + parent?: JsxElement | JsxAttributeLike; + dotDotDotToken?: Token; expression?: Expression; } interface JsxText extends Node { kind: SyntaxKind.JsxText; + containsOnlyWhiteSpaces: boolean; + parent?: JsxElement; } type JsxChild = JsxText | JsxExpression | JsxElement | JsxSelfClosingElement; interface Statement extends Node { _statementBrand: any; } + interface NotEmittedStatement extends Statement { + kind: SyntaxKind.NotEmittedStatement; + } interface EmptyStatement extends Statement { kind: SyntaxKind.EmptyStatement; } @@ -1021,7 +1089,7 @@ declare namespace ts { kind: SyntaxKind.MissingDeclaration; name?: Identifier; } - type BlockLike = SourceFile | Block | ModuleBlock | CaseClause; + type BlockLike = SourceFile | Block | ModuleBlock | CaseOrDefaultClause; interface Block extends Statement { kind: SyntaxKind.Block; statements: NodeArray; @@ -1065,6 +1133,7 @@ declare namespace ts { } interface ForOfStatement extends IterationStatement { kind: SyntaxKind.ForOfStatement; + awaitModifier?: AwaitKeywordToken; initializer: ForInitializer; expression: Expression; } @@ -1094,15 +1163,18 @@ declare namespace ts { } interface CaseBlock extends Node { kind: SyntaxKind.CaseBlock; + parent?: SwitchStatement; clauses: NodeArray; } interface CaseClause extends Node { kind: SyntaxKind.CaseClause; + parent?: CaseBlock; expression: Expression; statements: NodeArray; } interface DefaultClause extends Node { kind: SyntaxKind.DefaultClause; + parent?: CaseBlock; statements: NodeArray; } type CaseOrDefaultClause = CaseClause | DefaultClause; @@ -1123,11 +1195,12 @@ declare namespace ts { } interface CatchClause extends Node { kind: SyntaxKind.CatchClause; + parent?: TryStatement; variableDeclaration: VariableDeclaration; block: Block; } type DeclarationWithTypeParameters = SignatureDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration; - interface ClassLikeDeclaration extends Declaration { + interface ClassLikeDeclaration extends NamedDeclaration { name?: Identifier; typeParameters?: NodeArray; heritageClauses?: NodeArray; @@ -1140,11 +1213,11 @@ declare namespace ts { interface ClassExpression extends ClassLikeDeclaration, PrimaryExpression { kind: SyntaxKind.ClassExpression; } - interface ClassElement extends Declaration { + interface ClassElement extends NamedDeclaration { _classElementBrand: any; name?: PropertyName; } - interface TypeElement extends Declaration { + interface TypeElement extends NamedDeclaration { _typeElementBrand: any; name?: PropertyName; questionToken?: QuestionToken; @@ -1158,8 +1231,9 @@ declare namespace ts { } interface HeritageClause extends Node { kind: SyntaxKind.HeritageClause; - token: SyntaxKind; - types?: NodeArray; + parent?: InterfaceDeclaration | ClassDeclaration | ClassExpression; + token: SyntaxKind.ExtendsKeyword | SyntaxKind.ImplementsKeyword; + types: NodeArray; } interface TypeAliasDeclaration extends DeclarationStatement { kind: SyntaxKind.TypeAliasDeclaration; @@ -1167,8 +1241,9 @@ declare namespace ts { typeParameters?: NodeArray; type: TypeNode; } - interface EnumMember extends Declaration { + interface EnumMember extends NamedDeclaration { kind: SyntaxKind.EnumMember; + parent?: EnumDeclaration; name: PropertyName; initializer?: Expression; } @@ -1177,91 +1252,121 @@ declare namespace ts { name: Identifier; members: NodeArray; } - type ModuleBody = ModuleBlock | ModuleDeclaration; type ModuleName = Identifier | StringLiteral; + type ModuleBody = NamespaceBody | JSDocNamespaceBody; interface ModuleDeclaration extends DeclarationStatement { kind: SyntaxKind.ModuleDeclaration; - name: Identifier | StringLiteral; - body?: ModuleBlock | NamespaceDeclaration | JSDocNamespaceDeclaration | Identifier; + parent?: ModuleBody | SourceFile; + name: ModuleName; + body?: ModuleBody | JSDocNamespaceDeclaration; } + type NamespaceBody = ModuleBlock | NamespaceDeclaration; interface NamespaceDeclaration extends ModuleDeclaration { name: Identifier; - body: ModuleBlock | NamespaceDeclaration; + body: NamespaceBody; } + type JSDocNamespaceBody = Identifier | JSDocNamespaceDeclaration; interface JSDocNamespaceDeclaration extends ModuleDeclaration { name: Identifier; - body: JSDocNamespaceDeclaration | Identifier; + body: JSDocNamespaceBody; } interface ModuleBlock extends Node, Statement { kind: SyntaxKind.ModuleBlock; + parent?: ModuleDeclaration; statements: NodeArray; } type ModuleReference = EntityName | ExternalModuleReference; + /** + * One of: + * - import x = require("mod"); + * - import x = M.x; + */ interface ImportEqualsDeclaration extends DeclarationStatement { kind: SyntaxKind.ImportEqualsDeclaration; + parent?: SourceFile | ModuleBlock; name: Identifier; moduleReference: ModuleReference; } interface ExternalModuleReference extends Node { kind: SyntaxKind.ExternalModuleReference; + parent?: ImportEqualsDeclaration; expression?: Expression; } interface ImportDeclaration extends Statement { kind: SyntaxKind.ImportDeclaration; + parent?: SourceFile | ModuleBlock; importClause?: ImportClause; + /** If this is not a StringLiteral it will be a grammar error. */ moduleSpecifier: Expression; } type NamedImportBindings = NamespaceImport | NamedImports; - interface ImportClause extends Declaration { + interface ImportClause extends NamedDeclaration { kind: SyntaxKind.ImportClause; + parent?: ImportDeclaration; name?: Identifier; namedBindings?: NamedImportBindings; } - interface NamespaceImport extends Declaration { + interface NamespaceImport extends NamedDeclaration { kind: SyntaxKind.NamespaceImport; + parent?: ImportClause; name: Identifier; } interface NamespaceExportDeclaration extends DeclarationStatement { kind: SyntaxKind.NamespaceExportDeclaration; name: Identifier; - moduleReference: LiteralLikeNode; } interface ExportDeclaration extends DeclarationStatement { kind: SyntaxKind.ExportDeclaration; + parent?: SourceFile | ModuleBlock; exportClause?: NamedExports; + /** If this is not a StringLiteral it will be a grammar error. */ moduleSpecifier?: Expression; } interface NamedImports extends Node { kind: SyntaxKind.NamedImports; + parent?: ImportClause; elements: NodeArray; } interface NamedExports extends Node { kind: SyntaxKind.NamedExports; + parent?: ExportDeclaration; elements: NodeArray; } type NamedImportsOrExports = NamedImports | NamedExports; - interface ImportSpecifier extends Declaration { + interface ImportSpecifier extends NamedDeclaration { kind: SyntaxKind.ImportSpecifier; + parent?: NamedImports; propertyName?: Identifier; name: Identifier; } - interface ExportSpecifier extends Declaration { + interface ExportSpecifier extends NamedDeclaration { kind: SyntaxKind.ExportSpecifier; + parent?: NamedExports; propertyName?: Identifier; name: Identifier; } type ImportOrExportSpecifier = ImportSpecifier | ExportSpecifier; interface ExportAssignment extends DeclarationStatement { kind: SyntaxKind.ExportAssignment; + parent?: SourceFile; isExportEquals?: boolean; expression: Expression; } interface FileReference extends TextRange { fileName: string; } + interface CheckJsDirective extends TextRange { + enabled: boolean; + } + type CommentKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia; interface CommentRange extends TextRange { hasTrailingNewLine?: boolean; - kind: SyntaxKind; + kind: CommentKind; + } + interface SynthesizedComment extends CommentRange { + text: string; + pos: -1; + end: -1; } interface JSDocTypeExpression extends Node { kind: SyntaxKind.JSDocTypeExpression; @@ -1365,7 +1470,7 @@ declare namespace ts { kind: SyntaxKind.JSDocTypeTag; typeExpression: JSDocTypeExpression; } - interface JSDocTypedefTag extends JSDocTag, Declaration { + interface JSDocTypedefTag extends JSDocTag, NamedDeclaration { kind: SyntaxKind.JSDocTypedefTag; fullName?: JSDocNamespaceDeclaration | Identifier; name?: Identifier; @@ -1405,9 +1510,21 @@ declare namespace ts { ArrayMutation = 256, Referenced = 512, Shared = 1024, + PreFinally = 2048, + AfterFinally = 4096, Label = 12, Condition = 96, } + interface FlowLock { + locked?: boolean; + } + interface AfterFinallyFlow extends FlowNode, FlowLock { + antecedent: FlowNode; + } + interface PreFinallyFlow extends FlowNode { + antecedent: FlowNode; + lock: FlowLock; + } interface FlowNode { flags: FlowFlags; id?: number; @@ -1450,7 +1567,6 @@ declare namespace ts { statements: NodeArray; endOfFileToken: Token; fileName: string; - path: Path; text: string; amdDependencies: AmdDependency[]; moduleName: string; @@ -1469,6 +1585,10 @@ declare namespace ts { hasNoDefaultLib: boolean; languageVersion: ScriptTarget; } + interface Bundle extends Node { + kind: SyntaxKind.Bundle; + sourceFiles: SourceFile[]; + } interface ScriptReferenceHost { getCompilerOptions(): CompilerOptions; getSourceFile(fileName: string): SourceFile; @@ -1479,9 +1599,9 @@ declare namespace ts { useCaseSensitiveFileNames: boolean; readDirectory(rootDir: string, extensions: string[], excludes: string[], includes: string[]): string[]; /** - * Gets a value indicating whether the specified path exists and is a file. - * @param path The path to test. - */ + * Gets a value indicating whether the specified path exists and is a file. + * @param path The path to test. + */ fileExists(path: string): boolean; readFile(path: string): string; } @@ -1514,7 +1634,7 @@ declare namespace ts { * used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter * will be invoked when writing the JavaScript and declaration files. */ - emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean): EmitResult; + emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult; getOptionsDiagnostics(cancellationToken?: CancellationToken): Diagnostic[]; getGlobalDiagnostics(cancellationToken?: CancellationToken): Diagnostic[]; getSyntacticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[]; @@ -1525,6 +1645,12 @@ declare namespace ts { */ getTypeChecker(): TypeChecker; } + interface CustomTransformers { + /** Custom transformers to evaluate before built-in transformations. */ + before?: TransformerFactory[]; + /** Custom transformers to evaluate after built-in transformations. */ + after?: TransformerFactory[]; + } interface SourceMapSpan { /** Line number in the .js file. */ emittedLine: number; @@ -1568,11 +1694,20 @@ declare namespace ts { getDeclaredTypeOfSymbol(symbol: Symbol): Type; getPropertiesOfType(type: Type): Symbol[]; getPropertyOfType(type: Type, propertyName: string): Symbol; + getIndexInfoOfType(type: Type, kind: IndexKind): IndexInfo; getSignaturesOfType(type: Type, kind: SignatureKind): Signature[]; getIndexTypeOfType(type: Type, kind: IndexKind): Type; - getBaseTypes(type: InterfaceType): ObjectType[]; + getBaseTypes(type: InterfaceType): BaseType[]; + getBaseTypeOfLiteralType(type: Type): Type; + getWidenedType(type: Type): Type; getReturnTypeOfSignature(signature: Signature): Type; getNonNullableType(type: Type): Type; + /** 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; + /** Note that the resulting nodes cannot be checked. */ + indexInfoToIndexSignatureDeclaration(indexInfo: IndexInfo, kind: IndexKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): IndexSignatureDeclaration; getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; getSymbolAtLocation(node: Node): Symbol; getSymbolsOfParameterPropertyDeclaration(parameter: ParameterDeclaration, parameterName: string): Symbol[]; @@ -1580,6 +1715,8 @@ declare namespace ts { getExportSpecifierLocalTargetSymbol(location: ExportSpecifier): Symbol; getPropertySymbolOfDestructuringAssignment(location: Identifier): Symbol; getTypeAtLocation(node: Node): Type; + getTypeFromTypeNode(node: TypeNode): Type; + signatureToString(signature: Signature, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): string; typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; getSymbolDisplayBuilder(): SymbolDisplayBuilder; @@ -1595,18 +1732,30 @@ declare namespace ts { isUnknownSymbol(symbol: Symbol): boolean; getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean; + /** Follow all aliases to get the original symbol. */ getAliasedSymbol(symbol: Symbol): Symbol; getExportsOfModule(moduleSymbol: Symbol): Symbol[]; - getJsxElementAttributesType(elementNode: JsxOpeningLikeElement): Type; + getAllAttributesTypeFromJsxOpeningLikeElement(elementNode: JsxOpeningLikeElement): Type; getJsxIntrinsicTagNames(): Symbol[]; isOptionalParameter(node: ParameterDeclaration): boolean; getAmbientModules(): Symbol[]; tryGetMemberInModuleExports(memberName: string, moduleSymbol: Symbol): Symbol | undefined; + getApparentType(type: Type): Type; + } + enum NodeBuilderFlags { + None = 0, + allowThisInObjectLiteral = 1, + allowQualifedNameInPlaceOfIdentifier = 2, + allowTypeParameterInQualifiedName = 4, + allowAnonymousIdentifier = 8, + allowEmptyUnionOrIntersection = 16, + allowEmptyTuple = 32, } interface SymbolDisplayBuilder { buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void; buildSignatureDisplay(signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): void; + buildIndexSignatureDisplay(info: IndexInfo, writer: SymbolWriter, kind: IndexKind, enclosingDeclaration?: Node, globalFlags?: TypeFormatFlags, symbolStack?: Symbol[]): void; buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; buildTypePredicateDisplay(predicate: TypePredicate, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; @@ -1630,6 +1779,7 @@ declare namespace ts { clear(): void; trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; reportInaccessibleThisError(): void; + reportIllegalExtends(): void; } enum TypeFormatFlags { None = 0, @@ -1644,6 +1794,8 @@ declare namespace ts { InFirstTypeArgument = 256, InTypeAlias = 512, UseTypeAliasValue = 1024, + SuppressAnyReturnType = 2048, + AddUndefined = 4096, } enum SymbolFormatFlags { None = 0, @@ -1693,13 +1845,10 @@ declare namespace ts { ExportType = 2097152, ExportNamespace = 4194304, Alias = 8388608, - Instantiated = 16777216, - Merged = 33554432, - Transient = 67108864, - Prototype = 134217728, - SyntheticProperty = 268435456, - Optional = 536870912, - ExportStar = 1073741824, + Prototype = 16777216, + ExportStar = 33554432, + Optional = 67108864, + Transient = 134217728, Enum = 384, Variable = 3, Value = 107455, @@ -1765,6 +1914,7 @@ declare namespace ts { Intersection = 131072, Index = 262144, IndexedAccess = 524288, + NonPrimitive = 16777216, Literal = 480, StringOrNumberLiteral = 96, PossiblyFalsy = 7406, @@ -1774,10 +1924,10 @@ declare namespace ts { EnumLike = 272, UnionOrIntersection = 196608, StructuredType = 229376, - StructuredOrTypeParameter = 507904, + StructuredOrTypeVariable = 1032192, TypeVariable = 540672, - Narrowable = 1033215, - NotUnionOrUnit = 33281, + Narrowable = 17810431, + NotUnionOrUnit = 16810497, } type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression; interface Type { @@ -1793,7 +1943,7 @@ declare namespace ts { regularType?: LiteralType; } interface EnumType extends Type { - memberTypes: Map; + memberTypes: EnumLiteralType[]; } interface EnumLiteralType extends LiteralType { baseType: EnumType & UnionType; @@ -1814,12 +1964,14 @@ declare namespace ts { interface ObjectType extends Type { objectFlags: ObjectFlags; } + /** Class and interface types (TypeFlags.Class and TypeFlags.Interface). */ interface InterfaceType extends ObjectType { typeParameters: TypeParameter[]; outerTypeParameters: TypeParameter[]; localTypeParameters: TypeParameter[]; thisType: TypeParameter; } + type BaseType = ObjectType | IntersectionType; interface InterfaceTypeWithDeclaredMembers extends InterfaceType { declaredProperties: Symbol[]; declaredCallSignatures: Signature[]; @@ -1827,6 +1979,16 @@ declare namespace ts { declaredStringIndexInfo: IndexInfo; declaredNumberIndexInfo: IndexInfo; } + /** + * Type references (TypeFlags.Reference). When a class or interface has type parameters or + * a "this" type, references to the class or interface are made using type references. The + * typeArguments property specifies the types to substitute for the type parameters of the + * class or interface and optionally includes an extra element that specifies the type to + * substitute for "this" in the resulting instantiation. When no extra argument is present, + * the type reference itself is substituted for "this". The typeArguments property is undefined + * if the class or interface has no type parameters and the reference isn't specifying an + * explicit "this" argument. + */ interface TypeReference extends ObjectType { target: GenericType; typeArguments: Type[]; @@ -1849,6 +2011,7 @@ declare namespace ts { } interface TypeParameter extends TypeVariable { constraint: Type; + default?: Type; } interface IndexedAccessType extends TypeVariable { objectType: Type; @@ -1876,9 +2039,8 @@ declare namespace ts { isReadonly: boolean; declaration?: SignatureDeclaration; } - interface FileExtensionInfo { + interface JsFileExtensionInfo { extension: string; - scriptKind: ScriptKind; isMixedContent: boolean; } interface DiagnosticMessage { @@ -1906,6 +2068,7 @@ declare namespace ts { messageText: string | DiagnosticMessageChain; category: DiagnosticCategory; code: number; + source?: string; } enum DiagnosticCategory { Warning = 0, @@ -1916,7 +2079,10 @@ declare namespace ts { Classic = 1, NodeJs = 2, } - type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike; + interface PluginImport { + name: string; + } + type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike | PluginImport[]; interface CompilerOptions { allowJs?: boolean; allowSyntheticDefaultImports?: boolean; @@ -1925,9 +2091,11 @@ declare namespace ts { alwaysStrict?: boolean; baseUrl?: string; charset?: string; + checkJs?: boolean; declaration?: boolean; declarationDir?: string; disableSizeLimit?: boolean; + downlevelIteration?: boolean; emitBOM?: boolean; emitDecoratorMetadata?: boolean; experimentalDecorators?: boolean; @@ -1972,6 +2140,7 @@ declare namespace ts { skipDefaultLibCheck?: boolean; sourceMap?: boolean; sourceRoot?: string; + strict?: boolean; strictNullChecks?: boolean; suppressExcessPropertyErrors?: boolean; suppressImplicitAnyIndexErrors?: boolean; @@ -2010,6 +2179,7 @@ declare namespace ts { None = 0, Preserve = 1, React = 2, + ReactNative = 3, } enum NewLineKind { CarriageReturnLineFeed = 0, @@ -2025,6 +2195,7 @@ declare namespace ts { JSX = 2, TS = 3, TSX = 4, + External = 5, } enum ScriptTarget { ES3 = 0, @@ -2105,7 +2276,6 @@ declare namespace ts { } interface ResolvedModuleWithFailedLookupLocations { resolvedModule: ResolvedModuleFull | undefined; - failedLookupLocations: string[]; } interface ResolvedTypeReferenceDirective { primary: boolean; @@ -2134,6 +2304,207 @@ declare namespace ts { resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string): ResolvedTypeReferenceDirective[]; getEnvironmentVariable?(name: string): string; } + enum EmitFlags { + SingleLine = 1, + AdviseOnEmitNode = 2, + NoSubstitution = 4, + CapturesThis = 8, + NoLeadingSourceMap = 16, + NoTrailingSourceMap = 32, + NoSourceMap = 48, + NoNestedSourceMaps = 64, + NoTokenLeadingSourceMaps = 128, + NoTokenTrailingSourceMaps = 256, + NoTokenSourceMaps = 384, + NoLeadingComments = 512, + NoTrailingComments = 1024, + NoComments = 1536, + NoNestedComments = 2048, + HelperName = 4096, + ExportName = 8192, + LocalName = 16384, + InternalName = 32768, + Indented = 65536, + NoIndentation = 131072, + AsyncFunctionBody = 262144, + ReuseTempVariableScope = 524288, + CustomPrologue = 1048576, + NoHoisting = 2097152, + HasEndOfDeclarationMarker = 4194304, + Iterator = 8388608, + } + interface EmitHelper { + readonly name: string; + readonly scoped: boolean; + readonly text: string; + readonly priority?: number; + } + enum EmitHint { + SourceFile = 0, + Expression = 1, + IdentifierName = 2, + Unspecified = 3, + } + interface TransformationContext { + /** Gets the compiler options supplied to the transformer. */ + getCompilerOptions(): CompilerOptions; + /** Starts a new lexical environment. */ + startLexicalEnvironment(): void; + /** Suspends the current lexical environment, usually after visiting a parameter list. */ + suspendLexicalEnvironment(): void; + /** Resumes a suspended lexical environment, usually before visiting a function body. */ + resumeLexicalEnvironment(): void; + /** Ends a lexical environment, returning any declarations. */ + endLexicalEnvironment(): Statement[]; + /** Hoists a function declaration to the containing scope. */ + hoistFunctionDeclaration(node: FunctionDeclaration): void; + /** Hoists a variable declaration to the containing scope. */ + hoistVariableDeclaration(node: Identifier): void; + /** Records a request for a non-scoped emit helper in the current context. */ + requestEmitHelper(helper: EmitHelper): void; + /** Gets and resets the requested non-scoped emit helpers. */ + readEmitHelpers(): EmitHelper[] | undefined; + /** Enables expression substitutions in the pretty printer for the provided SyntaxKind. */ + enableSubstitution(kind: SyntaxKind): void; + /** Determines whether expression substitutions are enabled for the provided node. */ + isSubstitutionEnabled(node: Node): boolean; + /** + * Hook used by transformers to substitute expressions just before they + * are emitted by the pretty printer. + * + * NOTE: Transformation hooks should only be modified during `Transformer` initialization, + * before returning the `NodeTransformer` callback. + */ + onSubstituteNode: (hint: EmitHint, node: Node) => Node; + /** + * Enables before/after emit notifications in the pretty printer for the provided + * SyntaxKind. + */ + enableEmitNotification(kind: SyntaxKind): void; + /** + * Determines whether before/after emit notifications should be raised in the pretty + * printer when it emits a node. + */ + isEmitNotificationEnabled(node: Node): boolean; + /** + * Hook used to allow transformers to capture state before or after + * the printer emits a node. + * + * NOTE: Transformation hooks should only be modified during `Transformer` initialization, + * before returning the `NodeTransformer` callback. + */ + onEmitNode: (hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) => void) => void; + } + interface TransformationResult { + /** Gets the transformed source files. */ + transformed: T[]; + /** Gets diagnostics for the transformation. */ + diagnostics?: Diagnostic[]; + /** + * Gets a substitute for a node, if one is available; otherwise, returns the original node. + * + * @param hint A hint as to the intended usage of the node. + * @param node The node to substitute. + */ + substituteNode(hint: EmitHint, node: Node): Node; + /** + * Emits a node with possible notification. + * + * @param hint A hint as to the intended usage of the node. + * @param node The node to emit. + * @param emitCallback A callback used to emit the node. + */ + emitNodeWithNotification(hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) => void): void; + /** + * Clean up EmitNode entries on any parse-tree nodes. + */ + dispose(): void; + } + /** + * A function that is used to initialize and return a `Transformer` callback, which in turn + * will be used to transform one or more nodes. + */ + type TransformerFactory = (context: TransformationContext) => Transformer; + /** + * A function that transforms a node. + */ + type Transformer = (node: T) => T; + /** + * A function that accepts and possibly transforms a node. + */ + type Visitor = (node: Node) => VisitResult; + type VisitResult = T | T[]; + interface Printer { + /** + * Print a node and its subtree as-is, without any emit transformations. + * @param hint A value indicating the purpose of a node. This is primarily used to + * distinguish between an `Identifier` used in an expression position, versus an + * `Identifier` used as an `IdentifierName` as part of a declaration. For most nodes you + * should just pass `Unspecified`. + * @param node The node to print. The node and its subtree are printed as-is, without any + * emit transformations. + * @param sourceFile A source file that provides context for the node. The source text of + * the file is used to emit the original source content for literals and identifiers, while + * the identifiers of the source file are used when generating unique names to avoid + * collisions. + */ + printNode(hint: EmitHint, node: Node, sourceFile: SourceFile): string; + /** + * Prints a source file as-is, without any emit transformations. + */ + printFile(sourceFile: SourceFile): string; + /** + * Prints a bundle of source files as-is, without any emit transformations. + */ + printBundle(bundle: Bundle): string; + } + interface PrintHandlers { + /** + * A hook used by the Printer when generating unique names to avoid collisions with + * globally defined names that exist outside of the current source file. + */ + hasGlobalName?(name: string): boolean; + /** + * A hook used by the Printer to provide notifications prior to emitting a node. A + * compatible implementation **must** invoke `emitCallback` with the provided `hint` and + * `node` values. + * @param hint A hint indicating the intended purpose of the node. + * @param node The node to emit. + * @param emitCallback A callback that, when invoked, will emit the node. + * @example + * ```ts + * var printer = createPrinter(printerOptions, { + * onEmitNode(hint, node, emitCallback) { + * // set up or track state prior to emitting the node... + * emitCallback(hint, node); + * // restore state after emitting the node... + * } + * }); + * ``` + */ + onEmitNode?(hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) => void): void; + /** + * A hook used by the Printer to perform just-in-time substitution of a node. This is + * primarily used by node transformations that need to substitute one node for another, + * such as replacing `myExportedVar` with `exports.myExportedVar`. + * @param hint A hint indicating the intended purpose of the node. + * @param node The node to emit. + * @example + * ```ts + * var printer = createPrinter(printerOptions, { + * substituteNode(hint, node) { + * // perform substitution if necessary... + * return node; + * } + * }); + * ``` + */ + substituteNode?(hint: EmitHint, node: Node): Node; + } + interface PrinterOptions { + removeComments?: boolean; + newLine?: NewLineKind; + } interface TextSpan { start: number; length: number; @@ -2148,8 +2519,10 @@ declare namespace ts { } declare namespace ts { /** The version of the TypeScript compiler release */ - const version = "2.1.5"; + const version = "2.3.4"; } +declare function setTimeout(handler: (...args: any[]) => void, timeout: number): any; +declare function clearTimeout(handle: any): void; declare namespace ts { type FileWatcherCallback = (fileName: string, removed?: boolean) => void; type DirectoryWatcherCallback = (fileName: string) => void; @@ -2195,6 +2568,7 @@ declare namespace ts { directoryName: string; referenceCount: number; } + function getNodeMajorVersion(): number; let sys: System; } declare namespace ts { @@ -2235,17 +2609,17 @@ declare namespace ts { function tokenToString(t: SyntaxKind): string; function getPositionOfLineAndCharacter(sourceFile: SourceFile, line: number, character: number): number; function getLineAndCharacterOfPosition(sourceFile: SourceFile, position: number): LineAndCharacter; - function isWhiteSpace(ch: number): boolean; + function isWhiteSpaceLike(ch: number): boolean; /** Does not include line breaks. For that, see isWhiteSpaceLike. */ function isWhiteSpaceSingleLine(ch: number): boolean; function isLineBreak(ch: number): boolean; function couldStartTrivia(text: string, pos: number): boolean; - function forEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: SyntaxKind, hasTrailingNewLine: boolean, state: T) => U, state?: T): U; - function forEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: SyntaxKind, hasTrailingNewLine: boolean, state: T) => U, state?: T): U; - function reduceEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: SyntaxKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U; - function reduceEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: SyntaxKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U; - function getLeadingCommentRanges(text: string, pos: number): CommentRange[]; - function getTrailingCommentRanges(text: string, pos: number): CommentRange[]; + function forEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state?: T): U; + function forEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state?: T): U; + function reduceEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U; + function reduceEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U; + function getLeadingCommentRanges(text: string, pos: number): CommentRange[] | undefined; + function getTrailingCommentRanges(text: string, pos: number): CommentRange[] | undefined; /** Optionally, get the shebang */ function getShebang(text: string): string; function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean; @@ -2285,15 +2659,414 @@ declare namespace ts { function getCombinedModifierFlags(node: Node): ModifierFlags; function getCombinedNodeFlags(node: Node): NodeFlags; /** - * Checks to see if the locale is in the appropriate format, - * and if it is, attempts to set the appropriate language. - */ + * Checks to see if the locale is in the appropriate format, + * and if it is, attempts to set the appropriate language. + */ function validateLocaleAndSetLanguage(locale: string, sys: { getExecutingFilePath(): string; resolvePath(path: string): string; fileExists(fileName: string): boolean; readFile(fileName: string): string; }, errors?: Diagnostic[]): void; + function getOriginalNode(node: Node): Node; + function getOriginalNode(node: Node, nodeTest: (node: Node) => node is T): T; + /** + * Gets a value indicating whether a node originated in the parse tree. + * + * @param node The node to test. + */ + function isParseTreeNode(node: Node): boolean; + /** + * Gets the original parse tree node for a node. + * + * @param node The original node. + * @returns The original parse tree node if found; otherwise, undefined. + */ + function getParseTreeNode(node: Node): Node; + /** + * Gets the original parse tree node for a node. + * + * @param node The original node. + * @param nodeTest A callback used to ensure the correct type of parse tree node is returned. + * @returns The original parse tree node if found; otherwise, undefined. + */ + function getParseTreeNode(node: Node, nodeTest?: (node: Node) => node is T): T; + /** + * Remove extra underscore from escaped identifier text content. + * + * @param identifier The escaped identifier text. + * @returns The unescaped identifier text. + */ + function unescapeIdentifier(identifier: string): string; +} +declare namespace ts { + /** + * Make `elements` into a `NodeArray`. If `elements` is `undefined`, returns an empty `NodeArray`. + */ + function createNodeArray(elements?: T[], hasTrailingComma?: boolean): NodeArray; + function createLiteral(value: string): StringLiteral; + function createLiteral(value: number): NumericLiteral; + function createLiteral(value: boolean): BooleanLiteral; + /** Create a string literal whose source text is read from a source node during emit. */ + function createLiteral(sourceNode: StringLiteral | NumericLiteral | Identifier): StringLiteral; + function createLiteral(value: string | number | boolean): PrimaryExpression; + function createNumericLiteral(value: string): NumericLiteral; + function createIdentifier(text: string): Identifier; + /** Create a unique temporary variable. */ + function createTempVariable(recordTempVariable: ((node: Identifier) => void) | undefined): Identifier; + /** Create a unique temporary variable for use in a loop. */ + function createLoopVariable(): Identifier; + /** Create a unique name based on the supplied text. */ + function createUniqueName(text: string): Identifier; + /** Create a unique name generated for a node. */ + function getGeneratedNameForNode(node: Node): Identifier; + function createToken(token: TKind): Token; + function createSuper(): SuperExpression; + function createThis(): ThisExpression & Token; + function createNull(): NullLiteral & Token; + function createTrue(): BooleanLiteral & Token; + function createFalse(): BooleanLiteral & Token; + function createQualifiedName(left: EntityName, right: string | Identifier): QualifiedName; + function updateQualifiedName(node: QualifiedName, left: EntityName, right: Identifier): QualifiedName; + function createComputedPropertyName(expression: Expression): ComputedPropertyName; + function updateComputedPropertyName(node: ComputedPropertyName, expression: Expression): ComputedPropertyName; + function createSignatureDeclaration(kind: SyntaxKind, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined): SignatureDeclaration; + function createFunctionTypeNode(typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined): FunctionTypeNode; + function updateFunctionTypeNode(node: FunctionTypeNode, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): FunctionTypeNode; + function createConstructorTypeNode(typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined): ConstructorTypeNode; + function updateConstructorTypeNode(node: ConstructorTypeNode, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): ConstructorTypeNode; + function createCallSignatureDeclaration(typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined): CallSignatureDeclaration; + function updateCallSignatureDeclaration(node: CallSignatureDeclaration, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): CallSignatureDeclaration; + function createConstructSignatureDeclaration(typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined): ConstructSignatureDeclaration; + function updateConstructSignatureDeclaration(node: ConstructSignatureDeclaration, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): ConstructSignatureDeclaration; + function createMethodSignature(typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], 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 createKeywordTypeNode(kind: KeywordTypeNode["kind"]): KeywordTypeNode; + function createThisTypeNode(): ThisTypeNode; + function createLiteralTypeNode(literal: Expression): LiteralTypeNode; + function updateLiteralTypeNode(node: LiteralTypeNode, literal: Expression): LiteralTypeNode; + function createTypeReferenceNode(typeName: string | EntityName, typeArguments: TypeNode[] | undefined): TypeReferenceNode; + function updateTypeReferenceNode(node: TypeReferenceNode, typeName: EntityName, typeArguments: NodeArray | undefined): TypeReferenceNode; + function createTypePredicateNode(parameterName: Identifier | ThisTypeNode | string, type: TypeNode): TypePredicateNode; + function updateTypePredicateNode(node: TypePredicateNode, parameterName: Identifier | ThisTypeNode, type: TypeNode): TypePredicateNode; + function createTypeQueryNode(exprName: EntityName): TypeQueryNode; + function updateTypeQueryNode(node: TypeQueryNode, exprName: EntityName): TypeQueryNode; + function createArrayTypeNode(elementType: TypeNode): ArrayTypeNode; + function updateArrayTypeNode(node: ArrayTypeNode, elementType: TypeNode): ArrayTypeNode; + function createUnionOrIntersectionTypeNode(kind: SyntaxKind.UnionType, types: TypeNode[]): UnionTypeNode; + function createUnionOrIntersectionTypeNode(kind: SyntaxKind.IntersectionType, types: TypeNode[]): IntersectionTypeNode; + function createUnionOrIntersectionTypeNode(kind: SyntaxKind.UnionType | SyntaxKind.IntersectionType, types: TypeNode[]): UnionOrIntersectionTypeNode; + function updateUnionOrIntersectionTypeNode(node: UnionOrIntersectionTypeNode, types: NodeArray): UnionOrIntersectionTypeNode; + function createTypeLiteralNode(members: TypeElement[]): TypeLiteralNode; + function updateTypeLiteralNode(node: TypeLiteralNode, members: NodeArray): TypeLiteralNode; + function createTupleTypeNode(elementTypes: TypeNode[]): TupleTypeNode; + function updateTypleTypeNode(node: TupleTypeNode, elementTypes: TypeNode[]): TupleTypeNode; + 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 createTypeOperatorNode(type: TypeNode): TypeOperatorNode; + function updateTypeOperatorNode(node: TypeOperatorNode, type: TypeNode): TypeOperatorNode; + function createIndexedAccessTypeNode(objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; + function updateIndexedAccessTypeNode(node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; + function createTypeParameterDeclaration(name: string | Identifier, constraint: TypeNode | undefined, defaultType: TypeNode | undefined): TypeParameterDeclaration; + function updateTypeParameterDeclaration(node: TypeParameterDeclaration, name: Identifier, constraint: TypeNode | undefined, defaultType: TypeNode | undefined): TypeParameterDeclaration; + function createPropertySignature(name: PropertyName | string, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertySignature; + function updatePropertySignature(node: PropertySignature, name: PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertySignature; + function createIndexSignatureDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, parameters: ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; + function updateIndexSignatureDeclaration(node: IndexSignatureDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, parameters: ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; + function createParameter(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, questionToken?: QuestionToken, type?: TypeNode, initializer?: Expression): ParameterDeclaration; + function updateParameter(node: ParameterDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): ParameterDeclaration; + function createDecorator(expression: Expression): Decorator; + function updateDecorator(node: Decorator, expression: Expression): Decorator; + function createProperty(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression): PropertyDeclaration; + function updateProperty(node: PropertyDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: PropertyName, type: TypeNode | undefined, initializer: Expression): PropertyDeclaration; + function createMethodDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration; + function updateMethod(node: MethodDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration; + function createConstructor(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, parameters: ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration; + function updateConstructor(node: ConstructorDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, parameters: ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration; + function createGetAccessor(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: string | PropertyName, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration; + function updateGetAccessor(node: GetAccessorDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: PropertyName, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration; + function createSetAccessor(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: string | PropertyName, parameters: ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration; + function updateSetAccessor(node: SetAccessorDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: PropertyName, parameters: ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration; + function createObjectBindingPattern(elements: BindingElement[]): ObjectBindingPattern; + function updateObjectBindingPattern(node: ObjectBindingPattern, elements: BindingElement[]): ObjectBindingPattern; + function createArrayBindingPattern(elements: ArrayBindingElement[]): ArrayBindingPattern; + function updateArrayBindingPattern(node: ArrayBindingPattern, elements: ArrayBindingElement[]): ArrayBindingPattern; + function createBindingElement(dotDotDotToken: DotDotDotToken | undefined, propertyName: string | PropertyName | undefined, name: string | BindingName, initializer?: Expression): BindingElement; + function updateBindingElement(node: BindingElement, dotDotDotToken: DotDotDotToken | undefined, propertyName: PropertyName | undefined, name: BindingName, initializer: Expression | undefined): BindingElement; + function createArrayLiteral(elements?: Expression[], multiLine?: boolean): ArrayLiteralExpression; + function updateArrayLiteral(node: ArrayLiteralExpression, elements: Expression[]): ArrayLiteralExpression; + function createObjectLiteral(properties?: ObjectLiteralElementLike[], multiLine?: boolean): ObjectLiteralExpression; + function updateObjectLiteral(node: ObjectLiteralExpression, properties: ObjectLiteralElementLike[]): ObjectLiteralExpression; + function createPropertyAccess(expression: Expression, name: string | Identifier): PropertyAccessExpression; + function updatePropertyAccess(node: PropertyAccessExpression, expression: Expression, name: Identifier): PropertyAccessExpression; + function createElementAccess(expression: Expression, index: number | Expression): ElementAccessExpression; + function updateElementAccess(node: ElementAccessExpression, expression: Expression, argumentExpression: Expression): ElementAccessExpression; + function createCall(expression: Expression, typeArguments: TypeNode[] | undefined, argumentsArray: Expression[]): CallExpression; + function updateCall(node: CallExpression, expression: Expression, typeArguments: TypeNode[] | undefined, argumentsArray: Expression[]): CallExpression; + function createNew(expression: Expression, typeArguments: TypeNode[] | undefined, argumentsArray: Expression[] | undefined): NewExpression; + function updateNew(node: NewExpression, expression: Expression, typeArguments: TypeNode[] | undefined, argumentsArray: Expression[] | undefined): NewExpression; + function createTaggedTemplate(tag: Expression, template: TemplateLiteral): TaggedTemplateExpression; + function updateTaggedTemplate(node: TaggedTemplateExpression, tag: Expression, template: TemplateLiteral): TaggedTemplateExpression; + function createTypeAssertion(type: TypeNode, expression: Expression): TypeAssertion; + function updateTypeAssertion(node: TypeAssertion, type: TypeNode, expression: Expression): TypeAssertion; + function createParen(expression: Expression): ParenthesizedExpression; + function updateParen(node: ParenthesizedExpression, expression: Expression): ParenthesizedExpression; + function createFunctionExpression(modifiers: Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | Identifier | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block): FunctionExpression; + function updateFunctionExpression(node: FunctionExpression, modifiers: Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: Identifier | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block): FunctionExpression; + function createArrowFunction(modifiers: Modifier[] | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken | undefined, body: ConciseBody): ArrowFunction; + function updateArrowFunction(node: ArrowFunction, modifiers: Modifier[] | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: ConciseBody): ArrowFunction; + function createDelete(expression: Expression): DeleteExpression; + function updateDelete(node: DeleteExpression, expression: Expression): DeleteExpression; + function createTypeOf(expression: Expression): TypeOfExpression; + function updateTypeOf(node: TypeOfExpression, expression: Expression): TypeOfExpression; + function createVoid(expression: Expression): VoidExpression; + function updateVoid(node: VoidExpression, expression: Expression): VoidExpression; + function createAwait(expression: Expression): AwaitExpression; + function updateAwait(node: AwaitExpression, expression: Expression): AwaitExpression; + function createPrefix(operator: PrefixUnaryOperator, operand: Expression): PrefixUnaryExpression; + function updatePrefix(node: PrefixUnaryExpression, operand: Expression): PrefixUnaryExpression; + function createPostfix(operand: Expression, operator: PostfixUnaryOperator): PostfixUnaryExpression; + function updatePostfix(node: PostfixUnaryExpression, operand: Expression): PostfixUnaryExpression; + function createBinary(left: Expression, operator: BinaryOperator | BinaryOperatorToken, right: Expression): BinaryExpression; + function updateBinary(node: BinaryExpression, left: Expression, right: Expression): BinaryExpression; + function createConditional(condition: Expression, whenTrue: Expression, whenFalse: Expression): ConditionalExpression; + function createConditional(condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression): ConditionalExpression; + function updateConditional(node: ConditionalExpression, condition: Expression, whenTrue: Expression, whenFalse: Expression): ConditionalExpression; + function createTemplateExpression(head: TemplateHead, templateSpans: TemplateSpan[]): TemplateExpression; + function updateTemplateExpression(node: TemplateExpression, head: TemplateHead, templateSpans: TemplateSpan[]): TemplateExpression; + function createYield(expression?: Expression): YieldExpression; + function createYield(asteriskToken: AsteriskToken, expression: Expression): YieldExpression; + function updateYield(node: YieldExpression, asteriskToken: AsteriskToken | undefined, expression: Expression): YieldExpression; + function createSpread(expression: Expression): SpreadElement; + function updateSpread(node: SpreadElement, expression: Expression): SpreadElement; + function createClassExpression(modifiers: Modifier[] | undefined, name: string | Identifier | undefined, typeParameters: TypeParameterDeclaration[] | undefined, heritageClauses: HeritageClause[], members: ClassElement[]): ClassExpression; + function updateClassExpression(node: ClassExpression, modifiers: Modifier[] | undefined, name: Identifier | undefined, typeParameters: TypeParameterDeclaration[] | undefined, heritageClauses: HeritageClause[], members: ClassElement[]): ClassExpression; + function createOmittedExpression(): OmittedExpression; + function createExpressionWithTypeArguments(typeArguments: TypeNode[], expression: Expression): ExpressionWithTypeArguments; + function updateExpressionWithTypeArguments(node: ExpressionWithTypeArguments, typeArguments: TypeNode[], expression: Expression): ExpressionWithTypeArguments; + function createAsExpression(expression: Expression, type: TypeNode): AsExpression; + function updateAsExpression(node: AsExpression, expression: Expression, type: TypeNode): AsExpression; + function createNonNullExpression(expression: Expression): NonNullExpression; + function updateNonNullExpression(node: NonNullExpression, expression: Expression): NonNullExpression; + function createTemplateSpan(expression: Expression, literal: TemplateMiddle | TemplateTail): TemplateSpan; + function updateTemplateSpan(node: TemplateSpan, expression: Expression, literal: TemplateMiddle | TemplateTail): TemplateSpan; + function createBlock(statements: Statement[], multiLine?: boolean): Block; + function updateBlock(node: Block, statements: Statement[]): Block; + function createVariableStatement(modifiers: Modifier[] | undefined, declarationList: VariableDeclarationList | VariableDeclaration[]): VariableStatement; + function updateVariableStatement(node: VariableStatement, modifiers: Modifier[] | undefined, declarationList: VariableDeclarationList): VariableStatement; + function createVariableDeclarationList(declarations: VariableDeclaration[], flags?: NodeFlags): VariableDeclarationList; + function updateVariableDeclarationList(node: VariableDeclarationList, declarations: VariableDeclaration[]): VariableDeclarationList; + function createVariableDeclaration(name: string | BindingName, type?: TypeNode, initializer?: Expression): VariableDeclaration; + function updateVariableDeclaration(node: VariableDeclaration, name: BindingName, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration; + function createEmptyStatement(): EmptyStatement; + function createStatement(expression: Expression): ExpressionStatement; + function updateStatement(node: ExpressionStatement, expression: Expression): ExpressionStatement; + function createIf(expression: Expression, thenStatement: Statement, elseStatement?: Statement): IfStatement; + function updateIf(node: IfStatement, expression: Expression, thenStatement: Statement, elseStatement: Statement | undefined): IfStatement; + function createDo(statement: Statement, expression: Expression): DoStatement; + function updateDo(node: DoStatement, statement: Statement, expression: Expression): DoStatement; + function createWhile(expression: Expression, statement: Statement): WhileStatement; + function updateWhile(node: WhileStatement, expression: Expression, statement: Statement): WhileStatement; + function createFor(initializer: ForInitializer | undefined, condition: Expression | undefined, incrementor: Expression | undefined, statement: Statement): ForStatement; + function updateFor(node: ForStatement, initializer: ForInitializer | undefined, condition: Expression | undefined, incrementor: Expression | undefined, statement: Statement): ForStatement; + function createForIn(initializer: ForInitializer, expression: Expression, statement: Statement): ForInStatement; + function updateForIn(node: ForInStatement, initializer: ForInitializer, expression: Expression, statement: Statement): ForInStatement; + function createForOf(awaitModifier: AwaitKeywordToken, initializer: ForInitializer, expression: Expression, statement: Statement): ForOfStatement; + function updateForOf(node: ForOfStatement, awaitModifier: AwaitKeywordToken, initializer: ForInitializer, expression: Expression, statement: Statement): ForOfStatement; + function createContinue(label?: string | Identifier): ContinueStatement; + function updateContinue(node: ContinueStatement, label: Identifier | undefined): ContinueStatement; + function createBreak(label?: string | Identifier): BreakStatement; + function updateBreak(node: BreakStatement, label: Identifier | undefined): BreakStatement; + function createReturn(expression?: Expression): ReturnStatement; + function updateReturn(node: ReturnStatement, expression: Expression | undefined): ReturnStatement; + function createWith(expression: Expression, statement: Statement): WithStatement; + function updateWith(node: WithStatement, expression: Expression, statement: Statement): WithStatement; + function createSwitch(expression: Expression, caseBlock: CaseBlock): SwitchStatement; + function updateSwitch(node: SwitchStatement, expression: Expression, caseBlock: CaseBlock): SwitchStatement; + function createLabel(label: string | Identifier, statement: Statement): LabeledStatement; + function updateLabel(node: LabeledStatement, label: Identifier, statement: Statement): LabeledStatement; + function createThrow(expression: Expression): ThrowStatement; + function updateThrow(node: ThrowStatement, expression: Expression): ThrowStatement; + function createTry(tryBlock: Block, catchClause: CatchClause | undefined, finallyBlock: Block | undefined): TryStatement; + function updateTry(node: TryStatement, tryBlock: Block, catchClause: CatchClause | undefined, finallyBlock: Block | undefined): TryStatement; + function createFunctionDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | Identifier | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): FunctionDeclaration; + function updateFunctionDeclaration(node: FunctionDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: Identifier | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): FunctionDeclaration; + function createClassDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: string | Identifier | undefined, typeParameters: TypeParameterDeclaration[] | undefined, heritageClauses: HeritageClause[], members: ClassElement[]): ClassDeclaration; + function updateClassDeclaration(node: ClassDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: Identifier | undefined, typeParameters: TypeParameterDeclaration[] | undefined, heritageClauses: HeritageClause[], members: ClassElement[]): ClassDeclaration; + function createEnumDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: string | Identifier, members: EnumMember[]): EnumDeclaration; + function updateEnumDeclaration(node: EnumDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: Identifier, members: EnumMember[]): EnumDeclaration; + function createModuleDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined, flags?: NodeFlags): ModuleDeclaration; + function updateModuleDeclaration(node: ModuleDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined): ModuleDeclaration; + function createModuleBlock(statements: Statement[]): ModuleBlock; + function updateModuleBlock(node: ModuleBlock, statements: Statement[]): ModuleBlock; + function createCaseBlock(clauses: CaseOrDefaultClause[]): CaseBlock; + function updateCaseBlock(node: CaseBlock, clauses: CaseOrDefaultClause[]): CaseBlock; + function createImportEqualsDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: string | Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration; + function updateImportEqualsDeclaration(node: ImportEqualsDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration; + function createImportDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier?: Expression): ImportDeclaration; + function updateImportDeclaration(node: ImportDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression | undefined): ImportDeclaration; + function createImportClause(name: Identifier, namedBindings: NamedImportBindings): ImportClause; + function updateImportClause(node: ImportClause, name: Identifier, namedBindings: NamedImportBindings): ImportClause; + function createNamespaceImport(name: Identifier): NamespaceImport; + function updateNamespaceImport(node: NamespaceImport, name: Identifier): NamespaceImport; + function createNamedImports(elements: ImportSpecifier[]): NamedImports; + function updateNamedImports(node: NamedImports, elements: ImportSpecifier[]): NamedImports; + function createImportSpecifier(propertyName: Identifier | undefined, name: Identifier): ImportSpecifier; + function updateImportSpecifier(node: ImportSpecifier, propertyName: Identifier | undefined, name: Identifier): ImportSpecifier; + function createExportAssignment(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, isExportEquals: boolean, expression: Expression): ExportAssignment; + function updateExportAssignment(node: ExportAssignment, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, expression: Expression): ExportAssignment; + function createExportDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, exportClause: NamedExports | undefined, moduleSpecifier?: Expression): ExportDeclaration; + function updateExportDeclaration(node: ExportDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, exportClause: NamedExports | undefined, moduleSpecifier: Expression | undefined): ExportDeclaration; + function createNamedExports(elements: ExportSpecifier[]): NamedExports; + function updateNamedExports(node: NamedExports, elements: ExportSpecifier[]): NamedExports; + function createExportSpecifier(propertyName: string | Identifier | undefined, name: string | Identifier): ExportSpecifier; + function updateExportSpecifier(node: ExportSpecifier, propertyName: Identifier | undefined, name: Identifier): ExportSpecifier; + function createExternalModuleReference(expression: Expression): ExternalModuleReference; + function updateExternalModuleReference(node: ExternalModuleReference, expression: Expression): ExternalModuleReference; + function createJsxElement(openingElement: JsxOpeningElement, children: JsxChild[], closingElement: JsxClosingElement): JsxElement; + function updateJsxElement(node: JsxElement, openingElement: JsxOpeningElement, children: JsxChild[], closingElement: JsxClosingElement): JsxElement; + function createJsxSelfClosingElement(tagName: JsxTagNameExpression, attributes: JsxAttributes): JsxSelfClosingElement; + function updateJsxSelfClosingElement(node: JsxSelfClosingElement, tagName: JsxTagNameExpression, attributes: JsxAttributes): JsxSelfClosingElement; + function createJsxOpeningElement(tagName: JsxTagNameExpression, attributes: JsxAttributes): JsxOpeningElement; + function updateJsxOpeningElement(node: JsxOpeningElement, tagName: JsxTagNameExpression, attributes: JsxAttributes): JsxOpeningElement; + function createJsxClosingElement(tagName: JsxTagNameExpression): JsxClosingElement; + function updateJsxClosingElement(node: JsxClosingElement, tagName: JsxTagNameExpression): JsxClosingElement; + function createJsxAttributes(properties: JsxAttributeLike[]): JsxAttributes; + function updateJsxAttributes(jsxAttributes: JsxAttributes, properties: JsxAttributeLike[]): JsxAttributes; + function createJsxAttribute(name: Identifier, initializer: StringLiteral | JsxExpression): JsxAttribute; + function updateJsxAttribute(node: JsxAttribute, name: Identifier, initializer: StringLiteral | JsxExpression): JsxAttribute; + function createJsxSpreadAttribute(expression: Expression): JsxSpreadAttribute; + function updateJsxSpreadAttribute(node: JsxSpreadAttribute, expression: Expression): JsxSpreadAttribute; + function createJsxExpression(dotDotDotToken: DotDotDotToken | undefined, expression: Expression | undefined): JsxExpression; + function updateJsxExpression(node: JsxExpression, expression: Expression | undefined): JsxExpression; + function createHeritageClause(token: HeritageClause["token"], types: ExpressionWithTypeArguments[]): HeritageClause; + function updateHeritageClause(node: HeritageClause, types: ExpressionWithTypeArguments[]): HeritageClause; + function createCaseClause(expression: Expression, statements: Statement[]): CaseClause; + function updateCaseClause(node: CaseClause, expression: Expression, statements: Statement[]): CaseClause; + function createDefaultClause(statements: Statement[]): DefaultClause; + function updateDefaultClause(node: DefaultClause, statements: Statement[]): DefaultClause; + function createCatchClause(variableDeclaration: string | VariableDeclaration, block: Block): CatchClause; + function updateCatchClause(node: CatchClause, variableDeclaration: VariableDeclaration, block: Block): CatchClause; + function createPropertyAssignment(name: string | PropertyName, initializer: Expression): PropertyAssignment; + function updatePropertyAssignment(node: PropertyAssignment, name: PropertyName, initializer: Expression): PropertyAssignment; + function createShorthandPropertyAssignment(name: string | Identifier, objectAssignmentInitializer?: Expression): ShorthandPropertyAssignment; + function updateShorthandPropertyAssignment(node: ShorthandPropertyAssignment, name: Identifier, objectAssignmentInitializer: Expression | undefined): ShorthandPropertyAssignment; + function createSpreadAssignment(expression: Expression): SpreadAssignment; + function updateSpreadAssignment(node: SpreadAssignment, expression: Expression): SpreadAssignment; + function createEnumMember(name: string | PropertyName, initializer?: Expression): EnumMember; + function updateEnumMember(node: EnumMember, name: PropertyName, initializer: Expression | undefined): EnumMember; + function updateSourceFileNode(node: SourceFile, statements: Statement[]): SourceFile; + /** + * Creates a shallow, memberwise clone of a node for mutation. + */ + function getMutableClone(node: T): T; + /** + * Creates a synthetic statement to act as a placeholder for a not-emitted statement in + * order to preserve comments. + * + * @param original The original statement. + */ + function createNotEmittedStatement(original: Node): NotEmittedStatement; + /** + * Creates a synthetic expression to act as a placeholder for a not-emitted expression in + * order to preserve comments or sourcemap positions. + * + * @param expression The inner expression to emit. + * @param original The original outer expression. + * @param location The location for the expression. Defaults to the positions from "original" if provided. + */ + function createPartiallyEmittedExpression(expression: Expression, original?: Node): PartiallyEmittedExpression; + function updatePartiallyEmittedExpression(node: PartiallyEmittedExpression, expression: Expression): PartiallyEmittedExpression; + function createBundle(sourceFiles: SourceFile[]): Bundle; + function updateBundle(node: Bundle, sourceFiles: SourceFile[]): Bundle; + function createComma(left: Expression, right: Expression): Expression; + function createLessThan(left: Expression, right: Expression): Expression; + function createAssignment(left: ObjectLiteralExpression | ArrayLiteralExpression, right: Expression): DestructuringAssignment; + function createAssignment(left: Expression, right: Expression): BinaryExpression; + function createStrictEquality(left: Expression, right: Expression): BinaryExpression; + function createStrictInequality(left: Expression, right: Expression): BinaryExpression; + function createAdd(left: Expression, right: Expression): BinaryExpression; + function createSubtract(left: Expression, right: Expression): BinaryExpression; + function createPostfixIncrement(operand: Expression): PostfixUnaryExpression; + function createLogicalAnd(left: Expression, right: Expression): BinaryExpression; + function createLogicalOr(left: Expression, right: Expression): BinaryExpression; + function createLogicalNot(operand: Expression): PrefixUnaryExpression; + function createVoidZero(): VoidExpression; + function createExportDefault(expression: Expression): ExportAssignment; + function createExternalModuleExport(exportName: Identifier): ExportDeclaration; + /** + * Clears any EmitNode entries from parse-tree nodes. + * @param sourceFile A source file. + */ + function disposeEmitNodes(sourceFile: SourceFile): void; + function setTextRange(range: T, location: TextRange | undefined): T; + /** + * Gets flags that control emit behavior of a node. + */ + function getEmitFlags(node: Node): EmitFlags | undefined; + /** + * Sets flags that control emit behavior of a node. + */ + function setEmitFlags(node: T, emitFlags: EmitFlags): T; + /** + * Gets a custom text range to use when emitting source maps. + */ + function getSourceMapRange(node: Node): TextRange; + /** + * Sets a custom text range to use when emitting source maps. + */ + function setSourceMapRange(node: T, range: TextRange | undefined): T; + /** + * Gets the TextRange to use for source maps for a token of a node. + */ + function getTokenSourceMapRange(node: Node, token: SyntaxKind): TextRange | undefined; + /** + * Sets the TextRange to use for source maps for a token of a node. + */ + function setTokenSourceMapRange(node: T, token: SyntaxKind, range: TextRange | undefined): T; + /** + * Gets a custom text range to use when emitting comments. + */ + function getCommentRange(node: Node): TextRange; + /** + * Sets a custom text range to use when emitting comments. + */ + function setCommentRange(node: T, range: TextRange): T; + function getSyntheticLeadingComments(node: Node): SynthesizedComment[] | undefined; + function setSyntheticLeadingComments(node: T, comments: SynthesizedComment[]): T; + function addSyntheticLeadingComment(node: T, kind: SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia, text: string, hasTrailingNewLine?: boolean): T; + function getSyntheticTrailingComments(node: Node): SynthesizedComment[] | undefined; + function setSyntheticTrailingComments(node: T, comments: SynthesizedComment[]): T; + function addSyntheticTrailingComment(node: T, kind: SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia, text: string, hasTrailingNewLine?: boolean): T; + /** + * Gets the constant value to emit for an expression. + */ + function getConstantValue(node: PropertyAccessExpression | ElementAccessExpression): number; + /** + * Sets the constant value to emit for an expression. + */ + function setConstantValue(node: PropertyAccessExpression | ElementAccessExpression, value: number): PropertyAccessExpression | ElementAccessExpression; + /** + * Adds an EmitHelper to a node. + */ + function addEmitHelper(node: T, helper: EmitHelper): T; + /** + * Add EmitHelpers to a node. + */ + function addEmitHelpers(node: T, helpers: EmitHelper[] | undefined): T; + /** + * Removes an EmitHelper from a node. + */ + function removeEmitHelper(node: Node, helper: EmitHelper): boolean; + /** + * Gets the EmitHelpers of a node. + */ + function getEmitHelpers(node: Node): EmitHelper[] | undefined; + /** + * Moves matching emit helpers from a source node to a target node. + */ + function moveEmitHelpers(source: Node, target: Node, predicate: (helper: EmitHelper) => boolean): void; + function setOriginalNode(node: T, original: Node | undefined): T; } declare namespace ts { function createNode(kind: SyntaxKind, pos?: number, end?: number): Node; @@ -2304,6 +3077,10 @@ declare namespace ts { function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; } declare namespace ts { + /** Array that is only intended to be pushed to, never read. */ + interface Push { + push(value: T): void; + } function moduleHasNonRelativeName(moduleName: string): boolean; function getEffectiveTypeRoots(options: CompilerOptions, host: { directoryExists?: (directoryName: string) => boolean; @@ -2316,13 +3093,13 @@ declare namespace ts { */ function resolveTypeReferenceDirective(typeReferenceDirectiveName: string, containingFile: string | undefined, options: CompilerOptions, host: ModuleResolutionHost): ResolvedTypeReferenceDirectiveWithFailedLookupLocations; /** - * Given a set of options, returns the set of type directive names - * that should be included for this program automatically. - * This list could either come from the config file, - * or from enumerating the types root + initial secondary types lookup location. - * More type directives might appear in the program later as a result of loading actual source files; - * this list is only the set of defaults that are implicitly included. - */ + * Given a set of options, returns the set of type directive names + * that should be included for this program automatically. + * This list could either come from the config file, + * or from enumerating the types root + initial secondary types lookup location. + * More type directives might appear in the program later as a result of loading actual source files; + * this list is only the set of defaults that are implicitly included. + */ function getAutomaticTypeDirectiveNames(options: CompilerOptions, host: ModuleResolutionHost): string[]; /** * Cached module resolutions per containing directory. @@ -2347,6 +3124,90 @@ declare namespace ts { function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache): ResolvedModuleWithFailedLookupLocations; function classicNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: NonRelativeModuleNameResolutionCache): ResolvedModuleWithFailedLookupLocations; } +declare namespace ts { + /** + * Visits a Node using the supplied visitor, possibly returning a new Node in its place. + * + * @param node The Node to visit. + * @param visitor The callback used to visit the Node. + * @param test A callback to execute to verify the Node is valid. + * @param lift An optional callback to execute to lift a NodeArray into a valid Node. + */ + function visitNode(node: T, visitor: Visitor, test?: (node: Node) => boolean, lift?: (node: NodeArray) => T): T; + /** + * Visits a Node using the supplied visitor, possibly returning a new Node in its place. + * + * @param node The Node to visit. + * @param visitor The callback used to visit the Node. + * @param test A callback to execute to verify the Node is valid. + * @param lift An optional callback to execute to lift a NodeArray into a valid Node. + */ + function visitNode(node: T | undefined, visitor: Visitor, test?: (node: Node) => boolean, lift?: (node: NodeArray) => T): T | undefined; + /** + * Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place. + * + * @param nodes The NodeArray to visit. + * @param visitor The callback used to visit a Node. + * @param test A node test to execute for each node. + * @param start An optional value indicating the starting offset at which to start visiting. + * @param count An optional value indicating the maximum number of nodes to visit. + */ + function visitNodes(nodes: NodeArray, visitor: Visitor, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray; + /** + * Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place. + * + * @param nodes The NodeArray to visit. + * @param visitor The callback used to visit a Node. + * @param test A node test to execute for each node. + * @param start An optional value indicating the starting offset at which to start visiting. + * @param count An optional value indicating the maximum number of nodes to visit. + */ + function visitNodes(nodes: NodeArray | undefined, visitor: Visitor, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray | undefined; + /** + * Starts a new lexical environment and visits a statement list, ending the lexical environment + * and merging hoisted declarations upon completion. + */ + function visitLexicalEnvironment(statements: NodeArray, visitor: Visitor, context: TransformationContext, start?: number, ensureUseStrict?: boolean): NodeArray; + /** + * Starts a new lexical environment and visits a parameter list, suspending the lexical + * environment upon completion. + */ + function visitParameterList(nodes: NodeArray, visitor: Visitor, context: TransformationContext, nodesVisitor?: typeof visitNodes): NodeArray; + /** + * Resumes a suspended lexical environment and visits a function body, ending the lexical + * environment and merging hoisted declarations upon completion. + */ + function visitFunctionBody(node: FunctionBody, visitor: Visitor, context: TransformationContext): FunctionBody; + /** + * Resumes a suspended lexical environment and visits a function body, ending the lexical + * environment and merging hoisted declarations upon completion. + */ + function visitFunctionBody(node: FunctionBody | undefined, visitor: Visitor, context: TransformationContext): FunctionBody | undefined; + /** + * Resumes a suspended lexical environment and visits a concise body, ending the lexical + * environment and merging hoisted declarations upon completion. + */ + function visitFunctionBody(node: ConciseBody, visitor: Visitor, context: TransformationContext): ConciseBody; + /** + * Visits each child of a Node using the supplied visitor, possibly returning a new Node of the same kind in its place. + * + * @param node The Node whose children will be visited. + * @param visitor The callback used to visit each child. + * @param context A lexical environment context for the visitor. + */ + function visitEachChild(node: T, visitor: Visitor, context: TransformationContext): T; + /** + * Visits each child of a Node using the supplied visitor, possibly returning a new Node of the same kind in its place. + * + * @param node The Node whose children will be visited. + * @param visitor The callback used to visit each child. + * @param context A lexical environment context for the visitor. + */ + function visitEachChild(node: T | undefined, visitor: Visitor, context: TransformationContext, nodesVisitor?: typeof visitNodes, tokenVisitor?: Visitor): T | undefined; +} +declare namespace ts { + function createPrinter(printerOptions?: PrinterOptions, handlers?: PrintHandlers): Printer; +} declare namespace ts { function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string; function resolveTripleslashReference(moduleName: string, containingFile: string): string; @@ -2364,31 +3225,31 @@ declare namespace ts { declare namespace ts { function parseCommandLine(commandLine: string[], readFile?: (path: string) => string): ParsedCommandLine; /** - * Read tsconfig.json file - * @param fileName The path to the config file - */ + * Read tsconfig.json file + * @param fileName The path to the config file + */ function readConfigFile(fileName: string, readFile: (path: string) => string): { config?: any; error?: Diagnostic; }; /** - * Parse the text of the tsconfig.json file - * @param fileName The path to the config file - * @param jsonText The text of the config file - */ + * Parse the text of the tsconfig.json file + * @param fileName The path to the config file + * @param jsonText The text of the config file + */ function parseConfigFileTextToJson(fileName: string, jsonText: string, stripComments?: boolean): { config?: any; error?: Diagnostic; }; /** - * Parse the contents of a config file (tsconfig.json). - * @param json The contents of the config file to parse - * @param host Instance of ParseConfigHost used to enumerate files in folder. - * @param basePath A root directory to resolve relative path entries in the config - * file to. e.g. outDir - */ - function parseJsonConfigFileContent(json: any, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: FileExtensionInfo[]): ParsedCommandLine; - function convertCompileOnSaveOptionFromJson(jsonOption: any, basePath: string, errors: Diagnostic[]): boolean; + * Parse the contents of a config file (tsconfig.json). + * @param json The contents of the config file to parse + * @param host Instance of ParseConfigHost used to enumerate files in folder. + * @param basePath A root directory to resolve relative path entries in the config + * file to. e.g. outDir + */ + function parseJsonConfigFileContent(json: any, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: JsFileExtensionInfo[]): ParsedCommandLine; + function convertCompileOnSaveOptionFromJson(jsonOption: any, basePath: string, errors: Diagnostic[]): boolean | undefined; function convertCompilerOptionsFromJson(jsonOptions: any, basePath: string, configFileName?: string): { options: CompilerOptions; errors: Diagnostic[]; @@ -2414,6 +3275,7 @@ declare namespace ts { getText(sourceFile?: SourceFile): string; getFirstToken(sourceFile?: SourceFile): Node; getLastToken(sourceFile?: SourceFile): Node; + forEachChild(cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T): T; } interface Symbol { getFlags(): SymbolFlags; @@ -2432,12 +3294,12 @@ declare namespace ts { getConstructSignatures(): Signature[]; getStringIndexType(): Type; getNumberIndexType(): Type; - getBaseTypes(): ObjectType[]; + getBaseTypes(): BaseType[]; getNonNullableType(): Type; } interface Signature { getDeclaration(): SignatureDeclaration; - getTypeParameters(): Type[]; + getTypeParameters(): TypeParameter[]; getParameters(): Symbol[]; getReturnType(): Type; getDocumentationComment(): SymbolDisplayPart[]; @@ -2450,6 +3312,9 @@ declare namespace ts { getPositionOfLineAndCharacter(line: number, character: number): number; update(newText: string, textChangeRange: TextChangeRange): SourceFile; } + interface SourceFileLike { + getLineAndCharacterOfPosition(pos: number): LineAndCharacter; + } /** * Represents an immutable snapshot of a script at a specified time.Once acquired, the * snapshot is observably immutable. i.e. the same calls with the same parameters will return @@ -2508,6 +3373,10 @@ declare namespace ts { resolveTypeReferenceDirectives?(typeDirectiveNames: string[], containingFile: string): ResolvedTypeReferenceDirective[]; directoryExists?(directoryName: string): boolean; getDirectories?(directoryName: string): string[]; + /** + * Gets a set of custom transformers to use during emit. + */ + getCustomTransformers?(): CustomTransformers | undefined; } interface LanguageService { cleanupSemanticCache(): void; @@ -2553,7 +3422,7 @@ declare namespace ts { getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[]; getDocCommentTemplateAtPosition(fileName: string, position: number): TextInsertion; isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean; - getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: number[]): CodeAction[]; + getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: number[], formatOptions: FormatCodeSettings): CodeAction[]; getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean): EmitOutput; getProgram(): Program; dispose(): void; @@ -2629,19 +3498,20 @@ declare namespace ts { /** The position in newText the caret should point to after the insertion. */ caretOffset: number; } - interface RenameLocation { + interface DocumentSpan { textSpan: TextSpan; fileName: string; } - interface ReferenceEntry { - textSpan: TextSpan; - fileName: string; + interface RenameLocation extends DocumentSpan { + } + interface ReferenceEntry extends DocumentSpan { isWriteAccess: boolean; isDefinition: boolean; + isInString?: true; } - interface ImplementationLocation { - textSpan: TextSpan; - fileName: string; + interface ImplementationLocation extends DocumentSpan { + kind: string; + displayParts: SymbolDisplayPart[]; } interface DocumentHighlights { fileName: string; @@ -2655,6 +3525,7 @@ declare namespace ts { } interface HighlightSpan { fileName?: string; + isInString?: true; textSpan: TextSpan; kind: string; } @@ -2835,10 +3706,10 @@ declare namespace ts { kindModifiers: string; sortText: string; /** - * An optional span that indicates the text to be replaced by this completion item. It will be - * set if the required span differs from the one generated by the default replacement behavior and should - * be used in that case - */ + * An optional span that indicates the text to be replaced by this completion item. It will be + * set if the required span differs from the one generated by the default replacement behavior and should + * be used in that case + */ replacementSpan?: TextSpan; } interface CompletionEntryDetails { @@ -2857,9 +3728,9 @@ declare namespace ts { /** The text to display in the editor for the collapsed region. */ bannerText: string; /** - * Whether or not this region should be automatically collapsed when - * the 'Collapse to Definitions' command is invoked. - */ + * Whether or not this region should be automatically collapsed when + * the 'Collapse to Definitions' command is invoked. + */ autoCollapse: boolean; } interface EmitOutput { @@ -2947,7 +3818,7 @@ declare namespace ts { const typeElement = "type"; /** enum E */ const enumElement = "enum"; - const enumMemberElement = "const"; + const enumMemberElement = "enum member"; /** * Inside module and script only * const v = .. @@ -2990,6 +3861,10 @@ declare namespace ts { const letElement = "let"; const directory = "directory"; const externalModuleName = "external module name"; + /** + * + */ + const jsxAttribute = "JSX attribute"; } namespace ScriptElementKindModifier { const none = ""; @@ -3058,61 +3933,61 @@ declare namespace ts { } declare namespace ts { /** - * The document registry represents a store of SourceFile objects that can be shared between - * multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST) - * of files in the context. - * SourceFile objects account for most of the memory usage by the language service. Sharing - * the same DocumentRegistry instance between different instances of LanguageService allow - * for more efficient memory utilization since all projects will share at least the library - * file (lib.d.ts). - * - * A more advanced use of the document registry is to serialize sourceFile objects to disk - * and re-hydrate them when needed. - * - * To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it - * to all subsequent createLanguageService calls. - */ + * The document registry represents a store of SourceFile objects that can be shared between + * multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST) + * of files in the context. + * SourceFile objects account for most of the memory usage by the language service. Sharing + * the same DocumentRegistry instance between different instances of LanguageService allow + * for more efficient memory utilization since all projects will share at least the library + * file (lib.d.ts). + * + * A more advanced use of the document registry is to serialize sourceFile objects to disk + * and re-hydrate them when needed. + * + * To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it + * to all subsequent createLanguageService calls. + */ interface DocumentRegistry { /** - * Request a stored SourceFile with a given fileName and compilationSettings. - * The first call to acquire will call createLanguageServiceSourceFile to generate - * the SourceFile if was not found in the registry. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @parm scriptSnapshot Text of the file. Only used if the file was not found - * in the registry and a new one was created. - * @parm version Current version of the file. Only used if the file was not found - * in the registry and a new one was created. - */ + * Request a stored SourceFile with a given fileName and compilationSettings. + * The first call to acquire will call createLanguageServiceSourceFile to generate + * the SourceFile if was not found in the registry. + * + * @param fileName The name of the file requested + * @param compilationSettings Some compilation settings like target affects the + * shape of a the resulting SourceFile. This allows the DocumentRegistry to store + * multiple copies of the same file for different compilation settings. + * @parm scriptSnapshot Text of the file. Only used if the file was not found + * in the registry and a new one was created. + * @parm version Current version of the file. Only used if the file was not found + * in the registry and a new one was created. + */ acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile; acquireDocumentWithKey(fileName: string, path: Path, compilationSettings: CompilerOptions, key: DocumentRegistryBucketKey, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile; /** - * Request an updated version of an already existing SourceFile with a given fileName - * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile - * to get an updated SourceFile. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @param scriptSnapshot Text of the file. - * @param version Current version of the file. - */ + * Request an updated version of an already existing SourceFile with a given fileName + * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile + * to get an updated SourceFile. + * + * @param fileName The name of the file requested + * @param compilationSettings Some compilation settings like target affects the + * shape of a the resulting SourceFile. This allows the DocumentRegistry to store + * multiple copies of the same file for different compilation settings. + * @param scriptSnapshot Text of the file. + * @param version Current version of the file. + */ updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile; updateDocumentWithKey(fileName: string, path: Path, compilationSettings: CompilerOptions, key: DocumentRegistryBucketKey, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile; getKeyForCompilationSettings(settings: CompilerOptions): DocumentRegistryBucketKey; /** - * Informs the DocumentRegistry that a file is not needed any longer. - * - * Note: It is not allowed to call release on a SourceFile that was not acquired from - * this registry originally. - * - * @param fileName The name of the file to be released - * @param compilationSettings The compilation settings used to acquire the file - */ + * Informs the DocumentRegistry that a file is not needed any longer. + * + * Note: It is not allowed to call release on a SourceFile that was not acquired from + * this registry originally. + * + * @param fileName The name of the file to be released + * @param compilationSettings The compilation settings used to acquire the file + */ releaseDocument(fileName: string, compilationSettings: CompilerOptions): void; releaseDocumentWithKey(path: Path, key: DocumentRegistryBucketKey): void; reportStats(): string; @@ -3156,12 +4031,21 @@ declare namespace ts { function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry): LanguageService; /** - * Get the path of the default library files (lib.d.ts) as distributed with the typescript - * node package. - * The functionality is not supported if the ts module is consumed outside of a node module. - */ + * Get the path of the default library files (lib.d.ts) as distributed with the typescript + * node package. + * The functionality is not supported if the ts module is consumed outside of a node module. + */ function getDefaultLibFilePath(options: CompilerOptions): string; } +declare namespace ts { + /** + * Transform one or more nodes using the supplied transformers. + * @param source A single `Node` or an array of `Node` objects. + * @param transformers An array of `TransformerFactory` callbacks used to process the transformation. + * @param compilerOptions Optional compiler options. + */ + function transform(source: T | T[], transformers: TransformerFactory[], compilerOptions?: CompilerOptions): TransformationResult; +} // MONACOCHANGE export = ts; diff --git a/lib/typescriptServices.js b/lib/typescriptServices.js index a8e93f90..f6c9bb9d 100644 --- a/lib/typescriptServices.js +++ b/lib/typescriptServices.js @@ -13,11 +13,24 @@ See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; }; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var ts; (function (ts) { // token > SyntaxKind.Identifer => token is a keyword @@ -39,351 +52,353 @@ var ts; SyntaxKind[SyntaxKind["NumericLiteral"] = 8] = "NumericLiteral"; SyntaxKind[SyntaxKind["StringLiteral"] = 9] = "StringLiteral"; SyntaxKind[SyntaxKind["JsxText"] = 10] = "JsxText"; - SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 11] = "RegularExpressionLiteral"; - SyntaxKind[SyntaxKind["NoSubstitutionTemplateLiteral"] = 12] = "NoSubstitutionTemplateLiteral"; + SyntaxKind[SyntaxKind["JsxTextAllWhiteSpaces"] = 11] = "JsxTextAllWhiteSpaces"; + SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 12] = "RegularExpressionLiteral"; + SyntaxKind[SyntaxKind["NoSubstitutionTemplateLiteral"] = 13] = "NoSubstitutionTemplateLiteral"; // Pseudo-literals - SyntaxKind[SyntaxKind["TemplateHead"] = 13] = "TemplateHead"; - SyntaxKind[SyntaxKind["TemplateMiddle"] = 14] = "TemplateMiddle"; - SyntaxKind[SyntaxKind["TemplateTail"] = 15] = "TemplateTail"; + SyntaxKind[SyntaxKind["TemplateHead"] = 14] = "TemplateHead"; + SyntaxKind[SyntaxKind["TemplateMiddle"] = 15] = "TemplateMiddle"; + SyntaxKind[SyntaxKind["TemplateTail"] = 16] = "TemplateTail"; // Punctuation - SyntaxKind[SyntaxKind["OpenBraceToken"] = 16] = "OpenBraceToken"; - SyntaxKind[SyntaxKind["CloseBraceToken"] = 17] = "CloseBraceToken"; - SyntaxKind[SyntaxKind["OpenParenToken"] = 18] = "OpenParenToken"; - SyntaxKind[SyntaxKind["CloseParenToken"] = 19] = "CloseParenToken"; - SyntaxKind[SyntaxKind["OpenBracketToken"] = 20] = "OpenBracketToken"; - SyntaxKind[SyntaxKind["CloseBracketToken"] = 21] = "CloseBracketToken"; - SyntaxKind[SyntaxKind["DotToken"] = 22] = "DotToken"; - SyntaxKind[SyntaxKind["DotDotDotToken"] = 23] = "DotDotDotToken"; - SyntaxKind[SyntaxKind["SemicolonToken"] = 24] = "SemicolonToken"; - SyntaxKind[SyntaxKind["CommaToken"] = 25] = "CommaToken"; - SyntaxKind[SyntaxKind["LessThanToken"] = 26] = "LessThanToken"; - SyntaxKind[SyntaxKind["LessThanSlashToken"] = 27] = "LessThanSlashToken"; - SyntaxKind[SyntaxKind["GreaterThanToken"] = 28] = "GreaterThanToken"; - SyntaxKind[SyntaxKind["LessThanEqualsToken"] = 29] = "LessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanEqualsToken"] = 30] = "GreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["EqualsEqualsToken"] = 31] = "EqualsEqualsToken"; - SyntaxKind[SyntaxKind["ExclamationEqualsToken"] = 32] = "ExclamationEqualsToken"; - SyntaxKind[SyntaxKind["EqualsEqualsEqualsToken"] = 33] = "EqualsEqualsEqualsToken"; - SyntaxKind[SyntaxKind["ExclamationEqualsEqualsToken"] = 34] = "ExclamationEqualsEqualsToken"; - SyntaxKind[SyntaxKind["EqualsGreaterThanToken"] = 35] = "EqualsGreaterThanToken"; - SyntaxKind[SyntaxKind["PlusToken"] = 36] = "PlusToken"; - SyntaxKind[SyntaxKind["MinusToken"] = 37] = "MinusToken"; - SyntaxKind[SyntaxKind["AsteriskToken"] = 38] = "AsteriskToken"; - SyntaxKind[SyntaxKind["AsteriskAsteriskToken"] = 39] = "AsteriskAsteriskToken"; - SyntaxKind[SyntaxKind["SlashToken"] = 40] = "SlashToken"; - SyntaxKind[SyntaxKind["PercentToken"] = 41] = "PercentToken"; - SyntaxKind[SyntaxKind["PlusPlusToken"] = 42] = "PlusPlusToken"; - SyntaxKind[SyntaxKind["MinusMinusToken"] = 43] = "MinusMinusToken"; - SyntaxKind[SyntaxKind["LessThanLessThanToken"] = 44] = "LessThanLessThanToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanToken"] = 45] = "GreaterThanGreaterThanToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanToken"] = 46] = "GreaterThanGreaterThanGreaterThanToken"; - SyntaxKind[SyntaxKind["AmpersandToken"] = 47] = "AmpersandToken"; - SyntaxKind[SyntaxKind["BarToken"] = 48] = "BarToken"; - SyntaxKind[SyntaxKind["CaretToken"] = 49] = "CaretToken"; - SyntaxKind[SyntaxKind["ExclamationToken"] = 50] = "ExclamationToken"; - SyntaxKind[SyntaxKind["TildeToken"] = 51] = "TildeToken"; - SyntaxKind[SyntaxKind["AmpersandAmpersandToken"] = 52] = "AmpersandAmpersandToken"; - SyntaxKind[SyntaxKind["BarBarToken"] = 53] = "BarBarToken"; - SyntaxKind[SyntaxKind["QuestionToken"] = 54] = "QuestionToken"; - SyntaxKind[SyntaxKind["ColonToken"] = 55] = "ColonToken"; - SyntaxKind[SyntaxKind["AtToken"] = 56] = "AtToken"; + SyntaxKind[SyntaxKind["OpenBraceToken"] = 17] = "OpenBraceToken"; + SyntaxKind[SyntaxKind["CloseBraceToken"] = 18] = "CloseBraceToken"; + SyntaxKind[SyntaxKind["OpenParenToken"] = 19] = "OpenParenToken"; + SyntaxKind[SyntaxKind["CloseParenToken"] = 20] = "CloseParenToken"; + SyntaxKind[SyntaxKind["OpenBracketToken"] = 21] = "OpenBracketToken"; + SyntaxKind[SyntaxKind["CloseBracketToken"] = 22] = "CloseBracketToken"; + SyntaxKind[SyntaxKind["DotToken"] = 23] = "DotToken"; + SyntaxKind[SyntaxKind["DotDotDotToken"] = 24] = "DotDotDotToken"; + SyntaxKind[SyntaxKind["SemicolonToken"] = 25] = "SemicolonToken"; + SyntaxKind[SyntaxKind["CommaToken"] = 26] = "CommaToken"; + SyntaxKind[SyntaxKind["LessThanToken"] = 27] = "LessThanToken"; + SyntaxKind[SyntaxKind["LessThanSlashToken"] = 28] = "LessThanSlashToken"; + SyntaxKind[SyntaxKind["GreaterThanToken"] = 29] = "GreaterThanToken"; + SyntaxKind[SyntaxKind["LessThanEqualsToken"] = 30] = "LessThanEqualsToken"; + SyntaxKind[SyntaxKind["GreaterThanEqualsToken"] = 31] = "GreaterThanEqualsToken"; + SyntaxKind[SyntaxKind["EqualsEqualsToken"] = 32] = "EqualsEqualsToken"; + SyntaxKind[SyntaxKind["ExclamationEqualsToken"] = 33] = "ExclamationEqualsToken"; + SyntaxKind[SyntaxKind["EqualsEqualsEqualsToken"] = 34] = "EqualsEqualsEqualsToken"; + SyntaxKind[SyntaxKind["ExclamationEqualsEqualsToken"] = 35] = "ExclamationEqualsEqualsToken"; + SyntaxKind[SyntaxKind["EqualsGreaterThanToken"] = 36] = "EqualsGreaterThanToken"; + SyntaxKind[SyntaxKind["PlusToken"] = 37] = "PlusToken"; + SyntaxKind[SyntaxKind["MinusToken"] = 38] = "MinusToken"; + SyntaxKind[SyntaxKind["AsteriskToken"] = 39] = "AsteriskToken"; + SyntaxKind[SyntaxKind["AsteriskAsteriskToken"] = 40] = "AsteriskAsteriskToken"; + SyntaxKind[SyntaxKind["SlashToken"] = 41] = "SlashToken"; + SyntaxKind[SyntaxKind["PercentToken"] = 42] = "PercentToken"; + SyntaxKind[SyntaxKind["PlusPlusToken"] = 43] = "PlusPlusToken"; + SyntaxKind[SyntaxKind["MinusMinusToken"] = 44] = "MinusMinusToken"; + SyntaxKind[SyntaxKind["LessThanLessThanToken"] = 45] = "LessThanLessThanToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanToken"] = 46] = "GreaterThanGreaterThanToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanToken"] = 47] = "GreaterThanGreaterThanGreaterThanToken"; + SyntaxKind[SyntaxKind["AmpersandToken"] = 48] = "AmpersandToken"; + SyntaxKind[SyntaxKind["BarToken"] = 49] = "BarToken"; + SyntaxKind[SyntaxKind["CaretToken"] = 50] = "CaretToken"; + SyntaxKind[SyntaxKind["ExclamationToken"] = 51] = "ExclamationToken"; + SyntaxKind[SyntaxKind["TildeToken"] = 52] = "TildeToken"; + SyntaxKind[SyntaxKind["AmpersandAmpersandToken"] = 53] = "AmpersandAmpersandToken"; + SyntaxKind[SyntaxKind["BarBarToken"] = 54] = "BarBarToken"; + SyntaxKind[SyntaxKind["QuestionToken"] = 55] = "QuestionToken"; + SyntaxKind[SyntaxKind["ColonToken"] = 56] = "ColonToken"; + SyntaxKind[SyntaxKind["AtToken"] = 57] = "AtToken"; // Assignments - SyntaxKind[SyntaxKind["EqualsToken"] = 57] = "EqualsToken"; - SyntaxKind[SyntaxKind["PlusEqualsToken"] = 58] = "PlusEqualsToken"; - SyntaxKind[SyntaxKind["MinusEqualsToken"] = 59] = "MinusEqualsToken"; - SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 60] = "AsteriskEqualsToken"; - SyntaxKind[SyntaxKind["AsteriskAsteriskEqualsToken"] = 61] = "AsteriskAsteriskEqualsToken"; - SyntaxKind[SyntaxKind["SlashEqualsToken"] = 62] = "SlashEqualsToken"; - SyntaxKind[SyntaxKind["PercentEqualsToken"] = 63] = "PercentEqualsToken"; - SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 64] = "LessThanLessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 65] = "GreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 66] = "GreaterThanGreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 67] = "AmpersandEqualsToken"; - SyntaxKind[SyntaxKind["BarEqualsToken"] = 68] = "BarEqualsToken"; - SyntaxKind[SyntaxKind["CaretEqualsToken"] = 69] = "CaretEqualsToken"; + SyntaxKind[SyntaxKind["EqualsToken"] = 58] = "EqualsToken"; + SyntaxKind[SyntaxKind["PlusEqualsToken"] = 59] = "PlusEqualsToken"; + SyntaxKind[SyntaxKind["MinusEqualsToken"] = 60] = "MinusEqualsToken"; + SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 61] = "AsteriskEqualsToken"; + SyntaxKind[SyntaxKind["AsteriskAsteriskEqualsToken"] = 62] = "AsteriskAsteriskEqualsToken"; + SyntaxKind[SyntaxKind["SlashEqualsToken"] = 63] = "SlashEqualsToken"; + SyntaxKind[SyntaxKind["PercentEqualsToken"] = 64] = "PercentEqualsToken"; + SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 65] = "LessThanLessThanEqualsToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 66] = "GreaterThanGreaterThanEqualsToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 67] = "GreaterThanGreaterThanGreaterThanEqualsToken"; + SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 68] = "AmpersandEqualsToken"; + SyntaxKind[SyntaxKind["BarEqualsToken"] = 69] = "BarEqualsToken"; + SyntaxKind[SyntaxKind["CaretEqualsToken"] = 70] = "CaretEqualsToken"; // Identifiers - SyntaxKind[SyntaxKind["Identifier"] = 70] = "Identifier"; + SyntaxKind[SyntaxKind["Identifier"] = 71] = "Identifier"; // Reserved words - SyntaxKind[SyntaxKind["BreakKeyword"] = 71] = "BreakKeyword"; - SyntaxKind[SyntaxKind["CaseKeyword"] = 72] = "CaseKeyword"; - SyntaxKind[SyntaxKind["CatchKeyword"] = 73] = "CatchKeyword"; - SyntaxKind[SyntaxKind["ClassKeyword"] = 74] = "ClassKeyword"; - SyntaxKind[SyntaxKind["ConstKeyword"] = 75] = "ConstKeyword"; - SyntaxKind[SyntaxKind["ContinueKeyword"] = 76] = "ContinueKeyword"; - SyntaxKind[SyntaxKind["DebuggerKeyword"] = 77] = "DebuggerKeyword"; - SyntaxKind[SyntaxKind["DefaultKeyword"] = 78] = "DefaultKeyword"; - SyntaxKind[SyntaxKind["DeleteKeyword"] = 79] = "DeleteKeyword"; - SyntaxKind[SyntaxKind["DoKeyword"] = 80] = "DoKeyword"; - SyntaxKind[SyntaxKind["ElseKeyword"] = 81] = "ElseKeyword"; - SyntaxKind[SyntaxKind["EnumKeyword"] = 82] = "EnumKeyword"; - SyntaxKind[SyntaxKind["ExportKeyword"] = 83] = "ExportKeyword"; - SyntaxKind[SyntaxKind["ExtendsKeyword"] = 84] = "ExtendsKeyword"; - SyntaxKind[SyntaxKind["FalseKeyword"] = 85] = "FalseKeyword"; - SyntaxKind[SyntaxKind["FinallyKeyword"] = 86] = "FinallyKeyword"; - SyntaxKind[SyntaxKind["ForKeyword"] = 87] = "ForKeyword"; - SyntaxKind[SyntaxKind["FunctionKeyword"] = 88] = "FunctionKeyword"; - SyntaxKind[SyntaxKind["IfKeyword"] = 89] = "IfKeyword"; - SyntaxKind[SyntaxKind["ImportKeyword"] = 90] = "ImportKeyword"; - SyntaxKind[SyntaxKind["InKeyword"] = 91] = "InKeyword"; - SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 92] = "InstanceOfKeyword"; - SyntaxKind[SyntaxKind["NewKeyword"] = 93] = "NewKeyword"; - SyntaxKind[SyntaxKind["NullKeyword"] = 94] = "NullKeyword"; - SyntaxKind[SyntaxKind["ReturnKeyword"] = 95] = "ReturnKeyword"; - SyntaxKind[SyntaxKind["SuperKeyword"] = 96] = "SuperKeyword"; - SyntaxKind[SyntaxKind["SwitchKeyword"] = 97] = "SwitchKeyword"; - SyntaxKind[SyntaxKind["ThisKeyword"] = 98] = "ThisKeyword"; - SyntaxKind[SyntaxKind["ThrowKeyword"] = 99] = "ThrowKeyword"; - SyntaxKind[SyntaxKind["TrueKeyword"] = 100] = "TrueKeyword"; - SyntaxKind[SyntaxKind["TryKeyword"] = 101] = "TryKeyword"; - SyntaxKind[SyntaxKind["TypeOfKeyword"] = 102] = "TypeOfKeyword"; - SyntaxKind[SyntaxKind["VarKeyword"] = 103] = "VarKeyword"; - SyntaxKind[SyntaxKind["VoidKeyword"] = 104] = "VoidKeyword"; - SyntaxKind[SyntaxKind["WhileKeyword"] = 105] = "WhileKeyword"; - SyntaxKind[SyntaxKind["WithKeyword"] = 106] = "WithKeyword"; + SyntaxKind[SyntaxKind["BreakKeyword"] = 72] = "BreakKeyword"; + SyntaxKind[SyntaxKind["CaseKeyword"] = 73] = "CaseKeyword"; + SyntaxKind[SyntaxKind["CatchKeyword"] = 74] = "CatchKeyword"; + SyntaxKind[SyntaxKind["ClassKeyword"] = 75] = "ClassKeyword"; + SyntaxKind[SyntaxKind["ConstKeyword"] = 76] = "ConstKeyword"; + SyntaxKind[SyntaxKind["ContinueKeyword"] = 77] = "ContinueKeyword"; + SyntaxKind[SyntaxKind["DebuggerKeyword"] = 78] = "DebuggerKeyword"; + SyntaxKind[SyntaxKind["DefaultKeyword"] = 79] = "DefaultKeyword"; + SyntaxKind[SyntaxKind["DeleteKeyword"] = 80] = "DeleteKeyword"; + SyntaxKind[SyntaxKind["DoKeyword"] = 81] = "DoKeyword"; + SyntaxKind[SyntaxKind["ElseKeyword"] = 82] = "ElseKeyword"; + SyntaxKind[SyntaxKind["EnumKeyword"] = 83] = "EnumKeyword"; + SyntaxKind[SyntaxKind["ExportKeyword"] = 84] = "ExportKeyword"; + SyntaxKind[SyntaxKind["ExtendsKeyword"] = 85] = "ExtendsKeyword"; + SyntaxKind[SyntaxKind["FalseKeyword"] = 86] = "FalseKeyword"; + SyntaxKind[SyntaxKind["FinallyKeyword"] = 87] = "FinallyKeyword"; + SyntaxKind[SyntaxKind["ForKeyword"] = 88] = "ForKeyword"; + SyntaxKind[SyntaxKind["FunctionKeyword"] = 89] = "FunctionKeyword"; + SyntaxKind[SyntaxKind["IfKeyword"] = 90] = "IfKeyword"; + SyntaxKind[SyntaxKind["ImportKeyword"] = 91] = "ImportKeyword"; + SyntaxKind[SyntaxKind["InKeyword"] = 92] = "InKeyword"; + SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 93] = "InstanceOfKeyword"; + SyntaxKind[SyntaxKind["NewKeyword"] = 94] = "NewKeyword"; + SyntaxKind[SyntaxKind["NullKeyword"] = 95] = "NullKeyword"; + SyntaxKind[SyntaxKind["ReturnKeyword"] = 96] = "ReturnKeyword"; + SyntaxKind[SyntaxKind["SuperKeyword"] = 97] = "SuperKeyword"; + SyntaxKind[SyntaxKind["SwitchKeyword"] = 98] = "SwitchKeyword"; + SyntaxKind[SyntaxKind["ThisKeyword"] = 99] = "ThisKeyword"; + SyntaxKind[SyntaxKind["ThrowKeyword"] = 100] = "ThrowKeyword"; + SyntaxKind[SyntaxKind["TrueKeyword"] = 101] = "TrueKeyword"; + SyntaxKind[SyntaxKind["TryKeyword"] = 102] = "TryKeyword"; + SyntaxKind[SyntaxKind["TypeOfKeyword"] = 103] = "TypeOfKeyword"; + SyntaxKind[SyntaxKind["VarKeyword"] = 104] = "VarKeyword"; + SyntaxKind[SyntaxKind["VoidKeyword"] = 105] = "VoidKeyword"; + SyntaxKind[SyntaxKind["WhileKeyword"] = 106] = "WhileKeyword"; + SyntaxKind[SyntaxKind["WithKeyword"] = 107] = "WithKeyword"; // Strict mode reserved words - SyntaxKind[SyntaxKind["ImplementsKeyword"] = 107] = "ImplementsKeyword"; - SyntaxKind[SyntaxKind["InterfaceKeyword"] = 108] = "InterfaceKeyword"; - SyntaxKind[SyntaxKind["LetKeyword"] = 109] = "LetKeyword"; - SyntaxKind[SyntaxKind["PackageKeyword"] = 110] = "PackageKeyword"; - SyntaxKind[SyntaxKind["PrivateKeyword"] = 111] = "PrivateKeyword"; - SyntaxKind[SyntaxKind["ProtectedKeyword"] = 112] = "ProtectedKeyword"; - SyntaxKind[SyntaxKind["PublicKeyword"] = 113] = "PublicKeyword"; - SyntaxKind[SyntaxKind["StaticKeyword"] = 114] = "StaticKeyword"; - SyntaxKind[SyntaxKind["YieldKeyword"] = 115] = "YieldKeyword"; + SyntaxKind[SyntaxKind["ImplementsKeyword"] = 108] = "ImplementsKeyword"; + SyntaxKind[SyntaxKind["InterfaceKeyword"] = 109] = "InterfaceKeyword"; + SyntaxKind[SyntaxKind["LetKeyword"] = 110] = "LetKeyword"; + SyntaxKind[SyntaxKind["PackageKeyword"] = 111] = "PackageKeyword"; + SyntaxKind[SyntaxKind["PrivateKeyword"] = 112] = "PrivateKeyword"; + SyntaxKind[SyntaxKind["ProtectedKeyword"] = 113] = "ProtectedKeyword"; + SyntaxKind[SyntaxKind["PublicKeyword"] = 114] = "PublicKeyword"; + SyntaxKind[SyntaxKind["StaticKeyword"] = 115] = "StaticKeyword"; + SyntaxKind[SyntaxKind["YieldKeyword"] = 116] = "YieldKeyword"; // Contextual keywords - SyntaxKind[SyntaxKind["AbstractKeyword"] = 116] = "AbstractKeyword"; - SyntaxKind[SyntaxKind["AsKeyword"] = 117] = "AsKeyword"; - SyntaxKind[SyntaxKind["AnyKeyword"] = 118] = "AnyKeyword"; - SyntaxKind[SyntaxKind["AsyncKeyword"] = 119] = "AsyncKeyword"; - SyntaxKind[SyntaxKind["AwaitKeyword"] = 120] = "AwaitKeyword"; - SyntaxKind[SyntaxKind["BooleanKeyword"] = 121] = "BooleanKeyword"; - SyntaxKind[SyntaxKind["ConstructorKeyword"] = 122] = "ConstructorKeyword"; - SyntaxKind[SyntaxKind["DeclareKeyword"] = 123] = "DeclareKeyword"; - SyntaxKind[SyntaxKind["GetKeyword"] = 124] = "GetKeyword"; - SyntaxKind[SyntaxKind["IsKeyword"] = 125] = "IsKeyword"; - SyntaxKind[SyntaxKind["KeyOfKeyword"] = 126] = "KeyOfKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 127] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["NamespaceKeyword"] = 128] = "NamespaceKeyword"; - SyntaxKind[SyntaxKind["NeverKeyword"] = 129] = "NeverKeyword"; - SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 130] = "ReadonlyKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 131] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 132] = "NumberKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 133] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 134] = "StringKeyword"; - SyntaxKind[SyntaxKind["SymbolKeyword"] = 135] = "SymbolKeyword"; - SyntaxKind[SyntaxKind["TypeKeyword"] = 136] = "TypeKeyword"; - SyntaxKind[SyntaxKind["UndefinedKeyword"] = 137] = "UndefinedKeyword"; - SyntaxKind[SyntaxKind["FromKeyword"] = 138] = "FromKeyword"; - SyntaxKind[SyntaxKind["GlobalKeyword"] = 139] = "GlobalKeyword"; - SyntaxKind[SyntaxKind["OfKeyword"] = 140] = "OfKeyword"; + SyntaxKind[SyntaxKind["AbstractKeyword"] = 117] = "AbstractKeyword"; + SyntaxKind[SyntaxKind["AsKeyword"] = 118] = "AsKeyword"; + SyntaxKind[SyntaxKind["AnyKeyword"] = 119] = "AnyKeyword"; + SyntaxKind[SyntaxKind["AsyncKeyword"] = 120] = "AsyncKeyword"; + SyntaxKind[SyntaxKind["AwaitKeyword"] = 121] = "AwaitKeyword"; + SyntaxKind[SyntaxKind["BooleanKeyword"] = 122] = "BooleanKeyword"; + 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["FromKeyword"] = 140] = "FromKeyword"; + SyntaxKind[SyntaxKind["GlobalKeyword"] = 141] = "GlobalKeyword"; + SyntaxKind[SyntaxKind["OfKeyword"] = 142] = "OfKeyword"; // Parse tree nodes // Names - SyntaxKind[SyntaxKind["QualifiedName"] = 141] = "QualifiedName"; - SyntaxKind[SyntaxKind["ComputedPropertyName"] = 142] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["QualifiedName"] = 143] = "QualifiedName"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 144] = "ComputedPropertyName"; // Signature elements - SyntaxKind[SyntaxKind["TypeParameter"] = 143] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 144] = "Parameter"; - SyntaxKind[SyntaxKind["Decorator"] = 145] = "Decorator"; + SyntaxKind[SyntaxKind["TypeParameter"] = 145] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 146] = "Parameter"; + SyntaxKind[SyntaxKind["Decorator"] = 147] = "Decorator"; // TypeMember - SyntaxKind[SyntaxKind["PropertySignature"] = 146] = "PropertySignature"; - SyntaxKind[SyntaxKind["PropertyDeclaration"] = 147] = "PropertyDeclaration"; - SyntaxKind[SyntaxKind["MethodSignature"] = 148] = "MethodSignature"; - SyntaxKind[SyntaxKind["MethodDeclaration"] = 149] = "MethodDeclaration"; - SyntaxKind[SyntaxKind["Constructor"] = 150] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 151] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 152] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 153] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 154] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 155] = "IndexSignature"; + SyntaxKind[SyntaxKind["PropertySignature"] = 148] = "PropertySignature"; + SyntaxKind[SyntaxKind["PropertyDeclaration"] = 149] = "PropertyDeclaration"; + SyntaxKind[SyntaxKind["MethodSignature"] = 150] = "MethodSignature"; + SyntaxKind[SyntaxKind["MethodDeclaration"] = 151] = "MethodDeclaration"; + SyntaxKind[SyntaxKind["Constructor"] = 152] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 153] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 154] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 155] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 156] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 157] = "IndexSignature"; // Type - SyntaxKind[SyntaxKind["TypePredicate"] = 156] = "TypePredicate"; - SyntaxKind[SyntaxKind["TypeReference"] = 157] = "TypeReference"; - SyntaxKind[SyntaxKind["FunctionType"] = 158] = "FunctionType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 159] = "ConstructorType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 160] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 161] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 162] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 163] = "TupleType"; - SyntaxKind[SyntaxKind["UnionType"] = 164] = "UnionType"; - SyntaxKind[SyntaxKind["IntersectionType"] = 165] = "IntersectionType"; - SyntaxKind[SyntaxKind["ParenthesizedType"] = 166] = "ParenthesizedType"; - SyntaxKind[SyntaxKind["ThisType"] = 167] = "ThisType"; - SyntaxKind[SyntaxKind["TypeOperator"] = 168] = "TypeOperator"; - SyntaxKind[SyntaxKind["IndexedAccessType"] = 169] = "IndexedAccessType"; - SyntaxKind[SyntaxKind["MappedType"] = 170] = "MappedType"; - SyntaxKind[SyntaxKind["LiteralType"] = 171] = "LiteralType"; + SyntaxKind[SyntaxKind["TypePredicate"] = 158] = "TypePredicate"; + SyntaxKind[SyntaxKind["TypeReference"] = 159] = "TypeReference"; + SyntaxKind[SyntaxKind["FunctionType"] = 160] = "FunctionType"; + SyntaxKind[SyntaxKind["ConstructorType"] = 161] = "ConstructorType"; + SyntaxKind[SyntaxKind["TypeQuery"] = 162] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 163] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 164] = "ArrayType"; + SyntaxKind[SyntaxKind["TupleType"] = 165] = "TupleType"; + SyntaxKind[SyntaxKind["UnionType"] = 166] = "UnionType"; + SyntaxKind[SyntaxKind["IntersectionType"] = 167] = "IntersectionType"; + SyntaxKind[SyntaxKind["ParenthesizedType"] = 168] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["ThisType"] = 169] = "ThisType"; + SyntaxKind[SyntaxKind["TypeOperator"] = 170] = "TypeOperator"; + SyntaxKind[SyntaxKind["IndexedAccessType"] = 171] = "IndexedAccessType"; + SyntaxKind[SyntaxKind["MappedType"] = 172] = "MappedType"; + SyntaxKind[SyntaxKind["LiteralType"] = 173] = "LiteralType"; // Binding patterns - SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 172] = "ObjectBindingPattern"; - SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 173] = "ArrayBindingPattern"; - SyntaxKind[SyntaxKind["BindingElement"] = 174] = "BindingElement"; + SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 174] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 175] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 176] = "BindingElement"; // Expression - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 175] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 176] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 177] = "PropertyAccessExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 178] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["CallExpression"] = 179] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 180] = "NewExpression"; - SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 181] = "TaggedTemplateExpression"; - SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 182] = "TypeAssertionExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 183] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 184] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 185] = "ArrowFunction"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 186] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 187] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 188] = "VoidExpression"; - SyntaxKind[SyntaxKind["AwaitExpression"] = 189] = "AwaitExpression"; - SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 190] = "PrefixUnaryExpression"; - SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 191] = "PostfixUnaryExpression"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 192] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 193] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["TemplateExpression"] = 194] = "TemplateExpression"; - SyntaxKind[SyntaxKind["YieldExpression"] = 195] = "YieldExpression"; - SyntaxKind[SyntaxKind["SpreadElement"] = 196] = "SpreadElement"; - SyntaxKind[SyntaxKind["ClassExpression"] = 197] = "ClassExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 198] = "OmittedExpression"; - SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 199] = "ExpressionWithTypeArguments"; - SyntaxKind[SyntaxKind["AsExpression"] = 200] = "AsExpression"; - SyntaxKind[SyntaxKind["NonNullExpression"] = 201] = "NonNullExpression"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 177] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 178] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 179] = "PropertyAccessExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 180] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["CallExpression"] = 181] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 182] = "NewExpression"; + SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 183] = "TaggedTemplateExpression"; + SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 184] = "TypeAssertionExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 185] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 186] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 187] = "ArrowFunction"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 188] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 189] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 190] = "VoidExpression"; + SyntaxKind[SyntaxKind["AwaitExpression"] = 191] = "AwaitExpression"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 192] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 193] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 194] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 195] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 196] = "TemplateExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 197] = "YieldExpression"; + SyntaxKind[SyntaxKind["SpreadElement"] = 198] = "SpreadElement"; + SyntaxKind[SyntaxKind["ClassExpression"] = 199] = "ClassExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 200] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 201] = "ExpressionWithTypeArguments"; + SyntaxKind[SyntaxKind["AsExpression"] = 202] = "AsExpression"; + SyntaxKind[SyntaxKind["NonNullExpression"] = 203] = "NonNullExpression"; + SyntaxKind[SyntaxKind["MetaProperty"] = 204] = "MetaProperty"; // Misc - SyntaxKind[SyntaxKind["TemplateSpan"] = 202] = "TemplateSpan"; - SyntaxKind[SyntaxKind["SemicolonClassElement"] = 203] = "SemicolonClassElement"; + SyntaxKind[SyntaxKind["TemplateSpan"] = 205] = "TemplateSpan"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 206] = "SemicolonClassElement"; // Element - SyntaxKind[SyntaxKind["Block"] = 204] = "Block"; - SyntaxKind[SyntaxKind["VariableStatement"] = 205] = "VariableStatement"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 206] = "EmptyStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 207] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 208] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 209] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 210] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 211] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 212] = "ForInStatement"; - SyntaxKind[SyntaxKind["ForOfStatement"] = 213] = "ForOfStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 214] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 215] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 216] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 217] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 218] = "SwitchStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 219] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 220] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 221] = "TryStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 222] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 223] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarationList"] = 224] = "VariableDeclarationList"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 225] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 226] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 227] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 228] = "TypeAliasDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 229] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 230] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 231] = "ModuleBlock"; - SyntaxKind[SyntaxKind["CaseBlock"] = 232] = "CaseBlock"; - SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 233] = "NamespaceExportDeclaration"; - SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 234] = "ImportEqualsDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 235] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ImportClause"] = 236] = "ImportClause"; - SyntaxKind[SyntaxKind["NamespaceImport"] = 237] = "NamespaceImport"; - SyntaxKind[SyntaxKind["NamedImports"] = 238] = "NamedImports"; - SyntaxKind[SyntaxKind["ImportSpecifier"] = 239] = "ImportSpecifier"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 240] = "ExportAssignment"; - SyntaxKind[SyntaxKind["ExportDeclaration"] = 241] = "ExportDeclaration"; - SyntaxKind[SyntaxKind["NamedExports"] = 242] = "NamedExports"; - SyntaxKind[SyntaxKind["ExportSpecifier"] = 243] = "ExportSpecifier"; - SyntaxKind[SyntaxKind["MissingDeclaration"] = 244] = "MissingDeclaration"; + SyntaxKind[SyntaxKind["Block"] = 207] = "Block"; + SyntaxKind[SyntaxKind["VariableStatement"] = 208] = "VariableStatement"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 209] = "EmptyStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 210] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 211] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 212] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 213] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 214] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 215] = "ForInStatement"; + SyntaxKind[SyntaxKind["ForOfStatement"] = 216] = "ForOfStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 217] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 218] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 219] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 220] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 221] = "SwitchStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 222] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 223] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 224] = "TryStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 225] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 226] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarationList"] = 227] = "VariableDeclarationList"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 228] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 229] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 230] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 231] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 232] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 233] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 234] = "ModuleBlock"; + SyntaxKind[SyntaxKind["CaseBlock"] = 235] = "CaseBlock"; + SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 236] = "NamespaceExportDeclaration"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 237] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 238] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 239] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 240] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 241] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 242] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 243] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 244] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 245] = "NamedExports"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 246] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["MissingDeclaration"] = 247] = "MissingDeclaration"; // Module references - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 245] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 248] = "ExternalModuleReference"; // JSX - SyntaxKind[SyntaxKind["JsxElement"] = 246] = "JsxElement"; - SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 247] = "JsxSelfClosingElement"; - SyntaxKind[SyntaxKind["JsxOpeningElement"] = 248] = "JsxOpeningElement"; - SyntaxKind[SyntaxKind["JsxClosingElement"] = 249] = "JsxClosingElement"; - SyntaxKind[SyntaxKind["JsxAttribute"] = 250] = "JsxAttribute"; - SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 251] = "JsxSpreadAttribute"; - SyntaxKind[SyntaxKind["JsxExpression"] = 252] = "JsxExpression"; + SyntaxKind[SyntaxKind["JsxElement"] = 249] = "JsxElement"; + SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 250] = "JsxSelfClosingElement"; + SyntaxKind[SyntaxKind["JsxOpeningElement"] = 251] = "JsxOpeningElement"; + SyntaxKind[SyntaxKind["JsxClosingElement"] = 252] = "JsxClosingElement"; + SyntaxKind[SyntaxKind["JsxAttribute"] = 253] = "JsxAttribute"; + SyntaxKind[SyntaxKind["JsxAttributes"] = 254] = "JsxAttributes"; + SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 255] = "JsxSpreadAttribute"; + SyntaxKind[SyntaxKind["JsxExpression"] = 256] = "JsxExpression"; // Clauses - SyntaxKind[SyntaxKind["CaseClause"] = 253] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 254] = "DefaultClause"; - SyntaxKind[SyntaxKind["HeritageClause"] = 255] = "HeritageClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 256] = "CatchClause"; + SyntaxKind[SyntaxKind["CaseClause"] = 257] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 258] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 259] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 260] = "CatchClause"; // Property assignments - SyntaxKind[SyntaxKind["PropertyAssignment"] = 257] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 258] = "ShorthandPropertyAssignment"; - SyntaxKind[SyntaxKind["SpreadAssignment"] = 259] = "SpreadAssignment"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 261] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 262] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["SpreadAssignment"] = 263] = "SpreadAssignment"; // Enum - SyntaxKind[SyntaxKind["EnumMember"] = 260] = "EnumMember"; + SyntaxKind[SyntaxKind["EnumMember"] = 264] = "EnumMember"; // Top-level nodes - SyntaxKind[SyntaxKind["SourceFile"] = 261] = "SourceFile"; + SyntaxKind[SyntaxKind["SourceFile"] = 265] = "SourceFile"; + SyntaxKind[SyntaxKind["Bundle"] = 266] = "Bundle"; // JSDoc nodes - SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 262] = "JSDocTypeExpression"; + SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 267] = "JSDocTypeExpression"; // The * type - SyntaxKind[SyntaxKind["JSDocAllType"] = 263] = "JSDocAllType"; + SyntaxKind[SyntaxKind["JSDocAllType"] = 268] = "JSDocAllType"; // The ? type - SyntaxKind[SyntaxKind["JSDocUnknownType"] = 264] = "JSDocUnknownType"; - SyntaxKind[SyntaxKind["JSDocArrayType"] = 265] = "JSDocArrayType"; - SyntaxKind[SyntaxKind["JSDocUnionType"] = 266] = "JSDocUnionType"; - SyntaxKind[SyntaxKind["JSDocTupleType"] = 267] = "JSDocTupleType"; - SyntaxKind[SyntaxKind["JSDocNullableType"] = 268] = "JSDocNullableType"; - SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 269] = "JSDocNonNullableType"; - SyntaxKind[SyntaxKind["JSDocRecordType"] = 270] = "JSDocRecordType"; - SyntaxKind[SyntaxKind["JSDocRecordMember"] = 271] = "JSDocRecordMember"; - SyntaxKind[SyntaxKind["JSDocTypeReference"] = 272] = "JSDocTypeReference"; - SyntaxKind[SyntaxKind["JSDocOptionalType"] = 273] = "JSDocOptionalType"; - SyntaxKind[SyntaxKind["JSDocFunctionType"] = 274] = "JSDocFunctionType"; - SyntaxKind[SyntaxKind["JSDocVariadicType"] = 275] = "JSDocVariadicType"; - SyntaxKind[SyntaxKind["JSDocConstructorType"] = 276] = "JSDocConstructorType"; - SyntaxKind[SyntaxKind["JSDocThisType"] = 277] = "JSDocThisType"; - SyntaxKind[SyntaxKind["JSDocComment"] = 278] = "JSDocComment"; - SyntaxKind[SyntaxKind["JSDocTag"] = 279] = "JSDocTag"; - SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 280] = "JSDocAugmentsTag"; - SyntaxKind[SyntaxKind["JSDocParameterTag"] = 281] = "JSDocParameterTag"; - SyntaxKind[SyntaxKind["JSDocReturnTag"] = 282] = "JSDocReturnTag"; - SyntaxKind[SyntaxKind["JSDocTypeTag"] = 283] = "JSDocTypeTag"; - SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 284] = "JSDocTemplateTag"; - SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 285] = "JSDocTypedefTag"; - SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 286] = "JSDocPropertyTag"; - SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 287] = "JSDocTypeLiteral"; - SyntaxKind[SyntaxKind["JSDocLiteralType"] = 288] = "JSDocLiteralType"; - SyntaxKind[SyntaxKind["JSDocNullKeyword"] = 289] = "JSDocNullKeyword"; - SyntaxKind[SyntaxKind["JSDocUndefinedKeyword"] = 290] = "JSDocUndefinedKeyword"; - SyntaxKind[SyntaxKind["JSDocNeverKeyword"] = 291] = "JSDocNeverKeyword"; + SyntaxKind[SyntaxKind["JSDocUnknownType"] = 269] = "JSDocUnknownType"; + SyntaxKind[SyntaxKind["JSDocArrayType"] = 270] = "JSDocArrayType"; + SyntaxKind[SyntaxKind["JSDocUnionType"] = 271] = "JSDocUnionType"; + SyntaxKind[SyntaxKind["JSDocTupleType"] = 272] = "JSDocTupleType"; + SyntaxKind[SyntaxKind["JSDocNullableType"] = 273] = "JSDocNullableType"; + SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 274] = "JSDocNonNullableType"; + SyntaxKind[SyntaxKind["JSDocRecordType"] = 275] = "JSDocRecordType"; + SyntaxKind[SyntaxKind["JSDocRecordMember"] = 276] = "JSDocRecordMember"; + SyntaxKind[SyntaxKind["JSDocTypeReference"] = 277] = "JSDocTypeReference"; + SyntaxKind[SyntaxKind["JSDocOptionalType"] = 278] = "JSDocOptionalType"; + SyntaxKind[SyntaxKind["JSDocFunctionType"] = 279] = "JSDocFunctionType"; + SyntaxKind[SyntaxKind["JSDocVariadicType"] = 280] = "JSDocVariadicType"; + SyntaxKind[SyntaxKind["JSDocConstructorType"] = 281] = "JSDocConstructorType"; + SyntaxKind[SyntaxKind["JSDocThisType"] = 282] = "JSDocThisType"; + SyntaxKind[SyntaxKind["JSDocComment"] = 283] = "JSDocComment"; + SyntaxKind[SyntaxKind["JSDocTag"] = 284] = "JSDocTag"; + SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 285] = "JSDocAugmentsTag"; + SyntaxKind[SyntaxKind["JSDocParameterTag"] = 286] = "JSDocParameterTag"; + SyntaxKind[SyntaxKind["JSDocReturnTag"] = 287] = "JSDocReturnTag"; + SyntaxKind[SyntaxKind["JSDocTypeTag"] = 288] = "JSDocTypeTag"; + SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 289] = "JSDocTemplateTag"; + SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 290] = "JSDocTypedefTag"; + SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 291] = "JSDocPropertyTag"; + SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 292] = "JSDocTypeLiteral"; + SyntaxKind[SyntaxKind["JSDocLiteralType"] = 293] = "JSDocLiteralType"; // Synthesized list - SyntaxKind[SyntaxKind["SyntaxList"] = 292] = "SyntaxList"; + SyntaxKind[SyntaxKind["SyntaxList"] = 294] = "SyntaxList"; // Transformation nodes - SyntaxKind[SyntaxKind["NotEmittedStatement"] = 293] = "NotEmittedStatement"; - SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 294] = "PartiallyEmittedExpression"; - SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 295] = "MergeDeclarationMarker"; - SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 296] = "EndOfDeclarationMarker"; + SyntaxKind[SyntaxKind["NotEmittedStatement"] = 295] = "NotEmittedStatement"; + SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 296] = "PartiallyEmittedExpression"; + SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 297] = "MergeDeclarationMarker"; + SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 298] = "EndOfDeclarationMarker"; // Enum value count - SyntaxKind[SyntaxKind["Count"] = 297] = "Count"; + SyntaxKind[SyntaxKind["Count"] = 299] = "Count"; // Markers - SyntaxKind[SyntaxKind["FirstAssignment"] = 57] = "FirstAssignment"; - SyntaxKind[SyntaxKind["LastAssignment"] = 69] = "LastAssignment"; - SyntaxKind[SyntaxKind["FirstCompoundAssignment"] = 58] = "FirstCompoundAssignment"; - SyntaxKind[SyntaxKind["LastCompoundAssignment"] = 69] = "LastCompoundAssignment"; - SyntaxKind[SyntaxKind["FirstReservedWord"] = 71] = "FirstReservedWord"; - SyntaxKind[SyntaxKind["LastReservedWord"] = 106] = "LastReservedWord"; - SyntaxKind[SyntaxKind["FirstKeyword"] = 71] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = 140] = "LastKeyword"; - SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 107] = "FirstFutureReservedWord"; - SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 115] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = 156] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = 171] = "LastTypeNode"; - SyntaxKind[SyntaxKind["FirstPunctuation"] = 16] = "FirstPunctuation"; - SyntaxKind[SyntaxKind["LastPunctuation"] = 69] = "LastPunctuation"; + SyntaxKind[SyntaxKind["FirstAssignment"] = 58] = "FirstAssignment"; + SyntaxKind[SyntaxKind["LastAssignment"] = 70] = "LastAssignment"; + SyntaxKind[SyntaxKind["FirstCompoundAssignment"] = 59] = "FirstCompoundAssignment"; + SyntaxKind[SyntaxKind["LastCompoundAssignment"] = 70] = "LastCompoundAssignment"; + SyntaxKind[SyntaxKind["FirstReservedWord"] = 72] = "FirstReservedWord"; + SyntaxKind[SyntaxKind["LastReservedWord"] = 107] = "LastReservedWord"; + SyntaxKind[SyntaxKind["FirstKeyword"] = 72] = "FirstKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = 142] = "LastKeyword"; + SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 108] = "FirstFutureReservedWord"; + SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 116] = "LastFutureReservedWord"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 158] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 173] = "LastTypeNode"; + SyntaxKind[SyntaxKind["FirstPunctuation"] = 17] = "FirstPunctuation"; + SyntaxKind[SyntaxKind["LastPunctuation"] = 70] = "LastPunctuation"; SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = 140] = "LastToken"; + SyntaxKind[SyntaxKind["LastToken"] = 142] = "LastToken"; SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken"; SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken"; SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken"; - SyntaxKind[SyntaxKind["LastLiteralToken"] = 12] = "LastLiteralToken"; - SyntaxKind[SyntaxKind["FirstTemplateToken"] = 12] = "FirstTemplateToken"; - SyntaxKind[SyntaxKind["LastTemplateToken"] = 15] = "LastTemplateToken"; - SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 26] = "FirstBinaryOperator"; - SyntaxKind[SyntaxKind["LastBinaryOperator"] = 69] = "LastBinaryOperator"; - SyntaxKind[SyntaxKind["FirstNode"] = 141] = "FirstNode"; - SyntaxKind[SyntaxKind["FirstJSDocNode"] = 262] = "FirstJSDocNode"; - SyntaxKind[SyntaxKind["LastJSDocNode"] = 288] = "LastJSDocNode"; - SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 278] = "FirstJSDocTagNode"; - SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 291] = "LastJSDocTagNode"; + SyntaxKind[SyntaxKind["LastLiteralToken"] = 13] = "LastLiteralToken"; + SyntaxKind[SyntaxKind["FirstTemplateToken"] = 13] = "FirstTemplateToken"; + SyntaxKind[SyntaxKind["LastTemplateToken"] = 16] = "LastTemplateToken"; + SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 27] = "FirstBinaryOperator"; + SyntaxKind[SyntaxKind["LastBinaryOperator"] = 70] = "LastBinaryOperator"; + SyntaxKind[SyntaxKind["FirstNode"] = 143] = "FirstNode"; + SyntaxKind[SyntaxKind["FirstJSDocNode"] = 267] = "FirstJSDocNode"; + SyntaxKind[SyntaxKind["LastJSDocNode"] = 293] = "LastJSDocNode"; + SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 283] = "FirstJSDocTagNode"; + SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 293] = "LastJSDocTagNode"; })(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {})); var NodeFlags; (function (NodeFlags) { @@ -462,6 +477,17 @@ var ts; GeneratedIdentifierKind[GeneratedIdentifierKind["Unique"] = 3] = "Unique"; GeneratedIdentifierKind[GeneratedIdentifierKind["Node"] = 4] = "Node"; })(GeneratedIdentifierKind = ts.GeneratedIdentifierKind || (ts.GeneratedIdentifierKind = {})); + /* @internal */ + var NumericLiteralFlags; + (function (NumericLiteralFlags) { + NumericLiteralFlags[NumericLiteralFlags["None"] = 0] = "None"; + NumericLiteralFlags[NumericLiteralFlags["Scientific"] = 2] = "Scientific"; + NumericLiteralFlags[NumericLiteralFlags["Octal"] = 4] = "Octal"; + NumericLiteralFlags[NumericLiteralFlags["HexSpecifier"] = 8] = "HexSpecifier"; + NumericLiteralFlags[NumericLiteralFlags["BinarySpecifier"] = 16] = "BinarySpecifier"; + NumericLiteralFlags[NumericLiteralFlags["OctalSpecifier"] = 32] = "OctalSpecifier"; + NumericLiteralFlags[NumericLiteralFlags["BinaryOrOctalSpecifier"] = 48] = "BinaryOrOctalSpecifier"; + })(NumericLiteralFlags = ts.NumericLiteralFlags || (ts.NumericLiteralFlags = {})); var FlowFlags; (function (FlowFlags) { FlowFlags[FlowFlags["Unreachable"] = 1] = "Unreachable"; @@ -475,6 +501,8 @@ var ts; FlowFlags[FlowFlags["ArrayMutation"] = 256] = "ArrayMutation"; FlowFlags[FlowFlags["Referenced"] = 512] = "Referenced"; FlowFlags[FlowFlags["Shared"] = 1024] = "Shared"; + FlowFlags[FlowFlags["PreFinally"] = 2048] = "PreFinally"; + FlowFlags[FlowFlags["AfterFinally"] = 4096] = "AfterFinally"; FlowFlags[FlowFlags["Label"] = 12] = "Label"; FlowFlags[FlowFlags["Condition"] = 96] = "Condition"; })(FlowFlags = ts.FlowFlags || (ts.FlowFlags = {})); @@ -496,6 +524,16 @@ var ts; // Diagnostics were produced and outputs were generated in spite of them. ExitStatus[ExitStatus["DiagnosticsPresent_OutputsGenerated"] = 2] = "DiagnosticsPresent_OutputsGenerated"; })(ExitStatus = ts.ExitStatus || (ts.ExitStatus = {})); + var NodeBuilderFlags; + (function (NodeBuilderFlags) { + NodeBuilderFlags[NodeBuilderFlags["None"] = 0] = "None"; + NodeBuilderFlags[NodeBuilderFlags["allowThisInObjectLiteral"] = 1] = "allowThisInObjectLiteral"; + NodeBuilderFlags[NodeBuilderFlags["allowQualifedNameInPlaceOfIdentifier"] = 2] = "allowQualifedNameInPlaceOfIdentifier"; + NodeBuilderFlags[NodeBuilderFlags["allowTypeParameterInQualifiedName"] = 4] = "allowTypeParameterInQualifiedName"; + NodeBuilderFlags[NodeBuilderFlags["allowAnonymousIdentifier"] = 8] = "allowAnonymousIdentifier"; + NodeBuilderFlags[NodeBuilderFlags["allowEmptyUnionOrIntersection"] = 16] = "allowEmptyUnionOrIntersection"; + NodeBuilderFlags[NodeBuilderFlags["allowEmptyTuple"] = 32] = "allowEmptyTuple"; + })(NodeBuilderFlags = ts.NodeBuilderFlags || (ts.NodeBuilderFlags = {})); var TypeFormatFlags; (function (TypeFormatFlags) { TypeFormatFlags[TypeFormatFlags["None"] = 0] = "None"; @@ -510,6 +548,8 @@ var ts; TypeFormatFlags[TypeFormatFlags["InFirstTypeArgument"] = 256] = "InFirstTypeArgument"; TypeFormatFlags[TypeFormatFlags["InTypeAlias"] = 512] = "InTypeAlias"; TypeFormatFlags[TypeFormatFlags["UseTypeAliasValue"] = 1024] = "UseTypeAliasValue"; + TypeFormatFlags[TypeFormatFlags["SuppressAnyReturnType"] = 2048] = "SuppressAnyReturnType"; + TypeFormatFlags[TypeFormatFlags["AddUndefined"] = 4096] = "AddUndefined"; })(TypeFormatFlags = ts.TypeFormatFlags || (ts.TypeFormatFlags = {})); var SymbolFormatFlags; (function (SymbolFormatFlags) { @@ -542,8 +582,7 @@ var ts; TypePredicateKind[TypePredicateKind["This"] = 0] = "This"; TypePredicateKind[TypePredicateKind["Identifier"] = 1] = "Identifier"; })(TypePredicateKind = ts.TypePredicateKind || (ts.TypePredicateKind = {})); - /** Indicates how to serialize the name for a TypeReferenceNode when emitting decorator - * metadata */ + /** Indicates how to serialize the name for a TypeReferenceNode when emitting decorator metadata */ /* @internal */ var TypeReferenceSerializationKind; (function (TypeReferenceSerializationKind) { @@ -591,13 +630,10 @@ var ts; SymbolFlags[SymbolFlags["ExportType"] = 2097152] = "ExportType"; SymbolFlags[SymbolFlags["ExportNamespace"] = 4194304] = "ExportNamespace"; SymbolFlags[SymbolFlags["Alias"] = 8388608] = "Alias"; - SymbolFlags[SymbolFlags["Instantiated"] = 16777216] = "Instantiated"; - SymbolFlags[SymbolFlags["Merged"] = 33554432] = "Merged"; - SymbolFlags[SymbolFlags["Transient"] = 67108864] = "Transient"; - SymbolFlags[SymbolFlags["Prototype"] = 134217728] = "Prototype"; - SymbolFlags[SymbolFlags["SyntheticProperty"] = 268435456] = "SyntheticProperty"; - SymbolFlags[SymbolFlags["Optional"] = 536870912] = "Optional"; - SymbolFlags[SymbolFlags["ExportStar"] = 1073741824] = "ExportStar"; + SymbolFlags[SymbolFlags["Prototype"] = 16777216] = "Prototype"; + SymbolFlags[SymbolFlags["ExportStar"] = 33554432] = "ExportStar"; + SymbolFlags[SymbolFlags["Optional"] = 67108864] = "Optional"; + SymbolFlags[SymbolFlags["Transient"] = 134217728] = "Transient"; SymbolFlags[SymbolFlags["Enum"] = 384] = "Enum"; SymbolFlags[SymbolFlags["Variable"] = 3] = "Variable"; SymbolFlags[SymbolFlags["Value"] = 107455] = "Value"; @@ -641,11 +677,27 @@ var ts; SymbolFlags[SymbolFlags["Classifiable"] = 788448] = "Classifiable"; })(SymbolFlags = ts.SymbolFlags || (ts.SymbolFlags = {})); /* @internal */ + var CheckFlags; + (function (CheckFlags) { + CheckFlags[CheckFlags["Instantiated"] = 1] = "Instantiated"; + CheckFlags[CheckFlags["SyntheticProperty"] = 2] = "SyntheticProperty"; + CheckFlags[CheckFlags["SyntheticMethod"] = 4] = "SyntheticMethod"; + CheckFlags[CheckFlags["Readonly"] = 8] = "Readonly"; + CheckFlags[CheckFlags["Partial"] = 16] = "Partial"; + CheckFlags[CheckFlags["HasNonUniformType"] = 32] = "HasNonUniformType"; + CheckFlags[CheckFlags["ContainsPublic"] = 64] = "ContainsPublic"; + CheckFlags[CheckFlags["ContainsProtected"] = 128] = "ContainsProtected"; + CheckFlags[CheckFlags["ContainsPrivate"] = 256] = "ContainsPrivate"; + CheckFlags[CheckFlags["ContainsStatic"] = 512] = "ContainsStatic"; + CheckFlags[CheckFlags["Synthetic"] = 6] = "Synthetic"; + })(CheckFlags = ts.CheckFlags || (ts.CheckFlags = {})); + /* @internal */ var NodeCheckFlags; (function (NodeCheckFlags) { NodeCheckFlags[NodeCheckFlags["TypeChecked"] = 1] = "TypeChecked"; NodeCheckFlags[NodeCheckFlags["LexicalThis"] = 2] = "LexicalThis"; NodeCheckFlags[NodeCheckFlags["CaptureThis"] = 4] = "CaptureThis"; + NodeCheckFlags[NodeCheckFlags["CaptureNewTarget"] = 8] = "CaptureNewTarget"; NodeCheckFlags[NodeCheckFlags["SuperInstance"] = 256] = "SuperInstance"; NodeCheckFlags[NodeCheckFlags["SuperStatic"] = 512] = "SuperStatic"; NodeCheckFlags[NodeCheckFlags["ContextChecked"] = 1024] = "ContextChecked"; @@ -694,6 +746,9 @@ var ts; TypeFlags[TypeFlags["ContainsObjectLiteral"] = 4194304] = "ContainsObjectLiteral"; /* @internal */ TypeFlags[TypeFlags["ContainsAnyFunctionType"] = 8388608] = "ContainsAnyFunctionType"; + TypeFlags[TypeFlags["NonPrimitive"] = 16777216] = "NonPrimitive"; + /* @internal */ + TypeFlags[TypeFlags["JsxAttributes"] = 33554432] = "JsxAttributes"; /* @internal */ TypeFlags[TypeFlags["Nullable"] = 6144] = "Nullable"; TypeFlags[TypeFlags["Literal"] = 480] = "Literal"; @@ -702,7 +757,7 @@ var ts; TypeFlags[TypeFlags["DefinitelyFalsy"] = 7392] = "DefinitelyFalsy"; TypeFlags[TypeFlags["PossiblyFalsy"] = 7406] = "PossiblyFalsy"; /* @internal */ - TypeFlags[TypeFlags["Intrinsic"] = 16015] = "Intrinsic"; + TypeFlags[TypeFlags["Intrinsic"] = 16793231] = "Intrinsic"; /* @internal */ TypeFlags[TypeFlags["Primitive"] = 8190] = "Primitive"; TypeFlags[TypeFlags["StringLike"] = 262178] = "StringLike"; @@ -711,12 +766,12 @@ var ts; TypeFlags[TypeFlags["EnumLike"] = 272] = "EnumLike"; TypeFlags[TypeFlags["UnionOrIntersection"] = 196608] = "UnionOrIntersection"; TypeFlags[TypeFlags["StructuredType"] = 229376] = "StructuredType"; - TypeFlags[TypeFlags["StructuredOrTypeParameter"] = 507904] = "StructuredOrTypeParameter"; + TypeFlags[TypeFlags["StructuredOrTypeVariable"] = 1032192] = "StructuredOrTypeVariable"; TypeFlags[TypeFlags["TypeVariable"] = 540672] = "TypeVariable"; // 'Narrowable' types are types where narrowing actually narrows. // This *should* be every type other than null, undefined, void, and never - TypeFlags[TypeFlags["Narrowable"] = 1033215] = "Narrowable"; - TypeFlags[TypeFlags["NotUnionOrUnit"] = 33281] = "NotUnionOrUnit"; + TypeFlags[TypeFlags["Narrowable"] = 17810431] = "Narrowable"; + TypeFlags[TypeFlags["NotUnionOrUnit"] = 16810497] = "NotUnionOrUnit"; /* @internal */ TypeFlags[TypeFlags["RequiresWidening"] = 6291456] = "RequiresWidening"; /* @internal */ @@ -758,6 +813,8 @@ var ts; SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["PrototypeProperty"] = 3] = "PrototypeProperty"; /// this.name = expr SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["ThisProperty"] = 4] = "ThisProperty"; + // F.name = expr + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["Property"] = 5] = "Property"; })(SpecialPropertyAssignmentKind = ts.SpecialPropertyAssignmentKind || (ts.SpecialPropertyAssignmentKind = {})); var DiagnosticCategory; (function (DiagnosticCategory) { @@ -784,6 +841,7 @@ var ts; JsxEmit[JsxEmit["None"] = 0] = "None"; JsxEmit[JsxEmit["Preserve"] = 1] = "Preserve"; JsxEmit[JsxEmit["React"] = 2] = "React"; + JsxEmit[JsxEmit["ReactNative"] = 3] = "ReactNative"; })(JsxEmit = ts.JsxEmit || (ts.JsxEmit = {})); var NewLineKind; (function (NewLineKind) { @@ -797,6 +855,7 @@ var ts; ScriptKind[ScriptKind["JSX"] = 2] = "JSX"; ScriptKind[ScriptKind["TS"] = 3] = "TS"; ScriptKind[ScriptKind["TSX"] = 4] = "TSX"; + ScriptKind[ScriptKind["External"] = 5] = "External"; })(ScriptKind = ts.ScriptKind || (ts.ScriptKind = {})); var ScriptTarget; (function (ScriptTarget) { @@ -1031,7 +1090,6 @@ var ts; TransformFlags[TransformFlags["TypeScriptClassSyntaxMask"] = 274432] = "TypeScriptClassSyntaxMask"; TransformFlags[TransformFlags["ES2015FunctionSyntaxMask"] = 163840] = "ES2015FunctionSyntaxMask"; })(TransformFlags = ts.TransformFlags || (ts.TransformFlags = {})); - /* @internal */ var EmitFlags; (function (EmitFlags) { EmitFlags[EmitFlags["SingleLine"] = 1] = "SingleLine"; @@ -1052,13 +1110,15 @@ var ts; EmitFlags[EmitFlags["HelperName"] = 4096] = "HelperName"; EmitFlags[EmitFlags["ExportName"] = 8192] = "ExportName"; EmitFlags[EmitFlags["LocalName"] = 16384] = "LocalName"; - EmitFlags[EmitFlags["Indented"] = 32768] = "Indented"; - EmitFlags[EmitFlags["NoIndentation"] = 65536] = "NoIndentation"; - EmitFlags[EmitFlags["AsyncFunctionBody"] = 131072] = "AsyncFunctionBody"; - EmitFlags[EmitFlags["ReuseTempVariableScope"] = 262144] = "ReuseTempVariableScope"; - EmitFlags[EmitFlags["CustomPrologue"] = 524288] = "CustomPrologue"; - EmitFlags[EmitFlags["NoHoisting"] = 1048576] = "NoHoisting"; - EmitFlags[EmitFlags["HasEndOfDeclarationMarker"] = 2097152] = "HasEndOfDeclarationMarker"; + EmitFlags[EmitFlags["InternalName"] = 32768] = "InternalName"; + EmitFlags[EmitFlags["Indented"] = 65536] = "Indented"; + EmitFlags[EmitFlags["NoIndentation"] = 131072] = "NoIndentation"; + EmitFlags[EmitFlags["AsyncFunctionBody"] = 262144] = "AsyncFunctionBody"; + EmitFlags[EmitFlags["ReuseTempVariableScope"] = 524288] = "ReuseTempVariableScope"; + EmitFlags[EmitFlags["CustomPrologue"] = 1048576] = "CustomPrologue"; + EmitFlags[EmitFlags["NoHoisting"] = 2097152] = "NoHoisting"; + EmitFlags[EmitFlags["HasEndOfDeclarationMarker"] = 4194304] = "HasEndOfDeclarationMarker"; + EmitFlags[EmitFlags["Iterator"] = 8388608] = "Iterator"; })(EmitFlags = ts.EmitFlags || (ts.EmitFlags = {})); /** * Used by the checker, this enum keeps track of external emit helpers that should be type @@ -1075,17 +1135,33 @@ var ts; ExternalEmitHelpers[ExternalEmitHelpers["Param"] = 32] = "Param"; ExternalEmitHelpers[ExternalEmitHelpers["Awaiter"] = 64] = "Awaiter"; ExternalEmitHelpers[ExternalEmitHelpers["Generator"] = 128] = "Generator"; + ExternalEmitHelpers[ExternalEmitHelpers["Values"] = 256] = "Values"; + ExternalEmitHelpers[ExternalEmitHelpers["Read"] = 512] = "Read"; + ExternalEmitHelpers[ExternalEmitHelpers["Spread"] = 1024] = "Spread"; + ExternalEmitHelpers[ExternalEmitHelpers["Await"] = 2048] = "Await"; + ExternalEmitHelpers[ExternalEmitHelpers["AsyncGenerator"] = 4096] = "AsyncGenerator"; + ExternalEmitHelpers[ExternalEmitHelpers["AsyncDelegator"] = 8192] = "AsyncDelegator"; + ExternalEmitHelpers[ExternalEmitHelpers["AsyncValues"] = 16384] = "AsyncValues"; + // Helpers included by ES2015 for..of + ExternalEmitHelpers[ExternalEmitHelpers["ForOfIncludes"] = 256] = "ForOfIncludes"; + // Helpers included by ES2017 for..await..of + ExternalEmitHelpers[ExternalEmitHelpers["ForAwaitOfIncludes"] = 16384] = "ForAwaitOfIncludes"; + // Helpers included by ES2017 async generators + ExternalEmitHelpers[ExternalEmitHelpers["AsyncGeneratorIncludes"] = 6144] = "AsyncGeneratorIncludes"; + // Helpers included by yield* in ES2017 async generators + ExternalEmitHelpers[ExternalEmitHelpers["AsyncDelegatorIncludes"] = 26624] = "AsyncDelegatorIncludes"; + // Helpers included by ES2015 spread + ExternalEmitHelpers[ExternalEmitHelpers["SpreadIncludes"] = 1536] = "SpreadIncludes"; ExternalEmitHelpers[ExternalEmitHelpers["FirstEmitHelper"] = 1] = "FirstEmitHelper"; - ExternalEmitHelpers[ExternalEmitHelpers["LastEmitHelper"] = 128] = "LastEmitHelper"; + ExternalEmitHelpers[ExternalEmitHelpers["LastEmitHelper"] = 16384] = "LastEmitHelper"; })(ExternalEmitHelpers = ts.ExternalEmitHelpers || (ts.ExternalEmitHelpers = {})); - /* @internal */ - var EmitContext; - (function (EmitContext) { - EmitContext[EmitContext["SourceFile"] = 0] = "SourceFile"; - EmitContext[EmitContext["Expression"] = 1] = "Expression"; - EmitContext[EmitContext["IdentifierName"] = 2] = "IdentifierName"; - EmitContext[EmitContext["Unspecified"] = 3] = "Unspecified"; - })(EmitContext = ts.EmitContext || (ts.EmitContext = {})); + var EmitHint; + (function (EmitHint) { + EmitHint[EmitHint["SourceFile"] = 0] = "SourceFile"; + EmitHint[EmitHint["Expression"] = 1] = "Expression"; + EmitHint[EmitHint["IdentifierName"] = 2] = "IdentifierName"; + EmitHint[EmitHint["Unspecified"] = 3] = "Unspecified"; + })(EmitHint = ts.EmitHint || (ts.EmitHint = {})); })(ts || (ts = {})); /*@internal*/ var ts; @@ -1113,8 +1189,8 @@ var ts; */ function mark(markName) { if (enabled) { - marks[markName] = ts.timestamp(); - counts[markName] = (counts[markName] || 0) + 1; + marks.set(markName, ts.timestamp()); + counts.set(markName, (counts.get(markName) || 0) + 1); profilerEvent(markName); } } @@ -1130,9 +1206,9 @@ var ts; */ function measure(measureName, startMarkName, endMarkName) { if (enabled) { - var end = endMarkName && marks[endMarkName] || ts.timestamp(); - var start = startMarkName && marks[startMarkName] || profilerStart; - measures[measureName] = (measures[measureName] || 0) + (end - start); + var end = endMarkName && marks.get(endMarkName) || ts.timestamp(); + var start = startMarkName && marks.get(startMarkName) || profilerStart; + measures.set(measureName, (measures.get(measureName) || 0) + (end - start)); } } performance.measure = measure; @@ -1142,7 +1218,7 @@ var ts; * @param markName The name of the mark. */ function getCount(markName) { - return counts && counts[markName] || 0; + return counts && counts.get(markName) || 0; } performance.getCount = getCount; /** @@ -1151,7 +1227,7 @@ var ts; * @param measureName The name of the measure whose durations should be accumulated. */ function getDuration(measureName) { - return measures && measures[measureName] || 0; + return measures && measures.get(measureName) || 0; } performance.getDuration = getDuration; /** @@ -1160,9 +1236,9 @@ var ts; * @param cb The action to perform for each measure */ function forEachMeasure(cb) { - for (var key in measures) { - cb(key, measures[key]); - } + measures.forEach(function (measure, key) { + cb(key, measure); + }); } performance.forEachMeasure = forEachMeasure; /** Enables (and resets) performance measurements for the compiler. */ @@ -1186,7 +1262,7 @@ var ts; var ts; (function (ts) { /** The version of the TypeScript compiler release */ - ts.version = "2.1.5"; + ts.version = "2.3.4"; })(ts || (ts = {})); /* @internal */ (function (ts) { @@ -1205,25 +1281,106 @@ var ts; Ternary[Ternary["Maybe"] = 1] = "Maybe"; Ternary[Ternary["True"] = -1] = "True"; })(Ternary = ts.Ternary || (ts.Ternary = {})); - var createObject = Object.create; // More efficient to create a collator once and use its `compare` than to call `a.localeCompare(b)` many times. - ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator() : undefined; - function createMap(template) { - var map = createObject(null); // tslint:disable-line:no-null-keyword + ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator(/*locales*/ undefined, { usage: "sort", sensitivity: "accent" }) : undefined; + // Intl is missing in Safari, and node 0.10 treats "a" as greater than "B". + ts.localeCompareIsCorrect = ts.collator && ts.collator.compare("a", "B") < 0; + /** Create a MapLike with good performance. */ + function createDictionaryObject() { + var map = Object.create(/*prototype*/ null); // tslint:disable-line:no-null-keyword // Using 'delete' on an object causes V8 to put the object in dictionary mode. // This disables creation of hidden classes, which are expensive when an object is // constantly changing shape. map["__"] = undefined; delete map["__"]; + return map; + } + /** Create a new map. If a template object is provided, the map will copy entries from it. */ + function createMap() { + return new MapCtr(); + } + ts.createMap = createMap; + function createMapFromTemplate(template) { + var map = new MapCtr(); // Copies keys/values from template. Note that for..in will not throw if // template is undefined, and instead will just exit the loop. for (var key in template) if (hasOwnProperty.call(template, key)) { - map[key] = template[key]; + map.set(key, template[key]); } return map; } - ts.createMap = createMap; + ts.createMapFromTemplate = createMapFromTemplate; + // Internet Explorer's Map doesn't support iteration, so don't use it. + // tslint:disable-next-line:no-in-operator + var MapCtr = typeof Map !== "undefined" && "entries" in Map.prototype ? Map : shimMap(); + // Keep the class inside a function so it doesn't get compiled if it's not used. + function shimMap() { + var MapIterator = (function () { + function MapIterator(data, selector) { + this.index = 0; + this.data = data; + this.selector = selector; + this.keys = Object.keys(data); + } + MapIterator.prototype.next = function () { + var index = this.index; + if (index < this.keys.length) { + this.index++; + return { value: this.selector(this.data, this.keys[index]), done: false }; + } + return { value: undefined, done: true }; + }; + return MapIterator; + }()); + return (function () { + function class_1() { + this.data = createDictionaryObject(); + this.size = 0; + } + class_1.prototype.get = function (key) { + return this.data[key]; + }; + class_1.prototype.set = function (key, value) { + if (!this.has(key)) { + this.size++; + } + this.data[key] = value; + return this; + }; + class_1.prototype.has = function (key) { + // tslint:disable-next-line:no-in-operator + return key in this.data; + }; + class_1.prototype.delete = function (key) { + if (this.has(key)) { + this.size--; + delete this.data[key]; + return true; + } + return false; + }; + class_1.prototype.clear = function () { + this.data = createDictionaryObject(); + this.size = 0; + }; + class_1.prototype.keys = function () { + return new MapIterator(this.data, function (_data, key) { return key; }); + }; + class_1.prototype.values = function () { + return new MapIterator(this.data, function (data, key) { return data[key]; }); + }; + class_1.prototype.entries = function () { + return new MapIterator(this.data, function (data, key) { return [key, data[key]]; }); + }; + class_1.prototype.forEach = function (action) { + for (var key in this.data) { + action(this.data[key], key); + } + }; + return class_1; + }()); + } function createFileMap(keyMapper) { var files = createMap(); return { @@ -1236,33 +1393,28 @@ var ts; clear: clear, }; function forEachValueInMap(f) { - for (var key in files) { - f(key, files[key]); - } + files.forEach(function (file, key) { + f(key, file); + }); } function getKeys() { - var keys = []; - for (var key in files) { - keys.push(key); - } - return keys; + return arrayFrom(files.keys()); } // path should already be well-formed so it does not need to be normalized function get(path) { - return files[toKey(path)]; + return files.get(toKey(path)); } function set(path, value) { - files[toKey(path)] = value; + files.set(toKey(path), value); } function contains(path) { - return toKey(path) in files; + return files.has(toKey(path)); } function remove(path) { - var key = toKey(path); - delete files[key]; + files.delete(toKey(path)); } function clear() { - files = createMap(); + files.clear(); } function toKey(path) { return keyMapper ? keyMapper(path) : path; @@ -1282,6 +1434,10 @@ var ts; Comparison[Comparison["EqualTo"] = 0] = "EqualTo"; Comparison[Comparison["GreaterThan"] = 1] = "GreaterThan"; })(Comparison = ts.Comparison || (ts.Comparison = {})); + function length(array) { + return array ? array.length : 0; + } + ts.length = length; /** * Iterates through 'array' by index and performs the callback on each element of array until the callback * returns a truthy value, then returns that value. @@ -1289,7 +1445,7 @@ var ts; */ function forEach(array, callback) { if (array) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { var result = callback(array[i], i); if (result) { return result; @@ -1299,6 +1455,26 @@ var ts; return undefined; } ts.forEach = forEach; + /** + * Iterates through the parent chain of a node and performs the callback on each parent until the callback + * returns a truthy value, then returns that value. + * If no such value is found, it applies the callback until the parent pointer is undefined or the callback returns "quit" + * At that point findAncestor returns undefined. + */ + function findAncestor(node, callback) { + while (node) { + var result = callback(node); + if (result === "quit") { + return undefined; + } + else if (result) { + return node; + } + node = node.parent; + } + return undefined; + } + ts.findAncestor = findAncestor; function zipWith(arrayA, arrayB, callback) { Debug.assert(arrayA.length === arrayB.length); for (var i = 0; i < arrayA.length; i++) { @@ -1313,7 +1489,7 @@ var ts; */ function every(array, callback) { if (array) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { if (!callback(array[i], i)) { return false; } @@ -1324,7 +1500,7 @@ var ts; ts.every = every; /** Works like Array.prototype.find, returning `undefined` if no element satisfying the predicate is found. */ function find(array, predicate) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { var value = array[i]; if (predicate(value, i)) { return value; @@ -1333,12 +1509,22 @@ var ts; return undefined; } ts.find = find; + /** Works like Array.prototype.findIndex, returning `-1` if no element satisfying the predicate is found. */ + function findIndex(array, predicate) { + for (var i = 0; i < array.length; i++) { + if (predicate(array[i], i)) { + return i; + } + } + return -1; + } + ts.findIndex = findIndex; /** * Returns the first truthy result of `callback`, or else fails. * This is like `forEach`, but never returns undefined. */ function findMap(array, callback) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { var result = callback(array[i], i); if (result) { return result; @@ -1361,7 +1547,7 @@ var ts; ts.contains = contains; function indexOf(array, value) { if (array) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { if (array[i] === value) { return i; } @@ -1371,7 +1557,7 @@ var ts; } ts.indexOf = indexOf; function indexOfAnyCharCode(text, charCodes, start) { - for (var i = start || 0, len = text.length; i < len; i++) { + for (var i = start || 0; i < text.length; i++) { if (contains(charCodes, text.charCodeAt(i))) { return i; } @@ -1581,21 +1767,18 @@ var ts; return result; } ts.spanMap = spanMap; - function mapObject(object, f) { - var result; - if (object) { - result = {}; - for (var _i = 0, _a = getOwnKeys(object); _i < _a.length; _i++) { - var v = _a[_i]; - var _b = f(v, object[v]) || [undefined, undefined], key = _b[0], value = _b[1]; - if (key !== undefined) { - result[key] = value; - } - } + function mapEntries(map, f) { + if (!map) { + return undefined; } + var result = createMap(); + map.forEach(function (value, key) { + var _a = f(key, value), newKey = _a[0], newValue = _a[1]; + result.set(newKey, newValue); + }); return result; } - ts.mapObject = mapObject; + ts.mapEntries = mapEntries; function some(array, predicate) { if (array) { if (predicate) { @@ -1913,9 +2096,6 @@ var ts; /** * Indicates whether a map-like contains an own property with the specified key. * - * NOTE: This is intended for use only with MapLike objects. For Map objects, use - * the 'in' operator. - * * @param map A map-like. * @param key A property key. */ @@ -1926,9 +2106,6 @@ var ts; /** * Gets the value of an owned property in a map-like. * - * NOTE: This is intended for use only with MapLike objects. For Map objects, use - * an indexer. - * * @param map A map-like. * @param key A property key. */ @@ -1953,56 +2130,61 @@ var ts; return keys; } ts.getOwnKeys = getOwnKeys; - /** - * Enumerates the properties of a Map, invoking a callback and returning the first truthy result. - * - * @param map A map for which properties should be enumerated. - * @param callback A callback to invoke for each property. - */ - function forEachProperty(map, callback) { - var result; - for (var key in map) { - if (result = callback(map[key], key)) - break; + function arrayFrom(iterator, map) { + var result = []; + for (var _a = iterator.next(), value = _a.value, done = _a.done; !done; _b = iterator.next(), value = _b.value, done = _b.done, _b) { + result.push(map ? map(value) : value); } return result; + var _b; } - ts.forEachProperty = forEachProperty; - /** - * Returns true if a Map has some matching property. - * - * @param map A map whose properties should be tested. - * @param predicate An optional callback used to test each property. - */ - function someProperties(map, predicate) { - for (var key in map) { - if (!predicate || predicate(map[key], key)) - return true; + ts.arrayFrom = arrayFrom; + function convertToArray(iterator, f) { + var result = []; + for (var _a = iterator.next(), value = _a.value, done = _a.done; !done; _b = iterator.next(), value = _b.value, done = _b.done, _b) { + result.push(f(value)); } - return false; + return result; + var _b; } - ts.someProperties = someProperties; + ts.convertToArray = convertToArray; /** - * Performs a shallow copy of the properties from a source Map to a target MapLike - * - * @param source A map from which properties should be copied. - * @param target A map to which properties should be copied. + * Calls `callback` for each entry in the map, returning the first truthy result. + * Use `map.forEach` instead for normal iteration. */ - function copyProperties(source, target) { - for (var key in source) { - target[key] = source[key]; + function forEachEntry(map, callback) { + var iterator = map.entries(); + for (var _a = iterator.next(), pair = _a.value, done = _a.done; !done; _b = iterator.next(), pair = _b.value, done = _b.done, _b) { + var key = pair[0], value = pair[1]; + var result = callback(value, key); + if (result) { + return result; + } } + return undefined; + var _b; } - ts.copyProperties = copyProperties; - function appendProperty(map, key, value) { - if (key === undefined || value === undefined) - return map; - if (map === undefined) - map = createMap(); - map[key] = value; - return map; + ts.forEachEntry = forEachEntry; + /** `forEachEntry` for just keys. */ + function forEachKey(map, callback) { + var iterator = map.keys(); + for (var _a = iterator.next(), key = _a.value, done = _a.done; !done; _b = iterator.next(), key = _b.value, done = _b.done, _b) { + var result = callback(key); + if (result) { + return result; + } + } + return undefined; + var _b; } - ts.appendProperty = appendProperty; + ts.forEachKey = forEachKey; + /** Copy entries from `source` to `target`. */ + function copyEntries(source, target) { + source.forEach(function (value, key) { + target.set(key, value); + }); + } + ts.copyEntries = copyEntries; function assign(t) { var args = []; for (var _i = 1; _i < arguments.length; _i++) { @@ -2010,32 +2192,14 @@ var ts; } for (var _a = 0, args_1 = args; _a < args_1.length; _a++) { var arg = args_1[_a]; - for (var _b = 0, _c = getOwnKeys(arg); _b < _c.length; _b++) { - var p = _c[_b]; - t[p] = arg[p]; - } + for (var p in arg) + if (hasProperty(arg, p)) { + t[p] = arg[p]; + } } return t; } ts.assign = assign; - /** - * Reduce the properties of a map. - * - * NOTE: This is intended for use with Map objects. For MapLike objects, use - * reduceOwnProperties instead as it offers better runtime safety. - * - * @param map The map to reduce - * @param callback An aggregation function that is called for each entry in the map - * @param initial The initial value for the reduction. - */ - function reduceProperties(map, callback, initial) { - var result = initial; - for (var key in map) { - result = callback(result, map[key], String(key)); - } - return result; - } - ts.reduceProperties = reduceProperties; /** * Performs a shallow equality comparison of the contents of two map-likes. * @@ -2066,23 +2230,14 @@ var ts; var result = createMap(); for (var _i = 0, array_8 = array; _i < array_8.length; _i++) { var value = array_8[_i]; - result[makeKey(value)] = makeValue ? makeValue(value) : value; + result.set(makeKey(value), makeValue ? makeValue(value) : value); } return result; } ts.arrayToMap = arrayToMap; - function isEmpty(map) { - for (var id in map) { - if (hasProperty(map, id)) { - return false; - } - } - return true; - } - ts.isEmpty = isEmpty; function cloneMap(map) { var clone = createMap(); - copyProperties(map, clone); + copyEntries(map, clone); return clone; } ts.cloneMap = cloneMap; @@ -2109,36 +2264,32 @@ var ts; return result; } ts.extend = extend; - /** - * Adds the value to an array of values associated with the key, and returns the array. - * Creates the array if it does not already exist. - */ - function multiMapAdd(map, key, value) { - var values = map[key]; + function createMultiMap() { + var map = createMap(); + map.add = multiMapAdd; + map.remove = multiMapRemove; + return map; + } + ts.createMultiMap = createMultiMap; + function multiMapAdd(key, value) { + var values = this.get(key); if (values) { values.push(value); - return values; } else { - return map[key] = [value]; + this.set(key, values = [value]); } + return values; } - ts.multiMapAdd = multiMapAdd; - /** - * Removes a value from an array of values associated with the key. - * Does not preserve the order of those values. - * Does nothing if `key` is not in `map`, or `value` is not in `map[key]`. - */ - function multiMapRemove(map, key, value) { - var values = map[key]; + function multiMapRemove(key, value) { + var values = this.get(key); if (values) { unorderedRemoveItem(values, value); if (!values.length) { - delete map[key]; + this.delete(key); } } } - ts.multiMapRemove = multiMapRemove; /** * Tests whether a value is an array. */ @@ -2219,6 +2370,7 @@ var ts; baseIndex = baseIndex || 0; 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; @@ -2321,9 +2473,12 @@ var ts; if (b === undefined) return 1 /* GreaterThan */; if (ignoreCase) { - if (ts.collator && String.prototype.localeCompare) { - // accent means a ? b, a ? a´, a = A - var result = a.localeCompare(b, /*locales*/ undefined, { usage: "sort", sensitivity: "accent" }); + // Checking if "collator exists indicates that Intl is available. + // We still have to check if "collator.compare" is correct. If it is not, use "String.localeComapre" + if (ts.collator) { + var result = ts.localeCompareIsCorrect ? + ts.collator.compare(a, b) : + a.localeCompare(b, /*locales*/ undefined, { usage: "sort", sensitivity: "accent" }); // accent means a ≠ b, a ≠ á, a = A return result < 0 ? -1 /* LessThan */ : result > 0 ? 1 /* GreaterThan */ : 0 /* EqualTo */; } a = a.toUpperCase(); @@ -2396,7 +2551,7 @@ var ts; ts.normalizeSlashes = normalizeSlashes; /** * Returns length of path root (i.e. length of "/", "x:/", "//server/share/, file:///user/files") - */ + */ function getRootLength(path) { if (path.charCodeAt(0) === 47 /* slash */) { if (path.charCodeAt(1) !== 47 /* slash */) @@ -2768,6 +2923,17 @@ var ts; var singleAsteriskRegexFragmentFiles = "([^./]|(\\.(?!min\\.js$))?)*"; var singleAsteriskRegexFragmentOther = "[^/]*"; function getRegularExpressionForWildcard(specs, basePath, usage) { + var patterns = getRegularExpressionsForWildcards(specs, basePath, usage); + if (!patterns || !patterns.length) { + return undefined; + } + var pattern = patterns.map(function (pattern) { return "(" + pattern + ")"; }).join("|"); + // If excluding, match "foo/bar/baz...", but if including, only allow "foo". + var terminator = usage === "exclude" ? "($|/)" : "$"; + return "^(" + pattern + ")" + terminator; + } + ts.getRegularExpressionForWildcard = getRegularExpressionForWildcard; + function getRegularExpressionsForWildcards(specs, basePath, usage) { if (specs === undefined || specs.length === 0) { return undefined; } @@ -2778,31 +2944,10 @@ var ts; * files or directories, does not match subdirectories that start with a . character */ var doubleAsteriskRegexFragment = usage === "exclude" ? "(/.+?)?" : "(/[^/.][^/]*)*?"; - var pattern = ""; - var hasWrittenSubpattern = false; - for (var _i = 0, specs_1 = specs; _i < specs_1.length; _i++) { - var spec = specs_1[_i]; - if (!spec) { - continue; - } - var subPattern = getSubPatternFromSpec(spec, basePath, usage, singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter); - if (subPattern === undefined) { - continue; - } - if (hasWrittenSubpattern) { - pattern += "|"; - } - pattern += "(" + subPattern + ")"; - hasWrittenSubpattern = true; - } - if (!pattern) { - return undefined; - } - // If excluding, match "foo/bar/baz...", but if including, only allow "foo". - var terminator = usage === "exclude" ? "($|/)" : "$"; - return "^(" + pattern + ")" + terminator; + return flatMap(specs, function (spec) { + return spec && getSubPatternFromSpec(spec, basePath, usage, singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter); + }); } - ts.getRegularExpressionForWildcard = getRegularExpressionForWildcard; /** * An "includes" path "foo" is implicitly a glob "foo/** /*" (without the space) if its last component has no extension, * and does not contain any glob characters itself. @@ -2881,6 +3026,7 @@ var ts; currentDirectory = normalizePath(currentDirectory); var absolutePath = combinePaths(currentDirectory, path); return { + includeFilePatterns: map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), function (pattern) { return "^" + pattern + "$"; }), includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"), includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"), excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"), @@ -2893,34 +3039,50 @@ var ts; currentDirectory = normalizePath(currentDirectory); var patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory); var regexFlag = useCaseSensitiveFileNames ? "" : "i"; - var includeFileRegex = patterns.includeFilePattern && new RegExp(patterns.includeFilePattern, regexFlag); + var includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map(function (pattern) { return new RegExp(pattern, regexFlag); }); var includeDirectoryRegex = patterns.includeDirectoryPattern && new RegExp(patterns.includeDirectoryPattern, regexFlag); var excludeRegex = patterns.excludePattern && new RegExp(patterns.excludePattern, regexFlag); - var result = []; + // Associate an array of results with each include regex. This keeps results in order of the "include" order. + // If there are no "includes", then just put everything in results[0]. + var results = includeFileRegexes ? includeFileRegexes.map(function () { return []; }) : [[]]; + var comparer = useCaseSensitiveFileNames ? compareStrings : compareStringsCaseInsensitive; for (var _i = 0, _a = patterns.basePaths; _i < _a.length; _i++) { var basePath = _a[_i]; visitDirectory(basePath, combinePaths(currentDirectory, basePath)); } - return result; + return flatten(results); function visitDirectory(path, absolutePath) { var _a = getFileSystemEntries(path), files = _a.files, directories = _a.directories; + files = files.slice().sort(comparer); + directories = directories.slice().sort(comparer); + var _loop_1 = function (current) { + var name = combinePaths(path, current); + var absoluteName = combinePaths(absolutePath, current); + if (extensions && !fileExtensionIsAny(name, extensions)) + return "continue"; + if (excludeRegex && excludeRegex.test(absoluteName)) + return "continue"; + if (!includeFileRegexes) { + results[0].push(name); + } + else { + var includeIndex = findIndex(includeFileRegexes, function (re) { return re.test(absoluteName); }); + if (includeIndex !== -1) { + results[includeIndex].push(name); + } + } + }; for (var _i = 0, files_1 = files; _i < files_1.length; _i++) { var current = files_1[_i]; - var name_1 = combinePaths(path, current); - var absoluteName = combinePaths(absolutePath, current); - if ((!extensions || fileExtensionIsAny(name_1, extensions)) && - (!includeFileRegex || includeFileRegex.test(absoluteName)) && - (!excludeRegex || !excludeRegex.test(absoluteName))) { - result.push(name_1); - } + _loop_1(current); } for (var _b = 0, directories_1 = directories; _b < directories_1.length; _b++) { var current = directories_1[_b]; - var name_2 = combinePaths(path, current); + var name = combinePaths(path, current); var absoluteName = combinePaths(absolutePath, current); if ((!includeDirectoryRegex || includeDirectoryRegex.test(absoluteName)) && (!excludeRegex || !excludeRegex.test(absoluteName))) { - visitDirectory(name_2, absoluteName); + visitDirectory(name, absoluteName); } } } @@ -2945,7 +3107,7 @@ var ts; } // Sort the offsets array using either the literal or canonical path representations. includeBasePaths.sort(useCaseSensitiveFileNames ? compareStrings : compareStringsCaseInsensitive); - var _loop_1 = function (includeBasePath) { + var _loop_2 = function (includeBasePath) { if (ts.every(basePaths, function (basePath) { return !containsPath(basePath, includeBasePath, path, !useCaseSensitiveFileNames); })) { basePaths.push(includeBasePath); } @@ -2954,7 +3116,7 @@ var ts; // subpath of an existing base path for (var _a = 0, includeBasePaths_1 = includeBasePaths; _a < includeBasePaths_1.length; _a++) { var includeBasePath = includeBasePaths_1[_a]; - _loop_1(includeBasePath); + _loop_2(includeBasePath); } } return basePaths; @@ -3005,13 +3167,13 @@ var ts; var allSupportedExtensions = ts.supportedTypeScriptExtensions.concat(ts.supportedJavascriptExtensions); function getSupportedExtensions(options, extraFileExtensions) { var needAllExtensions = options && options.allowJs; - if (!extraFileExtensions || extraFileExtensions.length === 0) { + if (!extraFileExtensions || extraFileExtensions.length === 0 || !needAllExtensions) { return needAllExtensions ? allSupportedExtensions : ts.supportedTypeScriptExtensions; } - var extensions = (needAllExtensions ? allSupportedExtensions : ts.supportedTypeScriptExtensions).slice(0); + var extensions = allSupportedExtensions.slice(0); for (var _i = 0, extraFileExtensions_1 = extraFileExtensions; _i < extraFileExtensions_1.length; _i++) { var extInfo = extraFileExtensions_1[_i]; - if (needAllExtensions || extInfo.scriptKind === 3 /* TS */) { + if (extensions.indexOf(extInfo.extension) === -1) { extensions.push(extInfo.extension); } } @@ -3048,14 +3210,13 @@ var ts; (function (ExtensionPriority) { ExtensionPriority[ExtensionPriority["TypeScriptFiles"] = 0] = "TypeScriptFiles"; ExtensionPriority[ExtensionPriority["DeclarationAndJavaScriptFiles"] = 2] = "DeclarationAndJavaScriptFiles"; - ExtensionPriority[ExtensionPriority["Limit"] = 5] = "Limit"; ExtensionPriority[ExtensionPriority["Highest"] = 0] = "Highest"; ExtensionPriority[ExtensionPriority["Lowest"] = 2] = "Lowest"; })(ExtensionPriority = ts.ExtensionPriority || (ts.ExtensionPriority = {})); function getExtensionPriority(path, supportedExtensions) { for (var i = supportedExtensions.length - 1; i >= 0; i--) { if (fileExtensionIs(path, supportedExtensions[i])) { - return adjustExtensionPriority(i); + return adjustExtensionPriority(i, supportedExtensions); } } // If its not in the list of supported extensions, this is likely a @@ -3066,27 +3227,27 @@ var ts; /** * Adjusts an extension priority to be the highest priority within the same range. */ - function adjustExtensionPriority(extensionPriority) { + function adjustExtensionPriority(extensionPriority, supportedExtensions) { if (extensionPriority < 2 /* DeclarationAndJavaScriptFiles */) { return 0 /* TypeScriptFiles */; } - else if (extensionPriority < 5 /* Limit */) { + else if (extensionPriority < supportedExtensions.length) { return 2 /* DeclarationAndJavaScriptFiles */; } else { - return 5 /* Limit */; + return supportedExtensions.length; } } ts.adjustExtensionPriority = adjustExtensionPriority; /** * Gets the next lowest extension priority for a given priority. */ - function getNextLowestExtensionPriority(extensionPriority) { + function getNextLowestExtensionPriority(extensionPriority, supportedExtensions) { if (extensionPriority < 2 /* DeclarationAndJavaScriptFiles */) { return 2 /* DeclarationAndJavaScriptFiles */; } else { - return 5 /* Limit */; + return supportedExtensions.length; } } ts.getNextLowestExtensionPriority = getNextLowestExtensionPriority; @@ -3333,144 +3494,30 @@ var ts; } } ts.tryGetExtensionFromPath = tryGetExtensionFromPath; + function isCheckJsEnabledForFile(sourceFile, compilerOptions) { + return sourceFile.checkJsDirective ? sourceFile.checkJsDirective.enabled : compilerOptions.checkJs; + } + ts.isCheckJsEnabledForFile = isCheckJsEnabledForFile; })(ts || (ts = {})); /// var ts; (function (ts) { - ts.sys = (function () { - function getWScriptSystem() { - var fso = new ActiveXObject("Scripting.FileSystemObject"); - var shell = new ActiveXObject("WScript.Shell"); - var fileStream = new ActiveXObject("ADODB.Stream"); - fileStream.Type = 2 /*text*/; - var binaryStream = new ActiveXObject("ADODB.Stream"); - binaryStream.Type = 1 /*binary*/; - var args = []; - for (var i = 0; i < WScript.Arguments.length; i++) { - args[i] = WScript.Arguments.Item(i); - } - function readFile(fileName, encoding) { - if (!fso.FileExists(fileName)) { - return undefined; - } - fileStream.Open(); - try { - if (encoding) { - fileStream.Charset = encoding; - fileStream.LoadFromFile(fileName); - } - else { - // Load file and read the first two bytes into a string with no interpretation - fileStream.Charset = "x-ansi"; - fileStream.LoadFromFile(fileName); - var bom = fileStream.ReadText(2) || ""; - // Position must be at 0 before encoding can be changed - fileStream.Position = 0; - // [0xFF,0xFE] and [0xFE,0xFF] mean utf-16 (little or big endian), otherwise default to utf-8 - fileStream.Charset = bom.length >= 2 && (bom.charCodeAt(0) === 0xFF && bom.charCodeAt(1) === 0xFE || bom.charCodeAt(0) === 0xFE && bom.charCodeAt(1) === 0xFF) ? "unicode" : "utf-8"; - } - // ReadText method always strips byte order mark from resulting string - return fileStream.ReadText(); - } - catch (e) { - throw e; - } - finally { - fileStream.Close(); - } - } - function writeFile(fileName, data, writeByteOrderMark) { - fileStream.Open(); - binaryStream.Open(); - try { - // Write characters in UTF-8 encoding - fileStream.Charset = "utf-8"; - fileStream.WriteText(data); - // If we don't want the BOM, then skip it by setting the starting location to 3 (size of BOM). - // If not, start from position 0, as the BOM will be added automatically when charset==utf8. - if (writeByteOrderMark) { - fileStream.Position = 0; - } - else { - fileStream.Position = 3; - } - fileStream.CopyTo(binaryStream); - binaryStream.SaveToFile(fileName, 2 /*overwrite*/); - } - finally { - binaryStream.Close(); - fileStream.Close(); - } - } - function getNames(collection) { - var result = []; - for (var e = new Enumerator(collection); !e.atEnd(); e.moveNext()) { - result.push(e.item().Name); - } - return result.sort(); - } - function getDirectories(path) { - var folder = fso.GetFolder(path); - return getNames(folder.subfolders); - } - function getAccessibleFileSystemEntries(path) { - try { - var folder = fso.GetFolder(path || "."); - var files = getNames(folder.files); - var directories = getNames(folder.subfolders); - return { files: files, directories: directories }; - } - catch (e) { - return { files: [], directories: [] }; - } - } - function readDirectory(path, extensions, excludes, includes) { - return ts.matchFiles(path, extensions, excludes, includes, /*useCaseSensitiveFileNames*/ false, shell.CurrentDirectory, getAccessibleFileSystemEntries); - } - var wscriptSystem = { - args: args, - newLine: "\r\n", - useCaseSensitiveFileNames: false, - write: function (s) { - WScript.StdOut.Write(s); - }, - readFile: readFile, - writeFile: writeFile, - resolvePath: function (path) { - return fso.GetAbsolutePathName(path); - }, - fileExists: function (path) { - return fso.FileExists(path); - }, - directoryExists: function (path) { - return fso.FolderExists(path); - }, - createDirectory: function (directoryName) { - if (!wscriptSystem.directoryExists(directoryName)) { - fso.CreateFolder(directoryName); - } - }, - getExecutingFilePath: function () { - return WScript.ScriptFullName; - }, - getCurrentDirectory: function () { - return shell.CurrentDirectory; - }, - getDirectories: getDirectories, - getEnvironmentVariable: function (name) { - return new ActiveXObject("WScript.Shell").ExpandEnvironmentStrings("%" + name + "%"); - }, - readDirectory: readDirectory, - exit: function (exitCode) { - try { - WScript.Quit(exitCode); - } - catch (e) { - } - } - }; - return wscriptSystem; + function getNodeMajorVersion() { + if (typeof process === "undefined") { + return undefined; } + var version = process.version; + if (!version) { + return undefined; + } + var dot = version.indexOf("."); + if (dot === -1) { + return undefined; + } + return parseInt(version.substring(1, dot)); + } + ts.getNodeMajorVersion = getNodeMajorVersion; + ts.sys = (function () { function getNodeSystem() { var _fs = require("fs"); var _path = require("path"); @@ -3480,32 +3527,32 @@ var ts; function createWatchedFileSet() { var dirWatchers = ts.createMap(); // One file can have multiple watchers - var fileWatcherCallbacks = ts.createMap(); + var fileWatcherCallbacks = ts.createMultiMap(); return { addFile: addFile, removeFile: removeFile }; function reduceDirWatcherRefCountForFile(fileName) { var dirName = ts.getDirectoryPath(fileName); - var watcher = dirWatchers[dirName]; + var watcher = dirWatchers.get(dirName); if (watcher) { watcher.referenceCount -= 1; if (watcher.referenceCount <= 0) { watcher.close(); - delete dirWatchers[dirName]; + dirWatchers.delete(dirName); } } } function addDirWatcher(dirPath) { - var watcher = dirWatchers[dirPath]; + var watcher = dirWatchers.get(dirPath); if (watcher) { watcher.referenceCount += 1; return; } watcher = _fs.watch(dirPath, { persistent: true }, function (eventName, relativeFileName) { return fileEventHandler(eventName, relativeFileName, dirPath); }); watcher.referenceCount = 1; - dirWatchers[dirPath] = watcher; + dirWatchers.set(dirPath, watcher); return; } function addFileWatcherCallback(filePath, callback) { - ts.multiMapAdd(fileWatcherCallbacks, filePath, callback); + fileWatcherCallbacks.add(filePath, callback); } function addFile(fileName, callback) { addFileWatcherCallback(fileName, callback); @@ -3517,7 +3564,7 @@ var ts; reduceDirWatcherRefCountForFile(watchedFile.fileName); } function removeFileWatcherCallback(filePath, callback) { - ts.multiMapRemove(fileWatcherCallbacks, 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" @@ -3525,18 +3572,20 @@ var ts; ? undefined : ts.getNormalizedAbsolutePath(relativeFileName, baseDirPath); // Some applications save a working file via rename operations - if ((eventName === "change" || eventName === "rename") && fileWatcherCallbacks[fileName]) { - for (var _i = 0, _a = fileWatcherCallbacks[fileName]; _i < _a.length; _i++) { - var fileCallback = _a[_i]; - fileCallback(fileName); + 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); + } } } } } var watchedFileSet = createWatchedFileSet(); - function isNode4OrLater() { - return parseInt(process.version.charAt(1)) >= 4; - } + var nodeVersion = getNodeMajorVersion(); + var isNode4OrLater = nodeVersion >= 4; function isFileSystemCaseSensitive() { // win32\win64 are case insensitive platforms if (platform === "win32" || platform === "win64") { @@ -3557,7 +3606,7 @@ var ts; if (len >= 2 && buffer[0] === 0xFE && buffer[1] === 0xFF) { // Big endian UTF-16 byte order mark detected. Since big endian is not supported by node.js, // flip all byte pairs and treat as little endian. - len &= ~1; + len &= ~1; // Round down to a multiple of 2 for (var i = 0; i < len; i += 2) { var temp = buffer[i]; buffer[i] = buffer[i + 1]; @@ -3584,7 +3633,7 @@ var ts; var fd; try { fd = _fs.openSync(fileName, "w"); - _fs.writeSync(fd, data, undefined, "utf8"); + _fs.writeSync(fd, data, /*position*/ undefined, "utf8"); } finally { if (fd !== undefined) { @@ -3604,10 +3653,10 @@ var ts; if (entry === "." || entry === "..") { continue; } - var name_3 = ts.combinePaths(path, entry); + var name = ts.combinePaths(path, entry); var stat = void 0; try { - stat = _fs.statSync(name_3); + stat = _fs.statSync(name); } catch (e) { continue; @@ -3689,9 +3738,10 @@ var ts; // (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643) var options; if (!directoryExists(directoryName)) { + // do nothing if target folder does not exist return noOpFileWatcher; } - if (isNode4OrLater() && (process.platform === "win32" || process.platform === "darwin")) { + if (isNode4OrLater && (process.platform === "win32" || process.platform === "darwin")) { options = { persistent: true, recursive: !!recursive }; } else { @@ -3705,7 +3755,6 @@ var ts; // When deleting a file, the passed baseFileName is null callback(!relativeFileName ? relativeFileName : ts.normalizePath(ts.combinePaths(directoryName, relativeFileName))); } - ; }); }, resolvePath: function (path) { @@ -3769,6 +3818,7 @@ var ts; require("source-map-support").install(); } catch (e) { + // Could not enable source maps. } }, setTimeout: setTimeout, @@ -3824,9 +3874,6 @@ var ts; if (typeof ChakraHost !== "undefined") { sys = getChakraSystem(); } - else if (typeof WScript !== "undefined" && typeof ActiveXObject === "function") { - sys = getWScriptSystem(); - } else if (typeof process !== "undefined" && process.nextTick && !process.browser && typeof require !== "undefined") { // process and process.nextTick checks if current environment is node-like // process.browser check excludes webpack and browserify @@ -3901,11 +3948,11 @@ var ts; Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value: { code: 1055, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Prom_1055", message: "Type '{0}' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value." }, Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: ts.DiagnosticCategory.Error, key: "Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056", message: "Accessors are only available when targeting ECMAScript 5 and higher." }, An_async_function_or_method_must_have_a_valid_awaitable_return_type: { code: 1057, category: ts.DiagnosticCategory.Error, key: "An_async_function_or_method_must_have_a_valid_awaitable_return_type_1057", message: "An async function or method must have a valid awaitable return type." }, - Operand_for_await_does_not_have_a_valid_callable_then_member: { code: 1058, category: ts.DiagnosticCategory.Error, key: "Operand_for_await_does_not_have_a_valid_callable_then_member_1058", message: "Operand for 'await' does not have a valid callable 'then' member." }, - Return_expression_in_async_function_does_not_have_a_valid_callable_then_member: { code: 1059, category: ts.DiagnosticCategory.Error, key: "Return_expression_in_async_function_does_not_have_a_valid_callable_then_member_1059", message: "Return expression in async function does not have a valid callable 'then' member." }, - Expression_body_for_async_arrow_function_does_not_have_a_valid_callable_then_member: { code: 1060, category: ts.DiagnosticCategory.Error, key: "Expression_body_for_async_arrow_function_does_not_have_a_valid_callable_then_member_1060", message: "Expression body for async arrow function does not have a valid callable 'then' member." }, + The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: { code: 1058, category: ts.DiagnosticCategory.Error, key: "The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_t_1058", message: "The return type of an async function must either be a valid promise or must not contain a callable 'then' member." }, + A_promise_must_have_a_then_method: { code: 1059, category: ts.DiagnosticCategory.Error, key: "A_promise_must_have_a_then_method_1059", message: "A promise must have a 'then' method." }, + The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback: { code: 1060, category: ts.DiagnosticCategory.Error, key: "The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback_1060", message: "The first parameter of the 'then' method of a promise must be a callback." }, Enum_member_must_have_initializer: { code: 1061, category: ts.DiagnosticCategory.Error, key: "Enum_member_must_have_initializer_1061", message: "Enum member must have initializer." }, - _0_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method: { code: 1062, category: ts.DiagnosticCategory.Error, key: "_0_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method_1062", message: "{0} is referenced directly or indirectly in the fulfillment callback of its own 'then' method." }, + Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method: { code: 1062, category: ts.DiagnosticCategory.Error, key: "Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method_1062", message: "Type is referenced directly or indirectly in the fulfillment callback of its own 'then' method." }, An_export_assignment_cannot_be_used_in_a_namespace: { code: 1063, category: ts.DiagnosticCategory.Error, key: "An_export_assignment_cannot_be_used_in_a_namespace_1063", message: "An export assignment cannot be used in a namespace." }, The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type: { code: 1064, category: ts.DiagnosticCategory.Error, key: "The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_1064", message: "The return type of an async function or method must be the global Promise type." }, In_ambient_enum_declarations_member_initializer_must_be_constant_expression: { code: 1066, category: ts.DiagnosticCategory.Error, key: "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066", message: "In ambient enum declarations member initializer must be constant expression." }, @@ -3930,6 +3977,7 @@ var ts; Invalid_use_of_0_in_strict_mode: { code: 1100, category: ts.DiagnosticCategory.Error, key: "Invalid_use_of_0_in_strict_mode_1100", message: "Invalid use of '{0}' in strict mode." }, with_statements_are_not_allowed_in_strict_mode: { code: 1101, category: ts.DiagnosticCategory.Error, key: "with_statements_are_not_allowed_in_strict_mode_1101", message: "'with' statements are not allowed in strict mode." }, delete_cannot_be_called_on_an_identifier_in_strict_mode: { code: 1102, category: ts.DiagnosticCategory.Error, key: "delete_cannot_be_called_on_an_identifier_in_strict_mode_1102", message: "'delete' cannot be called on an identifier in strict mode." }, + A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator: { code: 1103, category: ts.DiagnosticCategory.Error, key: "A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator_1103", message: "A 'for-await-of' statement is only allowed within an async function or async generator." }, A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { code: 1104, category: ts.DiagnosticCategory.Error, key: "A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement_1104", message: "A 'continue' statement can only be used within an enclosing iteration statement." }, A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { code: 1105, category: ts.DiagnosticCategory.Error, key: "A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement_1105", message: "A 'break' statement can only be used within an enclosing iteration or switch statement." }, Jump_target_cannot_cross_function_boundary: { code: 1107, category: ts.DiagnosticCategory.Error, key: "Jump_target_cannot_cross_function_boundary_1107", message: "Jump target cannot cross function boundary." }, @@ -3937,7 +3985,7 @@ var ts; Expression_expected: { code: 1109, category: ts.DiagnosticCategory.Error, key: "Expression_expected_1109", message: "Expression expected." }, Type_expected: { code: 1110, category: ts.DiagnosticCategory.Error, key: "Type_expected_1110", message: "Type expected." }, A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { code: 1113, category: ts.DiagnosticCategory.Error, key: "A_default_clause_cannot_appear_more_than_once_in_a_switch_statement_1113", message: "A 'default' clause cannot appear more than once in a 'switch' statement." }, - Duplicate_label_0: { code: 1114, category: ts.DiagnosticCategory.Error, key: "Duplicate_label_0_1114", message: "Duplicate label '{0}'" }, + Duplicate_label_0: { code: 1114, category: ts.DiagnosticCategory.Error, key: "Duplicate_label_0_1114", message: "Duplicate label '{0}'." }, A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: { code: 1115, category: ts.DiagnosticCategory.Error, key: "A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115", message: "A 'continue' statement can only jump to a label of an enclosing iteration statement." }, A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: { code: 1116, category: ts.DiagnosticCategory.Error, key: "A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116", message: "A 'break' statement can only jump to a label of an enclosing statement." }, An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: { code: 1117, category: ts.DiagnosticCategory.Error, key: "An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode_1117", message: "An object literal cannot have multiple properties with the same name in strict mode." }, @@ -3969,9 +4017,9 @@ var ts; Declaration_expected: { code: 1146, category: ts.DiagnosticCategory.Error, key: "Declaration_expected_1146", message: "Declaration expected." }, Import_declarations_in_a_namespace_cannot_reference_a_module: { code: 1147, category: ts.DiagnosticCategory.Error, key: "Import_declarations_in_a_namespace_cannot_reference_a_module_1147", message: "Import declarations in a namespace cannot reference a module." }, Cannot_use_imports_exports_or_module_augmentations_when_module_is_none: { code: 1148, category: ts.DiagnosticCategory.Error, key: "Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148", message: "Cannot use imports, exports, or module augmentations when '--module' is 'none'." }, - File_name_0_differs_from_already_included_file_name_1_only_in_casing: { code: 1149, category: ts.DiagnosticCategory.Error, key: "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149", message: "File name '{0}' differs from already included file name '{1}' only in casing" }, + File_name_0_differs_from_already_included_file_name_1_only_in_casing: { code: 1149, category: ts.DiagnosticCategory.Error, key: "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149", message: "File name '{0}' differs from already included file name '{1}' only in casing." }, new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: ts.DiagnosticCategory.Error, key: "new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead_1150", message: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, - const_declarations_must_be_initialized: { code: 1155, category: ts.DiagnosticCategory.Error, key: "const_declarations_must_be_initialized_1155", message: "'const' declarations must be initialized" }, + const_declarations_must_be_initialized: { code: 1155, category: ts.DiagnosticCategory.Error, key: "const_declarations_must_be_initialized_1155", message: "'const' declarations must be initialized." }, const_declarations_can_only_be_declared_inside_a_block: { code: 1156, category: ts.DiagnosticCategory.Error, key: "const_declarations_can_only_be_declared_inside_a_block_1156", message: "'const' declarations can only be declared inside a block." }, let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: ts.DiagnosticCategory.Error, key: "let_declarations_can_only_be_declared_inside_a_block_1157", message: "'let' declarations can only be declared inside a block." }, Unterminated_template_literal: { code: 1160, category: ts.DiagnosticCategory.Error, key: "Unterminated_template_literal_1160", message: "Unterminated template literal." }, @@ -4020,11 +4068,12 @@ var ts; Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided: { code: 1208, category: ts.DiagnosticCategory.Error, key: "Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided_1208", message: "Cannot compile namespaces when the '--isolatedModules' flag is provided." }, Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided: { code: 1209, category: ts.DiagnosticCategory.Error, key: "Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided_1209", message: "Ambient const enums are not allowed when the '--isolatedModules' flag is provided." }, Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: { code: 1210, category: ts.DiagnosticCategory.Error, key: "Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode_1210", message: "Invalid use of '{0}'. Class definitions are automatically in strict mode." }, - A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1211, category: ts.DiagnosticCategory.Error, key: "A_class_declaration_without_the_default_modifier_must_have_a_name_1211", message: "A class declaration without the 'default' modifier must have a name" }, - Identifier_expected_0_is_a_reserved_word_in_strict_mode: { code: 1212, category: ts.DiagnosticCategory.Error, key: "Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212", message: "Identifier expected. '{0}' is a reserved word in strict mode" }, + A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1211, category: ts.DiagnosticCategory.Error, key: "A_class_declaration_without_the_default_modifier_must_have_a_name_1211", message: "A class declaration without the 'default' modifier must have a name." }, + Identifier_expected_0_is_a_reserved_word_in_strict_mode: { code: 1212, category: ts.DiagnosticCategory.Error, key: "Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212", message: "Identifier expected. '{0}' is a reserved word in strict mode." }, Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1213, category: ts.DiagnosticCategory.Error, key: "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_stric_1213", message: "Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." }, Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode: { code: 1214, category: ts.DiagnosticCategory.Error, key: "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214", message: "Identifier expected. '{0}' is a reserved word in strict mode. Modules are automatically in strict mode." }, Invalid_use_of_0_Modules_are_automatically_in_strict_mode: { code: 1215, category: ts.DiagnosticCategory.Error, key: "Invalid_use_of_0_Modules_are_automatically_in_strict_mode_1215", message: "Invalid use of '{0}'. Modules are automatically in strict mode." }, + Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules: { code: 1216, category: ts.DiagnosticCategory.Error, key: "Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216", message: "Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules." }, Export_assignment_is_not_supported_when_module_flag_is_system: { code: 1218, category: ts.DiagnosticCategory.Error, key: "Export_assignment_is_not_supported_when_module_flag_is_system_1218", message: "Export assignment is not supported when '--module' flag is 'system'." }, Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning: { code: 1219, category: ts.DiagnosticCategory.Error, key: "Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_t_1219", message: "Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning." }, Generators_are_only_available_when_targeting_ECMAScript_2015_or_higher: { code: 1220, category: ts.DiagnosticCategory.Error, key: "Generators_are_only_available_when_targeting_ECMAScript_2015_or_higher_1220", message: "Generators are only available when targeting ECMAScript 2015 or higher." }, @@ -4071,6 +4120,10 @@ var ts; Global_module_exports_may_only_appear_at_top_level: { code: 1316, category: ts.DiagnosticCategory.Error, key: "Global_module_exports_may_only_appear_at_top_level_1316", message: "Global module exports may only appear at top level." }, A_parameter_property_cannot_be_declared_using_a_rest_parameter: { code: 1317, category: ts.DiagnosticCategory.Error, key: "A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317", message: "A parameter property cannot be declared using a rest parameter." }, An_abstract_accessor_cannot_have_an_implementation: { code: 1318, category: ts.DiagnosticCategory.Error, key: "An_abstract_accessor_cannot_have_an_implementation_1318", message: "An abstract accessor cannot have an implementation." }, + A_default_export_can_only_be_used_in_an_ECMAScript_style_module: { code: 1319, category: ts.DiagnosticCategory.Error, key: "A_default_export_can_only_be_used_in_an_ECMAScript_style_module_1319", message: "A default export can only be used in an ECMAScript-style module." }, + Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: { code: 1320, category: ts.DiagnosticCategory.Error, key: "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320", message: "Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member." }, + Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: { code: 1321, category: ts.DiagnosticCategory.Error, key: "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321", message: "Type of 'yield' operand in an async generator must either be a valid promise or must not contain a callable 'then' member." }, + Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: { code: 1322, category: ts.DiagnosticCategory.Error, key: "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322", message: "Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member." }, Duplicate_identifier_0: { code: 2300, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_0_2300", message: "Duplicate identifier '{0}'." }, Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: ts.DiagnosticCategory.Error, key: "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", message: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, Static_members_cannot_reference_class_type_parameters: { code: 2302, category: ts.DiagnosticCategory.Error, key: "Static_members_cannot_reference_class_type_parameters_2302", message: "Static members cannot reference class type parameters." }, @@ -4132,13 +4185,13 @@ var ts; The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2358, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358", message: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." }, The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { code: 2359, category: ts.DiagnosticCategory.Error, key: "The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_F_2359", message: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." }, The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol: { code: 2360, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol_2360", message: "The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'." }, - The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: ts.DiagnosticCategory.Error, key: "The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter_2361", message: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, + The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: ts.DiagnosticCategory.Error, key: "The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter_2361", message: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter." }, The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2362, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type_2362", message: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2363, category: ts.DiagnosticCategory.Error, key: "The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type_2363", message: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access: { code: 2364, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364", message: "The left-hand side of an assignment expression must be a variable or a property access." }, Operator_0_cannot_be_applied_to_types_1_and_2: { code: 2365, category: ts.DiagnosticCategory.Error, key: "Operator_0_cannot_be_applied_to_types_1_and_2_2365", message: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined: { code: 2366, category: ts.DiagnosticCategory.Error, key: "Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366", message: "Function lacks ending return statement and return type does not include 'undefined'." }, - Type_parameter_name_cannot_be_0: { code: 2368, category: ts.DiagnosticCategory.Error, key: "Type_parameter_name_cannot_be_0_2368", message: "Type parameter name cannot be '{0}'" }, + Type_parameter_name_cannot_be_0: { code: 2368, category: ts.DiagnosticCategory.Error, key: "Type_parameter_name_cannot_be_0_2368", message: "Type parameter name cannot be '{0}'." }, A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2369, category: ts.DiagnosticCategory.Error, key: "A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369", message: "A parameter property is only allowed in a constructor implementation." }, A_rest_parameter_must_be_of_an_array_type: { code: 2370, category: ts.DiagnosticCategory.Error, key: "A_rest_parameter_must_be_of_an_array_type_2370", message: "A rest parameter must be of an array type." }, A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { code: 2371, category: ts.DiagnosticCategory.Error, key: "A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371", message: "A parameter initializer is only allowed in a function or constructor implementation." }, @@ -4178,12 +4231,12 @@ var ts; The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access: { code: 2406, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access_2406", message: "The left-hand side of a 'for...in' statement must be a variable or a property access." }, The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2407, category: ts.DiagnosticCategory.Error, key: "The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_2407", message: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, Setters_cannot_return_a_value: { code: 2408, category: ts.DiagnosticCategory.Error, key: "Setters_cannot_return_a_value_2408", message: "Setters cannot return a value." }, - Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2409, category: ts.DiagnosticCategory.Error, key: "Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class_2409", message: "Return type of constructor signature must be assignable to the instance type of the class" }, + Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2409, category: ts.DiagnosticCategory.Error, key: "Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class_2409", message: "Return type of constructor signature must be assignable to the instance type of the class." }, The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any: { code: 2410, category: ts.DiagnosticCategory.Error, key: "The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any_2410", message: "The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'." }, Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: 2411, category: ts.DiagnosticCategory.Error, key: "Property_0_of_type_1_is_not_assignable_to_string_index_type_2_2411", message: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { code: 2412, category: ts.DiagnosticCategory.Error, key: "Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2_2412", message: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." }, Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: 2413, category: ts.DiagnosticCategory.Error, key: "Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413", message: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, - Class_name_cannot_be_0: { code: 2414, category: ts.DiagnosticCategory.Error, key: "Class_name_cannot_be_0_2414", message: "Class name cannot be '{0}'" }, + Class_name_cannot_be_0: { code: 2414, category: ts.DiagnosticCategory.Error, key: "Class_name_cannot_be_0_2414", message: "Class name cannot be '{0}'." }, Class_0_incorrectly_extends_base_class_1: { code: 2415, category: ts.DiagnosticCategory.Error, key: "Class_0_incorrectly_extends_base_class_1_2415", message: "Class '{0}' incorrectly extends base class '{1}'." }, Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: 2417, category: ts.DiagnosticCategory.Error, key: "Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417", message: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, Class_0_incorrectly_implements_interface_1: { code: 2420, category: ts.DiagnosticCategory.Error, key: "Class_0_incorrectly_implements_interface_1_2420", message: "Class '{0}' incorrectly implements interface '{1}'." }, @@ -4192,19 +4245,19 @@ var ts; Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 2424, category: ts.DiagnosticCategory.Error, key: "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_proper_2424", message: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2425, category: ts.DiagnosticCategory.Error, key: "Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425", message: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2426, category: ts.DiagnosticCategory.Error, key: "Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_functi_2426", message: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, - Interface_name_cannot_be_0: { code: 2427, category: ts.DiagnosticCategory.Error, key: "Interface_name_cannot_be_0_2427", message: "Interface name cannot be '{0}'" }, + Interface_name_cannot_be_0: { code: 2427, category: ts.DiagnosticCategory.Error, key: "Interface_name_cannot_be_0_2427", message: "Interface name cannot be '{0}'." }, All_declarations_of_0_must_have_identical_type_parameters: { code: 2428, category: ts.DiagnosticCategory.Error, key: "All_declarations_of_0_must_have_identical_type_parameters_2428", message: "All declarations of '{0}' must have identical type parameters." }, Interface_0_incorrectly_extends_interface_1: { code: 2430, category: ts.DiagnosticCategory.Error, key: "Interface_0_incorrectly_extends_interface_1_2430", message: "Interface '{0}' incorrectly extends interface '{1}'." }, - Enum_name_cannot_be_0: { code: 2431, category: ts.DiagnosticCategory.Error, key: "Enum_name_cannot_be_0_2431", message: "Enum name cannot be '{0}'" }, + Enum_name_cannot_be_0: { code: 2431, category: ts.DiagnosticCategory.Error, key: "Enum_name_cannot_be_0_2431", message: "Enum name cannot be '{0}'." }, In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 2432, category: ts.DiagnosticCategory.Error, key: "In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432", message: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, - A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: ts.DiagnosticCategory.Error, key: "A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433", message: "A namespace declaration cannot be in a different file from a class or function with which it is merged" }, - A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: ts.DiagnosticCategory.Error, key: "A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434", message: "A namespace declaration cannot be located prior to a class or function with which it is merged" }, + A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: ts.DiagnosticCategory.Error, key: "A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433", message: "A namespace declaration cannot be in a different file from a class or function with which it is merged." }, + A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: ts.DiagnosticCategory.Error, key: "A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434", message: "A namespace declaration cannot be located prior to a class or function with which it is merged." }, Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces: { code: 2435, category: ts.DiagnosticCategory.Error, key: "Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces_2435", message: "Ambient modules cannot be nested in other modules or namespaces." }, Ambient_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: ts.DiagnosticCategory.Error, key: "Ambient_module_declaration_cannot_specify_relative_module_name_2436", message: "Ambient module declaration cannot specify relative module name." }, - Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: ts.DiagnosticCategory.Error, key: "Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437", message: "Module '{0}' is hidden by a local declaration with the same name" }, - Import_name_cannot_be_0: { code: 2438, category: ts.DiagnosticCategory.Error, key: "Import_name_cannot_be_0_2438", message: "Import name cannot be '{0}'" }, + Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: ts.DiagnosticCategory.Error, key: "Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437", message: "Module '{0}' is hidden by a local declaration with the same name." }, + Import_name_cannot_be_0: { code: 2438, category: ts.DiagnosticCategory.Error, key: "Import_name_cannot_be_0_2438", message: "Import name cannot be '{0}'." }, Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name: { code: 2439, category: ts.DiagnosticCategory.Error, key: "Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relati_2439", message: "Import or export declaration in an ambient module declaration cannot reference module through relative module name." }, - Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: ts.DiagnosticCategory.Error, key: "Import_declaration_conflicts_with_local_declaration_of_0_2440", message: "Import declaration conflicts with local declaration of '{0}'" }, + Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: ts.DiagnosticCategory.Error, key: "Import_declaration_conflicts_with_local_declaration_of_0_2440", message: "Import declaration conflicts with local declaration of '{0}'." }, Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module: { code: 2441, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_2441", message: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module." }, Types_have_separate_declarations_of_a_private_property_0: { code: 2442, category: ts.DiagnosticCategory.Error, key: "Types_have_separate_declarations_of_a_private_property_0_2442", message: "Types have separate declarations of a private property '{0}'." }, Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: { code: 2443, category: ts.DiagnosticCategory.Error, key: "Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2_2443", message: "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'." }, @@ -4213,18 +4266,20 @@ var ts; Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { code: 2446, category: ts.DiagnosticCategory.Error, key: "Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_2446", message: "Property '{0}' is protected and only accessible through an instance of class '{1}'." }, The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { code: 2447, category: ts.DiagnosticCategory.Error, key: "The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead_2447", message: "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead." }, Block_scoped_variable_0_used_before_its_declaration: { code: 2448, category: ts.DiagnosticCategory.Error, key: "Block_scoped_variable_0_used_before_its_declaration_2448", message: "Block-scoped variable '{0}' used before its declaration." }, + Class_0_used_before_its_declaration: { code: 2449, category: ts.DiagnosticCategory.Error, key: "Class_0_used_before_its_declaration_2449", message: "Class '{0}' used before its declaration." }, + Enum_0_used_before_its_declaration: { code: 2450, category: ts.DiagnosticCategory.Error, key: "Enum_0_used_before_its_declaration_2450", message: "Enum '{0}' used before its declaration." }, Cannot_redeclare_block_scoped_variable_0: { code: 2451, category: ts.DiagnosticCategory.Error, key: "Cannot_redeclare_block_scoped_variable_0_2451", message: "Cannot redeclare block-scoped variable '{0}'." }, An_enum_member_cannot_have_a_numeric_name: { code: 2452, category: ts.DiagnosticCategory.Error, key: "An_enum_member_cannot_have_a_numeric_name_2452", message: "An enum member cannot have a numeric name." }, The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: { code: 2453, category: ts.DiagnosticCategory.Error, key: "The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_typ_2453", message: "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly." }, Variable_0_is_used_before_being_assigned: { code: 2454, category: ts.DiagnosticCategory.Error, key: "Variable_0_is_used_before_being_assigned_2454", message: "Variable '{0}' is used before being assigned." }, Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { code: 2455, category: ts.DiagnosticCategory.Error, key: "Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0_2455", message: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." }, Type_alias_0_circularly_references_itself: { code: 2456, category: ts.DiagnosticCategory.Error, key: "Type_alias_0_circularly_references_itself_2456", message: "Type alias '{0}' circularly references itself." }, - Type_alias_name_cannot_be_0: { code: 2457, category: ts.DiagnosticCategory.Error, key: "Type_alias_name_cannot_be_0_2457", message: "Type alias name cannot be '{0}'" }, + Type_alias_name_cannot_be_0: { code: 2457, category: ts.DiagnosticCategory.Error, key: "Type_alias_name_cannot_be_0_2457", message: "Type alias name cannot be '{0}'." }, An_AMD_module_cannot_have_multiple_name_assignments: { code: 2458, category: ts.DiagnosticCategory.Error, key: "An_AMD_module_cannot_have_multiple_name_assignments_2458", message: "An AMD module cannot have multiple name assignments." }, Type_0_has_no_property_1_and_no_string_index_signature: { code: 2459, category: ts.DiagnosticCategory.Error, key: "Type_0_has_no_property_1_and_no_string_index_signature_2459", message: "Type '{0}' has no property '{1}' and no string index signature." }, Type_0_has_no_property_1: { code: 2460, category: ts.DiagnosticCategory.Error, key: "Type_0_has_no_property_1_2460", message: "Type '{0}' has no property '{1}'." }, Type_0_is_not_an_array_type: { code: 2461, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_an_array_type_2461", message: "Type '{0}' is not an array type." }, - A_rest_element_must_be_last_in_a_destructuring_pattern: { code: 2462, category: ts.DiagnosticCategory.Error, key: "A_rest_element_must_be_last_in_a_destructuring_pattern_2462", message: "A rest element must be last in a destructuring pattern" }, + A_rest_element_must_be_last_in_a_destructuring_pattern: { code: 2462, category: ts.DiagnosticCategory.Error, key: "A_rest_element_must_be_last_in_a_destructuring_pattern_2462", message: "A rest element must be last in a destructuring pattern." }, A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature: { code: 2463, category: ts.DiagnosticCategory.Error, key: "A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature_2463", message: "A binding pattern parameter cannot be optional in an implementation signature." }, A_computed_property_name_must_be_of_type_string_number_symbol_or_any: { code: 2464, category: ts.DiagnosticCategory.Error, key: "A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464", message: "A computed property name must be of type 'string', 'number', 'symbol', or 'any'." }, this_cannot_be_referenced_in_a_computed_property_name: { code: 2465, category: ts.DiagnosticCategory.Error, key: "this_cannot_be_referenced_in_a_computed_property_name_2465", message: "'this' cannot be referenced in a computed property name." }, @@ -4245,13 +4300,13 @@ var ts; let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: { code: 2480, category: ts.DiagnosticCategory.Error, key: "let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480", message: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." }, Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: { code: 2481, category: ts.DiagnosticCategory.Error, key: "Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481", message: "Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'." }, The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation: { code: 2483, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation_2483", message: "The left-hand side of a 'for...of' statement cannot use a type annotation." }, - Export_declaration_conflicts_with_exported_declaration_of_0: { code: 2484, category: ts.DiagnosticCategory.Error, key: "Export_declaration_conflicts_with_exported_declaration_of_0_2484", message: "Export declaration conflicts with exported declaration of '{0}'" }, + Export_declaration_conflicts_with_exported_declaration_of_0: { code: 2484, category: ts.DiagnosticCategory.Error, key: "Export_declaration_conflicts_with_exported_declaration_of_0_2484", message: "Export declaration conflicts with exported declaration of '{0}'." }, The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access: { code: 2487, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access_2487", message: "The left-hand side of a 'for...of' statement must be a variable or a property access." }, Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2488, category: ts.DiagnosticCategory.Error, key: "Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator_2488", message: "Type must have a '[Symbol.iterator]()' method that returns an iterator." }, An_iterator_must_have_a_next_method: { code: 2489, category: ts.DiagnosticCategory.Error, key: "An_iterator_must_have_a_next_method_2489", message: "An iterator must have a 'next()' method." }, The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property: { code: 2490, category: ts.DiagnosticCategory.Error, key: "The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property_2490", message: "The type returned by the 'next()' method of an iterator must have a 'value' property." }, The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: { code: 2491, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern_2491", message: "The left-hand side of a 'for...in' statement cannot be a destructuring pattern." }, - Cannot_redeclare_identifier_0_in_catch_clause: { code: 2492, category: ts.DiagnosticCategory.Error, key: "Cannot_redeclare_identifier_0_in_catch_clause_2492", message: "Cannot redeclare identifier '{0}' in catch clause" }, + Cannot_redeclare_identifier_0_in_catch_clause: { code: 2492, category: ts.DiagnosticCategory.Error, key: "Cannot_redeclare_identifier_0_in_catch_clause_2492", message: "Cannot redeclare identifier '{0}' in catch clause." }, Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2: { code: 2493, category: ts.DiagnosticCategory.Error, key: "Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2_2493", message: "Tuple type '{0}' with length '{1}' cannot be assigned to tuple with length '{2}'." }, Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher: { code: 2494, category: ts.DiagnosticCategory.Error, key: "Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494", message: "Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher." }, Type_0_is_not_an_array_type_or_a_string_type: { code: 2495, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_an_array_type_or_a_string_type_2495", message: "Type '{0}' is not an array type or a string type." }, @@ -4263,6 +4318,7 @@ var ts; A_rest_element_cannot_contain_a_binding_pattern: { code: 2501, category: ts.DiagnosticCategory.Error, key: "A_rest_element_cannot_contain_a_binding_pattern_2501", message: "A rest element cannot contain a binding pattern." }, _0_is_referenced_directly_or_indirectly_in_its_own_type_annotation: { code: 2502, category: ts.DiagnosticCategory.Error, key: "_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502", message: "'{0}' is referenced directly or indirectly in its own type annotation." }, Cannot_find_namespace_0: { code: 2503, category: ts.DiagnosticCategory.Error, key: "Cannot_find_namespace_0_2503", message: "Cannot find namespace '{0}'." }, + Type_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator: { code: 2504, category: ts.DiagnosticCategory.Error, key: "Type_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator_2504", message: "Type must have a '[Symbol.asyncIterator]()' method that returns an async iterator." }, A_generator_cannot_have_a_void_type_annotation: { code: 2505, category: ts.DiagnosticCategory.Error, key: "A_generator_cannot_have_a_void_type_annotation_2505", message: "A generator cannot have a 'void' type annotation." }, _0_is_referenced_directly_or_indirectly_in_its_own_base_expression: { code: 2506, category: ts.DiagnosticCategory.Error, key: "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506", message: "'{0}' is referenced directly or indirectly in its own base expression." }, Type_0_is_not_a_constructor_function_type: { code: 2507, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_a_constructor_function_type_2507", message: "Type '{0}' is not a constructor function type." }, @@ -4277,6 +4333,7 @@ var ts; All_declarations_of_an_abstract_method_must_be_consecutive: { code: 2516, category: ts.DiagnosticCategory.Error, key: "All_declarations_of_an_abstract_method_must_be_consecutive_2516", message: "All declarations of an abstract method must be consecutive." }, Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type: { code: 2517, category: ts.DiagnosticCategory.Error, key: "Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type_2517", message: "Cannot assign an abstract constructor type to a non-abstract constructor type." }, A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard: { code: 2518, category: ts.DiagnosticCategory.Error, key: "A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard_2518", message: "A 'this'-based type guard is not compatible with a parameter-based type guard." }, + An_async_iterator_must_have_a_next_method: { code: 2519, category: ts.DiagnosticCategory.Error, key: "An_async_iterator_must_have_a_next_method_2519", message: "An async iterator must have a 'next()' method." }, Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions: { code: 2520, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions_2520", message: "Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions." }, Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions: { code: 2521, category: ts.DiagnosticCategory.Error, key: "Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions_2521", message: "Expression resolves to variable declaration '{0}' that compiler uses to support async functions." }, The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method: { code: 2522, category: ts.DiagnosticCategory.Error, key: "The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_usi_2522", message: "The 'arguments' object cannot be referenced in an async function or method in ES3 and ES5. Consider using a standard function or method." }, @@ -4300,23 +4357,33 @@ var ts; Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property: { code: 2540, category: ts.DiagnosticCategory.Error, key: "Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property_2540", message: "Cannot assign to '{0}' because it is a constant or a read-only property." }, The_target_of_an_assignment_must_be_a_variable_or_a_property_access: { code: 2541, category: ts.DiagnosticCategory.Error, key: "The_target_of_an_assignment_must_be_a_variable_or_a_property_access_2541", message: "The target of an assignment must be a variable or a property access." }, Index_signature_in_type_0_only_permits_reading: { code: 2542, category: ts.DiagnosticCategory.Error, key: "Index_signature_in_type_0_only_permits_reading_2542", message: "Index signature in type '{0}' only permits reading." }, + Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference: { code: 2543, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_me_2543", message: "Duplicate identifier '_newTarget'. Compiler uses variable declaration '_newTarget' to capture 'new.target' meta-property reference." }, + Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference: { code: 2544, category: ts.DiagnosticCategory.Error, key: "Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta__2544", message: "Expression resolves to variable declaration '_newTarget' that compiler uses to capture 'new.target' meta-property reference." }, + A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any: { code: 2545, category: ts.DiagnosticCategory.Error, key: "A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any_2545", message: "A mixin class must have a constructor with a single rest parameter of type 'any[]'." }, + Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1: { code: 2546, category: ts.DiagnosticCategory.Error, key: "Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1_2546", message: "Property '{0}' has conflicting declarations and is inaccessible in type '{1}'." }, + The_type_returned_by_the_next_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property: { code: 2547, category: ts.DiagnosticCategory.Error, key: "The_type_returned_by_the_next_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value__2547", message: "The type returned by the 'next()' method of an async iterator must be a promise for a type with a 'value' property." }, + Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2548, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548", message: "Type '{0}' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator." }, + Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2549, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549", message: "Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]()' method that returns an iterator." }, + Generic_type_instantiation_is_excessively_deep_and_possibly_infinite: { code: 2550, category: ts.DiagnosticCategory.Error, key: "Generic_type_instantiation_is_excessively_deep_and_possibly_infinite_2550", message: "Generic type instantiation is excessively deep and possibly infinite." }, JSX_element_attributes_type_0_may_not_be_a_union_type: { code: 2600, category: ts.DiagnosticCategory.Error, key: "JSX_element_attributes_type_0_may_not_be_a_union_type_2600", message: "JSX element attributes type '{0}' may not be a union type." }, The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: { code: 2601, category: ts.DiagnosticCategory.Error, key: "The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601", message: "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: { code: 2602, category: ts.DiagnosticCategory.Error, key: "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", message: "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist." }, - Property_0_in_type_1_is_not_assignable_to_type_2: { code: 2603, category: ts.DiagnosticCategory.Error, key: "Property_0_in_type_1_is_not_assignable_to_type_2_2603", message: "Property '{0}' in type '{1}' is not assignable to type '{2}'" }, + Property_0_in_type_1_is_not_assignable_to_type_2: { code: 2603, category: ts.DiagnosticCategory.Error, key: "Property_0_in_type_1_is_not_assignable_to_type_2_2603", message: "Property '{0}' in type '{1}' is not assignable to type '{2}'." }, JSX_element_type_0_does_not_have_any_construct_or_call_signatures: { code: 2604, category: ts.DiagnosticCategory.Error, key: "JSX_element_type_0_does_not_have_any_construct_or_call_signatures_2604", message: "JSX element type '{0}' does not have any construct or call signatures." }, JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements: { code: 2605, category: ts.DiagnosticCategory.Error, key: "JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements_2605", message: "JSX element type '{0}' is not a constructor function for JSX elements." }, Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property: { code: 2606, category: ts.DiagnosticCategory.Error, key: "Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property_2606", message: "Property '{0}' of JSX spread attribute is not assignable to target property." }, - JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property: { code: 2607, category: ts.DiagnosticCategory.Error, key: "JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property_2607", message: "JSX element class does not support attributes because it does not have a '{0}' property" }, - The_global_type_JSX_0_may_not_have_more_than_one_property: { code: 2608, category: ts.DiagnosticCategory.Error, key: "The_global_type_JSX_0_may_not_have_more_than_one_property_2608", message: "The global type 'JSX.{0}' may not have more than one property" }, - Cannot_emit_namespaced_JSX_elements_in_React: { code: 2650, category: ts.DiagnosticCategory.Error, key: "Cannot_emit_namespaced_JSX_elements_in_React_2650", message: "Cannot emit namespaced JSX elements in React" }, + JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property: { code: 2607, category: ts.DiagnosticCategory.Error, key: "JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property_2607", message: "JSX element class does not support attributes because it does not have a '{0}' property." }, + The_global_type_JSX_0_may_not_have_more_than_one_property: { code: 2608, category: ts.DiagnosticCategory.Error, key: "The_global_type_JSX_0_may_not_have_more_than_one_property_2608", message: "The global type 'JSX.{0}' may not have more than one property." }, + JSX_spread_child_must_be_an_array_type: { code: 2609, category: ts.DiagnosticCategory.Error, key: "JSX_spread_child_must_be_an_array_type_2609", message: "JSX spread child must be an array type." }, + Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity: { code: 2649, category: ts.DiagnosticCategory.Error, key: "Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity_2649", message: "Cannot augment module '{0}' with value exports because it resolves to a non-module entity." }, + Cannot_emit_namespaced_JSX_elements_in_React: { code: 2650, category: ts.DiagnosticCategory.Error, key: "Cannot_emit_namespaced_JSX_elements_in_React_2650", message: "Cannot emit namespaced JSX elements in React." }, A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums: { code: 2651, category: ts.DiagnosticCategory.Error, key: "A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651", message: "A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums." }, Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead: { code: 2652, category: ts.DiagnosticCategory.Error, key: "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652", message: "Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead." }, Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1: { code: 2653, category: ts.DiagnosticCategory.Error, key: "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653", message: "Non-abstract class expression does not implement inherited abstract member '{0}' from class '{1}'." }, Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_package_author_to_update_the_package_definition: { code: 2654, category: ts.DiagnosticCategory.Error, key: "Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_pack_2654", message: "Exported external package typings file cannot contain tripleslash references. Please contact the package author to update the package definition." }, Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_the_package_definition: { code: 2656, category: ts.DiagnosticCategory.Error, key: "Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_2656", message: "Exported external package typings file '{0}' is not a module. Please contact the package author to update the package definition." }, - JSX_expressions_must_have_one_parent_element: { code: 2657, category: ts.DiagnosticCategory.Error, key: "JSX_expressions_must_have_one_parent_element_2657", message: "JSX expressions must have one parent element" }, - Type_0_provides_no_match_for_the_signature_1: { code: 2658, category: ts.DiagnosticCategory.Error, key: "Type_0_provides_no_match_for_the_signature_1_2658", message: "Type '{0}' provides no match for the signature '{1}'" }, + JSX_expressions_must_have_one_parent_element: { code: 2657, category: ts.DiagnosticCategory.Error, key: "JSX_expressions_must_have_one_parent_element_2657", message: "JSX expressions must have one parent element." }, + Type_0_provides_no_match_for_the_signature_1: { code: 2658, category: ts.DiagnosticCategory.Error, key: "Type_0_provides_no_match_for_the_signature_1_2658", message: "Type '{0}' provides no match for the signature '{1}'." }, super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher: { code: 2659, category: ts.DiagnosticCategory.Error, key: "super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_highe_2659", message: "'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher." }, super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions: { code: 2660, category: ts.DiagnosticCategory.Error, key: "super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions_2660", message: "'super' can only be referenced in members of derived classes or object literal expressions." }, Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module: { code: 2661, category: ts.DiagnosticCategory.Error, key: "Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module_2661", message: "Cannot export '{0}'. Only local declarations can be exported from a module." }, @@ -4348,7 +4415,6 @@ var ts; All_declarations_of_0_must_have_identical_modifiers: { code: 2687, category: ts.DiagnosticCategory.Error, key: "All_declarations_of_0_must_have_identical_modifiers_2687", message: "All declarations of '{0}' must have identical modifiers." }, Cannot_find_type_definition_file_for_0: { code: 2688, category: ts.DiagnosticCategory.Error, key: "Cannot_find_type_definition_file_for_0_2688", message: "Cannot find type definition file for '{0}'." }, Cannot_extend_an_interface_0_Did_you_mean_implements: { code: 2689, category: ts.DiagnosticCategory.Error, key: "Cannot_extend_an_interface_0_Did_you_mean_implements_2689", message: "Cannot extend an interface '{0}'. Did you mean 'implements'?" }, - A_class_must_be_declared_after_its_base_class: { code: 2690, category: ts.DiagnosticCategory.Error, key: "A_class_must_be_declared_after_its_base_class_2690", message: "A class must be declared after its base class." }, An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead: { code: 2691, category: ts.DiagnosticCategory.Error, key: "An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead_2691", message: "An import path cannot end with a '{0}' extension. Consider importing '{1}' instead." }, _0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible: { code: 2692, category: ts.DiagnosticCategory.Error, key: "_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692", message: "'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible." }, _0_only_refers_to_a_type_but_is_being_used_as_a_value_here: { code: 2693, category: ts.DiagnosticCategory.Error, key: "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693", message: "'{0}' only refers to a type, but is being used as a value here." }, @@ -4357,9 +4423,18 @@ var ts; The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead: { code: 2696, category: ts.DiagnosticCategory.Error, key: "The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead_2696", message: "The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?" }, An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option: { code: 2697, category: ts.DiagnosticCategory.Error, key: "An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_in_2697", message: "An async function or method must return a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your `--lib` option." }, Spread_types_may_only_be_created_from_object_types: { code: 2698, category: ts.DiagnosticCategory.Error, key: "Spread_types_may_only_be_created_from_object_types_2698", message: "Spread types may only be created from object types." }, + Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1: { code: 2699, category: ts.DiagnosticCategory.Error, key: "Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1_2699", message: "Static property '{0}' conflicts with built-in property 'Function.{0}' of constructor function '{1}'." }, Rest_types_may_only_be_created_from_object_types: { code: 2700, category: ts.DiagnosticCategory.Error, key: "Rest_types_may_only_be_created_from_object_types_2700", message: "Rest types may only be created from object types." }, The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access: { code: 2701, category: ts.DiagnosticCategory.Error, key: "The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access_2701", message: "The target of an object rest assignment must be a variable or a property access." }, _0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here: { code: 2702, category: ts.DiagnosticCategory.Error, key: "_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702", message: "'{0}' only refers to a type, but is being used as a namespace here." }, + The_operand_of_a_delete_operator_must_be_a_property_reference: { code: 2703, category: ts.DiagnosticCategory.Error, key: "The_operand_of_a_delete_operator_must_be_a_property_reference_2703", message: "The operand of a delete operator must be a property reference." }, + The_operand_of_a_delete_operator_cannot_be_a_read_only_property: { code: 2704, category: ts.DiagnosticCategory.Error, key: "The_operand_of_a_delete_operator_cannot_be_a_read_only_property_2704", message: "The operand of a delete operator cannot be a read-only property." }, + An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option: { code: 2705, category: ts.DiagnosticCategory.Error, key: "An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_de_2705", message: "An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option." }, + Required_type_parameters_may_not_follow_optional_type_parameters: { code: 2706, category: ts.DiagnosticCategory.Error, key: "Required_type_parameters_may_not_follow_optional_type_parameters_2706", message: "Required type parameters may not follow optional type parameters." }, + Generic_type_0_requires_between_1_and_2_type_arguments: { code: 2707, category: ts.DiagnosticCategory.Error, key: "Generic_type_0_requires_between_1_and_2_type_arguments_2707", message: "Generic type '{0}' requires between {1} and {2} type arguments." }, + Cannot_use_namespace_0_as_a_value: { code: 2708, category: ts.DiagnosticCategory.Error, key: "Cannot_use_namespace_0_as_a_value_2708", message: "Cannot use namespace '{0}' as a value." }, + Cannot_use_namespace_0_as_a_type: { code: 2709, category: ts.DiagnosticCategory.Error, key: "Cannot_use_namespace_0_as_a_type_2709", message: "Cannot use namespace '{0}' as a type." }, + _0_are_specified_twice_The_attribute_named_0_will_be_overwritten: { code: 2710, category: ts.DiagnosticCategory.Error, key: "_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710", message: "'{0}' are specified twice. The attribute named '{0}' will be overwritten." }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: ts.DiagnosticCategory.Error, key: "Import_declaration_0_is_using_private_name_1_4000", message: "Import declaration '{0}' is using private name '{1}'." }, Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", message: "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: { code: 4004, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", message: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, @@ -4370,8 +4445,8 @@ var ts; Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4014, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4014", message: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." }, Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4016, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_function_has_or_is_using_private_name_1_4016", message: "Type parameter '{0}' of exported function has or is using private name '{1}'." }, Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4019, category: ts.DiagnosticCategory.Error, key: "Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019", message: "Implements clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: ts.DiagnosticCategory.Error, key: "Extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020", message: "Extends clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: ts.DiagnosticCategory.Error, key: "Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022", message: "Extends clause of exported interface '{0}' has or is using private name '{1}'." }, + extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: ts.DiagnosticCategory.Error, key: "extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020", message: "'extends' clause of exported class '{0}' has or is using private name '{1}'." }, + extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: ts.DiagnosticCategory.Error, key: "extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022", message: "'extends' clause of exported interface '{0}' has or is using private name '{1}'." }, Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4023, category: ts.DiagnosticCategory.Error, key: "Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023", message: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { code: 4024, category: ts.DiagnosticCategory.Error, key: "Exported_variable_0_has_or_is_using_name_1_from_private_module_2_4024", message: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." }, Exported_variable_0_has_or_is_using_private_name_1: { code: 4025, category: ts.DiagnosticCategory.Error, key: "Exported_variable_0_has_or_is_using_private_name_1_4025", message: "Exported variable '{0}' has or is using private name '{1}'." }, @@ -4434,16 +4509,16 @@ var ts; Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict: { code: 4090, category: ts.DiagnosticCategory.Message, key: "Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_librar_4090", message: "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: { code: 4091, category: ts.DiagnosticCategory.Error, key: "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091", message: "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: { code: 4092, category: ts.DiagnosticCategory.Error, key: "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092", message: "Parameter '{0}' of index signature from exported interface has or is using private name '{1}'." }, + extends_clause_of_exported_class_0_refers_to_a_type_whose_name_cannot_be_referenced: { code: 4093, category: ts.DiagnosticCategory.Error, key: "extends_clause_of_exported_class_0_refers_to_a_type_whose_name_cannot_be_referenced_4093", message: "'extends' clause of exported class '{0}' refers to a type whose name cannot be referenced." }, The_current_host_does_not_support_the_0_option: { code: 5001, category: ts.DiagnosticCategory.Error, key: "The_current_host_does_not_support_the_0_option_5001", message: "The current host does not support the '{0}' option." }, Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: ts.DiagnosticCategory.Error, key: "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", message: "Cannot find the common subdirectory path for the input files." }, File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: { code: 5010, category: ts.DiagnosticCategory.Error, key: "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", message: "File specification cannot end in a recursive directory wildcard ('**'): '{0}'." }, File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0: { code: 5011, category: ts.DiagnosticCategory.Error, key: "File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011", message: "File specification cannot contain multiple recursive directory wildcards ('**'): '{0}'." }, - Cannot_read_file_0_Colon_1: { code: 5012, category: ts.DiagnosticCategory.Error, key: "Cannot_read_file_0_Colon_1_5012", message: "Cannot read file '{0}': {1}" }, - Unsupported_file_encoding: { code: 5013, category: ts.DiagnosticCategory.Error, key: "Unsupported_file_encoding_5013", message: "Unsupported file encoding." }, + Cannot_read_file_0_Colon_1: { code: 5012, category: ts.DiagnosticCategory.Error, key: "Cannot_read_file_0_Colon_1_5012", message: "Cannot read file '{0}': {1}." }, Failed_to_parse_file_0_Colon_1: { code: 5014, category: ts.DiagnosticCategory.Error, key: "Failed_to_parse_file_0_Colon_1_5014", message: "Failed to parse file '{0}': {1}." }, Unknown_compiler_option_0: { code: 5023, category: ts.DiagnosticCategory.Error, key: "Unknown_compiler_option_0_5023", message: "Unknown compiler option '{0}'." }, Compiler_option_0_requires_a_value_of_type_1: { code: 5024, category: ts.DiagnosticCategory.Error, key: "Compiler_option_0_requires_a_value_of_type_1_5024", message: "Compiler option '{0}' requires a value of type {1}." }, - Could_not_write_file_0_Colon_1: { code: 5033, category: ts.DiagnosticCategory.Error, key: "Could_not_write_file_0_Colon_1_5033", message: "Could not write file '{0}': {1}" }, + Could_not_write_file_0_Colon_1: { code: 5033, category: ts.DiagnosticCategory.Error, key: "Could_not_write_file_0_Colon_1_5033", message: "Could not write file '{0}': {1}." }, Option_project_cannot_be_mixed_with_source_files_on_a_command_line: { code: 5042, category: ts.DiagnosticCategory.Error, key: "Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042", message: "Option 'project' cannot be mixed with source files on a command line." }, Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher: { code: 5047, category: ts.DiagnosticCategory.Error, key: "Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047", message: "Option 'isolatedModules' can only be used when either option '--module' is provided or option 'target' is 'ES2015' or higher." }, Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided: { code: 5051, category: ts.DiagnosticCategory.Error, key: "Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051", message: "Option '{0} can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided." }, @@ -4452,12 +4527,12 @@ var ts; A_tsconfig_json_file_is_already_defined_at_Colon_0: { code: 5054, category: ts.DiagnosticCategory.Error, key: "A_tsconfig_json_file_is_already_defined_at_Colon_0_5054", message: "A 'tsconfig.json' file is already defined at: '{0}'." }, Cannot_write_file_0_because_it_would_overwrite_input_file: { code: 5055, category: ts.DiagnosticCategory.Error, key: "Cannot_write_file_0_because_it_would_overwrite_input_file_5055", message: "Cannot write file '{0}' because it would overwrite input file." }, Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files: { code: 5056, category: ts.DiagnosticCategory.Error, key: "Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files_5056", message: "Cannot write file '{0}' because it would be overwritten by multiple input files." }, - Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0: { code: 5057, category: ts.DiagnosticCategory.Error, key: "Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057", message: "Cannot find a tsconfig.json file at the specified directory: '{0}'" }, - The_specified_path_does_not_exist_Colon_0: { code: 5058, category: ts.DiagnosticCategory.Error, key: "The_specified_path_does_not_exist_Colon_0_5058", message: "The specified path does not exist: '{0}'" }, + Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0: { code: 5057, category: ts.DiagnosticCategory.Error, key: "Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057", message: "Cannot find a tsconfig.json file at the specified directory: '{0}'." }, + The_specified_path_does_not_exist_Colon_0: { code: 5058, category: ts.DiagnosticCategory.Error, key: "The_specified_path_does_not_exist_Colon_0_5058", message: "The specified path does not exist: '{0}'." }, Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier: { code: 5059, category: ts.DiagnosticCategory.Error, key: "Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059", message: "Invalid value for '--reactNamespace'. '{0}' is not a valid identifier." }, Option_paths_cannot_be_used_without_specifying_baseUrl_option: { code: 5060, category: ts.DiagnosticCategory.Error, key: "Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060", message: "Option 'paths' cannot be used without specifying '--baseUrl' option." }, - Pattern_0_can_have_at_most_one_Asterisk_character: { code: 5061, category: ts.DiagnosticCategory.Error, key: "Pattern_0_can_have_at_most_one_Asterisk_character_5061", message: "Pattern '{0}' can have at most one '*' character" }, - Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character: { code: 5062, category: ts.DiagnosticCategory.Error, key: "Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character_5062", message: "Substitution '{0}' in pattern '{1}' in can have at most one '*' character" }, + Pattern_0_can_have_at_most_one_Asterisk_character: { code: 5061, category: ts.DiagnosticCategory.Error, key: "Pattern_0_can_have_at_most_one_Asterisk_character_5061", message: "Pattern '{0}' can have at most one '*' character." }, + Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character: { code: 5062, category: ts.DiagnosticCategory.Error, key: "Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character_5062", message: "Substitution '{0}' in pattern '{1}' in can have at most one '*' character." }, Substitutions_for_pattern_0_should_be_an_array: { code: 5063, category: ts.DiagnosticCategory.Error, key: "Substitutions_for_pattern_0_should_be_an_array_5063", message: "Substitutions for pattern '{0}' should be an array." }, Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2: { code: 5064, category: ts.DiagnosticCategory.Error, key: "Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064", message: "Substitution '{0}' for pattern '{1}' has incorrect type, expected 'string', got '{2}'." }, File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: { code: 5065, category: ts.DiagnosticCategory.Error, key: "File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065", message: "File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '{0}'." }, @@ -4475,11 +4550,11 @@ var ts; Do_not_emit_outputs: { code: 6010, category: ts.DiagnosticCategory.Message, key: "Do_not_emit_outputs_6010", message: "Do not emit outputs." }, Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking: { code: 6011, category: ts.DiagnosticCategory.Message, key: "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011", message: "Allow default imports from modules with no default export. This does not affect code emit, just typechecking." }, Skip_type_checking_of_declaration_files: { code: 6012, category: ts.DiagnosticCategory.Message, key: "Skip_type_checking_of_declaration_files_6012", message: "Skip type checking of declaration files." }, - Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT: { code: 6015, category: ts.DiagnosticCategory.Message, key: "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015", message: "Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'" }, - Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015_6016", message: "Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'" }, + Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT: { code: 6015, category: ts.DiagnosticCategory.Message, key: "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015", message: "Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'." }, + Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015_6016", message: "Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'." }, Print_this_message: { code: 6017, category: ts.DiagnosticCategory.Message, key: "Print_this_message_6017", message: "Print this message." }, Print_the_compiler_s_version: { code: 6019, category: ts.DiagnosticCategory.Message, key: "Print_the_compiler_s_version_6019", message: "Print the compiler's version." }, - Compile_the_project_in_the_given_directory: { code: 6020, category: ts.DiagnosticCategory.Message, key: "Compile_the_project_in_the_given_directory_6020", message: "Compile the project in the given directory." }, + Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json: { code: 6020, category: ts.DiagnosticCategory.Message, key: "Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json_6020", message: "Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'." }, Syntax_Colon_0: { code: 6023, category: ts.DiagnosticCategory.Message, key: "Syntax_Colon_0_6023", message: "Syntax: {0}" }, options: { code: 6024, category: ts.DiagnosticCategory.Message, key: "options_6024", message: "options" }, file: { code: 6025, category: ts.DiagnosticCategory.Message, key: "file_6025", message: "file" }, @@ -4494,11 +4569,12 @@ var ts; LOCATION: { code: 6037, category: ts.DiagnosticCategory.Message, key: "LOCATION_6037", message: "LOCATION" }, DIRECTORY: { code: 6038, category: ts.DiagnosticCategory.Message, key: "DIRECTORY_6038", message: "DIRECTORY" }, STRATEGY: { code: 6039, category: ts.DiagnosticCategory.Message, key: "STRATEGY_6039", message: "STRATEGY" }, + FILE_OR_DIRECTORY: { code: 6040, category: ts.DiagnosticCategory.Message, key: "FILE_OR_DIRECTORY_6040", message: "FILE OR DIRECTORY" }, Compilation_complete_Watching_for_file_changes: { code: 6042, category: ts.DiagnosticCategory.Message, key: "Compilation_complete_Watching_for_file_changes_6042", message: "Compilation complete. Watching for file changes." }, Generates_corresponding_map_file: { code: 6043, category: ts.DiagnosticCategory.Message, key: "Generates_corresponding_map_file_6043", message: "Generates corresponding '.map' file." }, Compiler_option_0_expects_an_argument: { code: 6044, category: ts.DiagnosticCategory.Error, key: "Compiler_option_0_expects_an_argument_6044", message: "Compiler option '{0}' expects an argument." }, Unterminated_quoted_string_in_response_file_0: { code: 6045, category: ts.DiagnosticCategory.Error, key: "Unterminated_quoted_string_in_response_file_0_6045", message: "Unterminated quoted string in response file '{0}'." }, - Argument_for_0_option_must_be_Colon_1: { code: 6046, category: ts.DiagnosticCategory.Error, key: "Argument_for_0_option_must_be_Colon_1_6046", message: "Argument for '{0}' option must be: {1}" }, + Argument_for_0_option_must_be_Colon_1: { code: 6046, category: ts.DiagnosticCategory.Error, key: "Argument_for_0_option_must_be_Colon_1_6046", message: "Argument for '{0}' option must be: {1}." }, Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: ts.DiagnosticCategory.Error, key: "Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048", message: "Locale must be of the form or -. For example '{0}' or '{1}'." }, Unsupported_locale_0: { code: 6049, category: ts.DiagnosticCategory.Error, key: "Unsupported_locale_0_6049", message: "Unsupported locale '{0}'." }, Unable_to_open_file_0: { code: 6050, category: ts.DiagnosticCategory.Error, key: "Unable_to_open_file_0_6050", message: "Unable to open file '{0}'." }, @@ -4520,18 +4596,18 @@ var ts; Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file: { code: 6070, category: ts.DiagnosticCategory.Message, key: "Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file_6070", message: "Initializes a TypeScript project and creates a tsconfig.json file." }, Successfully_created_a_tsconfig_json_file: { code: 6071, category: ts.DiagnosticCategory.Message, key: "Successfully_created_a_tsconfig_json_file_6071", message: "Successfully created a tsconfig.json file." }, Suppress_excess_property_checks_for_object_literals: { code: 6072, category: ts.DiagnosticCategory.Message, key: "Suppress_excess_property_checks_for_object_literals_6072", message: "Suppress excess property checks for object literals." }, - Stylize_errors_and_messages_using_color_and_context_experimental: { code: 6073, category: ts.DiagnosticCategory.Message, key: "Stylize_errors_and_messages_using_color_and_context_experimental_6073", message: "Stylize errors and messages using color and context. (experimental)" }, + Stylize_errors_and_messages_using_color_and_context_experimental: { code: 6073, category: ts.DiagnosticCategory.Message, key: "Stylize_errors_and_messages_using_color_and_context_experimental_6073", message: "Stylize errors and messages using color and context (experimental)." }, Do_not_report_errors_on_unused_labels: { code: 6074, category: ts.DiagnosticCategory.Message, key: "Do_not_report_errors_on_unused_labels_6074", message: "Do not report errors on unused labels." }, Report_error_when_not_all_code_paths_in_function_return_a_value: { code: 6075, category: ts.DiagnosticCategory.Message, key: "Report_error_when_not_all_code_paths_in_function_return_a_value_6075", message: "Report error when not all code paths in function return a value." }, Report_errors_for_fallthrough_cases_in_switch_statement: { code: 6076, category: ts.DiagnosticCategory.Message, key: "Report_errors_for_fallthrough_cases_in_switch_statement_6076", message: "Report errors for fallthrough cases in switch statement." }, Do_not_report_errors_on_unreachable_code: { code: 6077, category: ts.DiagnosticCategory.Message, key: "Do_not_report_errors_on_unreachable_code_6077", message: "Do not report errors on unreachable code." }, Disallow_inconsistently_cased_references_to_the_same_file: { code: 6078, category: ts.DiagnosticCategory.Message, key: "Disallow_inconsistently_cased_references_to_the_same_file_6078", message: "Disallow inconsistently-cased references to the same file." }, Specify_library_files_to_be_included_in_the_compilation_Colon: { code: 6079, category: ts.DiagnosticCategory.Message, key: "Specify_library_files_to_be_included_in_the_compilation_Colon_6079", message: "Specify library files to be included in the compilation: " }, - Specify_JSX_code_generation_Colon_preserve_or_react: { code: 6080, category: ts.DiagnosticCategory.Message, key: "Specify_JSX_code_generation_Colon_preserve_or_react_6080", message: "Specify JSX code generation: 'preserve' or 'react'" }, + Specify_JSX_code_generation_Colon_preserve_react_native_or_react: { code: 6080, category: ts.DiagnosticCategory.Message, key: "Specify_JSX_code_generation_Colon_preserve_react_native_or_react_6080", message: "Specify JSX code generation: 'preserve', 'react-native', or 'react'." }, File_0_has_an_unsupported_extension_so_skipping_it: { code: 6081, category: ts.DiagnosticCategory.Message, key: "File_0_has_an_unsupported_extension_so_skipping_it_6081", message: "File '{0}' has an unsupported extension, so skipping it." }, Only_amd_and_system_modules_are_supported_alongside_0: { code: 6082, category: ts.DiagnosticCategory.Error, key: "Only_amd_and_system_modules_are_supported_alongside_0_6082", message: "Only 'amd' and 'system' modules are supported alongside --{0}." }, Base_directory_to_resolve_non_absolute_module_names: { code: 6083, category: ts.DiagnosticCategory.Message, key: "Base_directory_to_resolve_non_absolute_module_names_6083", message: "Base directory to resolve non-absolute module names." }, - Specify_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit: { code: 6084, category: ts.DiagnosticCategory.Message, key: "Specify_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit_6084", message: "Specify the object invoked for createElement and __spread when targeting 'react' JSX emit" }, + Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit: { code: 6084, category: ts.DiagnosticCategory.Message, key: "Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084", message: "[Deprecated] Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit" }, Enable_tracing_of_the_name_resolution_process: { code: 6085, category: ts.DiagnosticCategory.Message, key: "Enable_tracing_of_the_name_resolution_process_6085", message: "Enable tracing of the name resolution process." }, Resolving_module_0_from_1: { code: 6086, category: ts.DiagnosticCategory.Message, key: "Resolving_module_0_from_1_6086", message: "======== Resolving module '{0}' from '{1}'. ========" }, Explicitly_specified_module_resolution_kind_Colon_0: { code: 6087, category: ts.DiagnosticCategory.Message, key: "Explicitly_specified_module_resolution_kind_Colon_0_6087", message: "Explicitly specified module resolution kind: '{0}'." }, @@ -4542,23 +4618,23 @@ var ts; Module_name_0_matched_pattern_1: { code: 6092, category: ts.DiagnosticCategory.Message, key: "Module_name_0_matched_pattern_1_6092", message: "Module name '{0}', matched pattern '{1}'." }, Trying_substitution_0_candidate_module_location_Colon_1: { code: 6093, category: ts.DiagnosticCategory.Message, key: "Trying_substitution_0_candidate_module_location_Colon_1_6093", message: "Trying substitution '{0}', candidate module location: '{1}'." }, Resolving_module_name_0_relative_to_base_url_1_2: { code: 6094, category: ts.DiagnosticCategory.Message, key: "Resolving_module_name_0_relative_to_base_url_1_2_6094", message: "Resolving module name '{0}' relative to base url '{1}' - '{2}'." }, - Loading_module_as_file_Slash_folder_candidate_module_location_0: { code: 6095, category: ts.DiagnosticCategory.Message, key: "Loading_module_as_file_Slash_folder_candidate_module_location_0_6095", message: "Loading module as file / folder, candidate module location '{0}'." }, + Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1: { code: 6095, category: ts.DiagnosticCategory.Message, key: "Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1_6095", message: "Loading module as file / folder, candidate module location '{0}', target file type '{1}'." }, File_0_does_not_exist: { code: 6096, category: ts.DiagnosticCategory.Message, key: "File_0_does_not_exist_6096", message: "File '{0}' does not exist." }, File_0_exist_use_it_as_a_name_resolution_result: { code: 6097, category: ts.DiagnosticCategory.Message, key: "File_0_exist_use_it_as_a_name_resolution_result_6097", message: "File '{0}' exist - use it as a name resolution result." }, - Loading_module_0_from_node_modules_folder: { code: 6098, category: ts.DiagnosticCategory.Message, key: "Loading_module_0_from_node_modules_folder_6098", message: "Loading module '{0}' from 'node_modules' folder." }, + Loading_module_0_from_node_modules_folder_target_file_type_1: { code: 6098, category: ts.DiagnosticCategory.Message, key: "Loading_module_0_from_node_modules_folder_target_file_type_1_6098", message: "Loading module '{0}' from 'node_modules' folder, target file type '{1}'." }, Found_package_json_at_0: { code: 6099, category: ts.DiagnosticCategory.Message, key: "Found_package_json_at_0_6099", message: "Found 'package.json' at '{0}'." }, - package_json_does_not_have_a_types_or_main_field: { code: 6100, category: ts.DiagnosticCategory.Message, key: "package_json_does_not_have_a_types_or_main_field_6100", message: "'package.json' does not have a 'types' or 'main' field." }, + package_json_does_not_have_a_0_field: { code: 6100, category: ts.DiagnosticCategory.Message, key: "package_json_does_not_have_a_0_field_6100", message: "'package.json' does not have a '{0}' field." }, package_json_has_0_field_1_that_references_2: { code: 6101, category: ts.DiagnosticCategory.Message, key: "package_json_has_0_field_1_that_references_2_6101", message: "'package.json' has '{0}' field '{1}' that references '{2}'." }, Allow_javascript_files_to_be_compiled: { code: 6102, category: ts.DiagnosticCategory.Message, key: "Allow_javascript_files_to_be_compiled_6102", message: "Allow javascript files to be compiled." }, Option_0_should_have_array_of_strings_as_a_value: { code: 6103, category: ts.DiagnosticCategory.Error, key: "Option_0_should_have_array_of_strings_as_a_value_6103", message: "Option '{0}' should have array of strings as a value." }, Checking_if_0_is_the_longest_matching_prefix_for_1_2: { code: 6104, category: ts.DiagnosticCategory.Message, key: "Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104", message: "Checking if '{0}' is the longest matching prefix for '{1}' - '{2}'." }, Expected_type_of_0_field_in_package_json_to_be_string_got_1: { code: 6105, category: ts.DiagnosticCategory.Message, key: "Expected_type_of_0_field_in_package_json_to_be_string_got_1_6105", message: "Expected type of '{0}' field in 'package.json' to be 'string', got '{1}'." }, - baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1: { code: 6106, category: ts.DiagnosticCategory.Message, key: "baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1_6106", message: "'baseUrl' option is set to '{0}', using this value to resolve non-relative module name '{1}'" }, - rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0: { code: 6107, category: ts.DiagnosticCategory.Message, key: "rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107", message: "'rootDirs' option is set, using it to resolve relative module name '{0}'" }, - Longest_matching_prefix_for_0_is_1: { code: 6108, category: ts.DiagnosticCategory.Message, key: "Longest_matching_prefix_for_0_is_1_6108", message: "Longest matching prefix for '{0}' is '{1}'" }, - Loading_0_from_the_root_dir_1_candidate_location_2: { code: 6109, category: ts.DiagnosticCategory.Message, key: "Loading_0_from_the_root_dir_1_candidate_location_2_6109", message: "Loading '{0}' from the root dir '{1}', candidate location '{2}'" }, - Trying_other_entries_in_rootDirs: { code: 6110, category: ts.DiagnosticCategory.Message, key: "Trying_other_entries_in_rootDirs_6110", message: "Trying other entries in 'rootDirs'" }, - Module_resolution_using_rootDirs_has_failed: { code: 6111, category: ts.DiagnosticCategory.Message, key: "Module_resolution_using_rootDirs_has_failed_6111", message: "Module resolution using 'rootDirs' has failed" }, + baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1: { code: 6106, category: ts.DiagnosticCategory.Message, key: "baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1_6106", message: "'baseUrl' option is set to '{0}', using this value to resolve non-relative module name '{1}'." }, + rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0: { code: 6107, category: ts.DiagnosticCategory.Message, key: "rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107", message: "'rootDirs' option is set, using it to resolve relative module name '{0}'." }, + Longest_matching_prefix_for_0_is_1: { code: 6108, category: ts.DiagnosticCategory.Message, key: "Longest_matching_prefix_for_0_is_1_6108", message: "Longest matching prefix for '{0}' is '{1}'." }, + Loading_0_from_the_root_dir_1_candidate_location_2: { code: 6109, category: ts.DiagnosticCategory.Message, key: "Loading_0_from_the_root_dir_1_candidate_location_2_6109", message: "Loading '{0}' from the root dir '{1}', candidate location '{2}'." }, + Trying_other_entries_in_rootDirs: { code: 6110, category: ts.DiagnosticCategory.Message, key: "Trying_other_entries_in_rootDirs_6110", message: "Trying other entries in 'rootDirs'." }, + Module_resolution_using_rootDirs_has_failed: { code: 6111, category: ts.DiagnosticCategory.Message, key: "Module_resolution_using_rootDirs_has_failed_6111", message: "Module resolution using 'rootDirs' has failed." }, Do_not_emit_use_strict_directives_in_module_output: { code: 6112, category: ts.DiagnosticCategory.Message, key: "Do_not_emit_use_strict_directives_in_module_output_6112", message: "Do not emit 'use strict' directives in module output." }, Enable_strict_null_checks: { code: 6113, category: ts.DiagnosticCategory.Message, key: "Enable_strict_null_checks_6113", message: "Enable strict null checks." }, Unknown_option_excludes_Did_you_mean_exclude: { code: 6114, category: ts.DiagnosticCategory.Error, key: "Unknown_option_excludes_Did_you_mean_exclude_6114", message: "Unknown option 'excludes'. Did you mean 'exclude'?" }, @@ -4568,33 +4644,67 @@ var ts; Resolving_from_node_modules_folder: { code: 6118, category: ts.DiagnosticCategory.Message, key: "Resolving_from_node_modules_folder_6118", message: "Resolving from node_modules folder..." }, Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2: { code: 6119, category: ts.DiagnosticCategory.Message, key: "Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119", message: "======== Type reference directive '{0}' was successfully resolved to '{1}', primary: {2}. ========" }, Type_reference_directive_0_was_not_resolved: { code: 6120, category: ts.DiagnosticCategory.Message, key: "Type_reference_directive_0_was_not_resolved_6120", message: "======== Type reference directive '{0}' was not resolved. ========" }, - Resolving_with_primary_search_path_0: { code: 6121, category: ts.DiagnosticCategory.Message, key: "Resolving_with_primary_search_path_0_6121", message: "Resolving with primary search path '{0}'" }, + Resolving_with_primary_search_path_0: { code: 6121, category: ts.DiagnosticCategory.Message, key: "Resolving_with_primary_search_path_0_6121", message: "Resolving with primary search path '{0}'." }, Root_directory_cannot_be_determined_skipping_primary_search_paths: { code: 6122, category: ts.DiagnosticCategory.Message, key: "Root_directory_cannot_be_determined_skipping_primary_search_paths_6122", message: "Root directory cannot be determined, skipping primary search paths." }, Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set: { code: 6123, category: ts.DiagnosticCategory.Message, key: "Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set_6123", message: "======== Resolving type reference directive '{0}', containing file '{1}', root directory not set. ========" }, Type_declaration_files_to_be_included_in_compilation: { code: 6124, category: ts.DiagnosticCategory.Message, key: "Type_declaration_files_to_be_included_in_compilation_6124", message: "Type declaration files to be included in compilation." }, - Looking_up_in_node_modules_folder_initial_location_0: { code: 6125, category: ts.DiagnosticCategory.Message, key: "Looking_up_in_node_modules_folder_initial_location_0_6125", message: "Looking up in 'node_modules' folder, initial location '{0}'" }, + Looking_up_in_node_modules_folder_initial_location_0: { code: 6125, category: ts.DiagnosticCategory.Message, key: "Looking_up_in_node_modules_folder_initial_location_0_6125", message: "Looking up in 'node_modules' folder, initial location '{0}'." }, Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder: { code: 6126, category: ts.DiagnosticCategory.Message, key: "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126", message: "Containing file is not specified and root directory cannot be determined, skipping lookup in 'node_modules' folder." }, Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1: { code: 6127, category: ts.DiagnosticCategory.Message, key: "Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1_6127", message: "======== Resolving type reference directive '{0}', containing file not set, root directory '{1}'. ========" }, Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set: { code: 6128, category: ts.DiagnosticCategory.Message, key: "Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set_6128", message: "======== Resolving type reference directive '{0}', containing file not set, root directory not set. ========" }, The_config_file_0_found_doesn_t_contain_any_source_files: { code: 6129, category: ts.DiagnosticCategory.Error, key: "The_config_file_0_found_doesn_t_contain_any_source_files_6129", message: "The config file '{0}' found doesn't contain any source files." }, - Resolving_real_path_for_0_result_1: { code: 6130, category: ts.DiagnosticCategory.Message, key: "Resolving_real_path_for_0_result_1_6130", message: "Resolving real path for '{0}', result '{1}'" }, + Resolving_real_path_for_0_result_1: { code: 6130, category: ts.DiagnosticCategory.Message, key: "Resolving_real_path_for_0_result_1_6130", message: "Resolving real path for '{0}', result '{1}'." }, Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system: { code: 6131, category: ts.DiagnosticCategory.Error, key: "Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system_6131", message: "Cannot compile modules using option '{0}' unless the '--module' flag is 'amd' or 'system'." }, - File_name_0_has_a_1_extension_stripping_it: { code: 6132, category: ts.DiagnosticCategory.Message, key: "File_name_0_has_a_1_extension_stripping_it_6132", message: "File name '{0}' has a '{1}' extension - stripping it" }, + File_name_0_has_a_1_extension_stripping_it: { code: 6132, category: ts.DiagnosticCategory.Message, key: "File_name_0_has_a_1_extension_stripping_it_6132", message: "File name '{0}' has a '{1}' extension - stripping it." }, _0_is_declared_but_never_used: { code: 6133, category: ts.DiagnosticCategory.Error, key: "_0_is_declared_but_never_used_6133", message: "'{0}' is declared but never used." }, Report_errors_on_unused_locals: { code: 6134, category: ts.DiagnosticCategory.Message, key: "Report_errors_on_unused_locals_6134", message: "Report errors on unused locals." }, Report_errors_on_unused_parameters: { code: 6135, category: ts.DiagnosticCategory.Message, key: "Report_errors_on_unused_parameters_6135", message: "Report errors on unused parameters." }, - The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files: { code: 6136, category: ts.DiagnosticCategory.Message, key: "The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136", message: "The maximum dependency depth to search under node_modules and load JavaScript files" }, - No_types_specified_in_package_json_so_returning_main_value_of_0: { code: 6137, category: ts.DiagnosticCategory.Message, key: "No_types_specified_in_package_json_so_returning_main_value_of_0_6137", message: "No types specified in 'package.json', so returning 'main' value of '{0}'" }, + The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files: { code: 6136, category: ts.DiagnosticCategory.Message, key: "The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136", message: "The maximum dependency depth to search under node_modules and load JavaScript files." }, Property_0_is_declared_but_never_used: { code: 6138, category: ts.DiagnosticCategory.Error, key: "Property_0_is_declared_but_never_used_6138", message: "Property '{0}' is declared but never used." }, Import_emit_helpers_from_tslib: { code: 6139, category: ts.DiagnosticCategory.Message, key: "Import_emit_helpers_from_tslib_6139", message: "Import emit helpers from 'tslib'." }, Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2: { code: 6140, category: ts.DiagnosticCategory.Error, key: "Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using__6140", message: "Auto discovery for typings is enabled in project '{0}'. Running extra resolution pass for module '{1}' using cache location '{2}'." }, - Parse_in_strict_mode_and_emit_use_strict_for_each_source_file: { code: 6141, category: ts.DiagnosticCategory.Message, key: "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141", message: "Parse in strict mode and emit \"use strict\" for each source file" }, + Parse_in_strict_mode_and_emit_use_strict_for_each_source_file: { code: 6141, category: ts.DiagnosticCategory.Message, key: "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141", message: "Parse in strict mode and emit \"use strict\" for each source file." }, Module_0_was_resolved_to_1_but_jsx_is_not_set: { code: 6142, category: ts.DiagnosticCategory.Error, key: "Module_0_was_resolved_to_1_but_jsx_is_not_set_6142", message: "Module '{0}' was resolved to '{1}', but '--jsx' is not set." }, Module_0_was_resolved_to_1_but_allowJs_is_not_set: { code: 6143, category: ts.DiagnosticCategory.Error, key: "Module_0_was_resolved_to_1_but_allowJs_is_not_set_6143", message: "Module '{0}' was resolved to '{1}', but '--allowJs' is not set." }, Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1: { code: 6144, category: ts.DiagnosticCategory.Message, key: "Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1_6144", message: "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: { code: 6145, category: ts.DiagnosticCategory.Message, key: "Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified_6145", message: "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: { code: 6146, category: ts.DiagnosticCategory.Message, key: "Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146", message: "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: { code: 6147, category: ts.DiagnosticCategory.Message, key: "Resolution_for_module_0_was_found_in_cache_6147", message: "Resolution for module '{0}' was found in cache" }, + Resolution_for_module_0_was_found_in_cache: { code: 6147, category: ts.DiagnosticCategory.Message, key: "Resolution_for_module_0_was_found_in_cache_6147", message: "Resolution for module '{0}' was found in cache." }, + Directory_0_does_not_exist_skipping_all_lookups_in_it: { code: 6148, category: ts.DiagnosticCategory.Message, key: "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148", message: "Directory '{0}' does not exist, skipping all lookups in it." }, + Show_diagnostic_information: { code: 6149, category: ts.DiagnosticCategory.Message, key: "Show_diagnostic_information_6149", message: "Show diagnostic information." }, + Show_verbose_diagnostic_information: { code: 6150, category: ts.DiagnosticCategory.Message, key: "Show_verbose_diagnostic_information_6150", message: "Show verbose diagnostic information." }, + Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file: { code: 6151, category: ts.DiagnosticCategory.Message, key: "Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file_6151", message: "Emit a single file with source maps instead of having a separate file." }, + Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set: { code: 6152, category: ts.DiagnosticCategory.Message, key: "Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap__6152", message: "Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set." }, + Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule: { code: 6153, category: ts.DiagnosticCategory.Message, key: "Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153", message: "Transpile each file as a separate module (similar to 'ts.transpileModule')." }, + Print_names_of_generated_files_part_of_the_compilation: { code: 6154, category: ts.DiagnosticCategory.Message, key: "Print_names_of_generated_files_part_of_the_compilation_6154", message: "Print names of generated files part of the compilation." }, + Print_names_of_files_part_of_the_compilation: { code: 6155, category: ts.DiagnosticCategory.Message, key: "Print_names_of_files_part_of_the_compilation_6155", message: "Print names of files part of the compilation." }, + The_locale_used_when_displaying_messages_to_the_user_e_g_en_us: { code: 6156, category: ts.DiagnosticCategory.Message, key: "The_locale_used_when_displaying_messages_to_the_user_e_g_en_us_6156", message: "The locale used when displaying messages to the user (e.g. 'en-us')" }, + Do_not_generate_custom_helper_functions_like_extends_in_compiled_output: { code: 6157, category: ts.DiagnosticCategory.Message, key: "Do_not_generate_custom_helper_functions_like_extends_in_compiled_output_6157", message: "Do not generate custom helper functions like '__extends' in compiled output." }, + Do_not_include_the_default_library_file_lib_d_ts: { code: 6158, category: ts.DiagnosticCategory.Message, key: "Do_not_include_the_default_library_file_lib_d_ts_6158", message: "Do not include the default library file (lib.d.ts)." }, + Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files: { code: 6159, category: ts.DiagnosticCategory.Message, key: "Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159", message: "Do not add triple-slash references or imported modules to the list of compiled files." }, + Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files: { code: 6160, category: ts.DiagnosticCategory.Message, key: "Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160", message: "[Deprecated] Use '--skipLibCheck' instead. Skip type checking of default library declaration files." }, + List_of_folders_to_include_type_definitions_from: { code: 6161, category: ts.DiagnosticCategory.Message, key: "List_of_folders_to_include_type_definitions_from_6161", message: "List of folders to include type definitions from." }, + Disable_size_limitations_on_JavaScript_projects: { code: 6162, category: ts.DiagnosticCategory.Message, key: "Disable_size_limitations_on_JavaScript_projects_6162", message: "Disable size limitations on JavaScript projects." }, + The_character_set_of_the_input_files: { code: 6163, category: ts.DiagnosticCategory.Message, key: "The_character_set_of_the_input_files_6163", message: "The character set of the input files." }, + Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files: { code: 6164, category: ts.DiagnosticCategory.Message, key: "Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files_6164", message: "Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files." }, + Do_not_truncate_error_messages: { code: 6165, category: ts.DiagnosticCategory.Message, key: "Do_not_truncate_error_messages_6165", message: "Do not truncate error messages." }, + Output_directory_for_generated_declaration_files: { code: 6166, category: ts.DiagnosticCategory.Message, key: "Output_directory_for_generated_declaration_files_6166", message: "Output directory for generated declaration files." }, + A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl: { code: 6167, category: ts.DiagnosticCategory.Message, key: "A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl_6167", message: "A series of entries which re-map imports to lookup locations relative to the 'baseUrl'." }, + List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime: { code: 6168, category: ts.DiagnosticCategory.Message, key: "List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime_6168", message: "List of root folders whose combined content represents the structure of the project at runtime." }, + Show_all_compiler_options: { code: 6169, category: ts.DiagnosticCategory.Message, key: "Show_all_compiler_options_6169", message: "Show all compiler options." }, + Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file: { code: 6170, category: ts.DiagnosticCategory.Message, key: "Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file_6170", message: "[Deprecated] Use '--outFile' instead. Concatenate and emit output to single file" }, + Command_line_Options: { code: 6171, category: ts.DiagnosticCategory.Message, key: "Command_line_Options_6171", message: "Command-line Options" }, + Basic_Options: { code: 6172, category: ts.DiagnosticCategory.Message, key: "Basic_Options_6172", message: "Basic Options" }, + Strict_Type_Checking_Options: { code: 6173, category: ts.DiagnosticCategory.Message, key: "Strict_Type_Checking_Options_6173", message: "Strict Type-Checking Options" }, + Module_Resolution_Options: { code: 6174, category: ts.DiagnosticCategory.Message, key: "Module_Resolution_Options_6174", message: "Module Resolution Options" }, + Source_Map_Options: { code: 6175, category: ts.DiagnosticCategory.Message, key: "Source_Map_Options_6175", message: "Source Map Options" }, + Additional_Checks: { code: 6176, category: ts.DiagnosticCategory.Message, key: "Additional_Checks_6176", message: "Additional Checks" }, + Experimental_Options: { code: 6177, category: ts.DiagnosticCategory.Message, key: "Experimental_Options_6177", message: "Experimental Options" }, + Advanced_Options: { code: 6178, category: ts.DiagnosticCategory.Message, key: "Advanced_Options_6178", message: "Advanced Options" }, + Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3: { code: 6179, category: ts.DiagnosticCategory.Message, key: "Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3_6179", message: "Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'." }, + Enable_all_strict_type_checking_options: { code: 6180, category: ts.DiagnosticCategory.Message, key: "Enable_all_strict_type_checking_options_6180", message: "Enable all strict type-checking options." }, + List_of_language_service_plugins: { code: 6181, category: ts.DiagnosticCategory.Message, key: "List_of_language_service_plugins_6181", message: "List of language service plugins." }, + Scoped_package_detected_looking_in_0: { code: 6182, category: ts.DiagnosticCategory.Message, key: "Scoped_package_detected_looking_in_0_6182", message: "Scoped package detected, looking in '{0}'" }, Variable_0_implicitly_has_an_1_type: { code: 7005, category: ts.DiagnosticCategory.Error, key: "Variable_0_implicitly_has_an_1_type_7005", message: "Variable '{0}' implicitly has an '{1}' type." }, Parameter_0_implicitly_has_an_1_type: { code: 7006, category: ts.DiagnosticCategory.Error, key: "Parameter_0_implicitly_has_an_1_type_7006", message: "Parameter '{0}' implicitly has an '{1}' type." }, Member_0_implicitly_has_an_1_type: { code: 7008, category: ts.DiagnosticCategory.Error, key: "Member_0_implicitly_has_an_1_type_7008", message: "Member '{0}' implicitly has an '{1}' type." }, @@ -4612,7 +4722,7 @@ var ts; _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: { code: 7023, category: ts.DiagnosticCategory.Error, key: "_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023", message: "'{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." }, Function_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: { code: 7024, category: ts.DiagnosticCategory.Error, key: "Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_ref_7024", message: "Function 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." }, Generator_implicitly_has_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type: { code: 7025, category: ts.DiagnosticCategory.Error, key: "Generator_implicitly_has_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_typ_7025", message: "Generator implicitly has type '{0}' because it does not yield any values. Consider supplying a return type." }, - JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists: { code: 7026, category: ts.DiagnosticCategory.Error, key: "JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026", message: "JSX element implicitly has type 'any' because no interface 'JSX.{0}' exists" }, + JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists: { code: 7026, category: ts.DiagnosticCategory.Error, key: "JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026", message: "JSX element implicitly has type 'any' because no interface 'JSX.{0}' exists." }, Unreachable_code_detected: { code: 7027, category: ts.DiagnosticCategory.Error, key: "Unreachable_code_detected_7027", message: "Unreachable code detected." }, Unused_label: { code: 7028, category: ts.DiagnosticCategory.Error, key: "Unused_label_7028", message: "Unused label." }, Fallthrough_case_in_switch: { code: 7029, category: ts.DiagnosticCategory.Error, key: "Fallthrough_case_in_switch_7029", message: "Fallthrough case in switch." }, @@ -4636,7 +4746,7 @@ var ts; parameter_modifiers_can_only_be_used_in_a_ts_file: { code: 8012, category: ts.DiagnosticCategory.Error, key: "parameter_modifiers_can_only_be_used_in_a_ts_file_8012", message: "'parameter modifiers' can only be used in a .ts file." }, enum_declarations_can_only_be_used_in_a_ts_file: { code: 8015, category: ts.DiagnosticCategory.Error, key: "enum_declarations_can_only_be_used_in_a_ts_file_8015", message: "'enum declarations' can only be used in a .ts file." }, type_assertion_expressions_can_only_be_used_in_a_ts_file: { code: 8016, category: ts.DiagnosticCategory.Error, key: "type_assertion_expressions_can_only_be_used_in_a_ts_file_8016", message: "'type assertion expressions' can only be used in a .ts file." }, - Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clauses: { code: 9002, category: ts.DiagnosticCategory.Error, key: "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002", message: "Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses." }, + Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clause: { code: 9002, category: ts.DiagnosticCategory.Error, key: "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002", message: "Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clause." }, class_expressions_are_not_currently_supported: { code: 9003, category: ts.DiagnosticCategory.Error, key: "class_expressions_are_not_currently_supported_9003", message: "'class' expressions are not currently supported." }, Language_service_is_disabled: { code: 9004, category: ts.DiagnosticCategory.Error, key: "Language_service_is_disabled_9004", message: "Language service is disabled." }, JSX_attributes_must_only_be_assigned_a_non_empty_expression: { code: 17000, category: ts.DiagnosticCategory.Error, key: "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000", message: "JSX attributes must only be assigned a non-empty 'expression'." }, @@ -4644,30 +4754,40 @@ var ts; Expected_corresponding_JSX_closing_tag_for_0: { code: 17002, category: ts.DiagnosticCategory.Error, key: "Expected_corresponding_JSX_closing_tag_for_0_17002", message: "Expected corresponding JSX closing tag for '{0}'." }, JSX_attribute_expected: { code: 17003, category: ts.DiagnosticCategory.Error, key: "JSX_attribute_expected_17003", message: "JSX attribute expected." }, Cannot_use_JSX_unless_the_jsx_flag_is_provided: { code: 17004, category: ts.DiagnosticCategory.Error, key: "Cannot_use_JSX_unless_the_jsx_flag_is_provided_17004", message: "Cannot use JSX unless the '--jsx' flag is provided." }, - A_constructor_cannot_contain_a_super_call_when_its_class_extends_null: { code: 17005, category: ts.DiagnosticCategory.Error, key: "A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005", message: "A constructor cannot contain a 'super' call when its class extends 'null'" }, + A_constructor_cannot_contain_a_super_call_when_its_class_extends_null: { code: 17005, category: ts.DiagnosticCategory.Error, key: "A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005", message: "A constructor cannot contain a 'super' call when its class extends 'null'." }, An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17006, category: ts.DiagnosticCategory.Error, key: "An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006", message: "An unary expression with the '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." }, A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17007, category: ts.DiagnosticCategory.Error, key: "A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007", message: "A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." }, JSX_element_0_has_no_corresponding_closing_tag: { code: 17008, category: ts.DiagnosticCategory.Error, key: "JSX_element_0_has_no_corresponding_closing_tag_17008", message: "JSX element '{0}' has no corresponding closing tag." }, super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class: { code: 17009, category: ts.DiagnosticCategory.Error, key: "super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class_17009", message: "'super' must be called before accessing 'this' in the constructor of a derived class." }, Unknown_type_acquisition_option_0: { code: 17010, category: ts.DiagnosticCategory.Error, key: "Unknown_type_acquisition_option_0_17010", message: "Unknown type acquisition option '{0}'." }, super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class: { code: 17011, category: ts.DiagnosticCategory.Error, key: "super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class_17011", message: "'super' must be called before accessing a property of 'super' in the constructor of a derived class." }, + _0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2: { code: 17012, category: ts.DiagnosticCategory.Error, key: "_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012", message: "'{0}' is not a valid meta-property for keyword '{1}'. Did you mean '{2}'?" }, + Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor: { code: 17013, category: ts.DiagnosticCategory.Error, key: "Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constru_17013", message: "Meta-property '{0}' is only allowed in the body of a function declaration, function expression, or constructor." }, Circularity_detected_while_resolving_configuration_Colon_0: { code: 18000, category: ts.DiagnosticCategory.Error, key: "Circularity_detected_while_resolving_configuration_Colon_0_18000", message: "Circularity detected while resolving configuration: {0}" }, A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not: { code: 18001, category: ts.DiagnosticCategory.Error, key: "A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not_18001", message: "A path in an 'extends' option must be relative or rooted, but '{0}' is not." }, The_files_list_in_config_file_0_is_empty: { code: 18002, category: ts.DiagnosticCategory.Error, key: "The_files_list_in_config_file_0_is_empty_18002", message: "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: { code: 18003, category: ts.DiagnosticCategory.Error, key: "No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2_18003", message: "No inputs were found in config file '{0}'. Specified 'include' paths were '{1}' and 'exclude' paths were '{2}'." }, Add_missing_super_call: { code: 90001, category: ts.DiagnosticCategory.Message, key: "Add_missing_super_call_90001", message: "Add missing 'super()' call." }, Make_super_call_the_first_statement_in_the_constructor: { code: 90002, category: ts.DiagnosticCategory.Message, key: "Make_super_call_the_first_statement_in_the_constructor_90002", message: "Make 'super()' call the first statement in the constructor." }, - Change_extends_to_implements: { code: 90003, category: ts.DiagnosticCategory.Message, key: "Change_extends_to_implements_90003", message: "Change 'extends' to 'implements'" }, - Remove_unused_identifiers: { code: 90004, category: ts.DiagnosticCategory.Message, key: "Remove_unused_identifiers_90004", message: "Remove unused identifiers" }, - Implement_interface_on_reference: { code: 90005, category: ts.DiagnosticCategory.Message, key: "Implement_interface_on_reference_90005", message: "Implement interface on reference" }, - Implement_interface_on_class: { code: 90006, category: ts.DiagnosticCategory.Message, key: "Implement_interface_on_class_90006", message: "Implement interface on class" }, - Implement_inherited_abstract_class: { code: 90007, category: ts.DiagnosticCategory.Message, key: "Implement_inherited_abstract_class_90007", message: "Implement inherited abstract class" }, - Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig: { code: 90009, category: ts.DiagnosticCategory.Error, key: "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009", message: "Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig" }, + Change_extends_to_implements: { code: 90003, category: ts.DiagnosticCategory.Message, key: "Change_extends_to_implements_90003", message: "Change 'extends' to 'implements'." }, + Remove_declaration_for_Colon_0: { code: 90004, category: ts.DiagnosticCategory.Message, key: "Remove_declaration_for_Colon_0_90004", message: "Remove declaration for: '{0}'." }, + Implement_interface_0: { code: 90006, category: ts.DiagnosticCategory.Message, key: "Implement_interface_0_90006", message: "Implement interface '{0}'." }, + Implement_inherited_abstract_class: { code: 90007, category: ts.DiagnosticCategory.Message, key: "Implement_inherited_abstract_class_90007", message: "Implement inherited abstract class." }, + Add_this_to_unresolved_variable: { code: 90008, category: ts.DiagnosticCategory.Message, key: "Add_this_to_unresolved_variable_90008", message: "Add 'this.' to unresolved variable." }, + Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig: { code: 90009, category: ts.DiagnosticCategory.Error, key: "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009", message: "Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig." }, Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated: { code: 90010, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_90010", message: "Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated." }, - Import_0_from_1: { code: 90013, category: ts.DiagnosticCategory.Message, key: "Import_0_from_1_90013", message: "Import {0} from {1}" }, - Change_0_to_1: { code: 90014, category: ts.DiagnosticCategory.Message, key: "Change_0_to_1_90014", message: "Change {0} to {1}" }, - Add_0_to_existing_import_declaration_from_1: { code: 90015, category: ts.DiagnosticCategory.Message, key: "Add_0_to_existing_import_declaration_from_1_90015", message: "Add {0} to existing import declaration from {1}" }, + Import_0_from_1: { code: 90013, category: ts.DiagnosticCategory.Message, key: "Import_0_from_1_90013", message: "Import {0} from {1}." }, + Change_0_to_1: { code: 90014, category: ts.DiagnosticCategory.Message, key: "Change_0_to_1_90014", message: "Change {0} to {1}." }, + Add_0_to_existing_import_declaration_from_1: { code: 90015, category: ts.DiagnosticCategory.Message, key: "Add_0_to_existing_import_declaration_from_1_90015", message: "Add {0} to existing import declaration from {1}." }, + Add_declaration_for_missing_property_0: { code: 90016, category: ts.DiagnosticCategory.Message, key: "Add_declaration_for_missing_property_0_90016", message: "Add declaration for missing property '{0}'." }, + Add_index_signature_for_missing_property_0: { code: 90017, category: ts.DiagnosticCategory.Message, key: "Add_index_signature_for_missing_property_0_90017", message: "Add index signature for missing property '{0}'." }, + Disable_checking_for_this_file: { code: 90018, category: ts.DiagnosticCategory.Message, key: "Disable_checking_for_this_file_90018", message: "Disable checking for this file." }, + Ignore_this_error_message: { code: 90019, category: ts.DiagnosticCategory.Message, key: "Ignore_this_error_message_90019", message: "Ignore this error message." }, + Initialize_property_0_in_the_constructor: { code: 90020, category: ts.DiagnosticCategory.Message, key: "Initialize_property_0_in_the_constructor_90020", message: "Initialize property '{0}' in the constructor." }, + Initialize_static_property_0: { code: 90021, category: ts.DiagnosticCategory.Message, key: "Initialize_static_property_0_90021", message: "Initialize static property '{0}'." }, Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0: { code: 8017, category: ts.DiagnosticCategory.Error, key: "Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0_8017", message: "Octal literal types must use ES2015 syntax. Use the syntax '{0}'." }, + Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0: { code: 8018, category: ts.DiagnosticCategory.Error, key: "Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0_8018", message: "Octal literals are not allowed in enums members initializer. Use the syntax '{0}'." }, + Report_errors_in_js_files: { code: 8019, category: ts.DiagnosticCategory.Message, key: "Report_errors_in_js_files_8019", message: "Report errors in .js files." }, }; })(ts || (ts = {})); /// @@ -4676,134 +4796,135 @@ var ts; (function (ts) { /* @internal */ function tokenIsIdentifierOrKeyword(token) { - return token >= 70 /* Identifier */; + return token >= 71 /* Identifier */; } ts.tokenIsIdentifierOrKeyword = tokenIsIdentifierOrKeyword; - var textToToken = ts.createMap({ - "abstract": 116 /* AbstractKeyword */, - "any": 118 /* AnyKeyword */, - "as": 117 /* AsKeyword */, - "boolean": 121 /* BooleanKeyword */, - "break": 71 /* BreakKeyword */, - "case": 72 /* CaseKeyword */, - "catch": 73 /* CatchKeyword */, - "class": 74 /* ClassKeyword */, - "continue": 76 /* ContinueKeyword */, - "const": 75 /* ConstKeyword */, - "constructor": 122 /* ConstructorKeyword */, - "debugger": 77 /* DebuggerKeyword */, - "declare": 123 /* DeclareKeyword */, - "default": 78 /* DefaultKeyword */, - "delete": 79 /* DeleteKeyword */, - "do": 80 /* DoKeyword */, - "else": 81 /* ElseKeyword */, - "enum": 82 /* EnumKeyword */, - "export": 83 /* ExportKeyword */, - "extends": 84 /* ExtendsKeyword */, - "false": 85 /* FalseKeyword */, - "finally": 86 /* FinallyKeyword */, - "for": 87 /* ForKeyword */, - "from": 138 /* FromKeyword */, - "function": 88 /* FunctionKeyword */, - "get": 124 /* GetKeyword */, - "if": 89 /* IfKeyword */, - "implements": 107 /* ImplementsKeyword */, - "import": 90 /* ImportKeyword */, - "in": 91 /* InKeyword */, - "instanceof": 92 /* InstanceOfKeyword */, - "interface": 108 /* InterfaceKeyword */, - "is": 125 /* IsKeyword */, - "keyof": 126 /* KeyOfKeyword */, - "let": 109 /* LetKeyword */, - "module": 127 /* ModuleKeyword */, - "namespace": 128 /* NamespaceKeyword */, - "never": 129 /* NeverKeyword */, - "new": 93 /* NewKeyword */, - "null": 94 /* NullKeyword */, - "number": 132 /* NumberKeyword */, - "package": 110 /* PackageKeyword */, - "private": 111 /* PrivateKeyword */, - "protected": 112 /* ProtectedKeyword */, - "public": 113 /* PublicKeyword */, - "readonly": 130 /* ReadonlyKeyword */, - "require": 131 /* RequireKeyword */, - "global": 139 /* GlobalKeyword */, - "return": 95 /* ReturnKeyword */, - "set": 133 /* SetKeyword */, - "static": 114 /* StaticKeyword */, - "string": 134 /* StringKeyword */, - "super": 96 /* SuperKeyword */, - "switch": 97 /* SwitchKeyword */, - "symbol": 135 /* SymbolKeyword */, - "this": 98 /* ThisKeyword */, - "throw": 99 /* ThrowKeyword */, - "true": 100 /* TrueKeyword */, - "try": 101 /* TryKeyword */, - "type": 136 /* TypeKeyword */, - "typeof": 102 /* TypeOfKeyword */, - "undefined": 137 /* UndefinedKeyword */, - "var": 103 /* VarKeyword */, - "void": 104 /* VoidKeyword */, - "while": 105 /* WhileKeyword */, - "with": 106 /* WithKeyword */, - "yield": 115 /* YieldKeyword */, - "async": 119 /* AsyncKeyword */, - "await": 120 /* AwaitKeyword */, - "of": 140 /* OfKeyword */, - "{": 16 /* OpenBraceToken */, - "}": 17 /* CloseBraceToken */, - "(": 18 /* OpenParenToken */, - ")": 19 /* CloseParenToken */, - "[": 20 /* OpenBracketToken */, - "]": 21 /* CloseBracketToken */, - ".": 22 /* DotToken */, - "...": 23 /* DotDotDotToken */, - ";": 24 /* SemicolonToken */, - ",": 25 /* CommaToken */, - "<": 26 /* LessThanToken */, - ">": 28 /* GreaterThanToken */, - "<=": 29 /* LessThanEqualsToken */, - ">=": 30 /* GreaterThanEqualsToken */, - "==": 31 /* EqualsEqualsToken */, - "!=": 32 /* ExclamationEqualsToken */, - "===": 33 /* EqualsEqualsEqualsToken */, - "!==": 34 /* ExclamationEqualsEqualsToken */, - "=>": 35 /* EqualsGreaterThanToken */, - "+": 36 /* PlusToken */, - "-": 37 /* MinusToken */, - "**": 39 /* AsteriskAsteriskToken */, - "*": 38 /* AsteriskToken */, - "/": 40 /* SlashToken */, - "%": 41 /* PercentToken */, - "++": 42 /* PlusPlusToken */, - "--": 43 /* MinusMinusToken */, - "<<": 44 /* LessThanLessThanToken */, - ">": 45 /* GreaterThanGreaterThanToken */, - ">>>": 46 /* GreaterThanGreaterThanGreaterThanToken */, - "&": 47 /* AmpersandToken */, - "|": 48 /* BarToken */, - "^": 49 /* CaretToken */, - "!": 50 /* ExclamationToken */, - "~": 51 /* TildeToken */, - "&&": 52 /* AmpersandAmpersandToken */, - "||": 53 /* BarBarToken */, - "?": 54 /* QuestionToken */, - ":": 55 /* ColonToken */, - "=": 57 /* EqualsToken */, - "+=": 58 /* PlusEqualsToken */, - "-=": 59 /* MinusEqualsToken */, - "*=": 60 /* AsteriskEqualsToken */, - "**=": 61 /* AsteriskAsteriskEqualsToken */, - "/=": 62 /* SlashEqualsToken */, - "%=": 63 /* PercentEqualsToken */, - "<<=": 64 /* LessThanLessThanEqualsToken */, - ">>=": 65 /* GreaterThanGreaterThanEqualsToken */, - ">>>=": 66 /* GreaterThanGreaterThanGreaterThanEqualsToken */, - "&=": 67 /* AmpersandEqualsToken */, - "|=": 68 /* BarEqualsToken */, - "^=": 69 /* CaretEqualsToken */, - "@": 56 /* AtToken */, + var textToToken = ts.createMapFromTemplate({ + "abstract": 117 /* AbstractKeyword */, + "any": 119 /* AnyKeyword */, + "as": 118 /* AsKeyword */, + "boolean": 122 /* BooleanKeyword */, + "break": 72 /* BreakKeyword */, + "case": 73 /* CaseKeyword */, + "catch": 74 /* CatchKeyword */, + "class": 75 /* ClassKeyword */, + "continue": 77 /* ContinueKeyword */, + "const": 76 /* ConstKeyword */, + "constructor": 123 /* ConstructorKeyword */, + "debugger": 78 /* DebuggerKeyword */, + "declare": 124 /* DeclareKeyword */, + "default": 79 /* DefaultKeyword */, + "delete": 80 /* DeleteKeyword */, + "do": 81 /* DoKeyword */, + "else": 82 /* ElseKeyword */, + "enum": 83 /* EnumKeyword */, + "export": 84 /* ExportKeyword */, + "extends": 85 /* ExtendsKeyword */, + "false": 86 /* FalseKeyword */, + "finally": 87 /* FinallyKeyword */, + "for": 88 /* ForKeyword */, + "from": 140 /* FromKeyword */, + "function": 89 /* FunctionKeyword */, + "get": 125 /* GetKeyword */, + "if": 90 /* IfKeyword */, + "implements": 108 /* ImplementsKeyword */, + "import": 91 /* ImportKeyword */, + "in": 92 /* InKeyword */, + "instanceof": 93 /* InstanceOfKeyword */, + "interface": 109 /* InterfaceKeyword */, + "is": 126 /* IsKeyword */, + "keyof": 127 /* KeyOfKeyword */, + "let": 110 /* LetKeyword */, + "module": 128 /* ModuleKeyword */, + "namespace": 129 /* NamespaceKeyword */, + "never": 130 /* NeverKeyword */, + "new": 94 /* NewKeyword */, + "null": 95 /* NullKeyword */, + "number": 133 /* NumberKeyword */, + "object": 134 /* ObjectKeyword */, + "package": 111 /* PackageKeyword */, + "private": 112 /* PrivateKeyword */, + "protected": 113 /* ProtectedKeyword */, + "public": 114 /* PublicKeyword */, + "readonly": 131 /* ReadonlyKeyword */, + "require": 132 /* RequireKeyword */, + "global": 141 /* GlobalKeyword */, + "return": 96 /* ReturnKeyword */, + "set": 135 /* SetKeyword */, + "static": 115 /* StaticKeyword */, + "string": 136 /* StringKeyword */, + "super": 97 /* SuperKeyword */, + "switch": 98 /* SwitchKeyword */, + "symbol": 137 /* SymbolKeyword */, + "this": 99 /* ThisKeyword */, + "throw": 100 /* ThrowKeyword */, + "true": 101 /* TrueKeyword */, + "try": 102 /* TryKeyword */, + "type": 138 /* TypeKeyword */, + "typeof": 103 /* TypeOfKeyword */, + "undefined": 139 /* UndefinedKeyword */, + "var": 104 /* VarKeyword */, + "void": 105 /* VoidKeyword */, + "while": 106 /* WhileKeyword */, + "with": 107 /* WithKeyword */, + "yield": 116 /* YieldKeyword */, + "async": 120 /* AsyncKeyword */, + "await": 121 /* AwaitKeyword */, + "of": 142 /* OfKeyword */, + "{": 17 /* OpenBraceToken */, + "}": 18 /* CloseBraceToken */, + "(": 19 /* OpenParenToken */, + ")": 20 /* CloseParenToken */, + "[": 21 /* OpenBracketToken */, + "]": 22 /* CloseBracketToken */, + ".": 23 /* DotToken */, + "...": 24 /* DotDotDotToken */, + ";": 25 /* SemicolonToken */, + ",": 26 /* CommaToken */, + "<": 27 /* LessThanToken */, + ">": 29 /* GreaterThanToken */, + "<=": 30 /* LessThanEqualsToken */, + ">=": 31 /* GreaterThanEqualsToken */, + "==": 32 /* EqualsEqualsToken */, + "!=": 33 /* ExclamationEqualsToken */, + "===": 34 /* EqualsEqualsEqualsToken */, + "!==": 35 /* ExclamationEqualsEqualsToken */, + "=>": 36 /* EqualsGreaterThanToken */, + "+": 37 /* PlusToken */, + "-": 38 /* MinusToken */, + "**": 40 /* AsteriskAsteriskToken */, + "*": 39 /* AsteriskToken */, + "/": 41 /* SlashToken */, + "%": 42 /* PercentToken */, + "++": 43 /* PlusPlusToken */, + "--": 44 /* MinusMinusToken */, + "<<": 45 /* LessThanLessThanToken */, + ">": 46 /* GreaterThanGreaterThanToken */, + ">>>": 47 /* GreaterThanGreaterThanGreaterThanToken */, + "&": 48 /* AmpersandToken */, + "|": 49 /* BarToken */, + "^": 50 /* CaretToken */, + "!": 51 /* ExclamationToken */, + "~": 52 /* TildeToken */, + "&&": 53 /* AmpersandAmpersandToken */, + "||": 54 /* BarBarToken */, + "?": 55 /* QuestionToken */, + ":": 56 /* ColonToken */, + "=": 58 /* EqualsToken */, + "+=": 59 /* PlusEqualsToken */, + "-=": 60 /* MinusEqualsToken */, + "*=": 61 /* AsteriskEqualsToken */, + "**=": 62 /* AsteriskAsteriskEqualsToken */, + "/=": 63 /* SlashEqualsToken */, + "%=": 64 /* PercentEqualsToken */, + "<<=": 65 /* LessThanLessThanEqualsToken */, + ">>=": 66 /* GreaterThanGreaterThanEqualsToken */, + ">>>=": 67 /* GreaterThanGreaterThanGreaterThanEqualsToken */, + "&=": 68 /* AmpersandEqualsToken */, + "|=": 69 /* BarEqualsToken */, + "^=": 70 /* CaretEqualsToken */, + "@": 57 /* AtToken */, }); /* As per ECMAScript Language Specification 3th Edition, Section 7.6: Identifiers @@ -4889,9 +5010,9 @@ var ts; } function makeReverseMap(source) { var result = []; - for (var name_4 in source) { - result[source[name_4]] = name_4; - } + source.forEach(function (value, name) { + result[value] = name; + }); return result; } var tokenStrings = makeReverseMap(textToToken); @@ -4901,7 +5022,7 @@ var ts; ts.tokenToString = tokenToString; /* @internal */ function stringToToken(s) { - return textToToken[s]; + return textToToken.get(s); } ts.stringToToken = stringToToken; /* @internal */ @@ -4917,6 +5038,7 @@ var ts; if (text.charCodeAt(pos) === 10 /* lineFeed */) { pos++; } + // falls through case 10 /* lineFeed */: result.push(lineStart); lineStart = pos; @@ -4975,11 +5097,10 @@ var ts; return computeLineAndCharacterOfPosition(getLineStarts(sourceFile), position); } ts.getLineAndCharacterOfPosition = getLineAndCharacterOfPosition; - var hasOwnProperty = Object.prototype.hasOwnProperty; - function isWhiteSpace(ch) { + function isWhiteSpaceLike(ch) { return isWhiteSpaceSingleLine(ch) || isLineBreak(ch); } - ts.isWhiteSpace = isWhiteSpace; + ts.isWhiteSpaceLike = isWhiteSpaceLike; /** Does not include line breaks. For that, see isWhiteSpaceLike. */ function isWhiteSpaceSingleLine(ch) { // Note: nextLine is in the Zs space, and should be considered to be a whitespace. @@ -5062,6 +5183,7 @@ var ts; if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) { pos++; } + // falls through case 10 /* lineFeed */: pos++; if (stopAfterLineBreak) { @@ -5115,7 +5237,7 @@ var ts; } break; default: - if (ch > 127 /* maxAsciiCharacter */ && (isWhiteSpace(ch))) { + if (ch > 127 /* maxAsciiCharacter */ && (isWhiteSpaceLike(ch))) { pos++; continue; } @@ -5134,7 +5256,7 @@ var ts; if (pos === 0 || isLineBreak(text.charCodeAt(pos - 1))) { var ch = text.charCodeAt(pos); if ((pos + mergeConflictMarkerLength) < text.length) { - for (var i = 0, n = mergeConflictMarkerLength; i < n; i++) { + for (var i = 0; i < mergeConflictMarkerLength; i++) { if (text.charCodeAt(pos + i) !== ch) { return false; } @@ -5216,6 +5338,7 @@ var ts; if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) { pos++; } + // falls through case 10 /* lineFeed */: pos++; if (trailing) { @@ -5276,7 +5399,7 @@ var ts; } break scan; default: - if (ch > 127 /* maxAsciiCharacter */ && (isWhiteSpace(ch))) { + if (ch > 127 /* maxAsciiCharacter */ && (isWhiteSpaceLike(ch))) { if (hasPendingCommentRange && isLineBreak(ch)) { pendingHasTrailingNewLine = true; } @@ -5311,15 +5434,15 @@ var ts; if (!comments) { comments = []; } - comments.push({ pos: pos, end: end, hasTrailingNewLine: hasTrailingNewLine, kind: kind }); + comments.push({ kind: kind, pos: pos, end: end, hasTrailingNewLine: hasTrailingNewLine }); return comments; } function getLeadingCommentRanges(text, pos) { - return reduceEachLeadingCommentRange(text, pos, appendCommentRange, undefined, undefined); + return reduceEachLeadingCommentRange(text, pos, appendCommentRange, /*state*/ undefined, /*initial*/ undefined); } ts.getLeadingCommentRanges = getLeadingCommentRanges; function getTrailingCommentRanges(text, pos) { - return reduceEachTrailingCommentRange(text, pos, appendCommentRange, undefined, undefined); + return reduceEachTrailingCommentRange(text, pos, appendCommentRange, /*state*/ undefined, /*initial*/ undefined); } ts.getTrailingCommentRanges = getTrailingCommentRanges; /** Optionally, get the shebang */ @@ -5346,7 +5469,7 @@ var ts; if (!isIdentifierStart(name.charCodeAt(0), languageVersion)) { return false; } - for (var i = 1, n = name.length; i < n; i++) { + for (var i = 1; i < name.length; i++) { if (!isIdentifierPart(name.charCodeAt(i), languageVersion)) { return false; } @@ -5370,6 +5493,7 @@ var ts; var precedingLineBreak; var hasExtendedUnicodeEscape; var tokenIsUnterminated; + var numericLiteralFlags; setText(text, start, length); return { getStartPos: function () { return startPos; }, @@ -5380,9 +5504,10 @@ var ts; getTokenValue: function () { return tokenValue; }, hasExtendedUnicodeEscape: function () { return hasExtendedUnicodeEscape; }, hasPrecedingLineBreak: function () { return precedingLineBreak; }, - isIdentifier: function () { return token === 70 /* Identifier */ || token > 106 /* LastReservedWord */; }, - isReservedWord: function () { return token >= 71 /* FirstReservedWord */ && token <= 106 /* LastReservedWord */; }, + isIdentifier: function () { return token === 71 /* Identifier */ || token > 107 /* LastReservedWord */; }, + isReservedWord: function () { return token >= 72 /* FirstReservedWord */ && token <= 107 /* LastReservedWord */; }, isUnterminated: function () { return tokenIsUnterminated; }, + getNumericLiteralFlags: function () { return numericLiteralFlags; }, reScanGreaterToken: reScanGreaterToken, reScanSlashToken: reScanSlashToken, reScanTemplateToken: reScanTemplateToken, @@ -5419,6 +5544,7 @@ var ts; var end = pos; if (text.charCodeAt(pos) === 69 /* E */ || text.charCodeAt(pos) === 101 /* e */) { pos++; + numericLiteralFlags = 2 /* Scientific */; if (text.charCodeAt(pos) === 43 /* plus */ || text.charCodeAt(pos) === 45 /* minus */) pos++; if (isDigit(text.charCodeAt(pos))) { @@ -5529,7 +5655,7 @@ var ts; contents += text.substring(start, pos); tokenIsUnterminated = true; error(ts.Diagnostics.Unterminated_template_literal); - resultingToken = startedWithBacktick ? 12 /* NoSubstitutionTemplateLiteral */ : 15 /* TemplateTail */; + resultingToken = startedWithBacktick ? 13 /* NoSubstitutionTemplateLiteral */ : 16 /* TemplateTail */; break; } var currChar = text.charCodeAt(pos); @@ -5537,14 +5663,14 @@ var ts; if (currChar === 96 /* backtick */) { contents += text.substring(start, pos); pos++; - resultingToken = startedWithBacktick ? 12 /* NoSubstitutionTemplateLiteral */ : 15 /* TemplateTail */; + resultingToken = startedWithBacktick ? 13 /* NoSubstitutionTemplateLiteral */ : 16 /* TemplateTail */; break; } // '${' if (currChar === 36 /* $ */ && pos + 1 < end && text.charCodeAt(pos + 1) === 123 /* openBrace */) { contents += text.substring(start, pos); pos += 2; - resultingToken = startedWithBacktick ? 13 /* TemplateHead */ : 14 /* TemplateMiddle */; + resultingToken = startedWithBacktick ? 14 /* TemplateHead */ : 15 /* TemplateMiddle */; break; } // Escape character @@ -5617,7 +5743,7 @@ var ts; if (pos < end && text.charCodeAt(pos) === 10 /* lineFeed */) { pos++; } - // fall through + // falls through case 10 /* lineFeed */: case 8232 /* lineSeparator */: case 8233 /* paragraphSeparator */: @@ -5718,11 +5844,14 @@ var ts; var len = tokenValue.length; if (len >= 2 && len <= 11) { var ch = tokenValue.charCodeAt(0); - if (ch >= 97 /* a */ && ch <= 122 /* z */ && hasOwnProperty.call(textToToken, tokenValue)) { - return token = textToToken[tokenValue]; + if (ch >= 97 /* a */ && ch <= 122 /* z */) { + token = textToToken.get(tokenValue); + if (token !== undefined) { + return token; + } } } - return token = 70 /* Identifier */; + return token = 71 /* Identifier */; } function scanBinaryOrOctalDigits(base) { ts.Debug.assert(base === 2 || base === 8, "Expected either base 2 or base 8"); @@ -5751,6 +5880,7 @@ var ts; hasExtendedUnicodeEscape = false; precedingLineBreak = false; tokenIsUnterminated = false; + numericLiteralFlags = 0; while (true) { tokenPos = pos; if (pos >= end) { @@ -5802,12 +5932,12 @@ var ts; case 33 /* exclamation */: if (text.charCodeAt(pos + 1) === 61 /* equals */) { if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 34 /* ExclamationEqualsEqualsToken */; + return pos += 3, token = 35 /* ExclamationEqualsEqualsToken */; } - return pos += 2, token = 32 /* ExclamationEqualsToken */; + return pos += 2, token = 33 /* ExclamationEqualsToken */; } pos++; - return token = 50 /* ExclamationToken */; + return token = 51 /* ExclamationToken */; case 34 /* doubleQuote */: case 39 /* singleQuote */: tokenValue = scanString(); @@ -5816,68 +5946,68 @@ var ts; return token = scanTemplateAndSetTokenValue(); case 37 /* percent */: if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 63 /* PercentEqualsToken */; + return pos += 2, token = 64 /* PercentEqualsToken */; } pos++; - return token = 41 /* PercentToken */; + return token = 42 /* PercentToken */; case 38 /* ampersand */: if (text.charCodeAt(pos + 1) === 38 /* ampersand */) { - return pos += 2, token = 52 /* AmpersandAmpersandToken */; + return pos += 2, token = 53 /* AmpersandAmpersandToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 67 /* AmpersandEqualsToken */; + return pos += 2, token = 68 /* AmpersandEqualsToken */; } pos++; - return token = 47 /* AmpersandToken */; + return token = 48 /* AmpersandToken */; case 40 /* openParen */: pos++; - return token = 18 /* OpenParenToken */; + return token = 19 /* OpenParenToken */; case 41 /* closeParen */: pos++; - return token = 19 /* CloseParenToken */; + return token = 20 /* CloseParenToken */; case 42 /* asterisk */: if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 60 /* AsteriskEqualsToken */; + return pos += 2, token = 61 /* AsteriskEqualsToken */; } if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 61 /* AsteriskAsteriskEqualsToken */; + return pos += 3, token = 62 /* AsteriskAsteriskEqualsToken */; } - return pos += 2, token = 39 /* AsteriskAsteriskToken */; + return pos += 2, token = 40 /* AsteriskAsteriskToken */; } pos++; - return token = 38 /* AsteriskToken */; + return token = 39 /* AsteriskToken */; case 43 /* plus */: if (text.charCodeAt(pos + 1) === 43 /* plus */) { - return pos += 2, token = 42 /* PlusPlusToken */; + return pos += 2, token = 43 /* PlusPlusToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 58 /* PlusEqualsToken */; + return pos += 2, token = 59 /* PlusEqualsToken */; } pos++; - return token = 36 /* PlusToken */; + return token = 37 /* PlusToken */; case 44 /* comma */: pos++; - return token = 25 /* CommaToken */; + return token = 26 /* CommaToken */; case 45 /* minus */: if (text.charCodeAt(pos + 1) === 45 /* minus */) { - return pos += 2, token = 43 /* MinusMinusToken */; + return pos += 2, token = 44 /* MinusMinusToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 59 /* MinusEqualsToken */; + return pos += 2, token = 60 /* MinusEqualsToken */; } pos++; - return token = 37 /* MinusToken */; + return token = 38 /* MinusToken */; case 46 /* dot */: if (isDigit(text.charCodeAt(pos + 1))) { tokenValue = scanNumber(); return token = 8 /* NumericLiteral */; } if (text.charCodeAt(pos + 1) === 46 /* dot */ && text.charCodeAt(pos + 2) === 46 /* dot */) { - return pos += 3, token = 23 /* DotDotDotToken */; + return pos += 3, token = 24 /* DotDotDotToken */; } pos++; - return token = 22 /* DotToken */; + return token = 23 /* DotToken */; case 47 /* slash */: // Single-line comment if (text.charCodeAt(pos + 1) === 47 /* slash */) { @@ -5923,10 +6053,10 @@ var ts; } } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 62 /* SlashEqualsToken */; + return pos += 2, token = 63 /* SlashEqualsToken */; } pos++; - return token = 40 /* SlashToken */; + return token = 41 /* SlashToken */; case 48 /* _0 */: if (pos + 2 < end && (text.charCodeAt(pos + 1) === 88 /* X */ || text.charCodeAt(pos + 1) === 120 /* x */)) { pos += 2; @@ -5936,6 +6066,7 @@ var ts; value = 0; } tokenValue = "" + value; + numericLiteralFlags = 8 /* HexSpecifier */; return token = 8 /* NumericLiteral */; } else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 66 /* B */ || text.charCodeAt(pos + 1) === 98 /* b */)) { @@ -5946,6 +6077,7 @@ var ts; value = 0; } tokenValue = "" + value; + numericLiteralFlags = 16 /* BinarySpecifier */; return token = 8 /* NumericLiteral */; } else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 79 /* O */ || text.charCodeAt(pos + 1) === 111 /* o */)) { @@ -5956,16 +6088,19 @@ var ts; value = 0; } tokenValue = "" + value; + numericLiteralFlags = 32 /* OctalSpecifier */; return token = 8 /* NumericLiteral */; } // Try to parse as an octal if (pos + 1 < end && isOctalDigit(text.charCodeAt(pos + 1))) { tokenValue = "" + scanOctalDigits(); + numericLiteralFlags = 4 /* Octal */; return token = 8 /* NumericLiteral */; } // This fall-through is a deviation from the EcmaScript grammar. The grammar says that a leading zero // can only be followed by an octal digit, a dot, or the end of the number literal. However, we are being // permissive and allowing decimal digits of the form 08* and 09* (which many browsers also do). + // falls through case 49 /* _1 */: case 50 /* _2 */: case 51 /* _3 */: @@ -5979,10 +6114,10 @@ var ts; return token = 8 /* NumericLiteral */; case 58 /* colon */: pos++; - return token = 55 /* ColonToken */; + return token = 56 /* ColonToken */; case 59 /* semicolon */: pos++; - return token = 24 /* SemicolonToken */; + return token = 25 /* SemicolonToken */; case 60 /* lessThan */: if (isConflictMarkerTrivia(text, pos)) { pos = scanConflictMarkerTrivia(text, pos, error); @@ -5995,20 +6130,20 @@ var ts; } if (text.charCodeAt(pos + 1) === 60 /* lessThan */) { if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 64 /* LessThanLessThanEqualsToken */; + return pos += 3, token = 65 /* LessThanLessThanEqualsToken */; } - return pos += 2, token = 44 /* LessThanLessThanToken */; + return pos += 2, token = 45 /* LessThanLessThanToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 29 /* LessThanEqualsToken */; + return pos += 2, token = 30 /* LessThanEqualsToken */; } if (languageVariant === 1 /* JSX */ && text.charCodeAt(pos + 1) === 47 /* slash */ && text.charCodeAt(pos + 2) !== 42 /* asterisk */) { - return pos += 2, token = 27 /* LessThanSlashToken */; + return pos += 2, token = 28 /* LessThanSlashToken */; } pos++; - return token = 26 /* LessThanToken */; + return token = 27 /* LessThanToken */; case 61 /* equals */: if (isConflictMarkerTrivia(text, pos)) { pos = scanConflictMarkerTrivia(text, pos, error); @@ -6021,15 +6156,15 @@ var ts; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 33 /* EqualsEqualsEqualsToken */; + return pos += 3, token = 34 /* EqualsEqualsEqualsToken */; } - return pos += 2, token = 31 /* EqualsEqualsToken */; + return pos += 2, token = 32 /* EqualsEqualsToken */; } if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { - return pos += 2, token = 35 /* EqualsGreaterThanToken */; + return pos += 2, token = 36 /* EqualsGreaterThanToken */; } pos++; - return token = 57 /* EqualsToken */; + return token = 58 /* EqualsToken */; case 62 /* greaterThan */: if (isConflictMarkerTrivia(text, pos)) { pos = scanConflictMarkerTrivia(text, pos, error); @@ -6041,43 +6176,43 @@ var ts; } } pos++; - return token = 28 /* GreaterThanToken */; + return token = 29 /* GreaterThanToken */; case 63 /* question */: pos++; - return token = 54 /* QuestionToken */; + return token = 55 /* QuestionToken */; case 91 /* openBracket */: pos++; - return token = 20 /* OpenBracketToken */; + return token = 21 /* OpenBracketToken */; case 93 /* closeBracket */: pos++; - return token = 21 /* CloseBracketToken */; + return token = 22 /* CloseBracketToken */; case 94 /* caret */: if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 69 /* CaretEqualsToken */; + return pos += 2, token = 70 /* CaretEqualsToken */; } pos++; - return token = 49 /* CaretToken */; + return token = 50 /* CaretToken */; case 123 /* openBrace */: pos++; - return token = 16 /* OpenBraceToken */; + return token = 17 /* OpenBraceToken */; case 124 /* bar */: if (text.charCodeAt(pos + 1) === 124 /* bar */) { - return pos += 2, token = 53 /* BarBarToken */; + return pos += 2, token = 54 /* BarBarToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 68 /* BarEqualsToken */; + return pos += 2, token = 69 /* BarEqualsToken */; } pos++; - return token = 48 /* BarToken */; + return token = 49 /* BarToken */; case 125 /* closeBrace */: pos++; - return token = 17 /* CloseBraceToken */; + return token = 18 /* CloseBraceToken */; case 126 /* tilde */: pos++; - return token = 51 /* TildeToken */; + return token = 52 /* TildeToken */; case 64 /* at */: pos++; - return token = 56 /* AtToken */; + return token = 57 /* AtToken */; case 92 /* backslash */: var cookedChar = peekUnicodeEscape(); if (cookedChar >= 0 && isIdentifierStart(cookedChar, languageVersion)) { @@ -6115,29 +6250,29 @@ var ts; } } function reScanGreaterToken() { - if (token === 28 /* GreaterThanToken */) { + if (token === 29 /* GreaterThanToken */) { if (text.charCodeAt(pos) === 62 /* greaterThan */) { if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 66 /* GreaterThanGreaterThanGreaterThanEqualsToken */; + return pos += 3, token = 67 /* GreaterThanGreaterThanGreaterThanEqualsToken */; } - return pos += 2, token = 46 /* GreaterThanGreaterThanGreaterThanToken */; + return pos += 2, token = 47 /* GreaterThanGreaterThanGreaterThanToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 65 /* GreaterThanGreaterThanEqualsToken */; + return pos += 2, token = 66 /* GreaterThanGreaterThanEqualsToken */; } pos++; - return token = 45 /* GreaterThanGreaterThanToken */; + return token = 46 /* GreaterThanGreaterThanToken */; } if (text.charCodeAt(pos) === 61 /* equals */) { pos++; - return token = 30 /* GreaterThanEqualsToken */; + return token = 31 /* GreaterThanEqualsToken */; } } return token; } function reScanSlashToken() { - if (token === 40 /* SlashToken */ || token === 62 /* SlashEqualsToken */) { + if (token === 41 /* SlashToken */ || token === 63 /* SlashEqualsToken */) { var p = tokenPos + 1; var inEscape = false; var inCharacterClass = false; @@ -6182,7 +6317,7 @@ var ts; } pos = p; tokenValue = text.substring(tokenPos, pos); - token = 11 /* RegularExpressionLiteral */; + token = 12 /* RegularExpressionLiteral */; } return token; } @@ -6190,7 +6325,7 @@ var ts; * Unconditionally back up and scan a template expression portion. */ function reScanTemplateToken() { - ts.Debug.assert(token === 17 /* CloseBraceToken */, "'reScanTemplateToken' should only be called on a '}'"); + ts.Debug.assert(token === 18 /* CloseBraceToken */, "'reScanTemplateToken' should only be called on a '}'"); pos = tokenPos; return token = scanTemplateAndSetTokenValue(); } @@ -6207,23 +6342,46 @@ var ts; if (char === 60 /* lessThan */) { if (text.charCodeAt(pos + 1) === 47 /* slash */) { pos += 2; - return token = 27 /* LessThanSlashToken */; + return token = 28 /* LessThanSlashToken */; } pos++; - return token = 26 /* LessThanToken */; + return token = 27 /* LessThanToken */; } if (char === 123 /* openBrace */) { pos++; - return token = 16 /* OpenBraceToken */; + return token = 17 /* OpenBraceToken */; } + // First non-whitespace character on this line. + var firstNonWhitespace = 0; + // These initial values are special because the first line is: + // firstNonWhitespace = 0 to indicate that we want leading whitspace, while (pos < end) { - pos++; char = text.charCodeAt(pos); - if ((char === 123 /* openBrace */) || (char === 60 /* lessThan */)) { + if (char === 123 /* openBrace */) { break; } + if (char === 60 /* lessThan */) { + if (isConflictMarkerTrivia(text, pos)) { + pos = scanConflictMarkerTrivia(text, pos, error); + return token = 7 /* ConflictMarkerTrivia */; + } + break; + } + // FirstNonWhitespace is 0, then we only see whitespaces so far. If we see a linebreak, we want to ignore that whitespaces. + // i.e (- : whitespace) + //
---- + //
becomes
+ // + //
----
becomes
----
+ if (isLineBreak(char) && firstNonWhitespace === 0) { + firstNonWhitespace = -1; + } + else if (!isWhiteSpaceLike(char)) { + firstNonWhitespace = pos; + } + pos++; } - return token = 10 /* JsxText */; + return firstNonWhitespace === -1 ? 11 /* JsxTextAllWhiteSpaces */ : 10 /* JsxText */; } // Scans a JSX identifier; these differ from normal identifiers in that // they allow dashes @@ -6273,42 +6431,42 @@ var ts; return token = 5 /* WhitespaceTrivia */; case 64 /* at */: pos++; - return token = 56 /* AtToken */; + return token = 57 /* AtToken */; case 10 /* lineFeed */: case 13 /* carriageReturn */: pos++; return token = 4 /* NewLineTrivia */; case 42 /* asterisk */: pos++; - return token = 38 /* AsteriskToken */; + return token = 39 /* AsteriskToken */; case 123 /* openBrace */: pos++; - return token = 16 /* OpenBraceToken */; + return token = 17 /* OpenBraceToken */; case 125 /* closeBrace */: pos++; - return token = 17 /* CloseBraceToken */; + return token = 18 /* CloseBraceToken */; case 91 /* openBracket */: pos++; - return token = 20 /* OpenBracketToken */; + return token = 21 /* OpenBracketToken */; case 93 /* closeBracket */: pos++; - return token = 21 /* CloseBracketToken */; + return token = 22 /* CloseBracketToken */; case 61 /* equals */: pos++; - return token = 57 /* EqualsToken */; + return token = 58 /* EqualsToken */; case 44 /* comma */: pos++; - return token = 25 /* CommaToken */; + return token = 26 /* CommaToken */; case 46 /* dot */: pos++; - return token = 22 /* DotToken */; + return token = 23 /* DotToken */; } if (isIdentifierStart(ch, 5 /* Latest */)) { pos++; while (isIdentifierPart(text.charCodeAt(pos), 5 /* Latest */) && pos < end) { pos++; } - return token = 70 /* Identifier */; + return token = 71 /* Identifier */; } else { return pos += 1, token = 0 /* Unknown */; @@ -6412,6 +6570,19 @@ var ts; return undefined; } ts.getDeclarationOfKind = getDeclarationOfKind; + function findDeclaration(symbol, predicate) { + var declarations = symbol.declarations; + if (declarations) { + for (var _i = 0, declarations_2 = declarations; _i < declarations_2.length; _i++) { + var declaration = declarations_2[_i]; + if (predicate(declaration)) { + return declaration; + } + } + } + return undefined; + } + ts.findDeclaration = findDeclaration; // Pool writers to avoid needing to allocate them for every symbol we write. var stringWriters = []; function getSingleLineStringWriter() { @@ -6435,7 +6606,8 @@ var ts; decreaseIndent: ts.noop, clear: function () { return str_1 = ""; }, trackSymbol: ts.noop, - reportInaccessibleThisError: ts.noop + reportInaccessibleThisError: ts.noop, + reportIllegalExtends: ts.noop }; } return stringWriters.pop(); @@ -6451,25 +6623,25 @@ var ts; } ts.getFullWidth = getFullWidth; function hasResolvedModule(sourceFile, moduleNameText) { - return !!(sourceFile && sourceFile.resolvedModules && sourceFile.resolvedModules[moduleNameText]); + return !!(sourceFile && sourceFile.resolvedModules && sourceFile.resolvedModules.get(moduleNameText)); } ts.hasResolvedModule = hasResolvedModule; function getResolvedModule(sourceFile, moduleNameText) { - return hasResolvedModule(sourceFile, moduleNameText) ? sourceFile.resolvedModules[moduleNameText] : undefined; + return hasResolvedModule(sourceFile, moduleNameText) ? sourceFile.resolvedModules.get(moduleNameText) : undefined; } ts.getResolvedModule = getResolvedModule; function setResolvedModule(sourceFile, moduleNameText, resolvedModule) { if (!sourceFile.resolvedModules) { sourceFile.resolvedModules = ts.createMap(); } - sourceFile.resolvedModules[moduleNameText] = resolvedModule; + sourceFile.resolvedModules.set(moduleNameText, resolvedModule); } ts.setResolvedModule = setResolvedModule; function setResolvedTypeReferenceDirective(sourceFile, typeReferenceDirectiveName, resolvedTypeReferenceDirective) { if (!sourceFile.resolvedTypeReferenceDirectiveNames) { sourceFile.resolvedTypeReferenceDirectiveNames = ts.createMap(); } - sourceFile.resolvedTypeReferenceDirectiveNames[typeReferenceDirectiveName] = resolvedTypeReferenceDirective; + sourceFile.resolvedTypeReferenceDirectiveNames.set(typeReferenceDirectiveName, resolvedTypeReferenceDirective); } ts.setResolvedTypeReferenceDirective = setResolvedTypeReferenceDirective; /* @internal */ @@ -6491,7 +6663,7 @@ var ts; } for (var i = 0; i < names.length; i++) { var newResolution = newResolutions[i]; - var oldResolution = oldResolutions && oldResolutions[names[i]]; + var oldResolution = oldResolutions && oldResolutions.get(names[i]); var changed = oldResolution ? !newResolution || !comparer(oldResolution, newResolution) : newResolution; @@ -6526,7 +6698,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 261 /* SourceFile */) { + while (node && node.kind !== 265 /* SourceFile */) { node = node.parent; } return node; @@ -6534,11 +6706,11 @@ var ts; ts.getSourceFileOfNode = getSourceFileOfNode; function isStatementWithLocals(node) { switch (node.kind) { - case 204 /* Block */: - case 232 /* CaseBlock */: - case 211 /* ForStatement */: - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: + case 207 /* Block */: + case 235 /* CaseBlock */: + case 214 /* ForStatement */: + case 215 /* ForInStatement */: + case 216 /* ForOfStatement */: return true; } return false; @@ -6613,6 +6785,10 @@ var ts; return !nodeIsMissing(node); } ts.nodeIsPresent = nodeIsPresent; + function isToken(n) { + return n.kind >= 0 /* FirstToken */ && n.kind <= 142 /* LastToken */; + } + ts.isToken = isToken; function getTokenPosOfNode(node, sourceFile, includeJsDoc) { // With nodes that have no width (i.e. 'Missing' nodes), we actually *don't* // want to skip trivia because this will launch us forward to the next token. @@ -6629,18 +6805,18 @@ 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 === 292 /* SyntaxList */ && node._children.length > 0) { + if (node.kind === 294 /* SyntaxList */ && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); } ts.getTokenPosOfNode = getTokenPosOfNode; function isJSDocNode(node) { - return node.kind >= 262 /* FirstJSDocNode */ && node.kind <= 288 /* LastJSDocNode */; + return node.kind >= 267 /* FirstJSDocNode */ && node.kind <= 293 /* LastJSDocNode */; } ts.isJSDocNode = isJSDocNode; function isJSDocTag(node) { - return node.kind >= 278 /* FirstJSDocTagNode */ && node.kind <= 291 /* LastJSDocTagNode */; + return node.kind >= 283 /* FirstJSDocTagNode */ && node.kind <= 293 /* LastJSDocTagNode */; } ts.isJSDocTag = isJSDocTag; function getNonDecoratorTokenPosOfNode(node, sourceFile) { @@ -6671,33 +6847,24 @@ var ts; return getSourceTextOfNodeFromSourceFile(getSourceFileOfNode(node), node, includeTrivia); } ts.getTextOfNode = getTextOfNode; - function getLiteralText(node, sourceFile, languageVersion) { - // Any template literal or string literal with an extended escape - // (e.g. "\u{0067}") will need to be downleveled as a escaped string literal. - if (languageVersion < 2 /* ES2015 */ && (isTemplateLiteralKind(node.kind) || node.hasExtendedUnicodeEscape)) { - return getQuotedEscapedLiteralText('"', node.text, '"'); - } + function getLiteralText(node, sourceFile) { // If we don't need to downlevel and we can reach the original source text using // the node's parent reference, then simply get the text as it was originally written. if (!nodeIsSynthesized(node) && node.parent) { - var text = getSourceTextOfNodeFromSourceFile(sourceFile, node); - if (languageVersion < 2 /* ES2015 */ && isBinaryOrOctalIntegerLiteral(node, text)) { - return node.text; - } - return text; + return getSourceTextOfNodeFromSourceFile(sourceFile, node); } // If we can't reach the original source text, use the canonical form if it's a number, // or an escaped quoted form of the original text if it's string-like. switch (node.kind) { case 9 /* StringLiteral */: return getQuotedEscapedLiteralText('"', node.text, '"'); - case 12 /* NoSubstitutionTemplateLiteral */: + case 13 /* NoSubstitutionTemplateLiteral */: return getQuotedEscapedLiteralText("`", node.text, "`"); - case 13 /* TemplateHead */: + case 14 /* TemplateHead */: return getQuotedEscapedLiteralText("`", node.text, "${"); - case 14 /* TemplateMiddle */: + case 15 /* TemplateMiddle */: return getQuotedEscapedLiteralText("}", node.text, "${"); - case 15 /* TemplateTail */: + case 16 /* TemplateTail */: return getQuotedEscapedLiteralText("}", node.text, "`"); case 8 /* NumericLiteral */: return node.text; @@ -6705,19 +6872,6 @@ var ts; ts.Debug.fail("Literal kind '" + node.kind + "' not accounted for."); } ts.getLiteralText = getLiteralText; - function isBinaryOrOctalIntegerLiteral(node, text) { - if (node.kind === 8 /* NumericLiteral */ && text.length > 1) { - switch (text.charCodeAt(1)) { - case 98 /* b */: - case 66 /* B */: - case 111 /* o */: - case 79 /* O */: - return true; - } - } - return false; - } - ts.isBinaryOrOctalIntegerLiteral = isBinaryOrOctalIntegerLiteral; function getQuotedEscapedLiteralText(leftQuote, text, rightQuote) { return leftQuote + escapeNonAsciiCharacters(escapeString(text)) + rightQuote; } @@ -6726,11 +6880,6 @@ var ts; return identifier.length >= 2 && identifier.charCodeAt(0) === 95 /* _ */ && identifier.charCodeAt(1) === 95 /* _ */ ? "_" + identifier : identifier; } ts.escapeIdentifier = escapeIdentifier; - // Remove extra underscore from escaped identifier - function unescapeIdentifier(identifier) { - return identifier.length >= 3 && identifier.charCodeAt(0) === 95 /* _ */ && identifier.charCodeAt(1) === 95 /* _ */ && identifier.charCodeAt(2) === 95 /* _ */ ? identifier.substr(1) : identifier; - } - ts.unescapeIdentifier = unescapeIdentifier; // Make an identifier from an external module name by extracting the string after the last "/" and replacing // all non-alphanumeric characters with underscores function makeIdentifierFromModuleName(moduleName) { @@ -6744,26 +6893,26 @@ var ts; ts.isBlockOrCatchScoped = isBlockOrCatchScoped; function isCatchClauseVariableDeclarationOrBindingElement(declaration) { var node = getRootDeclaration(declaration); - return node.kind === 223 /* VariableDeclaration */ && node.parent.kind === 256 /* CatchClause */; + return node.kind === 226 /* VariableDeclaration */ && node.parent.kind === 260 /* CatchClause */; } ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement; function isAmbientModule(node) { - return node && node.kind === 230 /* ModuleDeclaration */ && + return node && node.kind === 233 /* ModuleDeclaration */ && (node.name.kind === 9 /* StringLiteral */ || isGlobalScopeAugmentation(node)); } ts.isAmbientModule = isAmbientModule; - /** Given a symbol for a module, checks that it is either an untyped import or a shorthand ambient module. */ + /** Given a symbol for a module, checks that it is a shorthand ambient module. */ function isShorthandAmbientModuleSymbol(moduleSymbol) { return isShorthandAmbientModule(moduleSymbol.valueDeclaration); } ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol; function isShorthandAmbientModule(node) { // The only kind of module that can be missing a body is a shorthand ambient module. - return node.kind === 230 /* ModuleDeclaration */ && (!node.body); + return node && node.kind === 233 /* ModuleDeclaration */ && (!node.body); } function isBlockScopedContainerTopLevel(node) { - return node.kind === 261 /* SourceFile */ || - node.kind === 230 /* ModuleDeclaration */ || + return node.kind === 265 /* SourceFile */ || + node.kind === 233 /* ModuleDeclaration */ || isFunctionLike(node); } ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel; @@ -6779,9 +6928,9 @@ var ts; return false; } switch (node.parent.kind) { - case 261 /* SourceFile */: + case 265 /* SourceFile */: return ts.isExternalModule(node.parent); - case 231 /* ModuleBlock */: + case 234 /* ModuleBlock */: return isAmbientModule(node.parent.parent) && !ts.isExternalModule(node.parent.parent.parent); } return false; @@ -6793,22 +6942,22 @@ var ts; ts.isEffectiveExternalModule = isEffectiveExternalModule; function isBlockScope(node, parentNode) { switch (node.kind) { - case 261 /* SourceFile */: - case 232 /* CaseBlock */: - case 256 /* CatchClause */: - case 230 /* ModuleDeclaration */: - case 211 /* ForStatement */: - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: - case 150 /* Constructor */: - case 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: + case 265 /* SourceFile */: + case 235 /* CaseBlock */: + case 260 /* CatchClause */: + case 233 /* ModuleDeclaration */: + case 214 /* ForStatement */: + case 215 /* ForInStatement */: + case 216 /* ForOfStatement */: + case 152 /* Constructor */: + case 151 /* MethodDeclaration */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + case 228 /* FunctionDeclaration */: + case 186 /* FunctionExpression */: + case 187 /* ArrowFunction */: return true; - case 204 /* Block */: + case 207 /* Block */: // function block is not considered block-scope container // see comment in binder.ts: bind(...), case for SyntaxKind.Block return parentNode && !isFunctionLike(parentNode); @@ -6835,14 +6984,18 @@ var ts; return getFullWidth(name) === 0 ? "(Missing)" : getTextOfNode(name); } ts.declarationNameToString = declarationNameToString; + function getNameFromIndexInfo(info) { + return info.declaration ? declarationNameToString(info.declaration.parameters[0].name) : undefined; + } + ts.getNameFromIndexInfo = getNameFromIndexInfo; function getTextOfPropertyName(name) { switch (name.kind) { - case 70 /* Identifier */: + case 71 /* Identifier */: return name.text; case 9 /* StringLiteral */: case 8 /* NumericLiteral */: return name.text; - case 142 /* ComputedPropertyName */: + case 144 /* ComputedPropertyName */: if (isStringOrNumericLiteral(name.expression)) { return name.expression.text; } @@ -6852,11 +7005,11 @@ var ts; ts.getTextOfPropertyName = getTextOfPropertyName; function entityNameToString(name) { switch (name.kind) { - case 70 /* Identifier */: - return getFullWidth(name) === 0 ? unescapeIdentifier(name.text) : getTextOfNode(name); - case 141 /* QualifiedName */: + case 71 /* Identifier */: + return getFullWidth(name) === 0 ? ts.unescapeIdentifier(name.text) : getTextOfNode(name); + case 143 /* QualifiedName */: return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 177 /* PropertyAccessExpression */: + case 179 /* PropertyAccessExpression */: return entityNameToString(name.expression) + "." + entityNameToString(name.name); } } @@ -6893,7 +7046,7 @@ var ts; ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; function getErrorSpanForArrowFunction(sourceFile, node) { var pos = ts.skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 204 /* Block */) { + if (node.body && node.body.kind === 207 /* Block */) { var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line; var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line; if (startLine < endLine) { @@ -6907,7 +7060,7 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 261 /* SourceFile */: + case 265 /* 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 @@ -6916,23 +7069,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 223 /* VariableDeclaration */: - case 174 /* BindingElement */: - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: - case 227 /* InterfaceDeclaration */: - case 230 /* ModuleDeclaration */: - case 229 /* EnumDeclaration */: - case 260 /* EnumMember */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 228 /* TypeAliasDeclaration */: + case 226 /* VariableDeclaration */: + case 176 /* BindingElement */: + case 229 /* ClassDeclaration */: + case 199 /* ClassExpression */: + case 230 /* InterfaceDeclaration */: + case 233 /* ModuleDeclaration */: + case 232 /* EnumDeclaration */: + case 264 /* EnumMember */: + case 228 /* FunctionDeclaration */: + case 186 /* FunctionExpression */: + case 151 /* MethodDeclaration */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + case 231 /* TypeAliasDeclaration */: errorNode = node.name; break; - case 185 /* ArrowFunction */: + case 187 /* ArrowFunction */: return getErrorSpanForArrowFunction(sourceFile, node); } if (errorNode === undefined) { @@ -6955,7 +7108,7 @@ var ts; } ts.isDeclarationFile = isDeclarationFile; function isConstEnumDeclaration(node) { - return node.kind === 229 /* EnumDeclaration */ && isConst(node); + return node.kind === 232 /* EnumDeclaration */ && isConst(node); } ts.isConstEnumDeclaration = isConstEnumDeclaration; function isConst(node) { @@ -6968,11 +7121,11 @@ var ts; } ts.isLet = isLet; function isSuperCall(n) { - return n.kind === 179 /* CallExpression */ && n.expression.kind === 96 /* SuperKeyword */; + return n.kind === 181 /* CallExpression */ && n.expression.kind === 97 /* SuperKeyword */; } ts.isSuperCall = isSuperCall; function isPrologueDirective(node) { - return node.kind === 207 /* ExpressionStatement */ + return node.kind === 210 /* ExpressionStatement */ && node.expression.kind === 9 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; @@ -6985,10 +7138,10 @@ var ts; } ts.getLeadingCommentRangesOfNodeFromText = getLeadingCommentRangesOfNodeFromText; function getJSDocCommentRanges(node, text) { - var commentRanges = (node.kind === 144 /* Parameter */ || - node.kind === 143 /* TypeParameter */ || - node.kind === 184 /* FunctionExpression */ || - node.kind === 185 /* ArrowFunction */) ? + var commentRanges = (node.kind === 146 /* Parameter */ || + node.kind === 145 /* TypeParameter */ || + node.kind === 186 /* FunctionExpression */ || + node.kind === 187 /* ArrowFunction */) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : getLeadingCommentRangesOfNodeFromText(node, text); // True if the comment starts with '/**' but not if it is '/**/' @@ -7003,79 +7156,80 @@ var ts; ts.fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*/; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { - if (156 /* FirstTypeNode */ <= node.kind && node.kind <= 171 /* LastTypeNode */) { + if (158 /* FirstTypeNode */ <= node.kind && node.kind <= 173 /* LastTypeNode */) { return true; } switch (node.kind) { - case 118 /* AnyKeyword */: - case 132 /* NumberKeyword */: - case 134 /* StringKeyword */: - case 121 /* BooleanKeyword */: - case 135 /* SymbolKeyword */: - case 137 /* UndefinedKeyword */: - case 129 /* NeverKeyword */: + case 119 /* AnyKeyword */: + case 133 /* NumberKeyword */: + case 136 /* StringKeyword */: + case 122 /* BooleanKeyword */: + case 137 /* SymbolKeyword */: + case 139 /* UndefinedKeyword */: + case 130 /* NeverKeyword */: return true; - case 104 /* VoidKeyword */: - return node.parent.kind !== 188 /* VoidExpression */; - case 199 /* ExpressionWithTypeArguments */: + case 105 /* VoidKeyword */: + return node.parent.kind !== 190 /* VoidExpression */; + case 201 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); // Identifiers and qualified names may be type nodes, depending on their context. Climb // above them to find the lowest container - case 70 /* Identifier */: + 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 === 141 /* QualifiedName */ && node.parent.right === node) { + if (node.parent.kind === 143 /* QualifiedName */ && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 177 /* PropertyAccessExpression */ && node.parent.name === node) { + else if (node.parent.kind === 179 /* 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 === 70 /* Identifier */ || node.kind === 141 /* QualifiedName */ || node.kind === 177 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); - case 141 /* QualifiedName */: - case 177 /* PropertyAccessExpression */: - case 98 /* ThisKeyword */: - var parent_1 = node.parent; - if (parent_1.kind === 160 /* TypeQuery */) { + ts.Debug.assert(node.kind === 71 /* Identifier */ || node.kind === 143 /* QualifiedName */ || node.kind === 179 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + // falls through + case 143 /* QualifiedName */: + case 179 /* PropertyAccessExpression */: + case 99 /* ThisKeyword */: + var parent = node.parent; + if (parent.kind === 162 /* TypeQuery */) { return false; } // Do not recursively call isPartOfTypeNode on the parent. In the example: // // let a: A.B.C; // - // Calling isPartOfTypeNode would consider the qualified name A.B a type node. Only C or - // A.B.C is a type node. - if (156 /* FirstTypeNode */ <= parent_1.kind && parent_1.kind <= 171 /* LastTypeNode */) { + // Calling isPartOfTypeNode would consider the qualified name A.B a type node. + // Only C and A.B.C are type nodes. + if (158 /* FirstTypeNode */ <= parent.kind && parent.kind <= 173 /* LastTypeNode */) { return true; } - switch (parent_1.kind) { - case 199 /* ExpressionWithTypeArguments */: - return !isExpressionWithTypeArgumentsInClassExtendsClause(parent_1); - case 143 /* TypeParameter */: - return node === parent_1.constraint; - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 144 /* Parameter */: - case 223 /* VariableDeclaration */: - return node === parent_1.type; - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - case 150 /* Constructor */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - return node === parent_1.type; - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: - return node === parent_1.type; - case 182 /* TypeAssertionExpression */: - return node === parent_1.type; - case 179 /* CallExpression */: - case 180 /* NewExpression */: - return parent_1.typeArguments && ts.indexOf(parent_1.typeArguments, node) >= 0; - case 181 /* TaggedTemplateExpression */: + switch (parent.kind) { + case 201 /* ExpressionWithTypeArguments */: + return !isExpressionWithTypeArgumentsInClassExtendsClause(parent); + case 145 /* TypeParameter */: + return node === parent.constraint; + case 149 /* PropertyDeclaration */: + case 148 /* PropertySignature */: + case 146 /* Parameter */: + case 226 /* VariableDeclaration */: + return node === parent.type; + case 228 /* FunctionDeclaration */: + case 186 /* FunctionExpression */: + case 187 /* ArrowFunction */: + case 152 /* Constructor */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + return node === parent.type; + case 155 /* CallSignature */: + case 156 /* ConstructSignature */: + case 157 /* IndexSignature */: + return node === parent.type; + case 184 /* TypeAssertionExpression */: + return node === parent.type; + case 181 /* CallExpression */: + case 182 /* NewExpression */: + return parent.typeArguments && ts.indexOf(parent.typeArguments, node) >= 0; + case 183 /* TaggedTemplateExpression */: // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments. return false; } @@ -7083,18 +7237,18 @@ var ts; return false; } ts.isPartOfTypeNode = isPartOfTypeNode; - function isChildOfLiteralType(node) { + function isChildOfNodeWithKind(node, kind) { while (node) { - if (node.kind === 171 /* LiteralType */) { + if (node.kind === kind) { return true; } node = node.parent; } return false; } - ts.isChildOfLiteralType = isChildOfLiteralType; + ts.isChildOfNodeWithKind = isChildOfNodeWithKind; function isPrefixUnaryExpression(node) { - return node.kind === 190 /* PrefixUnaryExpression */; + return node.kind === 192 /* PrefixUnaryExpression */; } ts.isPrefixUnaryExpression = isPrefixUnaryExpression; // Warning: This has the same semantics as the forEach family of functions, @@ -7103,23 +7257,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 216 /* ReturnStatement */: + case 219 /* ReturnStatement */: return visitor(node); - case 232 /* CaseBlock */: - case 204 /* Block */: - case 208 /* IfStatement */: - case 209 /* DoStatement */: - case 210 /* WhileStatement */: - case 211 /* ForStatement */: - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: - case 217 /* WithStatement */: - case 218 /* SwitchStatement */: - case 253 /* CaseClause */: - case 254 /* DefaultClause */: - case 219 /* LabeledStatement */: - case 221 /* TryStatement */: - case 256 /* CatchClause */: + case 235 /* CaseBlock */: + case 207 /* Block */: + case 211 /* IfStatement */: + case 212 /* DoStatement */: + case 213 /* WhileStatement */: + case 214 /* ForStatement */: + case 215 /* ForInStatement */: + case 216 /* ForOfStatement */: + case 220 /* WithStatement */: + case 221 /* SwitchStatement */: + case 257 /* CaseClause */: + case 258 /* DefaultClause */: + case 222 /* LabeledStatement */: + case 224 /* TryStatement */: + case 260 /* CatchClause */: return ts.forEachChild(node, traverse); } } @@ -7129,29 +7283,30 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 195 /* YieldExpression */: + case 197 /* YieldExpression */: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } - case 229 /* EnumDeclaration */: - case 227 /* InterfaceDeclaration */: - case 230 /* ModuleDeclaration */: - case 228 /* TypeAliasDeclaration */: - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: + return; + case 232 /* EnumDeclaration */: + case 230 /* InterfaceDeclaration */: + case 233 /* ModuleDeclaration */: + case 231 /* TypeAliasDeclaration */: + case 229 /* ClassDeclaration */: + case 199 /* 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 (isFunctionLike(node)) { - var name_5 = node.name; - if (name_5 && name_5.kind === 142 /* ComputedPropertyName */) { + var name = node.name; + if (name && name.kind === 144 /* 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_5.expression); + traverse(name.expression); return; } } @@ -7171,10 +7326,10 @@ var ts; * @param node The type node. */ function getRestParameterElementType(node) { - if (node && node.kind === 162 /* ArrayType */) { + if (node && node.kind === 164 /* ArrayType */) { return node.elementType; } - else if (node && node.kind === 157 /* TypeReference */) { + else if (node && node.kind === 159 /* TypeReference */) { return ts.singleOrUndefined(node.typeArguments); } else { @@ -7185,14 +7340,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 174 /* BindingElement */: - case 260 /* EnumMember */: - case 144 /* Parameter */: - case 257 /* PropertyAssignment */: - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 258 /* ShorthandPropertyAssignment */: - case 223 /* VariableDeclaration */: + case 176 /* BindingElement */: + case 264 /* EnumMember */: + case 146 /* Parameter */: + case 261 /* PropertyAssignment */: + case 149 /* PropertyDeclaration */: + case 148 /* PropertySignature */: + case 262 /* ShorthandPropertyAssignment */: + case 226 /* VariableDeclaration */: return true; } } @@ -7200,11 +7355,11 @@ var ts; } ts.isVariableLike = isVariableLike; function isAccessor(node) { - return node && (node.kind === 151 /* GetAccessor */ || node.kind === 152 /* SetAccessor */); + return node && (node.kind === 153 /* GetAccessor */ || node.kind === 154 /* SetAccessor */); } ts.isAccessor = isAccessor; function isClassLike(node) { - return node && (node.kind === 226 /* ClassDeclaration */ || node.kind === 197 /* ClassExpression */); + return node && (node.kind === 229 /* ClassDeclaration */ || node.kind === 199 /* ClassExpression */); } ts.isClassLike = isClassLike; function isFunctionLike(node) { @@ -7213,19 +7368,19 @@ var ts; ts.isFunctionLike = isFunctionLike; function isFunctionLikeKind(kind) { switch (kind) { - case 150 /* Constructor */: - case 184 /* FunctionExpression */: - case 225 /* FunctionDeclaration */: - case 185 /* ArrowFunction */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: - case 158 /* FunctionType */: - case 159 /* ConstructorType */: + case 152 /* Constructor */: + case 186 /* FunctionExpression */: + case 228 /* FunctionDeclaration */: + case 187 /* ArrowFunction */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + case 155 /* CallSignature */: + case 156 /* ConstructSignature */: + case 157 /* IndexSignature */: + case 160 /* FunctionType */: + case 161 /* ConstructorType */: return true; } return false; @@ -7233,13 +7388,13 @@ var ts; ts.isFunctionLikeKind = isFunctionLikeKind; function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: + case 152 /* Constructor */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + case 228 /* FunctionDeclaration */: + case 186 /* FunctionExpression */: return true; } return false; @@ -7247,30 +7402,42 @@ var ts; ts.introducesArgumentsExoticObject = introducesArgumentsExoticObject; function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 211 /* ForStatement */: - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: - case 209 /* DoStatement */: - case 210 /* WhileStatement */: + case 214 /* ForStatement */: + case 215 /* ForInStatement */: + case 216 /* ForOfStatement */: + case 212 /* DoStatement */: + case 213 /* WhileStatement */: return true; - case 219 /* LabeledStatement */: + case 222 /* LabeledStatement */: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; } ts.isIterationStatement = isIterationStatement; + function unwrapInnermostStatementOfLabel(node, beforeUnwrapLabelCallback) { + while (true) { + if (beforeUnwrapLabelCallback) { + beforeUnwrapLabelCallback(node); + } + if (node.statement.kind !== 222 /* LabeledStatement */) { + return node.statement; + } + node = node.statement; + } + } + ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel; function isFunctionBlock(node) { - return node && node.kind === 204 /* Block */ && isFunctionLike(node.parent); + return node && node.kind === 207 /* Block */ && isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 149 /* MethodDeclaration */ && node.parent.kind === 176 /* ObjectLiteralExpression */; + return node && node.kind === 151 /* MethodDeclaration */ && node.parent.kind === 178 /* ObjectLiteralExpression */; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function isObjectLiteralOrClassExpressionMethod(node) { - return node.kind === 149 /* MethodDeclaration */ && - (node.parent.kind === 176 /* ObjectLiteralExpression */ || - node.parent.kind === 197 /* ClassExpression */); + return node.kind === 151 /* MethodDeclaration */ && + (node.parent.kind === 178 /* ObjectLiteralExpression */ || + node.parent.kind === 199 /* ClassExpression */); } ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod; function isIdentifierTypePredicate(predicate) { @@ -7306,7 +7473,7 @@ var ts; return undefined; } switch (node.kind) { - case 142 /* ComputedPropertyName */: + case 144 /* 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 @@ -7321,9 +7488,9 @@ var ts; // the *body* of the container. node = node.parent; break; - case 145 /* Decorator */: + case 147 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 144 /* Parameter */ && isClassElement(node.parent.parent)) { + if (node.parent.kind === 146 /* Parameter */ && 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; @@ -7334,39 +7501,52 @@ var ts; node = node.parent; } break; - case 185 /* ArrowFunction */: + case 187 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } - // Fall through - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 230 /* ModuleDeclaration */: - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: - case 229 /* EnumDeclaration */: - case 261 /* SourceFile */: + // falls through + case 228 /* FunctionDeclaration */: + case 186 /* FunctionExpression */: + case 233 /* ModuleDeclaration */: + case 149 /* PropertyDeclaration */: + case 148 /* PropertySignature */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: + case 152 /* Constructor */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + case 155 /* CallSignature */: + case 156 /* ConstructSignature */: + case 157 /* IndexSignature */: + case 232 /* EnumDeclaration */: + case 265 /* SourceFile */: return node; } } } ts.getThisContainer = getThisContainer; + function getNewTargetContainer(node) { + var container = getThisContainer(node, /*includeArrowFunctions*/ false); + if (container) { + switch (container.kind) { + case 152 /* Constructor */: + case 228 /* FunctionDeclaration */: + case 186 /* FunctionExpression */: + return container; + } + } + return undefined; + } + ts.getNewTargetContainer = getNewTargetContainer; /** - * Given an super call/property node, returns the closest node where - * - a super call/property access is legal in the node and not legal in the parent node the node. - * i.e. super call is legal in constructor but not legal in the class body. - * - the container is an arrow function (so caller might need to call getSuperContainer again in case it needs to climb higher) - * - a super call/property is definitely illegal in the container (but might be legal in some subnode) - * i.e. super property access is illegal in function declaration but can be legal in the statement list - */ + * Given an super call/property node, returns the closest node where + * - a super call/property access is legal in the node and not legal in the parent node the node. + * i.e. super call is legal in constructor but not legal in the class body. + * - the container is an arrow function (so caller might need to call getSuperContainer again in case it needs to climb higher) + * - a super call/property is definitely illegal in the container (but might be legal in some subnode) + * i.e. super property access is illegal in function declaration but can be legal in the statement list + */ function getSuperContainer(node, stopOnFunctions) { while (true) { node = node.parent; @@ -7374,26 +7554,27 @@ var ts; return node; } switch (node.kind) { - case 142 /* ComputedPropertyName */: + case 144 /* ComputedPropertyName */: node = node.parent; break; - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: + case 228 /* FunctionDeclaration */: + case 186 /* FunctionExpression */: + case 187 /* ArrowFunction */: if (!stopOnFunctions) { continue; } - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + // falls through + case 149 /* PropertyDeclaration */: + case 148 /* PropertySignature */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: + case 152 /* Constructor */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: return node; - case 145 /* Decorator */: + case 147 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 144 /* Parameter */ && isClassElement(node.parent.parent)) { + if (node.parent.kind === 146 /* Parameter */ && 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; @@ -7409,15 +7590,15 @@ var ts; } ts.getSuperContainer = getSuperContainer; function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 184 /* FunctionExpression */ || func.kind === 185 /* ArrowFunction */) { + if (func.kind === 186 /* FunctionExpression */ || func.kind === 187 /* ArrowFunction */) { var prev = func; - var parent_2 = func.parent; - while (parent_2.kind === 183 /* ParenthesizedExpression */) { - prev = parent_2; - parent_2 = parent_2.parent; + var parent = func.parent; + while (parent.kind === 185 /* ParenthesizedExpression */) { + prev = parent; + parent = parent.parent; } - if (parent_2.kind === 179 /* CallExpression */ && parent_2.expression === prev) { - return parent_2; + if (parent.kind === 181 /* CallExpression */ && parent.expression === prev) { + return parent; } } } @@ -7427,21 +7608,21 @@ var ts; */ function isSuperProperty(node) { var kind = node.kind; - return (kind === 177 /* PropertyAccessExpression */ || kind === 178 /* ElementAccessExpression */) - && node.expression.kind === 96 /* SuperKeyword */; + return (kind === 179 /* PropertyAccessExpression */ || kind === 180 /* ElementAccessExpression */) + && node.expression.kind === 97 /* SuperKeyword */; } ts.isSuperProperty = isSuperProperty; function getEntityNameFromTypeNode(node) { switch (node.kind) { - case 157 /* TypeReference */: - case 272 /* JSDocTypeReference */: + case 159 /* TypeReference */: + case 277 /* JSDocTypeReference */: return node.typeName; - case 199 /* ExpressionWithTypeArguments */: + case 201 /* ExpressionWithTypeArguments */: return isEntityNameExpression(node.expression) ? node.expression : undefined; - case 70 /* Identifier */: - case 141 /* QualifiedName */: + case 71 /* Identifier */: + case 143 /* QualifiedName */: return node; } return undefined; @@ -7449,10 +7630,12 @@ var ts; ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function isCallLikeExpression(node) { switch (node.kind) { - case 179 /* CallExpression */: - case 180 /* NewExpression */: - case 181 /* TaggedTemplateExpression */: - case 145 /* Decorator */: + case 251 /* JsxOpeningElement */: + case 250 /* JsxSelfClosingElement */: + case 181 /* CallExpression */: + case 182 /* NewExpression */: + case 183 /* TaggedTemplateExpression */: + case 147 /* Decorator */: return true; default: return false; @@ -7460,34 +7643,37 @@ var ts; } ts.isCallLikeExpression = isCallLikeExpression; function getInvokedExpression(node) { - if (node.kind === 181 /* TaggedTemplateExpression */) { + if (node.kind === 183 /* TaggedTemplateExpression */) { return node.tag; } + else if (isJsxOpeningLikeElement(node)) { + return node.tagName; + } // Will either be a CallExpression, NewExpression, or Decorator. return node.expression; } ts.getInvokedExpression = getInvokedExpression; function nodeCanBeDecorated(node) { switch (node.kind) { - case 226 /* ClassDeclaration */: + case 229 /* ClassDeclaration */: // classes are valid targets return true; - case 147 /* PropertyDeclaration */: + case 149 /* PropertyDeclaration */: // property declarations are valid if their parent is a class declaration. - return node.parent.kind === 226 /* ClassDeclaration */; - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 149 /* MethodDeclaration */: + return node.parent.kind === 229 /* ClassDeclaration */; + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + case 151 /* MethodDeclaration */: // if this method has a body and its parent is a class declaration, this is a valid target. return node.body !== undefined - && node.parent.kind === 226 /* ClassDeclaration */; - case 144 /* Parameter */: + && node.parent.kind === 229 /* ClassDeclaration */; + case 146 /* Parameter */: // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target; return node.parent.body !== undefined - && (node.parent.kind === 150 /* Constructor */ - || node.parent.kind === 149 /* MethodDeclaration */ - || node.parent.kind === 152 /* SetAccessor */) - && node.parent.parent.kind === 226 /* ClassDeclaration */; + && (node.parent.kind === 152 /* Constructor */ + || node.parent.kind === 151 /* MethodDeclaration */ + || node.parent.kind === 154 /* SetAccessor */) + && node.parent.parent.kind === 229 /* ClassDeclaration */; } return false; } @@ -7503,19 +7689,19 @@ var ts; ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function childIsDecorated(node) { switch (node.kind) { - case 226 /* ClassDeclaration */: + case 229 /* ClassDeclaration */: return ts.forEach(node.members, nodeOrChildIsDecorated); - case 149 /* MethodDeclaration */: - case 152 /* SetAccessor */: + case 151 /* MethodDeclaration */: + case 154 /* SetAccessor */: return ts.forEach(node.parameters, nodeIsDecorated); } } ts.childIsDecorated = childIsDecorated; function isJSXTagName(node) { var parent = node.parent; - if (parent.kind === 248 /* JsxOpeningElement */ || - parent.kind === 247 /* JsxSelfClosingElement */ || - parent.kind === 249 /* JsxClosingElement */) { + if (parent.kind === 251 /* JsxOpeningElement */ || + parent.kind === 250 /* JsxSelfClosingElement */ || + parent.kind === 252 /* JsxClosingElement */) { return parent.tagName === node; } return false; @@ -7523,102 +7709,103 @@ var ts; ts.isJSXTagName = isJSXTagName; function isPartOfExpression(node) { switch (node.kind) { - case 98 /* ThisKeyword */: - case 96 /* SuperKeyword */: - case 94 /* NullKeyword */: - case 100 /* TrueKeyword */: - case 85 /* FalseKeyword */: - case 11 /* RegularExpressionLiteral */: - case 175 /* ArrayLiteralExpression */: - case 176 /* ObjectLiteralExpression */: - case 177 /* PropertyAccessExpression */: - case 178 /* ElementAccessExpression */: - case 179 /* CallExpression */: - case 180 /* NewExpression */: - case 181 /* TaggedTemplateExpression */: - case 200 /* AsExpression */: - case 182 /* TypeAssertionExpression */: - case 201 /* NonNullExpression */: - case 183 /* ParenthesizedExpression */: - case 184 /* FunctionExpression */: - case 197 /* ClassExpression */: - case 185 /* ArrowFunction */: - case 188 /* VoidExpression */: - case 186 /* DeleteExpression */: - case 187 /* TypeOfExpression */: - case 190 /* PrefixUnaryExpression */: - case 191 /* PostfixUnaryExpression */: - case 192 /* BinaryExpression */: - case 193 /* ConditionalExpression */: - case 196 /* SpreadElement */: - case 194 /* TemplateExpression */: - case 12 /* NoSubstitutionTemplateLiteral */: - case 198 /* OmittedExpression */: - case 246 /* JsxElement */: - case 247 /* JsxSelfClosingElement */: - case 195 /* YieldExpression */: - case 189 /* AwaitExpression */: + case 99 /* ThisKeyword */: + case 97 /* SuperKeyword */: + case 95 /* NullKeyword */: + case 101 /* TrueKeyword */: + case 86 /* FalseKeyword */: + case 12 /* RegularExpressionLiteral */: + case 177 /* ArrayLiteralExpression */: + case 178 /* ObjectLiteralExpression */: + case 179 /* PropertyAccessExpression */: + case 180 /* ElementAccessExpression */: + case 181 /* CallExpression */: + case 182 /* NewExpression */: + case 183 /* TaggedTemplateExpression */: + case 202 /* AsExpression */: + case 184 /* TypeAssertionExpression */: + case 203 /* NonNullExpression */: + case 185 /* ParenthesizedExpression */: + case 186 /* FunctionExpression */: + case 199 /* ClassExpression */: + case 187 /* ArrowFunction */: + case 190 /* VoidExpression */: + case 188 /* DeleteExpression */: + case 189 /* TypeOfExpression */: + case 192 /* PrefixUnaryExpression */: + case 193 /* PostfixUnaryExpression */: + case 194 /* BinaryExpression */: + case 195 /* ConditionalExpression */: + case 198 /* SpreadElement */: + case 196 /* TemplateExpression */: + case 13 /* NoSubstitutionTemplateLiteral */: + case 200 /* OmittedExpression */: + case 249 /* JsxElement */: + case 250 /* JsxSelfClosingElement */: + case 197 /* YieldExpression */: + case 191 /* AwaitExpression */: + case 204 /* MetaProperty */: return true; - case 141 /* QualifiedName */: - while (node.parent.kind === 141 /* QualifiedName */) { + case 143 /* QualifiedName */: + while (node.parent.kind === 143 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 160 /* TypeQuery */ || isJSXTagName(node); - case 70 /* Identifier */: - if (node.parent.kind === 160 /* TypeQuery */ || isJSXTagName(node)) { + return node.parent.kind === 162 /* TypeQuery */ || isJSXTagName(node); + case 71 /* Identifier */: + if (node.parent.kind === 162 /* TypeQuery */ || isJSXTagName(node)) { return true; } - // fall through + // falls through case 8 /* NumericLiteral */: case 9 /* StringLiteral */: - case 98 /* ThisKeyword */: - var parent_3 = node.parent; - switch (parent_3.kind) { - case 223 /* VariableDeclaration */: - case 144 /* Parameter */: - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 260 /* EnumMember */: - case 257 /* PropertyAssignment */: - case 174 /* BindingElement */: - return parent_3.initializer === node; - case 207 /* ExpressionStatement */: - case 208 /* IfStatement */: - case 209 /* DoStatement */: - case 210 /* WhileStatement */: - case 216 /* ReturnStatement */: - case 217 /* WithStatement */: - case 218 /* SwitchStatement */: - case 253 /* CaseClause */: - case 220 /* ThrowStatement */: - case 218 /* SwitchStatement */: - return parent_3.expression === node; - case 211 /* ForStatement */: - var forStatement = parent_3; - return (forStatement.initializer === node && forStatement.initializer.kind !== 224 /* VariableDeclarationList */) || + case 99 /* ThisKeyword */: + var parent = node.parent; + switch (parent.kind) { + case 226 /* VariableDeclaration */: + case 146 /* Parameter */: + case 149 /* PropertyDeclaration */: + case 148 /* PropertySignature */: + case 264 /* EnumMember */: + case 261 /* PropertyAssignment */: + case 176 /* BindingElement */: + return parent.initializer === node; + case 210 /* ExpressionStatement */: + case 211 /* IfStatement */: + case 212 /* DoStatement */: + case 213 /* WhileStatement */: + case 219 /* ReturnStatement */: + case 220 /* WithStatement */: + case 221 /* SwitchStatement */: + case 257 /* CaseClause */: + case 223 /* ThrowStatement */: + case 221 /* SwitchStatement */: + return parent.expression === node; + case 214 /* ForStatement */: + var forStatement = parent; + return (forStatement.initializer === node && forStatement.initializer.kind !== 227 /* VariableDeclarationList */) || forStatement.condition === node || forStatement.incrementor === node; - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: - var forInStatement = parent_3; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 224 /* VariableDeclarationList */) || + case 215 /* ForInStatement */: + case 216 /* ForOfStatement */: + var forInStatement = parent; + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 227 /* VariableDeclarationList */) || forInStatement.expression === node; - case 182 /* TypeAssertionExpression */: - case 200 /* AsExpression */: - return node === parent_3.expression; - case 202 /* TemplateSpan */: - return node === parent_3.expression; - case 142 /* ComputedPropertyName */: - return node === parent_3.expression; - case 145 /* Decorator */: - case 252 /* JsxExpression */: - case 251 /* JsxSpreadAttribute */: - case 259 /* SpreadAssignment */: + case 184 /* TypeAssertionExpression */: + case 202 /* AsExpression */: + return node === parent.expression; + case 205 /* TemplateSpan */: + return node === parent.expression; + case 144 /* ComputedPropertyName */: + return node === parent.expression; + case 147 /* Decorator */: + case 256 /* JsxExpression */: + case 255 /* JsxSpreadAttribute */: + case 263 /* SpreadAssignment */: return true; - case 199 /* ExpressionWithTypeArguments */: - return parent_3.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent_3); + case 201 /* ExpressionWithTypeArguments */: + return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); default: - if (isPartOfExpression(parent_3)) { + if (isPartOfExpression(parent)) { return true; } } @@ -7633,7 +7820,7 @@ var ts; } ts.isInstantiatedModule = isInstantiatedModule; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 234 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 245 /* ExternalModuleReference */; + return node.kind === 237 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 248 /* ExternalModuleReference */; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -7642,7 +7829,7 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 234 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 245 /* ExternalModuleReference */; + return node.kind === 237 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 248 /* ExternalModuleReference */; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJavaScript(file) { @@ -7655,16 +7842,22 @@ var ts; ts.isInJavaScriptFile = isInJavaScriptFile; /** * Returns true if the node is a CallExpression to the identifier 'require' with - * exactly one argument. + * exactly one argument (of the form 'require("name")'). * This function does not test if the node is in a JavaScript file or not. - */ - function isRequireCall(expression, checkArgumentIsStringLiteral) { - // of the form 'require("name")' - var isRequire = expression.kind === 179 /* CallExpression */ && - expression.expression.kind === 70 /* Identifier */ && - expression.expression.text === "require" && - expression.arguments.length === 1; - return isRequire && (!checkArgumentIsStringLiteral || expression.arguments[0].kind === 9 /* StringLiteral */); + */ + function isRequireCall(callExpression, checkArgumentIsStringLiteral) { + if (callExpression.kind !== 181 /* CallExpression */) { + return false; + } + var _a = callExpression, expression = _a.expression, args = _a.arguments; + if (expression.kind !== 71 /* Identifier */ || expression.text !== "require") { + return false; + } + if (args.length !== 1) { + return false; + } + var arg = args[0]; + return !checkArgumentIsStringLiteral || arg.kind === 9 /* StringLiteral */ || arg.kind === 13 /* NoSubstitutionTemplateLiteral */; } ts.isRequireCall = isRequireCall; function isSingleOrDoubleQuote(charCode) { @@ -7675,29 +7868,41 @@ var ts; * Returns true if the node is a variable declaration whose initializer is a function expression. * This function does not test if the node is in a JavaScript file or not. */ - function isDeclarationOfFunctionExpression(s) { - if (s.valueDeclaration && s.valueDeclaration.kind === 223 /* VariableDeclaration */) { + function isDeclarationOfFunctionOrClassExpression(s) { + if (s.valueDeclaration && s.valueDeclaration.kind === 226 /* VariableDeclaration */) { var declaration = s.valueDeclaration; - return declaration.initializer && declaration.initializer.kind === 184 /* FunctionExpression */; + return declaration.initializer && (declaration.initializer.kind === 186 /* FunctionExpression */ || declaration.initializer.kind === 199 /* ClassExpression */); } return false; } - ts.isDeclarationOfFunctionExpression = isDeclarationOfFunctionExpression; + ts.isDeclarationOfFunctionOrClassExpression = isDeclarationOfFunctionOrClassExpression; + function getRightMostAssignedExpression(node) { + while (isAssignmentExpression(node, /*excludeCompoundAssignements*/ true)) { + node = node.right; + } + return node; + } + ts.getRightMostAssignedExpression = getRightMostAssignedExpression; + function isExportsIdentifier(node) { + return isIdentifier(node) && node.text === "exports"; + } + ts.isExportsIdentifier = isExportsIdentifier; + function isModuleExportsPropertyAccessExpression(node) { + return isPropertyAccessExpression(node) && isIdentifier(node.expression) && node.expression.text === "module" && node.name.text === "exports"; + } + ts.isModuleExportsPropertyAccessExpression = isModuleExportsPropertyAccessExpression; /// Given a BinaryExpression, returns SpecialPropertyAssignmentKind for the various kinds of property /// assignments we treat as special in the binder function getSpecialPropertyAssignmentKind(expression) { if (!isInJavaScriptFile(expression)) { return 0 /* None */; } - if (expression.kind !== 192 /* BinaryExpression */) { - return 0 /* None */; - } var expr = expression; - if (expr.operatorToken.kind !== 57 /* EqualsToken */ || expr.left.kind !== 177 /* PropertyAccessExpression */) { + if (expr.operatorToken.kind !== 58 /* EqualsToken */ || expr.left.kind !== 179 /* PropertyAccessExpression */) { return 0 /* None */; } var lhs = expr.left; - if (lhs.expression.kind === 70 /* Identifier */) { + if (lhs.expression.kind === 71 /* Identifier */) { var lhsId = lhs.expression; if (lhsId.text === "exports") { // exports.name = expr @@ -7707,14 +7912,18 @@ var ts; // module.exports = expr return 2 /* ModuleExports */; } + else { + // F.x = expr + return 5 /* Property */; + } } - else if (lhs.expression.kind === 98 /* ThisKeyword */) { + else if (lhs.expression.kind === 99 /* ThisKeyword */) { return 4 /* ThisProperty */; } - else if (lhs.expression.kind === 177 /* PropertyAccessExpression */) { + else if (lhs.expression.kind === 179 /* PropertyAccessExpression */) { // chained dot, e.g. x.y.z = expr; this var is the 'x.y' part var innerPropertyAccess = lhs.expression; - if (innerPropertyAccess.expression.kind === 70 /* Identifier */) { + if (innerPropertyAccess.expression.kind === 71 /* Identifier */) { // module.exports.name = expr var innerPropertyAccessIdentifier = innerPropertyAccess.expression; if (innerPropertyAccessIdentifier.text === "module" && innerPropertyAccess.name.text === "exports") { @@ -7729,35 +7938,35 @@ var ts; } ts.getSpecialPropertyAssignmentKind = getSpecialPropertyAssignmentKind; function getExternalModuleName(node) { - if (node.kind === 235 /* ImportDeclaration */) { + if (node.kind === 238 /* ImportDeclaration */) { return node.moduleSpecifier; } - if (node.kind === 234 /* ImportEqualsDeclaration */) { + if (node.kind === 237 /* ImportEqualsDeclaration */) { var reference = node.moduleReference; - if (reference.kind === 245 /* ExternalModuleReference */) { + if (reference.kind === 248 /* ExternalModuleReference */) { return reference.expression; } } - if (node.kind === 241 /* ExportDeclaration */) { + if (node.kind === 244 /* ExportDeclaration */) { return node.moduleSpecifier; } - if (node.kind === 230 /* ModuleDeclaration */ && node.name.kind === 9 /* StringLiteral */) { + if (node.kind === 233 /* ModuleDeclaration */ && node.name.kind === 9 /* StringLiteral */) { return node.name; } } ts.getExternalModuleName = getExternalModuleName; function getNamespaceDeclarationNode(node) { - if (node.kind === 234 /* ImportEqualsDeclaration */) { + if (node.kind === 237 /* ImportEqualsDeclaration */) { return node; } var importClause = node.importClause; - if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 237 /* NamespaceImport */) { + if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 240 /* NamespaceImport */) { return importClause.namedBindings; } } ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode; function isDefaultImport(node) { - return node.kind === 235 /* ImportDeclaration */ + return node.kind === 238 /* ImportDeclaration */ && node.importClause && !!node.importClause.name; } @@ -7765,13 +7974,13 @@ var ts; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 144 /* Parameter */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 258 /* ShorthandPropertyAssignment */: - case 257 /* PropertyAssignment */: - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: + case 146 /* Parameter */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: + case 262 /* ShorthandPropertyAssignment */: + case 261 /* PropertyAssignment */: + case 149 /* PropertyDeclaration */: + case 148 /* PropertySignature */: return node.questionToken !== undefined; } } @@ -7779,28 +7988,36 @@ var ts; } ts.hasQuestionToken = hasQuestionToken; function isJSDocConstructSignature(node) { - return node.kind === 274 /* JSDocFunctionType */ && + return node.kind === 279 /* JSDocFunctionType */ && node.parameters.length > 0 && - node.parameters[0].type.kind === 276 /* JSDocConstructorType */; + node.parameters[0].type.kind === 281 /* JSDocConstructorType */; } ts.isJSDocConstructSignature = isJSDocConstructSignature; function getCommentsFromJSDoc(node) { return ts.map(getJSDocs(node), function (doc) { return doc.comment; }); } ts.getCommentsFromJSDoc = getCommentsFromJSDoc; + function hasJSDocParameterTags(node) { + var parameterTags = getJSDocTags(node, 286 /* JSDocParameterTag */); + return parameterTags && parameterTags.length > 0; + } + ts.hasJSDocParameterTags = hasJSDocParameterTags; function getJSDocTags(node, kind) { var docs = getJSDocs(node); if (docs) { var result = []; for (var _i = 0, docs_1 = docs; _i < docs_1.length; _i++) { var doc = docs_1[_i]; - if (doc.kind === 281 /* JSDocParameterTag */) { + if (doc.kind === 286 /* JSDocParameterTag */) { if (doc.kind === kind) { result.push(doc); } } else { - result.push.apply(result, ts.filter(doc.tags, function (tag) { return tag.kind === kind; })); + var tags = doc.tags; + if (tags) { + result.push.apply(result, ts.filter(tags, function (tag) { return tag.kind === kind; })); + } } } return result; @@ -7826,9 +8043,9 @@ var ts; // var x = function(name) { return name.length; } var isInitializerOfVariableDeclarationInStatement = isVariableLike(parent) && parent.initializer === node && - parent.parent.parent.kind === 205 /* VariableStatement */; + parent.parent.parent.kind === 208 /* VariableStatement */; var isVariableOfVariableDeclarationStatement = isVariableLike(node) && - parent.parent.kind === 205 /* VariableStatement */; + parent.parent.kind === 208 /* VariableStatement */; var variableStatementNode = isInitializerOfVariableDeclarationInStatement ? parent.parent.parent : isVariableOfVariableDeclarationStatement ? parent.parent : undefined; @@ -7837,20 +8054,20 @@ var ts; } // Also recognize when the node is the RHS of an assignment expression var isSourceOfAssignmentExpressionStatement = parent && parent.parent && - parent.kind === 192 /* BinaryExpression */ && - parent.operatorToken.kind === 57 /* EqualsToken */ && - parent.parent.kind === 207 /* ExpressionStatement */; + parent.kind === 194 /* BinaryExpression */ && + parent.operatorToken.kind === 58 /* EqualsToken */ && + parent.parent.kind === 210 /* ExpressionStatement */; if (isSourceOfAssignmentExpressionStatement) { getJSDocsWorker(parent.parent); } - var isModuleDeclaration = node.kind === 230 /* ModuleDeclaration */ && - parent && parent.kind === 230 /* ModuleDeclaration */; - var isPropertyAssignmentExpression = parent && parent.kind === 257 /* PropertyAssignment */; + var isModuleDeclaration = node.kind === 233 /* ModuleDeclaration */ && + parent && parent.kind === 233 /* ModuleDeclaration */; + var isPropertyAssignmentExpression = parent && parent.kind === 261 /* PropertyAssignment */; if (isModuleDeclaration || isPropertyAssignmentExpression) { getJSDocsWorker(parent); } // Pull parameter comments from declaring function as well - if (node.kind === 144 /* Parameter */) { + if (node.kind === 146 /* Parameter */) { cache = ts.concatenate(cache, getJSDocParameterTags(node)); } if (isVariableLike(node) && node.initializer) { @@ -7865,18 +8082,18 @@ var ts; return undefined; } var func = param.parent; - var tags = getJSDocTags(func, 281 /* JSDocParameterTag */); + var tags = getJSDocTags(func, 286 /* JSDocParameterTag */); if (!param.name) { // this is an anonymous jsdoc param from a `function(type1, type2): type3` specification var i = func.parameters.indexOf(param); - var paramTags = ts.filter(tags, function (tag) { return tag.kind === 281 /* JSDocParameterTag */; }); + var paramTags = ts.filter(tags, function (tag) { return tag.kind === 286 /* JSDocParameterTag */; }); if (paramTags && 0 <= i && i < paramTags.length) { return [paramTags[i]]; } } - else if (param.name.kind === 70 /* Identifier */) { - var name_6 = param.name.text; - return ts.filter(tags, function (tag) { return tag.kind === 281 /* JSDocParameterTag */ && tag.parameterName.text === name_6; }); + else if (param.name.kind === 71 /* Identifier */) { + var name_1 = param.name.text; + return ts.filter(tags, function (tag) { return tag.kind === 286 /* JSDocParameterTag */ && tag.parameterName.text === name_1; }); } else { // TODO: it's a destructured parameter, so it should look up an "object type" series of multiple lines @@ -7886,8 +8103,8 @@ var ts; } ts.getJSDocParameterTags = getJSDocParameterTags; function getJSDocType(node) { - var tag = getFirstJSDocTag(node, 283 /* JSDocTypeTag */); - if (!tag && node.kind === 144 /* Parameter */) { + var tag = getFirstJSDocTag(node, 288 /* JSDocTypeTag */); + if (!tag && node.kind === 146 /* Parameter */) { var paramTags = getJSDocParameterTags(node); if (paramTags) { tag = ts.find(paramTags, function (tag) { return !!tag.typeExpression; }); @@ -7897,15 +8114,15 @@ var ts; } ts.getJSDocType = getJSDocType; function getJSDocAugmentsTag(node) { - return getFirstJSDocTag(node, 280 /* JSDocAugmentsTag */); + return getFirstJSDocTag(node, 285 /* JSDocAugmentsTag */); } ts.getJSDocAugmentsTag = getJSDocAugmentsTag; function getJSDocReturnTag(node) { - return getFirstJSDocTag(node, 282 /* JSDocReturnTag */); + return getFirstJSDocTag(node, 287 /* JSDocReturnTag */); } ts.getJSDocReturnTag = getJSDocReturnTag; function getJSDocTemplateTag(node) { - return getFirstJSDocTag(node, 284 /* JSDocTemplateTag */); + return getFirstJSDocTag(node, 289 /* JSDocTemplateTag */); } ts.getJSDocTemplateTag = getJSDocTemplateTag; function hasRestParameter(s) { @@ -7918,8 +8135,8 @@ var ts; ts.hasDeclaredRestParameter = hasDeclaredRestParameter; function isRestParameter(node) { if (node && (node.flags & 65536 /* JavaScriptFile */)) { - if (node.type && node.type.kind === 275 /* JSDocVariadicType */ || - ts.forEach(getJSDocParameterTags(node), function (t) { return t.typeExpression && t.typeExpression.type.kind === 275 /* JSDocVariadicType */; })) { + if (node.type && node.type.kind === 280 /* JSDocVariadicType */ || + ts.forEach(getJSDocParameterTags(node), function (t) { return t.typeExpression && t.typeExpression.type.kind === 280 /* JSDocVariadicType */; })) { return true; } } @@ -7940,29 +8157,33 @@ var ts; var parent = node.parent; while (true) { switch (parent.kind) { - case 192 /* BinaryExpression */: + case 194 /* BinaryExpression */: var binaryOperator = parent.operatorToken.kind; return isAssignmentOperator(binaryOperator) && parent.left === node ? - binaryOperator === 57 /* EqualsToken */ ? 1 /* Definite */ : 2 /* Compound */ : + binaryOperator === 58 /* EqualsToken */ ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */; - case 190 /* PrefixUnaryExpression */: - case 191 /* PostfixUnaryExpression */: + case 192 /* PrefixUnaryExpression */: + case 193 /* PostfixUnaryExpression */: var unaryOperator = parent.operator; - return unaryOperator === 42 /* PlusPlusToken */ || unaryOperator === 43 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */; - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: + return unaryOperator === 43 /* PlusPlusToken */ || unaryOperator === 44 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */; + case 215 /* ForInStatement */: + case 216 /* ForOfStatement */: return parent.initializer === node ? 1 /* Definite */ : 0 /* None */; - case 183 /* ParenthesizedExpression */: - case 175 /* ArrayLiteralExpression */: - case 196 /* SpreadElement */: + case 185 /* ParenthesizedExpression */: + case 177 /* ArrayLiteralExpression */: + case 198 /* SpreadElement */: node = parent; break; - case 258 /* ShorthandPropertyAssignment */: + case 262 /* ShorthandPropertyAssignment */: if (parent.name !== node) { return 0 /* None */; } - // Fall through - case 257 /* PropertyAssignment */: + node = parent.parent; + break; + case 261 /* PropertyAssignment */: + if (parent.name === node) { + return 0 /* None */; + } node = parent.parent; break; default: @@ -7974,11 +8195,24 @@ var ts; ts.getAssignmentTargetKind = getAssignmentTargetKind; // A node is an assignment target if it is on the left hand side of an '=' token, if it is parented by a property // assignment in an object literal that is an assignment target, or if it is parented by an array literal that is - // an assignment target. Examples include 'a = xxx', '{ p: a } = xxx', '[{ p: a}] = xxx'. + // an assignment target. Examples include 'a = xxx', '{ p: a } = xxx', '[{ a }] = xxx'. + // (Note that `p` is not a target in the above examples, only `a`.) function isAssignmentTarget(node) { return getAssignmentTargetKind(node) !== 0 /* None */; } ts.isAssignmentTarget = isAssignmentTarget; + // a node is delete target iff. it is PropertyAccessExpression/ElementAccessExpression with parentheses skipped + function isDeleteTarget(node) { + if (node.kind !== 179 /* PropertyAccessExpression */ && node.kind !== 180 /* ElementAccessExpression */) { + return false; + } + node = node.parent; + while (node && node.kind === 185 /* ParenthesizedExpression */) { + node = node.parent; + } + return node && node.kind === 188 /* DeleteExpression */; + } + ts.isDeleteTarget = isDeleteTarget; function isNodeDescendantOf(node, ancestor) { while (node) { if (node === ancestor) @@ -7990,7 +8224,7 @@ var ts; ts.isNodeDescendantOf = isNodeDescendantOf; function isInAmbientContext(node) { while (node) { - if (hasModifier(node, 2 /* Ambient */) || (node.kind === 261 /* SourceFile */ && node.isDeclarationFile)) { + if (hasModifier(node, 2 /* Ambient */) || (node.kind === 265 /* SourceFile */ && node.isDeclarationFile)) { return true; } node = node.parent; @@ -8000,11 +8234,11 @@ var ts; ts.isInAmbientContext = isInAmbientContext; // True if the given identifier, string literal, or number literal is the name of a declaration node function isDeclarationName(name) { - if (name.kind !== 70 /* Identifier */ && name.kind !== 9 /* StringLiteral */ && name.kind !== 8 /* NumericLiteral */) { + if (name.kind !== 71 /* Identifier */ && name.kind !== 9 /* StringLiteral */ && name.kind !== 8 /* NumericLiteral */) { return false; } var parent = name.parent; - if (parent.kind === 239 /* ImportSpecifier */ || parent.kind === 243 /* ExportSpecifier */) { + if (parent.kind === 242 /* ImportSpecifier */ || parent.kind === 246 /* ExportSpecifier */) { if (parent.propertyName) { return true; } @@ -8015,9 +8249,39 @@ var ts; return false; } ts.isDeclarationName = isDeclarationName; + function getNameOfDeclaration(declaration) { + if (!declaration) { + return undefined; + } + if (declaration.kind === 194 /* BinaryExpression */) { + var kind = getSpecialPropertyAssignmentKind(declaration); + var lhs = declaration.left; + switch (kind) { + case 0 /* None */: + case 2 /* ModuleExports */: + return undefined; + case 1 /* ExportsProperty */: + if (lhs.kind === 71 /* Identifier */) { + return lhs.name; + } + else { + return lhs.expression.name; + } + case 4 /* ThisProperty */: + case 5 /* Property */: + return lhs.name; + case 3 /* PrototypeProperty */: + return lhs.expression.name; + } + } + else { + return declaration.name; + } + } + ts.getNameOfDeclaration = getNameOfDeclaration; function isLiteralComputedPropertyDeclarationName(node) { return (node.kind === 9 /* StringLiteral */ || node.kind === 8 /* NumericLiteral */) && - node.parent.kind === 142 /* ComputedPropertyName */ && + node.parent.kind === 144 /* ComputedPropertyName */ && isDeclaration(node.parent.parent); } ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName; @@ -8025,31 +8289,31 @@ var ts; function isIdentifierName(node) { var parent = node.parent; switch (parent.kind) { - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 260 /* EnumMember */: - case 257 /* PropertyAssignment */: - case 177 /* PropertyAccessExpression */: + case 149 /* PropertyDeclaration */: + case 148 /* PropertySignature */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + case 264 /* EnumMember */: + case 261 /* PropertyAssignment */: + case 179 /* PropertyAccessExpression */: // Name in member declaration or property name in property access return parent.name === node; - case 141 /* QualifiedName */: + case 143 /* QualifiedName */: // Name on right hand side of dot in a type query if (parent.right === node) { - while (parent.kind === 141 /* QualifiedName */) { + while (parent.kind === 143 /* QualifiedName */) { parent = parent.parent; } - return parent.kind === 160 /* TypeQuery */; + return parent.kind === 162 /* TypeQuery */; } return false; - case 174 /* BindingElement */: - case 239 /* ImportSpecifier */: + case 176 /* BindingElement */: + case 242 /* ImportSpecifier */: // Property name in binding element or import specifier return parent.propertyName === node; - case 243 /* ExportSpecifier */: + case 246 /* ExportSpecifier */: // Any name in an export specifier return true; } @@ -8065,13 +8329,13 @@ var ts; // export = // export default function isAliasSymbolDeclaration(node) { - return node.kind === 234 /* ImportEqualsDeclaration */ || - node.kind === 233 /* NamespaceExportDeclaration */ || - node.kind === 236 /* ImportClause */ && !!node.name || - node.kind === 237 /* NamespaceImport */ || - node.kind === 239 /* ImportSpecifier */ || - node.kind === 243 /* ExportSpecifier */ || - node.kind === 240 /* ExportAssignment */ && exportAssignmentIsAlias(node); + return node.kind === 237 /* ImportEqualsDeclaration */ || + node.kind === 236 /* NamespaceExportDeclaration */ || + node.kind === 239 /* ImportClause */ && !!node.name || + node.kind === 240 /* NamespaceImport */ || + node.kind === 242 /* ImportSpecifier */ || + node.kind === 246 /* ExportSpecifier */ || + node.kind === 243 /* ExportAssignment */ && exportAssignmentIsAlias(node); } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function exportAssignmentIsAlias(node) { @@ -8079,17 +8343,17 @@ var ts; } ts.exportAssignmentIsAlias = exportAssignmentIsAlias; function getClassExtendsHeritageClauseElement(node) { - var heritageClause = getHeritageClause(node.heritageClauses, 84 /* ExtendsKeyword */); + var heritageClause = getHeritageClause(node.heritageClauses, 85 /* ExtendsKeyword */); return heritageClause && heritageClause.types.length > 0 ? heritageClause.types[0] : undefined; } ts.getClassExtendsHeritageClauseElement = getClassExtendsHeritageClauseElement; function getClassImplementsHeritageClauseElements(node) { - var heritageClause = getHeritageClause(node.heritageClauses, 107 /* ImplementsKeyword */); + var heritageClause = getHeritageClause(node.heritageClauses, 108 /* ImplementsKeyword */); return heritageClause ? heritageClause.types : undefined; } ts.getClassImplementsHeritageClauseElements = getClassImplementsHeritageClauseElements; function getInterfaceBaseTypeNodes(node) { - var heritageClause = getHeritageClause(node.heritageClauses, 84 /* ExtendsKeyword */); + var heritageClause = getHeritageClause(node.heritageClauses, 85 /* ExtendsKeyword */); return heritageClause ? heritageClause.types : undefined; } ts.getInterfaceBaseTypeNodes = getInterfaceBaseTypeNodes; @@ -8157,17 +8421,63 @@ var ts; } ts.getFileReferenceFromReferencePath = getFileReferenceFromReferencePath; function isKeyword(token) { - return 71 /* FirstKeyword */ <= token && token <= 140 /* LastKeyword */; + return 72 /* FirstKeyword */ <= token && token <= 142 /* LastKeyword */; } ts.isKeyword = isKeyword; function isTrivia(token) { return 2 /* FirstTriviaToken */ <= token && token <= 7 /* LastTriviaToken */; } ts.isTrivia = isTrivia; - function isAsyncFunctionLike(node) { - return isFunctionLike(node) && hasModifier(node, 256 /* Async */) && !isAccessor(node); + var FunctionFlags; + (function (FunctionFlags) { + FunctionFlags[FunctionFlags["Normal"] = 0] = "Normal"; + FunctionFlags[FunctionFlags["Generator"] = 1] = "Generator"; + FunctionFlags[FunctionFlags["Async"] = 2] = "Async"; + FunctionFlags[FunctionFlags["Invalid"] = 4] = "Invalid"; + FunctionFlags[FunctionFlags["AsyncGenerator"] = 3] = "AsyncGenerator"; + })(FunctionFlags = ts.FunctionFlags || (ts.FunctionFlags = {})); + function getFunctionFlags(node) { + if (!node) { + return 4 /* Invalid */; + } + var flags = 0 /* Normal */; + switch (node.kind) { + case 228 /* FunctionDeclaration */: + case 186 /* FunctionExpression */: + case 151 /* MethodDeclaration */: + if (node.asteriskToken) { + flags |= 1 /* Generator */; + } + // falls through + case 187 /* ArrowFunction */: + if (hasModifier(node, 256 /* Async */)) { + flags |= 2 /* Async */; + } + break; + } + if (!node.body) { + flags |= 4 /* Invalid */; + } + return flags; } - ts.isAsyncFunctionLike = isAsyncFunctionLike; + ts.getFunctionFlags = getFunctionFlags; + function isAsyncFunction(node) { + switch (node.kind) { + case 228 /* FunctionDeclaration */: + case 186 /* FunctionExpression */: + case 187 /* ArrowFunction */: + case 151 /* MethodDeclaration */: + return node.body !== undefined + && node.asteriskToken === undefined + && hasModifier(node, 256 /* Async */); + } + return false; + } + ts.isAsyncFunction = isAsyncFunction; + function isNumericLiteral(node) { + return node.kind === 8 /* NumericLiteral */; + } + ts.isNumericLiteral = isNumericLiteral; function isStringOrNumericLiteral(node) { var kind = node.kind; return kind === 9 /* StringLiteral */ @@ -8182,11 +8492,12 @@ var ts; * Symbol. */ function hasDynamicName(declaration) { - return declaration.name && isDynamicName(declaration.name); + var name = getNameOfDeclaration(declaration); + return name && isDynamicName(name); } ts.hasDynamicName = hasDynamicName; function isDynamicName(name) { - return name.kind === 142 /* ComputedPropertyName */ && + return name.kind === 144 /* ComputedPropertyName */ && !isStringOrNumericLiteral(name.expression) && !isWellKnownSymbolSyntactically(name.expression); } @@ -8201,10 +8512,10 @@ var ts; } ts.isWellKnownSymbolSyntactically = isWellKnownSymbolSyntactically; function getPropertyNameForPropertyNameNode(name) { - if (name.kind === 70 /* Identifier */ || name.kind === 9 /* StringLiteral */ || name.kind === 8 /* NumericLiteral */ || name.kind === 144 /* Parameter */) { + if (name.kind === 71 /* Identifier */ || name.kind === 9 /* StringLiteral */ || name.kind === 8 /* NumericLiteral */ || name.kind === 146 /* Parameter */) { return name.text; } - if (name.kind === 142 /* ComputedPropertyName */) { + if (name.kind === 144 /* ComputedPropertyName */) { var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { var rightHandSideName = nameExpression.name.text; @@ -8225,7 +8536,7 @@ var ts; * Includes the word "Symbol" with unicode escapes */ function isESSymbolIdentifier(node) { - return node.kind === 70 /* Identifier */ && node.text === "Symbol"; + return node.kind === 71 /* Identifier */ && node.text === "Symbol"; } ts.isESSymbolIdentifier = isESSymbolIdentifier; function isPushOrUnshiftIdentifier(node) { @@ -8234,17 +8545,17 @@ var ts; ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier; function isModifierKind(token) { switch (token) { - case 116 /* AbstractKeyword */: - case 119 /* AsyncKeyword */: - case 75 /* ConstKeyword */: - case 123 /* DeclareKeyword */: - case 78 /* DefaultKeyword */: - case 83 /* ExportKeyword */: - case 113 /* PublicKeyword */: - case 111 /* PrivateKeyword */: - case 112 /* ProtectedKeyword */: - case 130 /* ReadonlyKeyword */: - case 114 /* StaticKeyword */: + case 117 /* AbstractKeyword */: + case 120 /* AsyncKeyword */: + case 76 /* ConstKeyword */: + case 124 /* DeclareKeyword */: + case 79 /* DefaultKeyword */: + case 84 /* ExportKeyword */: + case 114 /* PublicKeyword */: + case 112 /* PrivateKeyword */: + case 113 /* ProtectedKeyword */: + case 131 /* ReadonlyKeyword */: + case 115 /* StaticKeyword */: return true; } return false; @@ -8252,11 +8563,11 @@ var ts; ts.isModifierKind = isModifierKind; function isParameterDeclaration(node) { var root = getRootDeclaration(node); - return root.kind === 144 /* Parameter */; + return root.kind === 146 /* Parameter */; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 174 /* BindingElement */) { + while (node.kind === 176 /* BindingElement */) { node = node.parent.parent; } return node; @@ -8264,15 +8575,15 @@ var ts; ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(node) { var kind = node.kind; - return kind === 150 /* Constructor */ - || kind === 184 /* FunctionExpression */ - || kind === 225 /* FunctionDeclaration */ - || kind === 185 /* ArrowFunction */ - || kind === 149 /* MethodDeclaration */ - || kind === 151 /* GetAccessor */ - || kind === 152 /* SetAccessor */ - || kind === 230 /* ModuleDeclaration */ - || kind === 261 /* SourceFile */; + return kind === 152 /* Constructor */ + || kind === 186 /* FunctionExpression */ + || kind === 228 /* FunctionDeclaration */ + || kind === 187 /* ArrowFunction */ + || kind === 151 /* MethodDeclaration */ + || kind === 153 /* GetAccessor */ + || kind === 154 /* SetAccessor */ + || kind === 233 /* ModuleDeclaration */ + || kind === 265 /* SourceFile */; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(node) { @@ -8280,49 +8591,22 @@ var ts; || ts.positionIsSynthesized(node.end); } ts.nodeIsSynthesized = nodeIsSynthesized; - function getOriginalNode(node, nodeTest) { - if (node) { - while (node.original !== undefined) { - node = node.original; - } + function getOriginalSourceFileOrBundle(sourceFileOrBundle) { + if (sourceFileOrBundle.kind === 266 /* Bundle */) { + return ts.updateBundle(sourceFileOrBundle, ts.sameMap(sourceFileOrBundle.sourceFiles, getOriginalSourceFile)); } - return !nodeTest || nodeTest(node) ? node : undefined; + return getOriginalSourceFile(sourceFileOrBundle); } - ts.getOriginalNode = getOriginalNode; - /** - * Gets a value indicating whether a node originated in the parse tree. - * - * @param node The node to test. - */ - function isParseTreeNode(node) { - return (node.flags & 8 /* Synthesized */) === 0; + ts.getOriginalSourceFileOrBundle = getOriginalSourceFileOrBundle; + function getOriginalSourceFile(sourceFile) { + return ts.getParseTreeNode(sourceFile, isSourceFile) || sourceFile; } - ts.isParseTreeNode = isParseTreeNode; - function getParseTreeNode(node, nodeTest) { - if (isParseTreeNode(node)) { - return node; - } - node = getOriginalNode(node); - if (isParseTreeNode(node) && (!nodeTest || nodeTest(node))) { - return node; - } - return undefined; - } - ts.getParseTreeNode = getParseTreeNode; function getOriginalSourceFiles(sourceFiles) { - var originalSourceFiles = []; - for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) { - var sourceFile = sourceFiles_1[_i]; - var originalSourceFile = getParseTreeNode(sourceFile, isSourceFile); - if (originalSourceFile) { - originalSourceFiles.push(originalSourceFile); - } - } - return originalSourceFiles; + return ts.sameMap(sourceFiles, getOriginalSourceFile); } ts.getOriginalSourceFiles = getOriginalSourceFiles; function getOriginalNodeId(node) { - node = getOriginalNode(node); + node = ts.getOriginalNode(node); return node ? ts.getNodeId(node) : 0; } ts.getOriginalNodeId = getOriginalNodeId; @@ -8333,38 +8617,38 @@ var ts; })(Associativity = ts.Associativity || (ts.Associativity = {})); function getExpressionAssociativity(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 180 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 182 /* NewExpression */ && expression.arguments !== undefined; return getOperatorAssociativity(expression.kind, operator, hasArguments); } ts.getExpressionAssociativity = getExpressionAssociativity; function getOperatorAssociativity(kind, operator, hasArguments) { switch (kind) { - case 180 /* NewExpression */: + case 182 /* NewExpression */: return hasArguments ? 0 /* Left */ : 1 /* Right */; - case 190 /* PrefixUnaryExpression */: - case 187 /* TypeOfExpression */: - case 188 /* VoidExpression */: - case 186 /* DeleteExpression */: - case 189 /* AwaitExpression */: - case 193 /* ConditionalExpression */: - case 195 /* YieldExpression */: + case 192 /* PrefixUnaryExpression */: + case 189 /* TypeOfExpression */: + case 190 /* VoidExpression */: + case 188 /* DeleteExpression */: + case 191 /* AwaitExpression */: + case 195 /* ConditionalExpression */: + case 197 /* YieldExpression */: return 1 /* Right */; - case 192 /* BinaryExpression */: + case 194 /* BinaryExpression */: switch (operator) { - case 39 /* AsteriskAsteriskToken */: - case 57 /* EqualsToken */: - case 58 /* PlusEqualsToken */: - case 59 /* MinusEqualsToken */: - case 61 /* AsteriskAsteriskEqualsToken */: - case 60 /* AsteriskEqualsToken */: - case 62 /* SlashEqualsToken */: - case 63 /* PercentEqualsToken */: - case 64 /* LessThanLessThanEqualsToken */: - case 65 /* GreaterThanGreaterThanEqualsToken */: - case 66 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - case 67 /* AmpersandEqualsToken */: - case 69 /* CaretEqualsToken */: - case 68 /* BarEqualsToken */: + case 40 /* AsteriskAsteriskToken */: + case 58 /* EqualsToken */: + case 59 /* PlusEqualsToken */: + case 60 /* MinusEqualsToken */: + case 62 /* AsteriskAsteriskEqualsToken */: + case 61 /* AsteriskEqualsToken */: + case 63 /* SlashEqualsToken */: + case 64 /* PercentEqualsToken */: + case 65 /* LessThanLessThanEqualsToken */: + case 66 /* GreaterThanGreaterThanEqualsToken */: + case 67 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 68 /* AmpersandEqualsToken */: + case 70 /* CaretEqualsToken */: + case 69 /* BarEqualsToken */: return 1 /* Right */; } } @@ -8373,15 +8657,15 @@ var ts; ts.getOperatorAssociativity = getOperatorAssociativity; function getExpressionPrecedence(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 180 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 182 /* NewExpression */ && expression.arguments !== undefined; return getOperatorPrecedence(expression.kind, operator, hasArguments); } ts.getExpressionPrecedence = getExpressionPrecedence; function getOperator(expression) { - if (expression.kind === 192 /* BinaryExpression */) { + if (expression.kind === 194 /* BinaryExpression */) { return expression.operatorToken.kind; } - else if (expression.kind === 190 /* PrefixUnaryExpression */ || expression.kind === 191 /* PostfixUnaryExpression */) { + else if (expression.kind === 192 /* PrefixUnaryExpression */ || expression.kind === 193 /* PostfixUnaryExpression */) { return expression.operator; } else { @@ -8391,106 +8675,106 @@ var ts; ts.getOperator = getOperator; function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { switch (nodeKind) { - case 98 /* ThisKeyword */: - case 96 /* SuperKeyword */: - case 70 /* Identifier */: - case 94 /* NullKeyword */: - case 100 /* TrueKeyword */: - case 85 /* FalseKeyword */: + case 99 /* ThisKeyword */: + case 97 /* SuperKeyword */: + case 71 /* Identifier */: + case 95 /* NullKeyword */: + case 101 /* TrueKeyword */: + case 86 /* FalseKeyword */: case 8 /* NumericLiteral */: case 9 /* StringLiteral */: - case 175 /* ArrayLiteralExpression */: - case 176 /* ObjectLiteralExpression */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - case 197 /* ClassExpression */: - case 246 /* JsxElement */: - case 247 /* JsxSelfClosingElement */: - case 11 /* RegularExpressionLiteral */: - case 12 /* NoSubstitutionTemplateLiteral */: - case 194 /* TemplateExpression */: - case 183 /* ParenthesizedExpression */: - case 198 /* OmittedExpression */: + case 177 /* ArrayLiteralExpression */: + case 178 /* ObjectLiteralExpression */: + case 186 /* FunctionExpression */: + case 187 /* ArrowFunction */: + case 199 /* ClassExpression */: + case 249 /* JsxElement */: + case 250 /* JsxSelfClosingElement */: + case 12 /* RegularExpressionLiteral */: + case 13 /* NoSubstitutionTemplateLiteral */: + case 196 /* TemplateExpression */: + case 185 /* ParenthesizedExpression */: + case 200 /* OmittedExpression */: return 19; - case 181 /* TaggedTemplateExpression */: - case 177 /* PropertyAccessExpression */: - case 178 /* ElementAccessExpression */: + case 183 /* TaggedTemplateExpression */: + case 179 /* PropertyAccessExpression */: + case 180 /* ElementAccessExpression */: return 18; - case 180 /* NewExpression */: + case 182 /* NewExpression */: return hasArguments ? 18 : 17; - case 179 /* CallExpression */: + case 181 /* CallExpression */: return 17; - case 191 /* PostfixUnaryExpression */: + case 193 /* PostfixUnaryExpression */: return 16; - case 190 /* PrefixUnaryExpression */: - case 187 /* TypeOfExpression */: - case 188 /* VoidExpression */: - case 186 /* DeleteExpression */: - case 189 /* AwaitExpression */: + case 192 /* PrefixUnaryExpression */: + case 189 /* TypeOfExpression */: + case 190 /* VoidExpression */: + case 188 /* DeleteExpression */: + case 191 /* AwaitExpression */: return 15; - case 192 /* BinaryExpression */: + case 194 /* BinaryExpression */: switch (operatorKind) { - case 50 /* ExclamationToken */: - case 51 /* TildeToken */: + case 51 /* ExclamationToken */: + case 52 /* TildeToken */: return 15; - case 39 /* AsteriskAsteriskToken */: - case 38 /* AsteriskToken */: - case 40 /* SlashToken */: - case 41 /* PercentToken */: + case 40 /* AsteriskAsteriskToken */: + case 39 /* AsteriskToken */: + case 41 /* SlashToken */: + case 42 /* PercentToken */: return 14; - case 36 /* PlusToken */: - case 37 /* MinusToken */: + case 37 /* PlusToken */: + case 38 /* MinusToken */: return 13; - case 44 /* LessThanLessThanToken */: - case 45 /* GreaterThanGreaterThanToken */: - case 46 /* GreaterThanGreaterThanGreaterThanToken */: + case 45 /* LessThanLessThanToken */: + case 46 /* GreaterThanGreaterThanToken */: + case 47 /* GreaterThanGreaterThanGreaterThanToken */: return 12; - case 26 /* LessThanToken */: - case 29 /* LessThanEqualsToken */: - case 28 /* GreaterThanToken */: - case 30 /* GreaterThanEqualsToken */: - case 91 /* InKeyword */: - case 92 /* InstanceOfKeyword */: + case 27 /* LessThanToken */: + case 30 /* LessThanEqualsToken */: + case 29 /* GreaterThanToken */: + case 31 /* GreaterThanEqualsToken */: + case 92 /* InKeyword */: + case 93 /* InstanceOfKeyword */: return 11; - case 31 /* EqualsEqualsToken */: - case 33 /* EqualsEqualsEqualsToken */: - case 32 /* ExclamationEqualsToken */: - case 34 /* ExclamationEqualsEqualsToken */: + case 32 /* EqualsEqualsToken */: + case 34 /* EqualsEqualsEqualsToken */: + case 33 /* ExclamationEqualsToken */: + case 35 /* ExclamationEqualsEqualsToken */: return 10; - case 47 /* AmpersandToken */: + case 48 /* AmpersandToken */: return 9; - case 49 /* CaretToken */: + case 50 /* CaretToken */: return 8; - case 48 /* BarToken */: + case 49 /* BarToken */: return 7; - case 52 /* AmpersandAmpersandToken */: + case 53 /* AmpersandAmpersandToken */: return 6; - case 53 /* BarBarToken */: + case 54 /* BarBarToken */: return 5; - case 57 /* EqualsToken */: - case 58 /* PlusEqualsToken */: - case 59 /* MinusEqualsToken */: - case 61 /* AsteriskAsteriskEqualsToken */: - case 60 /* AsteriskEqualsToken */: - case 62 /* SlashEqualsToken */: - case 63 /* PercentEqualsToken */: - case 64 /* LessThanLessThanEqualsToken */: - case 65 /* GreaterThanGreaterThanEqualsToken */: - case 66 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - case 67 /* AmpersandEqualsToken */: - case 69 /* CaretEqualsToken */: - case 68 /* BarEqualsToken */: + case 58 /* EqualsToken */: + case 59 /* PlusEqualsToken */: + case 60 /* MinusEqualsToken */: + case 62 /* AsteriskAsteriskEqualsToken */: + case 61 /* AsteriskEqualsToken */: + case 63 /* SlashEqualsToken */: + case 64 /* PercentEqualsToken */: + case 65 /* LessThanLessThanEqualsToken */: + case 66 /* GreaterThanGreaterThanEqualsToken */: + case 67 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 68 /* AmpersandEqualsToken */: + case 70 /* CaretEqualsToken */: + case 69 /* BarEqualsToken */: return 3; - case 25 /* CommaToken */: + case 26 /* CommaToken */: return 0; default: return -1; } - case 193 /* ConditionalExpression */: + case 195 /* ConditionalExpression */: return 4; - case 195 /* YieldExpression */: + case 197 /* YieldExpression */: return 2; - case 196 /* SpreadElement */: + case 198 /* SpreadElement */: return 1; default: return -1; @@ -8513,21 +8797,15 @@ var ts; return modificationCount; } function reattachFileDiagnostics(newFile) { - if (!ts.hasProperty(fileDiagnostics, newFile.fileName)) { - return; - } - for (var _i = 0, _a = fileDiagnostics[newFile.fileName]; _i < _a.length; _i++) { - var diagnostic = _a[_i]; - diagnostic.file = newFile; - } + ts.forEach(fileDiagnostics.get(newFile.fileName), function (diagnostic) { return diagnostic.file = newFile; }); } function add(diagnostic) { var diagnostics; if (diagnostic.file) { - diagnostics = fileDiagnostics[diagnostic.file.fileName]; + diagnostics = fileDiagnostics.get(diagnostic.file.fileName); if (!diagnostics) { diagnostics = []; - fileDiagnostics[diagnostic.file.fileName] = diagnostics; + fileDiagnostics.set(diagnostic.file.fileName, diagnostics); } } else { @@ -8544,16 +8822,16 @@ var ts; function getDiagnostics(fileName) { sortAndDeduplicate(); if (fileName) { - return fileDiagnostics[fileName] || []; + return fileDiagnostics.get(fileName) || []; } var allDiagnostics = []; function pushDiagnostic(d) { allDiagnostics.push(d); } ts.forEach(nonFileDiagnostics, pushDiagnostic); - for (var key in fileDiagnostics) { - ts.forEach(fileDiagnostics[key], pushDiagnostic); - } + fileDiagnostics.forEach(function (diagnostics) { + ts.forEach(diagnostics, pushDiagnostic); + }); return ts.sortAndDeduplicateDiagnostics(allDiagnostics); } function sortAndDeduplicate() { @@ -8562,9 +8840,9 @@ var ts; } diagnosticsModified = false; nonFileDiagnostics = ts.sortAndDeduplicateDiagnostics(nonFileDiagnostics); - for (var key in fileDiagnostics) { - fileDiagnostics[key] = ts.sortAndDeduplicateDiagnostics(fileDiagnostics[key]); - } + fileDiagnostics.forEach(function (diagnostics, key) { + fileDiagnostics.set(key, ts.sortAndDeduplicateDiagnostics(diagnostics)); + }); } } ts.createDiagnosticCollection = createDiagnosticCollection; @@ -8574,7 +8852,7 @@ var ts; // the map below must be updated. Note that this regexp *does not* include the 'delete' character. // There is no reason for this other than that JSON.stringify does not handle it either. var escapedCharsRegExp = /[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; - var escapedCharsMap = ts.createMap({ + var escapedCharsMap = ts.createMapFromTemplate({ "\0": "\\0", "\t": "\\t", "\v": "\\v", @@ -8598,7 +8876,7 @@ var ts; } ts.escapeString = escapeString; function getReplacement(c) { - return escapedCharsMap[c] || get16BitUnicodeEscapeSequence(c.charCodeAt(0)); + return escapedCharsMap.get(c) || get16BitUnicodeEscapeSequence(c.charCodeAt(0)); } function isIntrinsicJsxName(name) { var ch = name.substr(0, 1); @@ -8756,168 +9034,77 @@ var ts; */ function getSourceFilesToEmit(host, targetSourceFile) { var options = host.getCompilerOptions(); + var isSourceFileFromExternalLibrary = function (file) { return host.isSourceFileFromExternalLibrary(file); }; if (options.outFile || options.out) { var moduleKind = ts.getEmitModuleKind(options); - var moduleEmitEnabled = moduleKind === ts.ModuleKind.AMD || moduleKind === ts.ModuleKind.System; - var sourceFiles = getAllEmittableSourceFiles(); + var moduleEmitEnabled_1 = moduleKind === ts.ModuleKind.AMD || moduleKind === ts.ModuleKind.System; // Can emit only sources that are not declaration file and are either non module code or module with --module or --target es6 specified - return ts.filter(sourceFiles, moduleEmitEnabled ? isNonDeclarationFile : isBundleEmitNonExternalModule); + return ts.filter(host.getSourceFiles(), function (sourceFile) { + return (moduleEmitEnabled_1 || !ts.isExternalModule(sourceFile)) && sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary); + }); } else { - var sourceFiles = targetSourceFile === undefined ? getAllEmittableSourceFiles() : [targetSourceFile]; - return filterSourceFilesInDirectory(sourceFiles, function (file) { return host.isSourceFileFromExternalLibrary(file); }); - } - function getAllEmittableSourceFiles() { - return options.noEmitForJsFiles ? ts.filter(host.getSourceFiles(), function (sourceFile) { return !isSourceFileJavaScript(sourceFile); }) : host.getSourceFiles(); + var sourceFiles = targetSourceFile === undefined ? host.getSourceFiles() : [targetSourceFile]; + return ts.filter(sourceFiles, function (sourceFile) { return sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary); }); } } ts.getSourceFilesToEmit = getSourceFilesToEmit; - /** Don't call this for `--outFile`, just for `--outDir` or plain emit. */ - function filterSourceFilesInDirectory(sourceFiles, isSourceFileFromExternalLibrary) { - return ts.filter(sourceFiles, function (file) { return shouldEmitInDirectory(file, isSourceFileFromExternalLibrary); }); - } - ts.filterSourceFilesInDirectory = filterSourceFilesInDirectory; - function isNonDeclarationFile(sourceFile) { - return !isDeclarationFile(sourceFile); + /** Don't call this for `--outFile`, just for `--outDir` or plain emit. `--outFile` needs additional checks. */ + function sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary) { + return !(options.noEmitForJsFiles && isSourceFileJavaScript(sourceFile)) && !isDeclarationFile(sourceFile) && !isSourceFileFromExternalLibrary(sourceFile); } + ts.sourceFileMayBeEmitted = sourceFileMayBeEmitted; /** - * Whether a file should be emitted in a non-`--outFile` case. - * Don't emit if source file is a declaration file, or was located under node_modules - */ - function shouldEmitInDirectory(sourceFile, isSourceFileFromExternalLibrary) { - return isNonDeclarationFile(sourceFile) && !isSourceFileFromExternalLibrary(sourceFile); - } - function isBundleEmitNonExternalModule(sourceFile) { - return isNonDeclarationFile(sourceFile) && !ts.isExternalModule(sourceFile); - } - /** - * Iterates over each source file to emit. The source files are expected to have been - * transformed for use by the pretty printer. - * - * Originally part of `forEachExpectedEmitFile`, this functionality was extracted to support - * transformations. + * Iterates over the source files that are expected to have an emit output. * * @param host An EmitHost. - * @param sourceFiles The transformed source files to emit. * @param action The action to execute. + * @param sourceFilesOrTargetSourceFile + * If an array, the full list of source files to emit. + * Else, calls `getSourceFilesToEmit` with the (optional) target source file to determine the list of source files to emit. */ - function forEachTransformedEmitFile(host, sourceFiles, action, emitOnlyDtsFiles) { + function forEachEmittedFile(host, action, sourceFilesOrTargetSourceFile, emitOnlyDtsFiles) { + var sourceFiles = ts.isArray(sourceFilesOrTargetSourceFile) ? sourceFilesOrTargetSourceFile : getSourceFilesToEmit(host, sourceFilesOrTargetSourceFile); var options = host.getCompilerOptions(); - // Emit on each source file if (options.outFile || options.out) { - onBundledEmit(sourceFiles); - } - else { - for (var _i = 0, sourceFiles_2 = sourceFiles; _i < sourceFiles_2.length; _i++) { - var sourceFile = sourceFiles_2[_i]; - // Don't emit if source file is a declaration file, or was located under node_modules - if (!isDeclarationFile(sourceFile) && !host.isSourceFileFromExternalLibrary(sourceFile)) { - onSingleFileEmit(host, sourceFile); - } - } - } - function onSingleFileEmit(host, sourceFile) { - // JavaScript files are always LanguageVariant.JSX, as JSX syntax is allowed in .js files also. - // So for JavaScript files, '.jsx' is only emitted if the input was '.jsx', and JsxEmit.Preserve. - // For TypeScript, the only time to emit with a '.jsx' extension, is on JSX input, and JsxEmit.Preserve - var extension = ".js"; - if (options.jsx === 1 /* Preserve */) { - if (isSourceFileJavaScript(sourceFile)) { - if (ts.fileExtensionIs(sourceFile.fileName, ".jsx")) { - extension = ".jsx"; - } - } - else if (sourceFile.languageVariant === 1 /* JSX */) { - // TypeScript source file preserving JSX syntax - extension = ".jsx"; - } - } - var jsFilePath = getOwnEmitOutputFilePath(sourceFile, host, extension); - var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options); - var declarationFilePath = !isSourceFileJavaScript(sourceFile) && (options.declaration || emitOnlyDtsFiles) ? getDeclarationEmitOutputFilePath(sourceFile, host) : undefined; - action(jsFilePath, sourceMapFilePath, declarationFilePath, [sourceFile], /*isBundledEmit*/ false); - } - function onBundledEmit(sourceFiles) { if (sourceFiles.length) { var jsFilePath = options.outFile || options.out; var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options); - var declarationFilePath = options.declaration ? ts.removeFileExtension(jsFilePath) + ".d.ts" : undefined; - action(jsFilePath, sourceMapFilePath, declarationFilePath, sourceFiles, /*isBundledEmit*/ true); + var declarationFilePath = options.declaration ? ts.removeFileExtension(jsFilePath) + ".d.ts" : ""; + action({ jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath }, ts.createBundle(sourceFiles), emitOnlyDtsFiles); + } + } + else { + for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) { + var sourceFile = sourceFiles_1[_i]; + var jsFilePath = getOwnEmitOutputFilePath(sourceFile, host, getOutputExtension(sourceFile, options)); + var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options); + var declarationFilePath = !isSourceFileJavaScript(sourceFile) && (emitOnlyDtsFiles || options.declaration) ? getDeclarationEmitOutputFilePath(sourceFile, host) : undefined; + action({ jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath }, sourceFile, emitOnlyDtsFiles); } } } - ts.forEachTransformedEmitFile = forEachTransformedEmitFile; + ts.forEachEmittedFile = forEachEmittedFile; function getSourceMapFilePath(jsFilePath, options) { return options.sourceMap ? jsFilePath + ".map" : undefined; } - /** - * Iterates over the source files that are expected to have an emit output. This function - * is used by the legacy emitter and the declaration emitter and should not be used by - * the tree transforming emitter. - * - * @param host An EmitHost. - * @param action The action to execute. - * @param targetSourceFile An optional target source file to emit. - */ - function forEachExpectedEmitFile(host, action, targetSourceFile, emitOnlyDtsFiles) { - var options = host.getCompilerOptions(); - // Emit on each source file - if (options.outFile || options.out) { - onBundledEmit(host); - } - else { - var sourceFiles = targetSourceFile === undefined ? getSourceFilesToEmit(host) : [targetSourceFile]; - for (var _i = 0, sourceFiles_3 = sourceFiles; _i < sourceFiles_3.length; _i++) { - var sourceFile = sourceFiles_3[_i]; - if (shouldEmitInDirectory(sourceFile, function (file) { return host.isSourceFileFromExternalLibrary(file); })) { - onSingleFileEmit(host, sourceFile); + // JavaScript files are always LanguageVariant.JSX, as JSX syntax is allowed in .js files also. + // So for JavaScript files, '.jsx' is only emitted if the input was '.jsx', and JsxEmit.Preserve. + // For TypeScript, the only time to emit with a '.jsx' extension, is on JSX input, and JsxEmit.Preserve + function getOutputExtension(sourceFile, options) { + if (options.jsx === 1 /* Preserve */) { + if (isSourceFileJavaScript(sourceFile)) { + if (ts.fileExtensionIs(sourceFile.fileName, ".jsx")) { + return ".jsx"; } } - } - function onSingleFileEmit(host, sourceFile) { - // JavaScript files are always LanguageVariant.JSX, as JSX syntax is allowed in .js files also. - // So for JavaScript files, '.jsx' is only emitted if the input was '.jsx', and JsxEmit.Preserve. - // For TypeScript, the only time to emit with a '.jsx' extension, is on JSX input, and JsxEmit.Preserve - var extension = ".js"; - if (options.jsx === 1 /* Preserve */) { - if (isSourceFileJavaScript(sourceFile)) { - if (ts.fileExtensionIs(sourceFile.fileName, ".jsx")) { - extension = ".jsx"; - } - } - else if (sourceFile.languageVariant === 1 /* JSX */) { - // TypeScript source file preserving JSX syntax - extension = ".jsx"; - } - } - var jsFilePath = getOwnEmitOutputFilePath(sourceFile, host, extension); - var declarationFilePath = !isSourceFileJavaScript(sourceFile) && (emitOnlyDtsFiles || options.declaration) ? getDeclarationEmitOutputFilePath(sourceFile, host) : undefined; - var emitFileNames = { - jsFilePath: jsFilePath, - sourceMapFilePath: getSourceMapFilePath(jsFilePath, options), - declarationFilePath: declarationFilePath - }; - action(emitFileNames, [sourceFile], /*isBundledEmit*/ false, emitOnlyDtsFiles); - } - function onBundledEmit(host) { - // Can emit only sources that are not declaration file and are either non module code or module with - // --module or --target es6 specified. Files included by searching under node_modules are also not emitted. - var bundledSources = ts.filter(getSourceFilesToEmit(host), function (sourceFile) { return !isDeclarationFile(sourceFile) && - !host.isSourceFileFromExternalLibrary(sourceFile) && - (!ts.isExternalModule(sourceFile) || - !!ts.getEmitModuleKind(options)); }); - if (bundledSources.length) { - var jsFilePath = options.outFile || options.out; - var emitFileNames = { - jsFilePath: jsFilePath, - sourceMapFilePath: getSourceMapFilePath(jsFilePath, options), - declarationFilePath: options.declaration ? ts.removeFileExtension(jsFilePath) + ".d.ts" : undefined - }; - action(emitFileNames, bundledSources, /*isBundledEmit*/ true, emitOnlyDtsFiles); + else if (sourceFile.languageVariant === 1 /* JSX */) { + // TypeScript source file preserving JSX syntax + return ".jsx"; } } + return ".js"; } - ts.forEachExpectedEmitFile = forEachExpectedEmitFile; function getSourceFilePathInNewDir(sourceFile, host, newDirPath) { var sourceFilePath = ts.getNormalizedAbsolutePath(sourceFile.fileName, host.getCurrentDirectory()); var commonSourceDirectory = host.getCommonSourceDirectory(); @@ -8942,7 +9129,7 @@ var ts; ts.getLineOfLocalPositionFromLineMap = getLineOfLocalPositionFromLineMap; function getFirstConstructorWithBody(node) { return ts.forEach(node.members, function (member) { - if (member.kind === 150 /* Constructor */ && nodeIsPresent(member.body)) { + if (member.kind === 152 /* Constructor */ && nodeIsPresent(member.body)) { return member; } }); @@ -8970,11 +9157,11 @@ var ts; } ts.parameterIsThisKeyword = parameterIsThisKeyword; function isThisIdentifier(node) { - return node && node.kind === 70 /* Identifier */ && identifierIsThisKeyword(node); + return node && node.kind === 71 /* Identifier */ && identifierIsThisKeyword(node); } ts.isThisIdentifier = isThisIdentifier; function identifierIsThisKeyword(id) { - return id.originalKeywordKind === 98 /* ThisKeyword */; + return id.originalKeywordKind === 99 /* ThisKeyword */; } ts.identifierIsThisKeyword = identifierIsThisKeyword; function getAllAccessorDeclarations(declarations, accessor) { @@ -8984,10 +9171,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 151 /* GetAccessor */) { + if (accessor.kind === 153 /* GetAccessor */) { getAccessor = accessor; } - else if (accessor.kind === 152 /* SetAccessor */) { + else if (accessor.kind === 154 /* SetAccessor */) { setAccessor = accessor; } else { @@ -8996,7 +9183,7 @@ var ts; } else { ts.forEach(declarations, function (member) { - if ((member.kind === 151 /* GetAccessor */ || member.kind === 152 /* SetAccessor */) + if ((member.kind === 153 /* GetAccessor */ || member.kind === 154 /* SetAccessor */) && hasModifier(member, 32 /* Static */) === hasModifier(accessor, 32 /* Static */)) { var memberName = getPropertyNameForPropertyNameNode(member.name); var accessorName = getPropertyNameForPropertyNameNode(accessor.name); @@ -9007,10 +9194,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 151 /* GetAccessor */ && !getAccessor) { + if (member.kind === 153 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 152 /* SetAccessor */ && !setAccessor) { + if (member.kind === 154 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -9237,7 +9424,7 @@ var ts; flags |= modifierToFlag(modifier.kind); } } - if (node.flags & 4 /* NestedNamespace */ || (node.kind === 70 /* Identifier */ && node.isInJSDocNamespace)) { + if (node.flags & 4 /* NestedNamespace */ || (node.kind === 71 /* Identifier */ && node.isInJSDocNamespace)) { flags |= 1 /* Export */; } node.modifierFlagsCache = flags | 536870912 /* HasComputedFlags */; @@ -9246,35 +9433,35 @@ var ts; ts.getModifierFlags = getModifierFlags; function modifierToFlag(token) { switch (token) { - case 114 /* StaticKeyword */: return 32 /* Static */; - case 113 /* PublicKeyword */: return 4 /* Public */; - case 112 /* ProtectedKeyword */: return 16 /* Protected */; - case 111 /* PrivateKeyword */: return 8 /* Private */; - case 116 /* AbstractKeyword */: return 128 /* Abstract */; - case 83 /* ExportKeyword */: return 1 /* Export */; - case 123 /* DeclareKeyword */: return 2 /* Ambient */; - case 75 /* ConstKeyword */: return 2048 /* Const */; - case 78 /* DefaultKeyword */: return 512 /* Default */; - case 119 /* AsyncKeyword */: return 256 /* Async */; - case 130 /* ReadonlyKeyword */: return 64 /* Readonly */; + case 115 /* StaticKeyword */: return 32 /* Static */; + case 114 /* PublicKeyword */: return 4 /* Public */; + case 113 /* ProtectedKeyword */: return 16 /* Protected */; + case 112 /* PrivateKeyword */: return 8 /* Private */; + case 117 /* AbstractKeyword */: return 128 /* Abstract */; + case 84 /* ExportKeyword */: return 1 /* Export */; + case 124 /* DeclareKeyword */: return 2 /* Ambient */; + case 76 /* ConstKeyword */: return 2048 /* Const */; + case 79 /* DefaultKeyword */: return 512 /* Default */; + case 120 /* AsyncKeyword */: return 256 /* Async */; + case 131 /* ReadonlyKeyword */: return 64 /* Readonly */; } return 0 /* None */; } ts.modifierToFlag = modifierToFlag; function isLogicalOperator(token) { - return token === 53 /* BarBarToken */ - || token === 52 /* AmpersandAmpersandToken */ - || token === 50 /* ExclamationToken */; + return token === 54 /* BarBarToken */ + || token === 53 /* AmpersandAmpersandToken */ + || token === 51 /* ExclamationToken */; } ts.isLogicalOperator = isLogicalOperator; function isAssignmentOperator(token) { - return token >= 57 /* FirstAssignment */ && token <= 69 /* LastAssignment */; + return token >= 58 /* FirstAssignment */ && token <= 70 /* LastAssignment */; } 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 === 199 /* ExpressionWithTypeArguments */ && - node.parent.token === 84 /* ExtendsKeyword */ && + if (node.kind === 201 /* ExpressionWithTypeArguments */ && + node.parent.token === 85 /* ExtendsKeyword */ && isClassLike(node.parent.parent)) { return node.parent.parent; } @@ -9283,7 +9470,7 @@ var ts; function isAssignmentExpression(node, excludeCompoundAssignment) { return isBinaryExpression(node) && (excludeCompoundAssignment - ? node.operatorToken.kind === 57 /* EqualsToken */ + ? node.operatorToken.kind === 58 /* EqualsToken */ : isAssignmentOperator(node.operatorToken.kind)) && isLeftHandSideExpression(node.left); } @@ -9291,8 +9478,8 @@ var ts; function isDestructuringAssignment(node) { if (isAssignmentExpression(node, /*excludeCompoundAssignment*/ true)) { var kind = node.left.kind; - return kind === 176 /* ObjectLiteralExpression */ - || kind === 175 /* ArrayLiteralExpression */; + return kind === 178 /* ObjectLiteralExpression */ + || kind === 177 /* ArrayLiteralExpression */; } return false; } @@ -9304,7 +9491,7 @@ var ts; } ts.isSupportedExpressionWithTypeArguments = isSupportedExpressionWithTypeArguments; function isSupportedExpressionWithTypeArgumentsRest(node) { - if (node.kind === 70 /* Identifier */) { + if (node.kind === 71 /* Identifier */) { return true; } else if (isPropertyAccessExpression(node)) { @@ -9318,31 +9505,42 @@ var ts; return tryGetClassExtendingExpressionWithTypeArguments(node) !== undefined; } ts.isExpressionWithTypeArgumentsInClassExtendsClause = isExpressionWithTypeArgumentsInClassExtendsClause; + function isExpressionWithTypeArgumentsInClassImplementsClause(node) { + return node.kind === 201 /* ExpressionWithTypeArguments */ + && isEntityNameExpression(node.expression) + && node.parent + && node.parent.token === 108 /* ImplementsKeyword */ + && node.parent.parent + && isClassLike(node.parent.parent); + } + ts.isExpressionWithTypeArgumentsInClassImplementsClause = isExpressionWithTypeArgumentsInClassImplementsClause; function isEntityNameExpression(node) { - return node.kind === 70 /* Identifier */ || - node.kind === 177 /* PropertyAccessExpression */ && isEntityNameExpression(node.expression); + return node.kind === 71 /* Identifier */ || + node.kind === 179 /* PropertyAccessExpression */ && isEntityNameExpression(node.expression); } ts.isEntityNameExpression = isEntityNameExpression; function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 141 /* QualifiedName */ && node.parent.right === node) || - (node.parent.kind === 177 /* PropertyAccessExpression */ && node.parent.name === node); + return (node.parent.kind === 143 /* QualifiedName */ && node.parent.right === node) || + (node.parent.kind === 179 /* PropertyAccessExpression */ && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; - function isEmptyObjectLiteralOrArrayLiteral(expression) { - var kind = expression.kind; - if (kind === 176 /* ObjectLiteralExpression */) { - return expression.properties.length === 0; - } - if (kind === 175 /* ArrayLiteralExpression */) { - return expression.elements.length === 0; - } - return false; + function isEmptyObjectLiteral(expression) { + return expression.kind === 178 /* ObjectLiteralExpression */ && + expression.properties.length === 0; } - ts.isEmptyObjectLiteralOrArrayLiteral = isEmptyObjectLiteralOrArrayLiteral; + ts.isEmptyObjectLiteral = isEmptyObjectLiteral; + function isEmptyArrayLiteral(expression) { + return expression.kind === 177 /* ArrayLiteralExpression */ && + expression.elements.length === 0; + } + ts.isEmptyArrayLiteral = isEmptyArrayLiteral; function getLocalSymbolForExportDefault(symbol) { - return symbol && symbol.valueDeclaration && hasModifier(symbol.valueDeclaration, 512 /* Default */) ? symbol.valueDeclaration.localSymbol : undefined; + return isExportDefaultSymbol(symbol) ? symbol.valueDeclaration.localSymbol : undefined; } ts.getLocalSymbolForExportDefault = getLocalSymbolForExportDefault; + function isExportDefaultSymbol(symbol) { + return symbol && symbol.valueDeclaration && hasModifier(symbol.valueDeclaration, 512 /* Default */); + } /** Return ".ts", ".d.ts", or ".tsx", if that is the extension. */ function tryExtractTypeScriptExtension(fileName) { return ts.find(ts.supportedTypescriptExtensionsForExtractExtension, function (extension) { return ts.fileExtensionIs(fileName, extension); }); @@ -9444,49 +9642,49 @@ var ts; var kind = node.kind; if (kind === 9 /* StringLiteral */ || kind === 8 /* NumericLiteral */ - || kind === 11 /* RegularExpressionLiteral */ - || kind === 12 /* NoSubstitutionTemplateLiteral */ - || kind === 70 /* Identifier */ - || kind === 98 /* ThisKeyword */ - || kind === 96 /* SuperKeyword */ - || kind === 100 /* TrueKeyword */ - || kind === 85 /* FalseKeyword */ - || kind === 94 /* NullKeyword */) { + || kind === 12 /* RegularExpressionLiteral */ + || kind === 13 /* NoSubstitutionTemplateLiteral */ + || kind === 71 /* Identifier */ + || kind === 99 /* ThisKeyword */ + || kind === 97 /* SuperKeyword */ + || kind === 101 /* TrueKeyword */ + || kind === 86 /* FalseKeyword */ + || kind === 95 /* NullKeyword */) { return true; } - else if (kind === 177 /* PropertyAccessExpression */) { + else if (kind === 179 /* PropertyAccessExpression */) { return isSimpleExpressionWorker(node.expression, depth + 1); } - else if (kind === 178 /* ElementAccessExpression */) { + else if (kind === 180 /* ElementAccessExpression */) { return isSimpleExpressionWorker(node.expression, depth + 1) && isSimpleExpressionWorker(node.argumentExpression, depth + 1); } - else if (kind === 190 /* PrefixUnaryExpression */ - || kind === 191 /* PostfixUnaryExpression */) { + else if (kind === 192 /* PrefixUnaryExpression */ + || kind === 193 /* PostfixUnaryExpression */) { return isSimpleExpressionWorker(node.operand, depth + 1); } - else if (kind === 192 /* BinaryExpression */) { - return node.operatorToken.kind !== 39 /* AsteriskAsteriskToken */ + else if (kind === 194 /* BinaryExpression */) { + return node.operatorToken.kind !== 40 /* AsteriskAsteriskToken */ && isSimpleExpressionWorker(node.left, depth + 1) && isSimpleExpressionWorker(node.right, depth + 1); } - else if (kind === 193 /* ConditionalExpression */) { + else if (kind === 195 /* ConditionalExpression */) { return isSimpleExpressionWorker(node.condition, depth + 1) && isSimpleExpressionWorker(node.whenTrue, depth + 1) && isSimpleExpressionWorker(node.whenFalse, depth + 1); } - else if (kind === 188 /* VoidExpression */ - || kind === 187 /* TypeOfExpression */ - || kind === 186 /* DeleteExpression */) { + else if (kind === 190 /* VoidExpression */ + || kind === 189 /* TypeOfExpression */ + || kind === 188 /* DeleteExpression */) { return isSimpleExpressionWorker(node.expression, depth + 1); } - else if (kind === 175 /* ArrayLiteralExpression */) { + else if (kind === 177 /* ArrayLiteralExpression */) { return node.elements.length === 0; } - else if (kind === 176 /* ObjectLiteralExpression */) { + else if (kind === 178 /* ObjectLiteralExpression */) { return node.properties.length === 0; } - else if (kind === 179 /* CallExpression */) { + else if (kind === 181 /* CallExpression */) { if (!isSimpleExpressionWorker(node.expression, depth + 1)) { return false; } @@ -9501,16 +9699,19 @@ var ts; } return false; } - var syntaxKindCache = ts.createMap(); + var syntaxKindCache = []; function formatSyntaxKind(kind) { var syntaxKindEnum = ts.SyntaxKind; if (syntaxKindEnum) { - if (syntaxKindCache[kind]) { - return syntaxKindCache[kind]; + var cached = syntaxKindCache[kind]; + if (cached !== undefined) { + return cached; } - for (var name_7 in syntaxKindEnum) { - if (syntaxKindEnum[name_7] === kind) { - return syntaxKindCache[kind] = kind.toString() + " (" + name_7 + ")"; + for (var name in syntaxKindEnum) { + if (syntaxKindEnum[name] === kind) { + var result = kind + " (" + name + ")"; + syntaxKindCache[kind] = result; + return result; } } } @@ -9519,6 +9720,14 @@ var ts; } } ts.formatSyntaxKind = formatSyntaxKind; + function getRangePos(range) { + return range ? range.pos : -1; + } + ts.getRangePos = getRangePos; + function getRangeEnd(range) { + return range ? range.end : -1; + } + ts.getRangeEnd = getRangeEnd; /** * Increases (or decreases) a position by the provided amount. * @@ -9650,11 +9859,11 @@ var ts; * declaration. */ function isDeclarationNameOfEnumOrNamespace(node) { - var parseNode = getParseTreeNode(node); + var parseNode = ts.getParseTreeNode(node); if (parseNode) { switch (parseNode.parent.kind) { - case 229 /* EnumDeclaration */: - case 230 /* ModuleDeclaration */: + case 232 /* EnumDeclaration */: + case 233 /* ModuleDeclaration */: return parseNode === parseNode.parent.name; } } @@ -9675,7 +9884,7 @@ var ts; if (node.symbol) { for (var _i = 0, _a = node.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 226 /* ClassDeclaration */ && declaration !== node) { + if (declaration.kind === 229 /* ClassDeclaration */ && declaration !== node) { return true; } } @@ -9705,15 +9914,15 @@ var ts; ts.isNodeArray = isNodeArray; // Literals function isNoSubstitutionTemplateLiteral(node) { - return node.kind === 12 /* NoSubstitutionTemplateLiteral */; + return node.kind === 13 /* NoSubstitutionTemplateLiteral */; } ts.isNoSubstitutionTemplateLiteral = isNoSubstitutionTemplateLiteral; function isLiteralKind(kind) { - return 8 /* FirstLiteralToken */ <= kind && kind <= 12 /* LastLiteralToken */; + return 8 /* FirstLiteralToken */ <= kind && kind <= 13 /* LastLiteralToken */; } ts.isLiteralKind = isLiteralKind; function isTextualLiteralKind(kind) { - return kind === 9 /* StringLiteral */ || kind === 12 /* NoSubstitutionTemplateLiteral */; + return kind === 9 /* StringLiteral */ || kind === 13 /* NoSubstitutionTemplateLiteral */; } ts.isTextualLiteralKind = isTextualLiteralKind; function isLiteralExpression(node) { @@ -9722,26 +9931,26 @@ var ts; ts.isLiteralExpression = isLiteralExpression; // Pseudo-literals function isTemplateLiteralKind(kind) { - return 12 /* FirstTemplateToken */ <= kind && kind <= 15 /* LastTemplateToken */; + return 13 /* FirstTemplateToken */ <= kind && kind <= 16 /* LastTemplateToken */; } ts.isTemplateLiteralKind = isTemplateLiteralKind; function isTemplateHead(node) { - return node.kind === 13 /* TemplateHead */; + return node.kind === 14 /* TemplateHead */; } ts.isTemplateHead = isTemplateHead; function isTemplateMiddleOrTemplateTail(node) { var kind = node.kind; - return kind === 14 /* TemplateMiddle */ - || kind === 15 /* TemplateTail */; + return kind === 15 /* TemplateMiddle */ + || kind === 16 /* TemplateTail */; } ts.isTemplateMiddleOrTemplateTail = isTemplateMiddleOrTemplateTail; // Identifiers function isIdentifier(node) { - return node.kind === 70 /* Identifier */; + return node.kind === 71 /* Identifier */; } ts.isIdentifier = isIdentifier; function isVoidExpression(node) { - return node.kind === 188 /* VoidExpression */; + return node.kind === 190 /* VoidExpression */; } ts.isVoidExpression = isVoidExpression; function isGeneratedIdentifier(node) { @@ -9756,91 +9965,95 @@ var ts; ts.isModifier = isModifier; // Names function isQualifiedName(node) { - return node.kind === 141 /* QualifiedName */; + return node.kind === 143 /* QualifiedName */; } ts.isQualifiedName = isQualifiedName; function isComputedPropertyName(node) { - return node.kind === 142 /* ComputedPropertyName */; + return node.kind === 144 /* ComputedPropertyName */; } ts.isComputedPropertyName = isComputedPropertyName; function isEntityName(node) { var kind = node.kind; - return kind === 141 /* QualifiedName */ - || kind === 70 /* Identifier */; + return kind === 143 /* QualifiedName */ + || kind === 71 /* Identifier */; } ts.isEntityName = isEntityName; function isPropertyName(node) { var kind = node.kind; - return kind === 70 /* Identifier */ + return kind === 71 /* Identifier */ || kind === 9 /* StringLiteral */ || kind === 8 /* NumericLiteral */ - || kind === 142 /* ComputedPropertyName */; + || kind === 144 /* ComputedPropertyName */; } ts.isPropertyName = isPropertyName; function isModuleName(node) { var kind = node.kind; - return kind === 70 /* Identifier */ + return kind === 71 /* Identifier */ || kind === 9 /* StringLiteral */; } ts.isModuleName = isModuleName; function isBindingName(node) { var kind = node.kind; - return kind === 70 /* Identifier */ - || kind === 172 /* ObjectBindingPattern */ - || kind === 173 /* ArrayBindingPattern */; + return kind === 71 /* Identifier */ + || kind === 174 /* ObjectBindingPattern */ + || kind === 175 /* ArrayBindingPattern */; } ts.isBindingName = isBindingName; // Signature elements function isTypeParameter(node) { - return node.kind === 143 /* TypeParameter */; + return node.kind === 145 /* TypeParameter */; } ts.isTypeParameter = isTypeParameter; function isParameter(node) { - return node.kind === 144 /* Parameter */; + return node.kind === 146 /* Parameter */; } ts.isParameter = isParameter; function isDecorator(node) { - return node.kind === 145 /* Decorator */; + return node.kind === 147 /* Decorator */; } ts.isDecorator = isDecorator; // Type members function isMethodDeclaration(node) { - return node.kind === 149 /* MethodDeclaration */; + return node.kind === 151 /* MethodDeclaration */; } ts.isMethodDeclaration = isMethodDeclaration; function isClassElement(node) { var kind = node.kind; - return kind === 150 /* Constructor */ - || kind === 147 /* PropertyDeclaration */ - || kind === 149 /* MethodDeclaration */ - || kind === 151 /* GetAccessor */ - || kind === 152 /* SetAccessor */ - || kind === 155 /* IndexSignature */ - || kind === 203 /* SemicolonClassElement */; + return kind === 152 /* Constructor */ + || kind === 149 /* PropertyDeclaration */ + || kind === 151 /* MethodDeclaration */ + || kind === 153 /* GetAccessor */ + || kind === 154 /* SetAccessor */ + || kind === 157 /* IndexSignature */ + || kind === 206 /* SemicolonClassElement */; } ts.isClassElement = isClassElement; function isObjectLiteralElementLike(node) { var kind = node.kind; - return kind === 257 /* PropertyAssignment */ - || kind === 258 /* ShorthandPropertyAssignment */ - || kind === 259 /* SpreadAssignment */ - || kind === 149 /* MethodDeclaration */ - || kind === 151 /* GetAccessor */ - || kind === 152 /* SetAccessor */ - || kind === 244 /* MissingDeclaration */; + return kind === 261 /* PropertyAssignment */ + || kind === 262 /* ShorthandPropertyAssignment */ + || kind === 263 /* SpreadAssignment */ + || kind === 151 /* MethodDeclaration */ + || kind === 153 /* GetAccessor */ + || kind === 154 /* SetAccessor */ + || kind === 247 /* MissingDeclaration */; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; // Type function isTypeNodeKind(kind) { - return (kind >= 156 /* FirstTypeNode */ && kind <= 171 /* LastTypeNode */) - || kind === 118 /* AnyKeyword */ - || kind === 132 /* NumberKeyword */ - || kind === 121 /* BooleanKeyword */ - || kind === 134 /* StringKeyword */ - || kind === 135 /* SymbolKeyword */ - || kind === 104 /* VoidKeyword */ - || kind === 129 /* NeverKeyword */ - || kind === 199 /* ExpressionWithTypeArguments */; + return (kind >= 158 /* FirstTypeNode */ && kind <= 173 /* LastTypeNode */) + || kind === 119 /* AnyKeyword */ + || kind === 133 /* NumberKeyword */ + || kind === 134 /* ObjectKeyword */ + || kind === 122 /* BooleanKeyword */ + || kind === 136 /* StringKeyword */ + || kind === 137 /* SymbolKeyword */ + || kind === 99 /* ThisKeyword */ + || kind === 105 /* VoidKeyword */ + || kind === 139 /* UndefinedKeyword */ + || kind === 95 /* NullKeyword */ + || kind === 130 /* NeverKeyword */ + || kind === 201 /* ExpressionWithTypeArguments */; } /** * Node test that determines whether a node is a valid type node. @@ -9853,36 +10066,36 @@ var ts; ts.isTypeNode = isTypeNode; // Binding patterns function isArrayBindingPattern(node) { - return node.kind === 173 /* ArrayBindingPattern */; + return node.kind === 175 /* ArrayBindingPattern */; } ts.isArrayBindingPattern = isArrayBindingPattern; function isObjectBindingPattern(node) { - return node.kind === 172 /* ObjectBindingPattern */; + return node.kind === 174 /* ObjectBindingPattern */; } ts.isObjectBindingPattern = isObjectBindingPattern; function isBindingPattern(node) { if (node) { var kind = node.kind; - return kind === 173 /* ArrayBindingPattern */ - || kind === 172 /* ObjectBindingPattern */; + return kind === 175 /* ArrayBindingPattern */ + || kind === 174 /* ObjectBindingPattern */; } return false; } ts.isBindingPattern = isBindingPattern; function isAssignmentPattern(node) { var kind = node.kind; - return kind === 175 /* ArrayLiteralExpression */ - || kind === 176 /* ObjectLiteralExpression */; + return kind === 177 /* ArrayLiteralExpression */ + || kind === 178 /* ObjectLiteralExpression */; } ts.isAssignmentPattern = isAssignmentPattern; function isBindingElement(node) { - return node.kind === 174 /* BindingElement */; + return node.kind === 176 /* BindingElement */; } ts.isBindingElement = isBindingElement; function isArrayBindingElement(node) { var kind = node.kind; - return kind === 174 /* BindingElement */ - || kind === 198 /* OmittedExpression */; + return kind === 176 /* BindingElement */ + || kind === 200 /* OmittedExpression */; } ts.isArrayBindingElement = isArrayBindingElement; /** @@ -9890,9 +10103,9 @@ var ts; */ function isDeclarationBindingElement(bindingElement) { switch (bindingElement.kind) { - case 223 /* VariableDeclaration */: - case 144 /* Parameter */: - case 174 /* BindingElement */: + case 226 /* VariableDeclaration */: + case 146 /* Parameter */: + case 176 /* BindingElement */: return true; } return false; @@ -9911,8 +10124,8 @@ var ts; */ function isObjectBindingOrAssignmentPattern(node) { switch (node.kind) { - case 172 /* ObjectBindingPattern */: - case 176 /* ObjectLiteralExpression */: + case 174 /* ObjectBindingPattern */: + case 178 /* ObjectLiteralExpression */: return true; } return false; @@ -9923,8 +10136,8 @@ var ts; */ function isArrayBindingOrAssignmentPattern(node) { switch (node.kind) { - case 173 /* ArrayBindingPattern */: - case 175 /* ArrayLiteralExpression */: + case 175 /* ArrayBindingPattern */: + case 177 /* ArrayLiteralExpression */: return true; } return false; @@ -9932,85 +10145,92 @@ var ts; ts.isArrayBindingOrAssignmentPattern = isArrayBindingOrAssignmentPattern; // Expression function isArrayLiteralExpression(node) { - return node.kind === 175 /* ArrayLiteralExpression */; + return node.kind === 177 /* ArrayLiteralExpression */; } ts.isArrayLiteralExpression = isArrayLiteralExpression; function isObjectLiteralExpression(node) { - return node.kind === 176 /* ObjectLiteralExpression */; + return node.kind === 178 /* ObjectLiteralExpression */; } ts.isObjectLiteralExpression = isObjectLiteralExpression; function isPropertyAccessExpression(node) { - return node.kind === 177 /* PropertyAccessExpression */; + return node.kind === 179 /* PropertyAccessExpression */; } ts.isPropertyAccessExpression = isPropertyAccessExpression; + function isPropertyAccessOrQualifiedName(node) { + var kind = node.kind; + return kind === 179 /* PropertyAccessExpression */ + || kind === 143 /* QualifiedName */; + } + ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName; function isElementAccessExpression(node) { - return node.kind === 178 /* ElementAccessExpression */; + return node.kind === 180 /* ElementAccessExpression */; } ts.isElementAccessExpression = isElementAccessExpression; function isBinaryExpression(node) { - return node.kind === 192 /* BinaryExpression */; + return node.kind === 194 /* BinaryExpression */; } ts.isBinaryExpression = isBinaryExpression; function isConditionalExpression(node) { - return node.kind === 193 /* ConditionalExpression */; + return node.kind === 195 /* ConditionalExpression */; } ts.isConditionalExpression = isConditionalExpression; function isCallExpression(node) { - return node.kind === 179 /* CallExpression */; + return node.kind === 181 /* CallExpression */; } ts.isCallExpression = isCallExpression; function isTemplateLiteral(node) { var kind = node.kind; - return kind === 194 /* TemplateExpression */ - || kind === 12 /* NoSubstitutionTemplateLiteral */; + return kind === 196 /* TemplateExpression */ + || kind === 13 /* NoSubstitutionTemplateLiteral */; } ts.isTemplateLiteral = isTemplateLiteral; function isSpreadExpression(node) { - return node.kind === 196 /* SpreadElement */; + return node.kind === 198 /* SpreadElement */; } ts.isSpreadExpression = isSpreadExpression; function isExpressionWithTypeArguments(node) { - return node.kind === 199 /* ExpressionWithTypeArguments */; + return node.kind === 201 /* ExpressionWithTypeArguments */; } ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments; function isLeftHandSideExpressionKind(kind) { - return kind === 177 /* PropertyAccessExpression */ - || kind === 178 /* ElementAccessExpression */ - || kind === 180 /* NewExpression */ - || kind === 179 /* CallExpression */ - || kind === 246 /* JsxElement */ - || kind === 247 /* JsxSelfClosingElement */ - || kind === 181 /* TaggedTemplateExpression */ - || kind === 175 /* ArrayLiteralExpression */ - || kind === 183 /* ParenthesizedExpression */ - || kind === 176 /* ObjectLiteralExpression */ - || kind === 197 /* ClassExpression */ - || kind === 184 /* FunctionExpression */ - || kind === 70 /* Identifier */ - || kind === 11 /* RegularExpressionLiteral */ + return kind === 179 /* PropertyAccessExpression */ + || kind === 180 /* ElementAccessExpression */ + || kind === 182 /* NewExpression */ + || kind === 181 /* CallExpression */ + || kind === 249 /* JsxElement */ + || kind === 250 /* JsxSelfClosingElement */ + || kind === 183 /* TaggedTemplateExpression */ + || kind === 177 /* ArrayLiteralExpression */ + || kind === 185 /* ParenthesizedExpression */ + || kind === 178 /* ObjectLiteralExpression */ + || kind === 199 /* ClassExpression */ + || kind === 186 /* FunctionExpression */ + || kind === 71 /* Identifier */ + || kind === 12 /* RegularExpressionLiteral */ || kind === 8 /* NumericLiteral */ || kind === 9 /* StringLiteral */ - || kind === 12 /* NoSubstitutionTemplateLiteral */ - || kind === 194 /* TemplateExpression */ - || kind === 85 /* FalseKeyword */ - || kind === 94 /* NullKeyword */ - || kind === 98 /* ThisKeyword */ - || kind === 100 /* TrueKeyword */ - || kind === 96 /* SuperKeyword */ - || kind === 201 /* NonNullExpression */; + || kind === 13 /* NoSubstitutionTemplateLiteral */ + || kind === 196 /* TemplateExpression */ + || kind === 86 /* FalseKeyword */ + || kind === 95 /* NullKeyword */ + || kind === 99 /* ThisKeyword */ + || kind === 101 /* TrueKeyword */ + || kind === 97 /* SuperKeyword */ + || kind === 203 /* NonNullExpression */ + || kind === 204 /* MetaProperty */; } function isLeftHandSideExpression(node) { return isLeftHandSideExpressionKind(ts.skipPartiallyEmittedExpressions(node).kind); } ts.isLeftHandSideExpression = isLeftHandSideExpression; function isUnaryExpressionKind(kind) { - return kind === 190 /* PrefixUnaryExpression */ - || kind === 191 /* PostfixUnaryExpression */ - || kind === 186 /* DeleteExpression */ - || kind === 187 /* TypeOfExpression */ - || kind === 188 /* VoidExpression */ - || kind === 189 /* AwaitExpression */ - || kind === 182 /* TypeAssertionExpression */ + return kind === 192 /* PrefixUnaryExpression */ + || kind === 193 /* PostfixUnaryExpression */ + || kind === 188 /* DeleteExpression */ + || kind === 189 /* TypeOfExpression */ + || kind === 190 /* VoidExpression */ + || kind === 191 /* AwaitExpression */ + || kind === 184 /* TypeAssertionExpression */ || isLeftHandSideExpressionKind(kind); } function isUnaryExpression(node) { @@ -10018,13 +10238,13 @@ var ts; } ts.isUnaryExpression = isUnaryExpression; function isExpressionKind(kind) { - return kind === 193 /* ConditionalExpression */ - || kind === 195 /* YieldExpression */ - || kind === 185 /* ArrowFunction */ - || kind === 192 /* BinaryExpression */ - || kind === 196 /* SpreadElement */ - || kind === 200 /* AsExpression */ - || kind === 198 /* OmittedExpression */ + return kind === 195 /* ConditionalExpression */ + || kind === 197 /* YieldExpression */ + || kind === 187 /* ArrowFunction */ + || kind === 194 /* BinaryExpression */ + || kind === 198 /* SpreadElement */ + || kind === 202 /* AsExpression */ + || kind === 200 /* OmittedExpression */ || isUnaryExpressionKind(kind); } function isExpression(node) { @@ -10033,16 +10253,16 @@ var ts; ts.isExpression = isExpression; function isAssertionExpression(node) { var kind = node.kind; - return kind === 182 /* TypeAssertionExpression */ - || kind === 200 /* AsExpression */; + return kind === 184 /* TypeAssertionExpression */ + || kind === 202 /* AsExpression */; } ts.isAssertionExpression = isAssertionExpression; function isPartiallyEmittedExpression(node) { - return node.kind === 294 /* PartiallyEmittedExpression */; + return node.kind === 296 /* PartiallyEmittedExpression */; } ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression; function isNotEmittedStatement(node) { - return node.kind === 293 /* NotEmittedStatement */; + return node.kind === 295 /* NotEmittedStatement */; } ts.isNotEmittedStatement = isNotEmittedStatement; function isNotEmittedOrPartiallyEmittedNode(node) { @@ -10051,17 +10271,17 @@ var ts; } ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode; function isOmittedExpression(node) { - return node.kind === 198 /* OmittedExpression */; + return node.kind === 200 /* OmittedExpression */; } ts.isOmittedExpression = isOmittedExpression; // Misc function isTemplateSpan(node) { - return node.kind === 202 /* TemplateSpan */; + return node.kind === 205 /* TemplateSpan */; } ts.isTemplateSpan = isTemplateSpan; // Element function isBlock(node) { - return node.kind === 204 /* Block */; + return node.kind === 207 /* Block */; } ts.isBlock = isBlock; function isConciseBody(node) { @@ -10079,121 +10299,135 @@ var ts; } ts.isForInitializer = isForInitializer; function isVariableDeclaration(node) { - return node.kind === 223 /* VariableDeclaration */; + return node.kind === 226 /* VariableDeclaration */; } ts.isVariableDeclaration = isVariableDeclaration; function isVariableDeclarationList(node) { - return node.kind === 224 /* VariableDeclarationList */; + return node.kind === 227 /* VariableDeclarationList */; } ts.isVariableDeclarationList = isVariableDeclarationList; function isCaseBlock(node) { - return node.kind === 232 /* CaseBlock */; + return node.kind === 235 /* CaseBlock */; } ts.isCaseBlock = isCaseBlock; function isModuleBody(node) { var kind = node.kind; - return kind === 231 /* ModuleBlock */ - || kind === 230 /* ModuleDeclaration */; + return kind === 234 /* ModuleBlock */ + || kind === 233 /* ModuleDeclaration */ + || kind === 71 /* Identifier */; } ts.isModuleBody = isModuleBody; + function isNamespaceBody(node) { + var kind = node.kind; + return kind === 234 /* ModuleBlock */ + || kind === 233 /* ModuleDeclaration */; + } + ts.isNamespaceBody = isNamespaceBody; + function isJSDocNamespaceBody(node) { + var kind = node.kind; + return kind === 71 /* Identifier */ + || kind === 233 /* ModuleDeclaration */; + } + ts.isJSDocNamespaceBody = isJSDocNamespaceBody; function isImportEqualsDeclaration(node) { - return node.kind === 234 /* ImportEqualsDeclaration */; + return node.kind === 237 /* ImportEqualsDeclaration */; } ts.isImportEqualsDeclaration = isImportEqualsDeclaration; function isImportClause(node) { - return node.kind === 236 /* ImportClause */; + return node.kind === 239 /* ImportClause */; } ts.isImportClause = isImportClause; function isNamedImportBindings(node) { var kind = node.kind; - return kind === 238 /* NamedImports */ - || kind === 237 /* NamespaceImport */; + return kind === 241 /* NamedImports */ + || kind === 240 /* NamespaceImport */; } ts.isNamedImportBindings = isNamedImportBindings; function isImportSpecifier(node) { - return node.kind === 239 /* ImportSpecifier */; + return node.kind === 242 /* ImportSpecifier */; } ts.isImportSpecifier = isImportSpecifier; function isNamedExports(node) { - return node.kind === 242 /* NamedExports */; + return node.kind === 245 /* NamedExports */; } ts.isNamedExports = isNamedExports; function isExportSpecifier(node) { - return node.kind === 243 /* ExportSpecifier */; + return node.kind === 246 /* ExportSpecifier */; } ts.isExportSpecifier = isExportSpecifier; function isModuleOrEnumDeclaration(node) { - return node.kind === 230 /* ModuleDeclaration */ || node.kind === 229 /* EnumDeclaration */; + return node.kind === 233 /* ModuleDeclaration */ || node.kind === 232 /* EnumDeclaration */; } ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration; function isDeclarationKind(kind) { - return kind === 185 /* ArrowFunction */ - || kind === 174 /* BindingElement */ - || kind === 226 /* ClassDeclaration */ - || kind === 197 /* ClassExpression */ - || kind === 150 /* Constructor */ - || kind === 229 /* EnumDeclaration */ - || kind === 260 /* EnumMember */ - || kind === 243 /* ExportSpecifier */ - || kind === 225 /* FunctionDeclaration */ - || kind === 184 /* FunctionExpression */ - || kind === 151 /* GetAccessor */ - || kind === 236 /* ImportClause */ - || kind === 234 /* ImportEqualsDeclaration */ - || kind === 239 /* ImportSpecifier */ - || kind === 227 /* InterfaceDeclaration */ - || kind === 149 /* MethodDeclaration */ - || kind === 148 /* MethodSignature */ - || kind === 230 /* ModuleDeclaration */ - || kind === 233 /* NamespaceExportDeclaration */ - || kind === 237 /* NamespaceImport */ - || kind === 144 /* Parameter */ - || kind === 257 /* PropertyAssignment */ - || kind === 147 /* PropertyDeclaration */ - || kind === 146 /* PropertySignature */ - || kind === 152 /* SetAccessor */ - || kind === 258 /* ShorthandPropertyAssignment */ - || kind === 228 /* TypeAliasDeclaration */ - || kind === 143 /* TypeParameter */ - || kind === 223 /* VariableDeclaration */ - || kind === 285 /* JSDocTypedefTag */; + return kind === 187 /* ArrowFunction */ + || kind === 176 /* BindingElement */ + || kind === 229 /* ClassDeclaration */ + || kind === 199 /* ClassExpression */ + || kind === 152 /* Constructor */ + || kind === 232 /* EnumDeclaration */ + || kind === 264 /* EnumMember */ + || kind === 246 /* ExportSpecifier */ + || kind === 228 /* FunctionDeclaration */ + || kind === 186 /* FunctionExpression */ + || kind === 153 /* GetAccessor */ + || kind === 239 /* ImportClause */ + || kind === 237 /* ImportEqualsDeclaration */ + || kind === 242 /* ImportSpecifier */ + || kind === 230 /* InterfaceDeclaration */ + || kind === 253 /* JsxAttribute */ + || kind === 151 /* MethodDeclaration */ + || kind === 150 /* MethodSignature */ + || kind === 233 /* ModuleDeclaration */ + || kind === 236 /* NamespaceExportDeclaration */ + || kind === 240 /* NamespaceImport */ + || kind === 146 /* Parameter */ + || kind === 261 /* PropertyAssignment */ + || kind === 149 /* PropertyDeclaration */ + || kind === 148 /* PropertySignature */ + || kind === 154 /* SetAccessor */ + || kind === 262 /* ShorthandPropertyAssignment */ + || kind === 231 /* TypeAliasDeclaration */ + || kind === 145 /* TypeParameter */ + || kind === 226 /* VariableDeclaration */ + || kind === 290 /* JSDocTypedefTag */; } function isDeclarationStatementKind(kind) { - return kind === 225 /* FunctionDeclaration */ - || kind === 244 /* MissingDeclaration */ - || kind === 226 /* ClassDeclaration */ - || kind === 227 /* InterfaceDeclaration */ - || kind === 228 /* TypeAliasDeclaration */ - || kind === 229 /* EnumDeclaration */ - || kind === 230 /* ModuleDeclaration */ - || kind === 235 /* ImportDeclaration */ - || kind === 234 /* ImportEqualsDeclaration */ - || kind === 241 /* ExportDeclaration */ - || kind === 240 /* ExportAssignment */ - || kind === 233 /* NamespaceExportDeclaration */; + return kind === 228 /* FunctionDeclaration */ + || kind === 247 /* MissingDeclaration */ + || kind === 229 /* ClassDeclaration */ + || kind === 230 /* InterfaceDeclaration */ + || kind === 231 /* TypeAliasDeclaration */ + || kind === 232 /* EnumDeclaration */ + || kind === 233 /* ModuleDeclaration */ + || kind === 238 /* ImportDeclaration */ + || kind === 237 /* ImportEqualsDeclaration */ + || kind === 244 /* ExportDeclaration */ + || kind === 243 /* ExportAssignment */ + || kind === 236 /* NamespaceExportDeclaration */; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 215 /* BreakStatement */ - || kind === 214 /* ContinueStatement */ - || kind === 222 /* DebuggerStatement */ - || kind === 209 /* DoStatement */ - || kind === 207 /* ExpressionStatement */ - || kind === 206 /* EmptyStatement */ - || kind === 212 /* ForInStatement */ - || kind === 213 /* ForOfStatement */ - || kind === 211 /* ForStatement */ - || kind === 208 /* IfStatement */ - || kind === 219 /* LabeledStatement */ - || kind === 216 /* ReturnStatement */ - || kind === 218 /* SwitchStatement */ - || kind === 220 /* ThrowStatement */ - || kind === 221 /* TryStatement */ - || kind === 205 /* VariableStatement */ - || kind === 210 /* WhileStatement */ - || kind === 217 /* WithStatement */ - || kind === 293 /* NotEmittedStatement */ - || kind === 296 /* EndOfDeclarationMarker */ - || kind === 295 /* MergeDeclarationMarker */; + return kind === 218 /* BreakStatement */ + || kind === 217 /* ContinueStatement */ + || kind === 225 /* DebuggerStatement */ + || kind === 212 /* DoStatement */ + || kind === 210 /* ExpressionStatement */ + || kind === 209 /* EmptyStatement */ + || kind === 215 /* ForInStatement */ + || kind === 216 /* ForOfStatement */ + || kind === 214 /* ForStatement */ + || kind === 211 /* IfStatement */ + || kind === 222 /* LabeledStatement */ + || kind === 219 /* ReturnStatement */ + || kind === 221 /* SwitchStatement */ + || kind === 223 /* ThrowStatement */ + || kind === 224 /* TryStatement */ + || kind === 208 /* VariableStatement */ + || kind === 213 /* WhileStatement */ + || kind === 220 /* WithStatement */ + || kind === 295 /* NotEmittedStatement */ + || kind === 298 /* EndOfDeclarationMarker */ + || kind === 297 /* MergeDeclarationMarker */; } function isDeclaration(node) { return isDeclarationKind(node.kind); @@ -10214,93 +10448,104 @@ var ts; var kind = node.kind; return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) - || kind === 204 /* Block */; + || kind === 207 /* Block */; } ts.isStatement = isStatement; // Module references function isModuleReference(node) { var kind = node.kind; - return kind === 245 /* ExternalModuleReference */ - || kind === 141 /* QualifiedName */ - || kind === 70 /* Identifier */; + return kind === 248 /* ExternalModuleReference */ + || kind === 143 /* QualifiedName */ + || kind === 71 /* Identifier */; } ts.isModuleReference = isModuleReference; // JSX function isJsxOpeningElement(node) { - return node.kind === 248 /* JsxOpeningElement */; + return node.kind === 251 /* JsxOpeningElement */; } ts.isJsxOpeningElement = isJsxOpeningElement; function isJsxClosingElement(node) { - return node.kind === 249 /* JsxClosingElement */; + return node.kind === 252 /* JsxClosingElement */; } ts.isJsxClosingElement = isJsxClosingElement; function isJsxTagNameExpression(node) { var kind = node.kind; - return kind === 98 /* ThisKeyword */ - || kind === 70 /* Identifier */ - || kind === 177 /* PropertyAccessExpression */; + return kind === 99 /* ThisKeyword */ + || kind === 71 /* Identifier */ + || kind === 179 /* PropertyAccessExpression */; } ts.isJsxTagNameExpression = isJsxTagNameExpression; function isJsxChild(node) { var kind = node.kind; - return kind === 246 /* JsxElement */ - || kind === 252 /* JsxExpression */ - || kind === 247 /* JsxSelfClosingElement */ + return kind === 249 /* JsxElement */ + || kind === 256 /* JsxExpression */ + || kind === 250 /* JsxSelfClosingElement */ || kind === 10 /* JsxText */; } ts.isJsxChild = isJsxChild; + function isJsxAttributes(node) { + var kind = node.kind; + return kind === 254 /* JsxAttributes */; + } + ts.isJsxAttributes = isJsxAttributes; function isJsxAttributeLike(node) { var kind = node.kind; - return kind === 250 /* JsxAttribute */ - || kind === 251 /* JsxSpreadAttribute */; + return kind === 253 /* JsxAttribute */ + || kind === 255 /* JsxSpreadAttribute */; } ts.isJsxAttributeLike = isJsxAttributeLike; function isJsxSpreadAttribute(node) { - return node.kind === 251 /* JsxSpreadAttribute */; + return node.kind === 255 /* JsxSpreadAttribute */; } ts.isJsxSpreadAttribute = isJsxSpreadAttribute; function isJsxAttribute(node) { - return node.kind === 250 /* JsxAttribute */; + return node.kind === 253 /* JsxAttribute */; } ts.isJsxAttribute = isJsxAttribute; function isStringLiteralOrJsxExpression(node) { var kind = node.kind; return kind === 9 /* StringLiteral */ - || kind === 252 /* JsxExpression */; + || kind === 256 /* JsxExpression */; } ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression; + function isJsxOpeningLikeElement(node) { + var kind = node.kind; + return kind === 251 /* JsxOpeningElement */ + || kind === 250 /* JsxSelfClosingElement */; + } + ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement; // Clauses function isCaseOrDefaultClause(node) { var kind = node.kind; - return kind === 253 /* CaseClause */ - || kind === 254 /* DefaultClause */; + return kind === 257 /* CaseClause */ + || kind === 258 /* DefaultClause */; } ts.isCaseOrDefaultClause = isCaseOrDefaultClause; function isHeritageClause(node) { - return node.kind === 255 /* HeritageClause */; + return node.kind === 259 /* HeritageClause */; } ts.isHeritageClause = isHeritageClause; function isCatchClause(node) { - return node.kind === 256 /* CatchClause */; + return node.kind === 260 /* CatchClause */; } ts.isCatchClause = isCatchClause; // Property assignments function isPropertyAssignment(node) { - return node.kind === 257 /* PropertyAssignment */; + return node.kind === 261 /* PropertyAssignment */; } ts.isPropertyAssignment = isPropertyAssignment; function isShorthandPropertyAssignment(node) { - return node.kind === 258 /* ShorthandPropertyAssignment */; + return node.kind === 262 /* ShorthandPropertyAssignment */; } ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment; // Enum function isEnumMember(node) { - return node.kind === 260 /* EnumMember */; + return node.kind === 264 /* EnumMember */; } ts.isEnumMember = isEnumMember; // Top-level nodes function isSourceFile(node) { - return node.kind === 261 /* SourceFile */; + return node.kind === 265 /* SourceFile */; } ts.isSourceFile = isSourceFile; function isWatchSet(options) { @@ -10313,12 +10558,13 @@ var ts; function getDefaultLibFileName(options) { switch (options.target) { case 5 /* ESNext */: + return "lib.esnext.full.d.ts"; case 4 /* ES2017 */: - return "lib.es2017.d.ts"; + return "lib.es2017.full.d.ts"; case 3 /* ES2016 */: - return "lib.es2016.d.ts"; + return "lib.es2016.full.d.ts"; case 2 /* ES2015 */: - return "lib.es6.d.ts"; + return "lib.es6.d.ts"; // We don't use lib.es2015.full.d.ts due to breaking change. default: return "lib.d.ts"; } @@ -10526,13 +10772,13 @@ var ts; oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)); newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)); } - return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), /*newLength:*/ newEndN - oldStartN); + return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), /*newLength*/ newEndN - oldStartN); } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function getTypeParameterOwner(d) { - if (d && d.kind === 143 /* TypeParameter */) { + if (d && d.kind === 145 /* TypeParameter */) { for (var current = d; current; current = current.parent) { - if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 227 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 230 /* InterfaceDeclaration */) { return current; } } @@ -10540,11 +10786,11 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; function isParameterPropertyDeclaration(node) { - return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && node.parent.kind === 150 /* Constructor */ && ts.isClassLike(node.parent.parent); + return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && node.parent.kind === 152 /* Constructor */ && ts.isClassLike(node.parent.parent); } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; function walkUpBindingElementsAndPatterns(node) { - while (node && (node.kind === 174 /* BindingElement */ || ts.isBindingPattern(node))) { + while (node && (node.kind === 176 /* BindingElement */ || ts.isBindingPattern(node))) { node = node.parent; } return node; @@ -10552,14 +10798,14 @@ var ts; function getCombinedModifierFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = ts.getModifierFlags(node); - if (node.kind === 223 /* VariableDeclaration */) { + if (node.kind === 226 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 224 /* VariableDeclarationList */) { + if (node && node.kind === 227 /* VariableDeclarationList */) { flags |= ts.getModifierFlags(node); node = node.parent; } - if (node && node.kind === 205 /* VariableStatement */) { + if (node && node.kind === 208 /* VariableStatement */) { flags |= ts.getModifierFlags(node); } return flags; @@ -10575,23 +10821,23 @@ var ts; function getCombinedNodeFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = node.flags; - if (node.kind === 223 /* VariableDeclaration */) { + if (node.kind === 226 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 224 /* VariableDeclarationList */) { + if (node && node.kind === 227 /* VariableDeclarationList */) { flags |= node.flags; node = node.parent; } - if (node && node.kind === 205 /* VariableStatement */) { + if (node && node.kind === 208 /* VariableStatement */) { flags |= node.flags; } return flags; } ts.getCombinedNodeFlags = getCombinedNodeFlags; /** - * Checks to see if the locale is in the appropriate format, - * and if it is, attempts to set the appropriate language. - */ + * Checks to see if the locale is in the appropriate format, + * and if it is, attempts to set the appropriate language. + */ function validateLocaleAndSetLanguage(locale, sys, errors) { var matchResult = /^([a-z]+)([_\-]([a-z]+))?$/.exec(locale.toLowerCase()); if (!matchResult) { @@ -10642,27 +10888,60 @@ var ts; } } ts.validateLocaleAndSetLanguage = validateLocaleAndSetLanguage; + function getOriginalNode(node, nodeTest) { + if (node) { + while (node.original !== undefined) { + node = node.original; + } + } + return !nodeTest || nodeTest(node) ? node : undefined; + } + ts.getOriginalNode = getOriginalNode; + /** + * Gets a value indicating whether a node originated in the parse tree. + * + * @param node The node to test. + */ + function isParseTreeNode(node) { + return (node.flags & 8 /* Synthesized */) === 0; + } + ts.isParseTreeNode = isParseTreeNode; + function getParseTreeNode(node, nodeTest) { + if (node === undefined || isParseTreeNode(node)) { + return node; + } + node = getOriginalNode(node); + if (isParseTreeNode(node) && (!nodeTest || nodeTest(node))) { + return node; + } + return undefined; + } + ts.getParseTreeNode = getParseTreeNode; + /** + * Remove extra underscore from escaped identifier text content. + * + * @param identifier The escaped identifier text. + * @returns The unescaped identifier text. + */ + function unescapeIdentifier(identifier) { + return identifier.length >= 3 && identifier.charCodeAt(0) === 95 /* _ */ && identifier.charCodeAt(1) === 95 /* _ */ && identifier.charCodeAt(2) === 95 /* _ */ ? identifier.substr(1) : identifier; + } + ts.unescapeIdentifier = unescapeIdentifier; })(ts || (ts = {})); /// /// -/* @internal */ var ts; (function (ts) { - var NodeConstructor; - var SourceFileConstructor; - function createNode(kind, location, flags) { - var ConstructorForKind = kind === 261 /* SourceFile */ - ? (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor())) - : (NodeConstructor || (NodeConstructor = ts.objectAllocator.getNodeConstructor())); - var node = location - ? new ConstructorForKind(kind, location.pos, location.end) - : new ConstructorForKind(kind, /*pos*/ -1, /*end*/ -1); - node.flags = flags | 8 /* Synthesized */; + function createSynthesizedNode(kind) { + var node = ts.createNode(kind, -1, -1); + node.flags |= 8 /* Synthesized */; return node; } + /* @internal */ function updateNode(updated, original) { if (updated !== original) { setOriginalNode(updated, original); + setTextRange(updated, original); if (original.startsOnNewLine) { updated.startsOnNewLine = true; } @@ -10671,7 +10950,10 @@ var ts; return updated; } ts.updateNode = updateNode; - function createNodeArray(elements, location, hasTrailingComma) { + /** + * Make `elements` into a `NodeArray`. If `elements` is `undefined`, returns an empty `NodeArray`. + */ + function createNodeArray(elements, hasTrailingComma) { if (elements) { if (ts.isNodeArray(elements)) { return elements; @@ -10681,38 +10963,22 @@ var ts; elements = []; } var array = elements; - if (location) { - array.pos = location.pos; - array.end = location.end; - } - else { - array.pos = -1; - array.end = -1; - } - if (hasTrailingComma) { - array.hasTrailingComma = true; - } + array.pos = -1; + array.end = -1; + array.hasTrailingComma = hasTrailingComma; return array; } ts.createNodeArray = createNodeArray; - function createSynthesizedNode(kind, startsOnNewLine) { - var node = createNode(kind, /*location*/ undefined); - node.startsOnNewLine = startsOnNewLine; - return node; - } - ts.createSynthesizedNode = createSynthesizedNode; - function createSynthesizedNodeArray(elements) { - return createNodeArray(elements, /*location*/ undefined); - } - ts.createSynthesizedNodeArray = createSynthesizedNodeArray; /** * Creates a shallow, memberwise clone of a node with no source map location. */ + /* @internal */ function getSynthesizedClone(node) { // We don't use "clone" from core.ts here, as we need to preserve the prototype chain of // the original node. We also need to exclude specific properties and only include own- // properties (to skip members already defined on the shared prototype). - var clone = createNode(node.kind, /*location*/ undefined, node.flags); + var clone = createSynthesizedNode(node.kind); + clone.flags |= node.flags; setOriginalNode(clone, node); for (var key in node) { if (clone.hasOwnProperty(key) || !node.hasOwnProperty(key)) { @@ -10723,54 +10989,50 @@ var ts; return clone; } ts.getSynthesizedClone = getSynthesizedClone; - /** - * Creates a shallow, memberwise clone of a node for mutation. - */ - function getMutableClone(node) { - var clone = getSynthesizedClone(node); - clone.pos = node.pos; - clone.end = node.end; - clone.parent = node.parent; - return clone; - } - ts.getMutableClone = getMutableClone; - function createLiteral(value, location) { + function createLiteral(value) { if (typeof value === "number") { - var node = createNode(8 /* NumericLiteral */, location, /*flags*/ undefined); - node.text = value.toString(); - return node; + return createNumericLiteral(value + ""); } - else if (typeof value === "boolean") { - return createNode(value ? 100 /* TrueKeyword */ : 85 /* FalseKeyword */, location, /*flags*/ undefined); + if (typeof value === "boolean") { + return value ? createTrue() : createFalse(); } - else if (typeof value === "string") { - var node = createNode(9 /* StringLiteral */, location, /*flags*/ undefined); - node.text = value; - return node; - } - else if (value) { - var node = createNode(9 /* StringLiteral */, location, /*flags*/ undefined); - node.textSourceNode = value; - node.text = value.text; - return node; + if (typeof value === "string") { + return createStringLiteral(value); } + return createLiteralFromNode(value); } ts.createLiteral = createLiteral; + function createNumericLiteral(value) { + var node = createSynthesizedNode(8 /* NumericLiteral */); + node.text = value; + node.numericLiteralFlags = 0; + return node; + } + ts.createNumericLiteral = createNumericLiteral; + function createStringLiteral(text) { + var node = createSynthesizedNode(9 /* StringLiteral */); + node.text = text; + return node; + } + function createLiteralFromNode(sourceNode) { + var node = createStringLiteral(sourceNode.text); + node.textSourceNode = sourceNode; + return node; + } // Identifiers - var nextAutoGenerateId = 0; - function createIdentifier(text, location) { - var node = createNode(70 /* Identifier */, location); + function createIdentifier(text) { + var node = createSynthesizedNode(71 /* Identifier */); node.text = ts.escapeIdentifier(text); - node.originalKeywordKind = ts.stringToToken(text); + node.originalKeywordKind = text ? ts.stringToToken(text) : 0 /* Unknown */; node.autoGenerateKind = 0 /* None */; node.autoGenerateId = 0; return node; } ts.createIdentifier = createIdentifier; - function createTempVariable(recordTempVariable, location) { - var name = createNode(70 /* Identifier */, location); - name.text = ""; - name.originalKeywordKind = 0 /* Unknown */; + var nextAutoGenerateId = 0; + /** Create a unique temporary variable. */ + function createTempVariable(recordTempVariable) { + var name = createIdentifier(""); name.autoGenerateKind = 1 /* Auto */; name.autoGenerateId = nextAutoGenerateId; nextAutoGenerateId++; @@ -10780,98 +11042,399 @@ var ts; return name; } ts.createTempVariable = createTempVariable; - function createLoopVariable(location) { - var name = createNode(70 /* Identifier */, location); - name.text = ""; - name.originalKeywordKind = 0 /* Unknown */; + /** Create a unique temporary variable for use in a loop. */ + function createLoopVariable() { + var name = createIdentifier(""); name.autoGenerateKind = 2 /* Loop */; name.autoGenerateId = nextAutoGenerateId; nextAutoGenerateId++; return name; } ts.createLoopVariable = createLoopVariable; - function createUniqueName(text, location) { - var name = createNode(70 /* Identifier */, location); - name.text = text; - name.originalKeywordKind = 0 /* Unknown */; + /** Create a unique name based on the supplied text. */ + function createUniqueName(text) { + var name = createIdentifier(text); name.autoGenerateKind = 3 /* Unique */; name.autoGenerateId = nextAutoGenerateId; nextAutoGenerateId++; return name; } ts.createUniqueName = createUniqueName; - function getGeneratedNameForNode(node, location) { - var name = createNode(70 /* Identifier */, location); - name.original = node; - name.text = ""; - name.originalKeywordKind = 0 /* Unknown */; + /** Create a unique name generated for a node. */ + function getGeneratedNameForNode(node) { + var name = createIdentifier(""); name.autoGenerateKind = 4 /* Node */; name.autoGenerateId = nextAutoGenerateId; + name.original = node; nextAutoGenerateId++; return name; } ts.getGeneratedNameForNode = getGeneratedNameForNode; // Punctuation function createToken(token) { - return createNode(token); + return createSynthesizedNode(token); } ts.createToken = createToken; // Reserved words function createSuper() { - var node = createNode(96 /* SuperKeyword */); - return node; + return createSynthesizedNode(97 /* SuperKeyword */); } ts.createSuper = createSuper; - function createThis(location) { - var node = createNode(98 /* ThisKeyword */, location); - return node; + function createThis() { + return createSynthesizedNode(99 /* ThisKeyword */); } ts.createThis = createThis; function createNull() { - var node = createNode(94 /* NullKeyword */); - return node; + return createSynthesizedNode(95 /* NullKeyword */); } ts.createNull = createNull; + function createTrue() { + return createSynthesizedNode(101 /* TrueKeyword */); + } + ts.createTrue = createTrue; + function createFalse() { + return createSynthesizedNode(86 /* FalseKeyword */); + } + ts.createFalse = createFalse; // Names - function createComputedPropertyName(expression, location) { - var node = createNode(142 /* ComputedPropertyName */, location); + function createQualifiedName(left, right) { + var node = createSynthesizedNode(143 /* QualifiedName */); + node.left = left; + node.right = asName(right); + return node; + } + ts.createQualifiedName = createQualifiedName; + function updateQualifiedName(node, left, right) { + return node.left !== left + || node.right !== right + ? updateNode(createQualifiedName(left, right), node) + : node; + } + ts.updateQualifiedName = updateQualifiedName; + function createComputedPropertyName(expression) { + var node = createSynthesizedNode(144 /* ComputedPropertyName */); node.expression = expression; return node; } ts.createComputedPropertyName = createComputedPropertyName; function updateComputedPropertyName(node, expression) { - if (node.expression !== expression) { - return updateNode(createComputedPropertyName(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createComputedPropertyName(expression), node) + : node; } ts.updateComputedPropertyName = updateComputedPropertyName; + // Type Elements + function createSignatureDeclaration(kind, typeParameters, parameters, type) { + var signatureDeclaration = createSynthesizedNode(kind); + signatureDeclaration.typeParameters = asNodeArray(typeParameters); + signatureDeclaration.parameters = asNodeArray(parameters); + signatureDeclaration.type = type; + return signatureDeclaration; + } + ts.createSignatureDeclaration = createSignatureDeclaration; + function updateSignatureDeclaration(node, typeParameters, parameters, type) { + return node.typeParameters !== typeParameters + || node.parameters !== parameters + || node.type !== type + ? updateNode(createSignatureDeclaration(node.kind, typeParameters, parameters, type), node) + : node; + } + function createFunctionTypeNode(typeParameters, parameters, type) { + return createSignatureDeclaration(160 /* FunctionType */, typeParameters, parameters, type); + } + ts.createFunctionTypeNode = createFunctionTypeNode; + function updateFunctionTypeNode(node, typeParameters, parameters, type) { + return updateSignatureDeclaration(node, typeParameters, parameters, type); + } + ts.updateFunctionTypeNode = updateFunctionTypeNode; + function createConstructorTypeNode(typeParameters, parameters, type) { + return createSignatureDeclaration(161 /* ConstructorType */, typeParameters, parameters, type); + } + ts.createConstructorTypeNode = createConstructorTypeNode; + function updateConstructorTypeNode(node, typeParameters, parameters, type) { + return updateSignatureDeclaration(node, typeParameters, parameters, type); + } + ts.updateConstructorTypeNode = updateConstructorTypeNode; + function createCallSignatureDeclaration(typeParameters, parameters, type) { + return createSignatureDeclaration(155 /* CallSignature */, typeParameters, parameters, type); + } + ts.createCallSignatureDeclaration = createCallSignatureDeclaration; + function updateCallSignatureDeclaration(node, typeParameters, parameters, type) { + return updateSignatureDeclaration(node, typeParameters, parameters, type); + } + ts.updateCallSignatureDeclaration = updateCallSignatureDeclaration; + function createConstructSignatureDeclaration(typeParameters, parameters, type) { + return createSignatureDeclaration(156 /* ConstructSignature */, typeParameters, parameters, type); + } + ts.createConstructSignatureDeclaration = createConstructSignatureDeclaration; + function updateConstructSignatureDeclaration(node, typeParameters, parameters, type) { + return updateSignatureDeclaration(node, typeParameters, parameters, type); + } + ts.updateConstructSignatureDeclaration = updateConstructSignatureDeclaration; + function createMethodSignature(typeParameters, parameters, type, name, questionToken) { + var methodSignature = createSignatureDeclaration(150 /* MethodSignature */, typeParameters, parameters, type); + methodSignature.name = asName(name); + methodSignature.questionToken = questionToken; + return methodSignature; + } + ts.createMethodSignature = createMethodSignature; + function updateMethodSignature(node, typeParameters, parameters, type, name, questionToken) { + return node.typeParameters !== typeParameters + || node.parameters !== parameters + || node.type !== type + || node.name !== name + || node.questionToken !== questionToken + ? updateNode(createMethodSignature(typeParameters, parameters, type, name, questionToken), node) + : node; + } + ts.updateMethodSignature = updateMethodSignature; + // Types + function createKeywordTypeNode(kind) { + return createSynthesizedNode(kind); + } + ts.createKeywordTypeNode = createKeywordTypeNode; + function createThisTypeNode() { + return createSynthesizedNode(169 /* ThisType */); + } + ts.createThisTypeNode = createThisTypeNode; + function createLiteralTypeNode(literal) { + var literalTypeNode = createSynthesizedNode(173 /* LiteralType */); + literalTypeNode.literal = literal; + return literalTypeNode; + } + ts.createLiteralTypeNode = createLiteralTypeNode; + function updateLiteralTypeNode(node, literal) { + return node.literal !== literal + ? updateNode(createLiteralTypeNode(literal), node) + : node; + } + ts.updateLiteralTypeNode = updateLiteralTypeNode; + function createTypeReferenceNode(typeName, typeArguments) { + var typeReference = createSynthesizedNode(159 /* TypeReference */); + typeReference.typeName = asName(typeName); + typeReference.typeArguments = asNodeArray(typeArguments); + return typeReference; + } + ts.createTypeReferenceNode = createTypeReferenceNode; + function updateTypeReferenceNode(node, typeName, typeArguments) { + return node.typeName !== typeName + || node.typeArguments !== typeArguments + ? updateNode(createTypeReferenceNode(typeName, typeArguments), node) + : node; + } + ts.updateTypeReferenceNode = updateTypeReferenceNode; + function createTypePredicateNode(parameterName, type) { + var typePredicateNode = createSynthesizedNode(158 /* TypePredicate */); + typePredicateNode.parameterName = asName(parameterName); + typePredicateNode.type = type; + return typePredicateNode; + } + ts.createTypePredicateNode = createTypePredicateNode; + function updateTypePredicateNode(node, parameterName, type) { + return node.parameterName !== parameterName + || node.type !== type + ? updateNode(createTypePredicateNode(parameterName, type), node) + : node; + } + ts.updateTypePredicateNode = updateTypePredicateNode; + function createTypeQueryNode(exprName) { + var typeQueryNode = createSynthesizedNode(162 /* TypeQuery */); + typeQueryNode.exprName = exprName; + return typeQueryNode; + } + ts.createTypeQueryNode = createTypeQueryNode; + function updateTypeQueryNode(node, exprName) { + return node.exprName !== exprName ? updateNode(createTypeQueryNode(exprName), node) : node; + } + ts.updateTypeQueryNode = updateTypeQueryNode; + function createArrayTypeNode(elementType) { + var arrayTypeNode = createSynthesizedNode(164 /* ArrayType */); + arrayTypeNode.elementType = elementType; + return arrayTypeNode; + } + ts.createArrayTypeNode = createArrayTypeNode; + function updateArrayTypeNode(node, elementType) { + return node.elementType !== elementType + ? updateNode(createArrayTypeNode(elementType), node) + : node; + } + ts.updateArrayTypeNode = updateArrayTypeNode; + function createUnionOrIntersectionTypeNode(kind, types) { + var unionTypeNode = createSynthesizedNode(kind); + unionTypeNode.types = createNodeArray(types); + return unionTypeNode; + } + ts.createUnionOrIntersectionTypeNode = createUnionOrIntersectionTypeNode; + function updateUnionOrIntersectionTypeNode(node, types) { + return node.types !== types + ? updateNode(createUnionOrIntersectionTypeNode(node.kind, types), node) + : node; + } + ts.updateUnionOrIntersectionTypeNode = updateUnionOrIntersectionTypeNode; + function createTypeLiteralNode(members) { + var typeLiteralNode = createSynthesizedNode(163 /* TypeLiteral */); + typeLiteralNode.members = createNodeArray(members); + return typeLiteralNode; + } + ts.createTypeLiteralNode = createTypeLiteralNode; + function updateTypeLiteralNode(node, members) { + return node.members !== members + ? updateNode(createTypeLiteralNode(members), node) + : node; + } + ts.updateTypeLiteralNode = updateTypeLiteralNode; + function createTupleTypeNode(elementTypes) { + var tupleTypeNode = createSynthesizedNode(165 /* TupleType */); + tupleTypeNode.elementTypes = createNodeArray(elementTypes); + return tupleTypeNode; + } + ts.createTupleTypeNode = createTupleTypeNode; + function updateTypleTypeNode(node, elementTypes) { + return node.elementTypes !== elementTypes + ? updateNode(createTupleTypeNode(elementTypes), node) + : node; + } + ts.updateTypleTypeNode = updateTypleTypeNode; + function createMappedTypeNode(readonlyToken, typeParameter, questionToken, type) { + var mappedTypeNode = createSynthesizedNode(172 /* MappedType */); + mappedTypeNode.readonlyToken = readonlyToken; + mappedTypeNode.typeParameter = typeParameter; + mappedTypeNode.questionToken = questionToken; + mappedTypeNode.type = type; + return mappedTypeNode; + } + ts.createMappedTypeNode = createMappedTypeNode; + function updateMappedTypeNode(node, readonlyToken, typeParameter, questionToken, type) { + return node.readonlyToken !== readonlyToken + || node.typeParameter !== typeParameter + || node.questionToken !== questionToken + || node.type !== type + ? updateNode(createMappedTypeNode(readonlyToken, typeParameter, questionToken, type), node) + : node; + } + ts.updateMappedTypeNode = updateMappedTypeNode; + function createTypeOperatorNode(type) { + var typeOperatorNode = createSynthesizedNode(170 /* TypeOperator */); + typeOperatorNode.operator = 127 /* KeyOfKeyword */; + typeOperatorNode.type = type; + return typeOperatorNode; + } + ts.createTypeOperatorNode = createTypeOperatorNode; + function updateTypeOperatorNode(node, type) { + return node.type !== type ? updateNode(createTypeOperatorNode(type), node) : node; + } + ts.updateTypeOperatorNode = updateTypeOperatorNode; + function createIndexedAccessTypeNode(objectType, indexType) { + var indexedAccessTypeNode = createSynthesizedNode(171 /* IndexedAccessType */); + indexedAccessTypeNode.objectType = objectType; + indexedAccessTypeNode.indexType = indexType; + return indexedAccessTypeNode; + } + ts.createIndexedAccessTypeNode = createIndexedAccessTypeNode; + function updateIndexedAccessTypeNode(node, objectType, indexType) { + return node.objectType !== objectType + || node.indexType !== indexType + ? updateNode(createIndexedAccessTypeNode(objectType, indexType), node) + : node; + } + ts.updateIndexedAccessTypeNode = updateIndexedAccessTypeNode; + // Type Declarations + function createTypeParameterDeclaration(name, constraint, defaultType) { + var typeParameter = createSynthesizedNode(145 /* TypeParameter */); + typeParameter.name = asName(name); + typeParameter.constraint = constraint; + typeParameter.default = defaultType; + return typeParameter; + } + ts.createTypeParameterDeclaration = createTypeParameterDeclaration; + function updateTypeParameterDeclaration(node, name, constraint, defaultType) { + return node.name !== name + || node.constraint !== constraint + || node.default !== defaultType + ? updateNode(createTypeParameterDeclaration(name, constraint, defaultType), node) + : node; + } + ts.updateTypeParameterDeclaration = updateTypeParameterDeclaration; // Signature elements - function createParameter(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer, location, flags) { - var node = createNode(144 /* Parameter */, location, flags); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createPropertySignature(name, questionToken, type, initializer) { + var propertySignature = createSynthesizedNode(148 /* PropertySignature */); + propertySignature.name = asName(name); + propertySignature.questionToken = questionToken; + propertySignature.type = type; + propertySignature.initializer = initializer; + return propertySignature; + } + ts.createPropertySignature = createPropertySignature; + function updatePropertySignature(node, name, questionToken, type, initializer) { + return node.name !== name + || node.questionToken !== questionToken + || node.type !== type + || node.initializer !== initializer + ? updateNode(createPropertySignature(name, questionToken, type, initializer), node) + : node; + } + ts.updatePropertySignature = updatePropertySignature; + function createIndexSignatureDeclaration(decorators, modifiers, parameters, type) { + var indexSignature = createSynthesizedNode(157 /* IndexSignature */); + indexSignature.decorators = asNodeArray(decorators); + indexSignature.modifiers = asNodeArray(modifiers); + indexSignature.parameters = createNodeArray(parameters); + indexSignature.type = type; + return indexSignature; + } + ts.createIndexSignatureDeclaration = createIndexSignatureDeclaration; + function updateIndexSignatureDeclaration(node, decorators, modifiers, parameters, type) { + return node.parameters !== parameters + || node.type !== type + || node.decorators !== decorators + || node.modifiers !== modifiers + ? updateNode(createIndexSignatureDeclaration(decorators, modifiers, parameters, type), node) + : node; + } + ts.updateIndexSignatureDeclaration = updateIndexSignatureDeclaration; + // Signature elements + function createParameter(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { + var node = createSynthesizedNode(146 /* Parameter */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.dotDotDotToken = dotDotDotToken; - node.name = typeof name === "string" ? createIdentifier(name) : name; + node.name = asName(name); node.questionToken = questionToken; node.type = type; - node.initializer = initializer ? parenthesizeExpressionForList(initializer) : undefined; + node.initializer = initializer ? ts.parenthesizeExpressionForList(initializer) : undefined; return node; } ts.createParameter = createParameter; - function updateParameter(node, decorators, modifiers, dotDotDotToken, name, type, initializer) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.type !== type || node.initializer !== initializer) { - return updateNode(createParameter(decorators, modifiers, dotDotDotToken, name, node.questionToken, type, initializer, /*location*/ node, /*flags*/ node.flags), node); - } - return node; + function updateParameter(node, decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.dotDotDotToken !== dotDotDotToken + || node.name !== name + || node.questionToken !== questionToken + || node.type !== type + || node.initializer !== initializer + ? updateNode(createParameter(decorators, modifiers, dotDotDotToken, name, node.questionToken, type, initializer), node) + : node; } ts.updateParameter = updateParameter; + function createDecorator(expression) { + var node = createSynthesizedNode(147 /* Decorator */); + node.expression = ts.parenthesizeForAccess(expression); + return node; + } + ts.createDecorator = createDecorator; + function updateDecorator(node, expression) { + return node.expression !== expression + ? updateNode(createDecorator(expression), node) + : node; + } + ts.updateDecorator = updateDecorator; // Type members - function createProperty(decorators, modifiers, name, questionToken, type, initializer, location) { - var node = createNode(147 /* PropertyDeclaration */, location); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; - node.name = typeof name === "string" ? createIdentifier(name) : name; + function createProperty(decorators, modifiers, name, questionToken, type, initializer) { + var node = createSynthesizedNode(149 /* PropertyDeclaration */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); node.questionToken = questionToken; node.type = type; node.initializer = initializer; @@ -10879,36 +11442,46 @@ var ts; } ts.createProperty = createProperty; function updateProperty(node, decorators, modifiers, name, type, initializer) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name || node.type !== type || node.initializer !== initializer) { - return updateNode(createProperty(decorators, modifiers, name, node.questionToken, type, initializer, node), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.type !== type + || node.initializer !== initializer + ? updateNode(createProperty(decorators, modifiers, name, node.questionToken, type, initializer), node) + : node; } ts.updateProperty = updateProperty; - function createMethod(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body, location, flags) { - var node = createNode(149 /* MethodDeclaration */, location, flags); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createMethodDeclaration(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { + var node = createSynthesizedNode(151 /* MethodDeclaration */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; - node.name = typeof name === "string" ? createIdentifier(name) : name; - node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined; + node.name = asName(name); + node.questionToken = questionToken; + node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); node.type = type; node.body = body; return node; } - ts.createMethod = createMethod; - function updateMethod(node, decorators, modifiers, name, typeParameters, parameters, type, body) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body) { - return updateNode(createMethod(decorators, modifiers, node.asteriskToken, name, typeParameters, parameters, type, body, /*location*/ node, node.flags), node); - } - return node; + ts.createMethodDeclaration = createMethodDeclaration; + function updateMethod(node, decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.asteriskToken !== asteriskToken + || node.name !== name + || node.typeParameters !== typeParameters + || node.parameters !== parameters + || node.type !== type + || node.body !== body + ? updateNode(createMethodDeclaration(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body), node) + : node; } ts.updateMethod = updateMethod; - function createConstructor(decorators, modifiers, parameters, body, location, flags) { - var node = createNode(150 /* Constructor */, location, flags); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createConstructor(decorators, modifiers, parameters, body) { + var node = createSynthesizedNode(152 /* Constructor */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.typeParameters = undefined; node.parameters = createNodeArray(parameters); node.type = undefined; @@ -10917,17 +11490,19 @@ var ts; } ts.createConstructor = createConstructor; function updateConstructor(node, decorators, modifiers, parameters, body) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.parameters !== parameters || node.body !== body) { - return updateNode(createConstructor(decorators, modifiers, parameters, body, /*location*/ node, node.flags), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.parameters !== parameters + || node.body !== body + ? updateNode(createConstructor(decorators, modifiers, parameters, body), node) + : node; } ts.updateConstructor = updateConstructor; - function createGetAccessor(decorators, modifiers, name, parameters, type, body, location, flags) { - var node = createNode(151 /* GetAccessor */, location, flags); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; - node.name = typeof name === "string" ? createIdentifier(name) : name; + function createGetAccessor(decorators, modifiers, name, parameters, type, body) { + var node = createSynthesizedNode(153 /* GetAccessor */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); node.typeParameters = undefined; node.parameters = createNodeArray(parameters); node.type = type; @@ -10936,17 +11511,21 @@ var ts; } ts.createGetAccessor = createGetAccessor; function updateGetAccessor(node, decorators, modifiers, name, parameters, type, body) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name || node.parameters !== parameters || node.type !== type || node.body !== body) { - return updateNode(createGetAccessor(decorators, modifiers, name, parameters, type, body, /*location*/ node, node.flags), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.parameters !== parameters + || node.type !== type + || node.body !== body + ? updateNode(createGetAccessor(decorators, modifiers, name, parameters, type, body), node) + : node; } ts.updateGetAccessor = updateGetAccessor; - function createSetAccessor(decorators, modifiers, name, parameters, body, location, flags) { - var node = createNode(152 /* SetAccessor */, location, flags); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; - node.name = typeof name === "string" ? createIdentifier(name) : name; + function createSetAccessor(decorators, modifiers, name, parameters, body) { + var node = createSynthesizedNode(154 /* SetAccessor */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); node.typeParameters = undefined; node.parameters = createNodeArray(parameters); node.body = body; @@ -10954,59 +11533,62 @@ var ts; } ts.createSetAccessor = createSetAccessor; function updateSetAccessor(node, decorators, modifiers, name, parameters, body) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name || node.parameters !== parameters || node.body !== body) { - return updateNode(createSetAccessor(decorators, modifiers, name, parameters, body, /*location*/ node, node.flags), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.parameters !== parameters + || node.body !== body + ? updateNode(createSetAccessor(decorators, modifiers, name, parameters, body), node) + : node; } ts.updateSetAccessor = updateSetAccessor; // Binding Patterns - function createObjectBindingPattern(elements, location) { - var node = createNode(172 /* ObjectBindingPattern */, location); + function createObjectBindingPattern(elements) { + var node = createSynthesizedNode(174 /* ObjectBindingPattern */); node.elements = createNodeArray(elements); return node; } ts.createObjectBindingPattern = createObjectBindingPattern; function updateObjectBindingPattern(node, elements) { - if (node.elements !== elements) { - return updateNode(createObjectBindingPattern(elements, node), node); - } - return node; + return node.elements !== elements + ? updateNode(createObjectBindingPattern(elements), node) + : node; } ts.updateObjectBindingPattern = updateObjectBindingPattern; - function createArrayBindingPattern(elements, location) { - var node = createNode(173 /* ArrayBindingPattern */, location); + function createArrayBindingPattern(elements) { + var node = createSynthesizedNode(175 /* ArrayBindingPattern */); node.elements = createNodeArray(elements); return node; } ts.createArrayBindingPattern = createArrayBindingPattern; function updateArrayBindingPattern(node, elements) { - if (node.elements !== elements) { - return updateNode(createArrayBindingPattern(elements, node), node); - } - return node; + return node.elements !== elements + ? updateNode(createArrayBindingPattern(elements), node) + : node; } ts.updateArrayBindingPattern = updateArrayBindingPattern; - function createBindingElement(propertyName, dotDotDotToken, name, initializer, location) { - var node = createNode(174 /* BindingElement */, location); - node.propertyName = typeof propertyName === "string" ? createIdentifier(propertyName) : propertyName; + function createBindingElement(dotDotDotToken, propertyName, name, initializer) { + var node = createSynthesizedNode(176 /* BindingElement */); node.dotDotDotToken = dotDotDotToken; - node.name = typeof name === "string" ? createIdentifier(name) : name; + node.propertyName = asName(propertyName); + node.name = asName(name); node.initializer = initializer; return node; } ts.createBindingElement = createBindingElement; function updateBindingElement(node, dotDotDotToken, propertyName, name, initializer) { - if (node.propertyName !== propertyName || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.initializer !== initializer) { - return updateNode(createBindingElement(propertyName, dotDotDotToken, name, initializer, node), node); - } - return node; + return node.propertyName !== propertyName + || node.dotDotDotToken !== dotDotDotToken + || node.name !== name + || node.initializer !== initializer + ? updateNode(createBindingElement(dotDotDotToken, propertyName, name, initializer), node) + : node; } ts.updateBindingElement = updateBindingElement; // Expression - function createArrayLiteral(elements, location, multiLine) { - var node = createNode(175 /* ArrayLiteralExpression */, location); - node.elements = parenthesizeListElements(createNodeArray(elements)); + function createArrayLiteral(elements, multiLine) { + var node = createSynthesizedNode(177 /* ArrayLiteralExpression */); + node.elements = ts.parenthesizeListElements(createNodeArray(elements)); if (multiLine) { node.multiLine = true; } @@ -11014,14 +11596,13 @@ var ts; } ts.createArrayLiteral = createArrayLiteral; function updateArrayLiteral(node, elements) { - if (node.elements !== elements) { - return updateNode(createArrayLiteral(elements, node, node.multiLine), node); - } - return node; + return node.elements !== elements + ? updateNode(createArrayLiteral(elements, node.multiLine), node) + : node; } ts.updateArrayLiteral = updateArrayLiteral; - function createObjectLiteral(properties, location, multiLine) { - var node = createNode(176 /* ObjectLiteralExpression */, location); + function createObjectLiteral(properties, multiLine) { + var node = createSynthesizedNode(178 /* ObjectLiteralExpression */); node.properties = createNodeArray(properties); if (multiLine) { node.multiLine = true; @@ -11030,436 +11611,465 @@ var ts; } ts.createObjectLiteral = createObjectLiteral; function updateObjectLiteral(node, properties) { - if (node.properties !== properties) { - return updateNode(createObjectLiteral(properties, node, node.multiLine), node); - } - return node; + return node.properties !== properties + ? updateNode(createObjectLiteral(properties, node.multiLine), node) + : node; } ts.updateObjectLiteral = updateObjectLiteral; - function createPropertyAccess(expression, name, location, flags) { - var node = createNode(177 /* PropertyAccessExpression */, location, flags); - node.expression = parenthesizeForAccess(expression); - (node.emitNode || (node.emitNode = {})).flags |= 65536 /* NoIndentation */; - node.name = typeof name === "string" ? createIdentifier(name) : name; + function createPropertyAccess(expression, name) { + var node = createSynthesizedNode(179 /* PropertyAccessExpression */); + node.expression = ts.parenthesizeForAccess(expression); + node.name = asName(name); + setEmitFlags(node, 131072 /* NoIndentation */); return node; } ts.createPropertyAccess = createPropertyAccess; function updatePropertyAccess(node, expression, name) { - if (node.expression !== expression || node.name !== name) { - var propertyAccess = createPropertyAccess(expression, name, /*location*/ node, node.flags); - // Because we are updating existed propertyAccess we want to inherit its emitFlags instead of using default from createPropertyAccess - (propertyAccess.emitNode || (propertyAccess.emitNode = {})).flags = getEmitFlags(node); - return updateNode(propertyAccess, node); - } - return node; + // Because we are updating existed propertyAccess we want to inherit its emitFlags + // instead of using the default from createPropertyAccess + return node.expression !== expression + || node.name !== name + ? updateNode(setEmitFlags(createPropertyAccess(expression, name), getEmitFlags(node)), node) + : node; } ts.updatePropertyAccess = updatePropertyAccess; - function createElementAccess(expression, index, location) { - var node = createNode(178 /* ElementAccessExpression */, location); - node.expression = parenthesizeForAccess(expression); - node.argumentExpression = typeof index === "number" ? createLiteral(index) : index; + function createElementAccess(expression, index) { + var node = createSynthesizedNode(180 /* ElementAccessExpression */); + node.expression = ts.parenthesizeForAccess(expression); + node.argumentExpression = asExpression(index); return node; } ts.createElementAccess = createElementAccess; function updateElementAccess(node, expression, argumentExpression) { - if (node.expression !== expression || node.argumentExpression !== argumentExpression) { - return updateNode(createElementAccess(expression, argumentExpression, node), node); - } - return node; + return node.expression !== expression + || node.argumentExpression !== argumentExpression + ? updateNode(createElementAccess(expression, argumentExpression), node) + : node; } ts.updateElementAccess = updateElementAccess; - function createCall(expression, typeArguments, argumentsArray, location, flags) { - var node = createNode(179 /* CallExpression */, location, flags); - node.expression = parenthesizeForAccess(expression); - if (typeArguments) { - node.typeArguments = createNodeArray(typeArguments); - } - node.arguments = parenthesizeListElements(createNodeArray(argumentsArray)); + function createCall(expression, typeArguments, argumentsArray) { + var node = createSynthesizedNode(181 /* CallExpression */); + node.expression = ts.parenthesizeForAccess(expression); + node.typeArguments = asNodeArray(typeArguments); + node.arguments = ts.parenthesizeListElements(createNodeArray(argumentsArray)); return node; } ts.createCall = createCall; function updateCall(node, expression, typeArguments, argumentsArray) { - if (expression !== node.expression || typeArguments !== node.typeArguments || argumentsArray !== node.arguments) { - return updateNode(createCall(expression, typeArguments, argumentsArray, /*location*/ node, node.flags), node); - } - return node; + return expression !== node.expression + || typeArguments !== node.typeArguments + || argumentsArray !== node.arguments + ? updateNode(createCall(expression, typeArguments, argumentsArray), node) + : node; } ts.updateCall = updateCall; - function createNew(expression, typeArguments, argumentsArray, location, flags) { - var node = createNode(180 /* NewExpression */, location, flags); - node.expression = parenthesizeForNew(expression); - node.typeArguments = typeArguments ? createNodeArray(typeArguments) : undefined; - node.arguments = argumentsArray ? parenthesizeListElements(createNodeArray(argumentsArray)) : undefined; + function createNew(expression, typeArguments, argumentsArray) { + var node = createSynthesizedNode(182 /* NewExpression */); + node.expression = ts.parenthesizeForNew(expression); + node.typeArguments = asNodeArray(typeArguments); + node.arguments = argumentsArray ? ts.parenthesizeListElements(createNodeArray(argumentsArray)) : undefined; return node; } ts.createNew = createNew; function updateNew(node, expression, typeArguments, argumentsArray) { - if (node.expression !== expression || node.typeArguments !== typeArguments || node.arguments !== argumentsArray) { - return updateNode(createNew(expression, typeArguments, argumentsArray, /*location*/ node, node.flags), node); - } - return node; + return node.expression !== expression + || node.typeArguments !== typeArguments + || node.arguments !== argumentsArray + ? updateNode(createNew(expression, typeArguments, argumentsArray), node) + : node; } ts.updateNew = updateNew; - function createTaggedTemplate(tag, template, location) { - var node = createNode(181 /* TaggedTemplateExpression */, location); - node.tag = parenthesizeForAccess(tag); + function createTaggedTemplate(tag, template) { + var node = createSynthesizedNode(183 /* TaggedTemplateExpression */); + node.tag = ts.parenthesizeForAccess(tag); node.template = template; return node; } ts.createTaggedTemplate = createTaggedTemplate; function updateTaggedTemplate(node, tag, template) { - if (node.tag !== tag || node.template !== template) { - return updateNode(createTaggedTemplate(tag, template, node), node); - } - return node; + return node.tag !== tag + || node.template !== template + ? updateNode(createTaggedTemplate(tag, template), node) + : node; } ts.updateTaggedTemplate = updateTaggedTemplate; - function createParen(expression, location) { - var node = createNode(183 /* ParenthesizedExpression */, location); + function createTypeAssertion(type, expression) { + var node = createSynthesizedNode(184 /* TypeAssertionExpression */); + node.type = type; + node.expression = ts.parenthesizePrefixOperand(expression); + return node; + } + ts.createTypeAssertion = createTypeAssertion; + function updateTypeAssertion(node, type, expression) { + return node.type !== type + || node.expression !== expression + ? updateNode(createTypeAssertion(type, expression), node) + : node; + } + ts.updateTypeAssertion = updateTypeAssertion; + function createParen(expression) { + var node = createSynthesizedNode(185 /* ParenthesizedExpression */); node.expression = expression; return node; } ts.createParen = createParen; function updateParen(node, expression) { - if (node.expression !== expression) { - return updateNode(createParen(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createParen(expression), node) + : node; } ts.updateParen = updateParen; - function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body, location, flags) { - var node = createNode(184 /* FunctionExpression */, location, flags); - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { + var node = createSynthesizedNode(186 /* FunctionExpression */); + node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; - node.name = typeof name === "string" ? createIdentifier(name) : name; - node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined; + node.name = asName(name); + node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); node.type = type; node.body = body; return node; } ts.createFunctionExpression = createFunctionExpression; - function updateFunctionExpression(node, modifiers, name, typeParameters, parameters, type, body) { - if (node.name !== name || node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body) { - return updateNode(createFunctionExpression(modifiers, node.asteriskToken, name, typeParameters, parameters, type, body, /*location*/ node, node.flags), node); - } - return node; + function updateFunctionExpression(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { + return node.name !== name + || node.modifiers !== modifiers + || node.asteriskToken !== asteriskToken + || node.typeParameters !== typeParameters + || node.parameters !== parameters + || node.type !== type + || node.body !== body + ? updateNode(createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body), node) + : node; } ts.updateFunctionExpression = updateFunctionExpression; - function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body, location, flags) { - var node = createNode(185 /* ArrowFunction */, location, flags); - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; - node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined; + function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { + var node = createSynthesizedNode(187 /* ArrowFunction */); + node.modifiers = asNodeArray(modifiers); + node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); node.type = type; - node.equalsGreaterThanToken = equalsGreaterThanToken || createToken(35 /* EqualsGreaterThanToken */); - node.body = parenthesizeConciseBody(body); + node.equalsGreaterThanToken = equalsGreaterThanToken || createToken(36 /* EqualsGreaterThanToken */); + node.body = ts.parenthesizeConciseBody(body); return node; } ts.createArrowFunction = createArrowFunction; function updateArrowFunction(node, modifiers, typeParameters, parameters, type, body) { - if (node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body) { - return updateNode(createArrowFunction(modifiers, typeParameters, parameters, type, node.equalsGreaterThanToken, body, /*location*/ node, node.flags), node); - } - return node; + return node.modifiers !== modifiers + || node.typeParameters !== typeParameters + || node.parameters !== parameters + || node.type !== type + || node.body !== body + ? updateNode(createArrowFunction(modifiers, typeParameters, parameters, type, node.equalsGreaterThanToken, body), node) + : node; } ts.updateArrowFunction = updateArrowFunction; - function createDelete(expression, location) { - var node = createNode(186 /* DeleteExpression */, location); - node.expression = parenthesizePrefixOperand(expression); + function createDelete(expression) { + var node = createSynthesizedNode(188 /* DeleteExpression */); + node.expression = ts.parenthesizePrefixOperand(expression); return node; } ts.createDelete = createDelete; function updateDelete(node, expression) { - if (node.expression !== expression) { - return updateNode(createDelete(expression, node), expression); - } - return node; + return node.expression !== expression + ? updateNode(createDelete(expression), node) + : node; } ts.updateDelete = updateDelete; - function createTypeOf(expression, location) { - var node = createNode(187 /* TypeOfExpression */, location); - node.expression = parenthesizePrefixOperand(expression); + function createTypeOf(expression) { + var node = createSynthesizedNode(189 /* TypeOfExpression */); + node.expression = ts.parenthesizePrefixOperand(expression); return node; } ts.createTypeOf = createTypeOf; function updateTypeOf(node, expression) { - if (node.expression !== expression) { - return updateNode(createTypeOf(expression, node), expression); - } - return node; + return node.expression !== expression + ? updateNode(createTypeOf(expression), node) + : node; } ts.updateTypeOf = updateTypeOf; - function createVoid(expression, location) { - var node = createNode(188 /* VoidExpression */, location); - node.expression = parenthesizePrefixOperand(expression); + function createVoid(expression) { + var node = createSynthesizedNode(190 /* VoidExpression */); + node.expression = ts.parenthesizePrefixOperand(expression); return node; } ts.createVoid = createVoid; function updateVoid(node, expression) { - if (node.expression !== expression) { - return updateNode(createVoid(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createVoid(expression), node) + : node; } ts.updateVoid = updateVoid; - function createAwait(expression, location) { - var node = createNode(189 /* AwaitExpression */, location); - node.expression = parenthesizePrefixOperand(expression); + function createAwait(expression) { + var node = createSynthesizedNode(191 /* AwaitExpression */); + node.expression = ts.parenthesizePrefixOperand(expression); return node; } ts.createAwait = createAwait; function updateAwait(node, expression) { - if (node.expression !== expression) { - return updateNode(createAwait(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createAwait(expression), node) + : node; } ts.updateAwait = updateAwait; - function createPrefix(operator, operand, location) { - var node = createNode(190 /* PrefixUnaryExpression */, location); + function createPrefix(operator, operand) { + var node = createSynthesizedNode(192 /* PrefixUnaryExpression */); node.operator = operator; - node.operand = parenthesizePrefixOperand(operand); + node.operand = ts.parenthesizePrefixOperand(operand); return node; } ts.createPrefix = createPrefix; function updatePrefix(node, operand) { - if (node.operand !== operand) { - return updateNode(createPrefix(node.operator, operand, node), node); - } - return node; + return node.operand !== operand + ? updateNode(createPrefix(node.operator, operand), node) + : node; } ts.updatePrefix = updatePrefix; - function createPostfix(operand, operator, location) { - var node = createNode(191 /* PostfixUnaryExpression */, location); - node.operand = parenthesizePostfixOperand(operand); + function createPostfix(operand, operator) { + var node = createSynthesizedNode(193 /* PostfixUnaryExpression */); + node.operand = ts.parenthesizePostfixOperand(operand); node.operator = operator; return node; } ts.createPostfix = createPostfix; function updatePostfix(node, operand) { - if (node.operand !== operand) { - return updateNode(createPostfix(operand, node.operator, node), node); - } - return node; + return node.operand !== operand + ? updateNode(createPostfix(operand, node.operator), node) + : node; } ts.updatePostfix = updatePostfix; - function createBinary(left, operator, right, location) { - var operatorToken = typeof operator === "number" ? createToken(operator) : operator; + function createBinary(left, operator, right) { + var node = createSynthesizedNode(194 /* BinaryExpression */); + var operatorToken = asToken(operator); var operatorKind = operatorToken.kind; - var node = createNode(192 /* BinaryExpression */, location); - node.left = parenthesizeBinaryOperand(operatorKind, left, /*isLeftSideOfBinary*/ true, /*leftOperand*/ undefined); + node.left = ts.parenthesizeBinaryOperand(operatorKind, left, /*isLeftSideOfBinary*/ true, /*leftOperand*/ undefined); node.operatorToken = operatorToken; - node.right = parenthesizeBinaryOperand(operatorKind, right, /*isLeftSideOfBinary*/ false, node.left); + node.right = ts.parenthesizeBinaryOperand(operatorKind, right, /*isLeftSideOfBinary*/ false, node.left); return node; } ts.createBinary = createBinary; function updateBinary(node, left, right) { - if (node.left !== left || node.right !== right) { - return updateNode(createBinary(left, node.operatorToken, right, /*location*/ node), node); - } - return node; + return node.left !== left + || node.right !== right + ? updateNode(createBinary(left, node.operatorToken, right), node) + : node; } ts.updateBinary = updateBinary; - function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonTokenOrLocation, whenFalse, location) { - var node = createNode(193 /* ConditionalExpression */, whenFalse ? location : colonTokenOrLocation); - node.condition = parenthesizeForConditionalHead(condition); - if (whenFalse) { - // second overload - node.questionToken = questionTokenOrWhenTrue; - node.whenTrue = parenthesizeSubexpressionOfConditionalExpression(whenTrueOrWhenFalse); - node.colonToken = colonTokenOrLocation; - node.whenFalse = parenthesizeSubexpressionOfConditionalExpression(whenFalse); - } - else { - // first overload - node.questionToken = createToken(54 /* QuestionToken */); - node.whenTrue = parenthesizeSubexpressionOfConditionalExpression(questionTokenOrWhenTrue); - node.colonToken = createToken(55 /* ColonToken */); - node.whenFalse = parenthesizeSubexpressionOfConditionalExpression(whenTrueOrWhenFalse); - } + function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) { + var node = createSynthesizedNode(195 /* ConditionalExpression */); + node.condition = ts.parenthesizeForConditionalHead(condition); + node.questionToken = whenFalse ? questionTokenOrWhenTrue : createToken(55 /* QuestionToken */); + node.whenTrue = ts.parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenTrueOrWhenFalse : questionTokenOrWhenTrue); + node.colonToken = whenFalse ? colonToken : createToken(56 /* ColonToken */); + node.whenFalse = ts.parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenFalse : whenTrueOrWhenFalse); return node; } ts.createConditional = createConditional; function updateConditional(node, condition, whenTrue, whenFalse) { - if (node.condition !== condition || node.whenTrue !== whenTrue || node.whenFalse !== whenFalse) { - return updateNode(createConditional(condition, node.questionToken, whenTrue, node.colonToken, whenFalse, node), node); - } - return node; + return node.condition !== condition + || node.whenTrue !== whenTrue + || node.whenFalse !== whenFalse + ? updateNode(createConditional(condition, node.questionToken, whenTrue, node.colonToken, whenFalse), node) + : node; } ts.updateConditional = updateConditional; - function createTemplateExpression(head, templateSpans, location) { - var node = createNode(194 /* TemplateExpression */, location); + function createTemplateExpression(head, templateSpans) { + var node = createSynthesizedNode(196 /* TemplateExpression */); node.head = head; node.templateSpans = createNodeArray(templateSpans); return node; } ts.createTemplateExpression = createTemplateExpression; function updateTemplateExpression(node, head, templateSpans) { - if (node.head !== head || node.templateSpans !== templateSpans) { - return updateNode(createTemplateExpression(head, templateSpans, node), node); - } - return node; + return node.head !== head + || node.templateSpans !== templateSpans + ? updateNode(createTemplateExpression(head, templateSpans), node) + : node; } ts.updateTemplateExpression = updateTemplateExpression; - function createYield(asteriskToken, expression, location) { - var node = createNode(195 /* YieldExpression */, location); - node.asteriskToken = asteriskToken; - node.expression = expression; + function createYield(asteriskTokenOrExpression, expression) { + var node = createSynthesizedNode(197 /* YieldExpression */); + node.asteriskToken = asteriskTokenOrExpression && asteriskTokenOrExpression.kind === 39 /* AsteriskToken */ ? asteriskTokenOrExpression : undefined; + node.expression = asteriskTokenOrExpression && asteriskTokenOrExpression.kind !== 39 /* AsteriskToken */ ? asteriskTokenOrExpression : expression; return node; } ts.createYield = createYield; - function updateYield(node, expression) { - if (node.expression !== expression) { - return updateNode(createYield(node.asteriskToken, expression, node), node); - } - return node; + function updateYield(node, asteriskToken, expression) { + return node.expression !== expression + || node.asteriskToken !== asteriskToken + ? updateNode(createYield(asteriskToken, expression), node) + : node; } ts.updateYield = updateYield; - function createSpread(expression, location) { - var node = createNode(196 /* SpreadElement */, location); - node.expression = parenthesizeExpressionForList(expression); + function createSpread(expression) { + var node = createSynthesizedNode(198 /* SpreadElement */); + node.expression = ts.parenthesizeExpressionForList(expression); return node; } ts.createSpread = createSpread; function updateSpread(node, expression) { - if (node.expression !== expression) { - return updateNode(createSpread(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createSpread(expression), node) + : node; } ts.updateSpread = updateSpread; - function createClassExpression(modifiers, name, typeParameters, heritageClauses, members, location) { - var node = createNode(197 /* ClassExpression */, location); + function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) { + var node = createSynthesizedNode(199 /* ClassExpression */); node.decorators = undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; - node.name = name; - node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined; - node.heritageClauses = createNodeArray(heritageClauses); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); + node.typeParameters = asNodeArray(typeParameters); + node.heritageClauses = asNodeArray(heritageClauses); node.members = createNodeArray(members); return node; } ts.createClassExpression = createClassExpression; function updateClassExpression(node, modifiers, name, typeParameters, heritageClauses, members) { - if (node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members) { - return updateNode(createClassExpression(modifiers, name, typeParameters, heritageClauses, members, node), node); - } - return node; + return node.modifiers !== modifiers + || node.name !== name + || node.typeParameters !== typeParameters + || node.heritageClauses !== heritageClauses + || node.members !== members + ? updateNode(createClassExpression(modifiers, name, typeParameters, heritageClauses, members), node) + : node; } ts.updateClassExpression = updateClassExpression; - function createOmittedExpression(location) { - var node = createNode(198 /* OmittedExpression */, location); - return node; + function createOmittedExpression() { + return createSynthesizedNode(200 /* OmittedExpression */); } ts.createOmittedExpression = createOmittedExpression; - function createExpressionWithTypeArguments(typeArguments, expression, location) { - var node = createNode(199 /* ExpressionWithTypeArguments */, location); - node.typeArguments = typeArguments ? createNodeArray(typeArguments) : undefined; - node.expression = parenthesizeForAccess(expression); + function createExpressionWithTypeArguments(typeArguments, expression) { + var node = createSynthesizedNode(201 /* ExpressionWithTypeArguments */); + node.expression = ts.parenthesizeForAccess(expression); + node.typeArguments = asNodeArray(typeArguments); return node; } ts.createExpressionWithTypeArguments = createExpressionWithTypeArguments; function updateExpressionWithTypeArguments(node, typeArguments, expression) { - if (node.typeArguments !== typeArguments || node.expression !== expression) { - return updateNode(createExpressionWithTypeArguments(typeArguments, expression, node), node); - } - return node; + return node.typeArguments !== typeArguments + || node.expression !== expression + ? updateNode(createExpressionWithTypeArguments(typeArguments, expression), node) + : node; } ts.updateExpressionWithTypeArguments = updateExpressionWithTypeArguments; + function createAsExpression(expression, type) { + var node = createSynthesizedNode(202 /* AsExpression */); + node.expression = expression; + node.type = type; + return node; + } + ts.createAsExpression = createAsExpression; + function updateAsExpression(node, expression, type) { + return node.expression !== expression + || node.type !== type + ? updateNode(createAsExpression(expression, type), node) + : node; + } + ts.updateAsExpression = updateAsExpression; + function createNonNullExpression(expression) { + var node = createSynthesizedNode(203 /* NonNullExpression */); + node.expression = ts.parenthesizeForAccess(expression); + return node; + } + ts.createNonNullExpression = createNonNullExpression; + function updateNonNullExpression(node, expression) { + return node.expression !== expression + ? updateNode(createNonNullExpression(expression), node) + : node; + } + ts.updateNonNullExpression = updateNonNullExpression; // Misc - function createTemplateSpan(expression, literal, location) { - var node = createNode(202 /* TemplateSpan */, location); + function createTemplateSpan(expression, literal) { + var node = createSynthesizedNode(205 /* TemplateSpan */); node.expression = expression; node.literal = literal; return node; } ts.createTemplateSpan = createTemplateSpan; function updateTemplateSpan(node, expression, literal) { - if (node.expression !== expression || node.literal !== literal) { - return updateNode(createTemplateSpan(expression, literal, node), node); - } - return node; + return node.expression !== expression + || node.literal !== literal + ? updateNode(createTemplateSpan(expression, literal), node) + : node; } ts.updateTemplateSpan = updateTemplateSpan; // Element - function createBlock(statements, location, multiLine, flags) { - var block = createNode(204 /* Block */, location, flags); + function createBlock(statements, multiLine) { + var block = createSynthesizedNode(207 /* Block */); block.statements = createNodeArray(statements); - if (multiLine) { - block.multiLine = true; - } + if (multiLine) + block.multiLine = multiLine; return block; } ts.createBlock = createBlock; function updateBlock(node, statements) { - if (statements !== node.statements) { - return updateNode(createBlock(statements, /*location*/ node, node.multiLine, node.flags), node); - } - return node; + return statements !== node.statements + ? updateNode(createBlock(statements, node.multiLine), node) + : node; } ts.updateBlock = updateBlock; - function createVariableStatement(modifiers, declarationList, location, flags) { - var node = createNode(205 /* VariableStatement */, location, flags); + function createVariableStatement(modifiers, declarationList) { + var node = createSynthesizedNode(208 /* VariableStatement */); node.decorators = undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + node.modifiers = asNodeArray(modifiers); node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; return node; } ts.createVariableStatement = createVariableStatement; function updateVariableStatement(node, modifiers, declarationList) { - if (node.modifiers !== modifiers || node.declarationList !== declarationList) { - return updateNode(createVariableStatement(modifiers, declarationList, /*location*/ node, node.flags), node); - } - return node; + return node.modifiers !== modifiers + || node.declarationList !== declarationList + ? updateNode(createVariableStatement(modifiers, declarationList), node) + : node; } ts.updateVariableStatement = updateVariableStatement; - function createVariableDeclarationList(declarations, location, flags) { - var node = createNode(224 /* VariableDeclarationList */, location, flags); + function createVariableDeclarationList(declarations, flags) { + var node = createSynthesizedNode(227 /* VariableDeclarationList */); + node.flags |= flags; node.declarations = createNodeArray(declarations); return node; } ts.createVariableDeclarationList = createVariableDeclarationList; function updateVariableDeclarationList(node, declarations) { - if (node.declarations !== declarations) { - return updateNode(createVariableDeclarationList(declarations, /*location*/ node, node.flags), node); - } - return node; + return node.declarations !== declarations + ? updateNode(createVariableDeclarationList(declarations, node.flags), node) + : node; } ts.updateVariableDeclarationList = updateVariableDeclarationList; - function createVariableDeclaration(name, type, initializer, location, flags) { - var node = createNode(223 /* VariableDeclaration */, location, flags); - node.name = typeof name === "string" ? createIdentifier(name) : name; + function createVariableDeclaration(name, type, initializer) { + var node = createSynthesizedNode(226 /* VariableDeclaration */); + node.name = asName(name); node.type = type; - node.initializer = initializer !== undefined ? parenthesizeExpressionForList(initializer) : undefined; + node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; return node; } ts.createVariableDeclaration = createVariableDeclaration; function updateVariableDeclaration(node, name, type, initializer) { - if (node.name !== name || node.type !== type || node.initializer !== initializer) { - return updateNode(createVariableDeclaration(name, type, initializer, /*location*/ node, node.flags), node); - } - return node; + return node.name !== name + || node.type !== type + || node.initializer !== initializer + ? updateNode(createVariableDeclaration(name, type, initializer), node) + : node; } ts.updateVariableDeclaration = updateVariableDeclaration; - function createEmptyStatement(location) { - return createNode(206 /* EmptyStatement */, location); + function createEmptyStatement() { + return createSynthesizedNode(209 /* EmptyStatement */); } ts.createEmptyStatement = createEmptyStatement; - function createStatement(expression, location, flags) { - var node = createNode(207 /* ExpressionStatement */, location, flags); - node.expression = parenthesizeExpressionForExpressionStatement(expression); + function createStatement(expression) { + var node = createSynthesizedNode(210 /* ExpressionStatement */); + node.expression = ts.parenthesizeExpressionForExpressionStatement(expression); return node; } ts.createStatement = createStatement; function updateStatement(node, expression) { - if (node.expression !== expression) { - return updateNode(createStatement(expression, /*location*/ node, node.flags), node); - } - return node; + return node.expression !== expression + ? updateNode(createStatement(expression), node) + : node; } ts.updateStatement = updateStatement; - function createIf(expression, thenStatement, elseStatement, location) { - var node = createNode(208 /* IfStatement */, location); + function createIf(expression, thenStatement, elseStatement) { + var node = createSynthesizedNode(211 /* IfStatement */); node.expression = expression; node.thenStatement = thenStatement; node.elseStatement = elseStatement; @@ -11467,42 +12077,43 @@ var ts; } ts.createIf = createIf; function updateIf(node, expression, thenStatement, elseStatement) { - if (node.expression !== expression || node.thenStatement !== thenStatement || node.elseStatement !== elseStatement) { - return updateNode(createIf(expression, thenStatement, elseStatement, /*location*/ node), node); - } - return node; + return node.expression !== expression + || node.thenStatement !== thenStatement + || node.elseStatement !== elseStatement + ? updateNode(createIf(expression, thenStatement, elseStatement), node) + : node; } ts.updateIf = updateIf; - function createDo(statement, expression, location) { - var node = createNode(209 /* DoStatement */, location); + function createDo(statement, expression) { + var node = createSynthesizedNode(212 /* DoStatement */); node.statement = statement; node.expression = expression; return node; } ts.createDo = createDo; function updateDo(node, statement, expression) { - if (node.statement !== statement || node.expression !== expression) { - return updateNode(createDo(statement, expression, node), node); - } - return node; + return node.statement !== statement + || node.expression !== expression + ? updateNode(createDo(statement, expression), node) + : node; } ts.updateDo = updateDo; - function createWhile(expression, statement, location) { - var node = createNode(210 /* WhileStatement */, location); + function createWhile(expression, statement) { + var node = createSynthesizedNode(213 /* WhileStatement */); node.expression = expression; node.statement = statement; return node; } ts.createWhile = createWhile; function updateWhile(node, expression, statement) { - if (node.expression !== expression || node.statement !== statement) { - return updateNode(createWhile(expression, statement, node), node); - } - return node; + return node.expression !== expression + || node.statement !== statement + ? updateNode(createWhile(expression, statement), node) + : node; } ts.updateWhile = updateWhile; - function createFor(initializer, condition, incrementor, statement, location) { - var node = createNode(211 /* ForStatement */, location, /*flags*/ undefined); + function createFor(initializer, condition, incrementor, statement) { + var node = createSynthesizedNode(214 /* ForStatement */); node.initializer = initializer; node.condition = condition; node.incrementor = incrementor; @@ -11511,14 +12122,16 @@ var ts; } ts.createFor = createFor; function updateFor(node, initializer, condition, incrementor, statement) { - if (node.initializer !== initializer || node.condition !== condition || node.incrementor !== incrementor || node.statement !== statement) { - return updateNode(createFor(initializer, condition, incrementor, statement, node), node); - } - return node; + return node.initializer !== initializer + || node.condition !== condition + || node.incrementor !== incrementor + || node.statement !== statement + ? updateNode(createFor(initializer, condition, incrementor, statement), node) + : node; } ts.updateFor = updateFor; - function createForIn(initializer, expression, statement, location) { - var node = createNode(212 /* ForInStatement */, location); + function createForIn(initializer, expression, statement) { + var node = createSynthesizedNode(215 /* ForInStatement */); node.initializer = initializer; node.expression = expression; node.statement = statement; @@ -11526,127 +12139,123 @@ var ts; } ts.createForIn = createForIn; function updateForIn(node, initializer, expression, statement) { - if (node.initializer !== initializer || node.expression !== expression || node.statement !== statement) { - return updateNode(createForIn(initializer, expression, statement, node), node); - } - return node; + return node.initializer !== initializer + || node.expression !== expression + || node.statement !== statement + ? updateNode(createForIn(initializer, expression, statement), node) + : node; } ts.updateForIn = updateForIn; - function createForOf(initializer, expression, statement, location) { - var node = createNode(213 /* ForOfStatement */, location); + function createForOf(awaitModifier, initializer, expression, statement) { + var node = createSynthesizedNode(216 /* ForOfStatement */); + node.awaitModifier = awaitModifier; node.initializer = initializer; node.expression = expression; node.statement = statement; return node; } ts.createForOf = createForOf; - function updateForOf(node, initializer, expression, statement) { - if (node.initializer !== initializer || node.expression !== expression || node.statement !== statement) { - return updateNode(createForOf(initializer, expression, statement, node), node); - } - return node; + function updateForOf(node, awaitModifier, initializer, expression, statement) { + return node.awaitModifier !== awaitModifier + || node.initializer !== initializer + || node.expression !== expression + || node.statement !== statement + ? updateNode(createForOf(awaitModifier, initializer, expression, statement), node) + : node; } ts.updateForOf = updateForOf; - function createContinue(label, location) { - var node = createNode(214 /* ContinueStatement */, location); - if (label) { - node.label = label; - } + function createContinue(label) { + var node = createSynthesizedNode(217 /* ContinueStatement */); + node.label = asName(label); return node; } ts.createContinue = createContinue; function updateContinue(node, label) { - if (node.label !== label) { - return updateNode(createContinue(label, node), node); - } - return node; + return node.label !== label + ? updateNode(createContinue(label), node) + : node; } ts.updateContinue = updateContinue; - function createBreak(label, location) { - var node = createNode(215 /* BreakStatement */, location); - if (label) { - node.label = label; - } + function createBreak(label) { + var node = createSynthesizedNode(218 /* BreakStatement */); + node.label = asName(label); return node; } ts.createBreak = createBreak; function updateBreak(node, label) { - if (node.label !== label) { - return updateNode(createBreak(label, node), node); - } - return node; + return node.label !== label + ? updateNode(createBreak(label), node) + : node; } ts.updateBreak = updateBreak; - function createReturn(expression, location) { - var node = createNode(216 /* ReturnStatement */, location); + function createReturn(expression) { + var node = createSynthesizedNode(219 /* ReturnStatement */); node.expression = expression; return node; } ts.createReturn = createReturn; function updateReturn(node, expression) { - if (node.expression !== expression) { - return updateNode(createReturn(expression, /*location*/ node), node); - } - return node; + return node.expression !== expression + ? updateNode(createReturn(expression), node) + : node; } ts.updateReturn = updateReturn; - function createWith(expression, statement, location) { - var node = createNode(217 /* WithStatement */, location); + function createWith(expression, statement) { + var node = createSynthesizedNode(220 /* WithStatement */); node.expression = expression; node.statement = statement; return node; } ts.createWith = createWith; function updateWith(node, expression, statement) { - if (node.expression !== expression || node.statement !== statement) { - return updateNode(createWith(expression, statement, node), node); - } - return node; + return node.expression !== expression + || node.statement !== statement + ? updateNode(createWith(expression, statement), node) + : node; } ts.updateWith = updateWith; - function createSwitch(expression, caseBlock, location) { - var node = createNode(218 /* SwitchStatement */, location); - node.expression = parenthesizeExpressionForList(expression); + function createSwitch(expression, caseBlock) { + var node = createSynthesizedNode(221 /* SwitchStatement */); + node.expression = ts.parenthesizeExpressionForList(expression); node.caseBlock = caseBlock; return node; } ts.createSwitch = createSwitch; function updateSwitch(node, expression, caseBlock) { - if (node.expression !== expression || node.caseBlock !== caseBlock) { - return updateNode(createSwitch(expression, caseBlock, node), node); - } - return node; + return node.expression !== expression + || node.caseBlock !== caseBlock + ? updateNode(createSwitch(expression, caseBlock), node) + : node; } ts.updateSwitch = updateSwitch; - function createLabel(label, statement, location) { - var node = createNode(219 /* LabeledStatement */, location); - node.label = typeof label === "string" ? createIdentifier(label) : label; + function createLabel(label, statement) { + var node = createSynthesizedNode(222 /* LabeledStatement */); + node.label = asName(label); node.statement = statement; return node; } ts.createLabel = createLabel; function updateLabel(node, label, statement) { - if (node.label !== label || node.statement !== statement) { - return updateNode(createLabel(label, statement, node), node); - } - return node; + return node.label !== label + || node.statement !== statement + ? updateNode(createLabel(label, statement), node) + : node; } ts.updateLabel = updateLabel; - function createThrow(expression, location) { - var node = createNode(220 /* ThrowStatement */, location); + function createThrow(expression) { + var node = createSynthesizedNode(223 /* ThrowStatement */); node.expression = expression; return node; } ts.createThrow = createThrow; function updateThrow(node, expression) { - if (node.expression !== expression) { - return updateNode(createThrow(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createThrow(expression), node) + : node; } ts.updateThrow = updateThrow; - function createTry(tryBlock, catchClause, finallyBlock, location) { - var node = createNode(221 /* TryStatement */, location); + function createTry(tryBlock, catchClause, finallyBlock) { + var node = createSynthesizedNode(224 /* TryStatement */); node.tryBlock = tryBlock; node.catchClause = catchClause; node.finallyBlock = finallyBlock; @@ -11654,195 +12263,286 @@ var ts; } ts.createTry = createTry; function updateTry(node, tryBlock, catchClause, finallyBlock) { - if (node.tryBlock !== tryBlock || node.catchClause !== catchClause || node.finallyBlock !== finallyBlock) { - return updateNode(createTry(tryBlock, catchClause, finallyBlock, node), node); - } - return node; + return node.tryBlock !== tryBlock + || node.catchClause !== catchClause + || node.finallyBlock !== finallyBlock + ? updateNode(createTry(tryBlock, catchClause, finallyBlock), node) + : node; } ts.updateTry = updateTry; - function createCaseBlock(clauses, location) { - var node = createNode(232 /* CaseBlock */, location); - node.clauses = createNodeArray(clauses); - return node; - } - ts.createCaseBlock = createCaseBlock; - function updateCaseBlock(node, clauses) { - if (node.clauses !== clauses) { - return updateNode(createCaseBlock(clauses, node), node); - } - return node; - } - ts.updateCaseBlock = updateCaseBlock; - function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body, location, flags) { - var node = createNode(225 /* FunctionDeclaration */, location, flags); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { + var node = createSynthesizedNode(228 /* FunctionDeclaration */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; - node.name = typeof name === "string" ? createIdentifier(name) : name; - node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined; + node.name = asName(name); + node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); node.type = type; node.body = body; return node; } ts.createFunctionDeclaration = createFunctionDeclaration; - function updateFunctionDeclaration(node, decorators, modifiers, name, typeParameters, parameters, type, body) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body) { - return updateNode(createFunctionDeclaration(decorators, modifiers, node.asteriskToken, name, typeParameters, parameters, type, body, /*location*/ node, node.flags), node); - } - return node; + function updateFunctionDeclaration(node, decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.asteriskToken !== asteriskToken + || node.name !== name + || node.typeParameters !== typeParameters + || node.parameters !== parameters + || node.type !== type + || node.body !== body + ? updateNode(createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body), node) + : node; } ts.updateFunctionDeclaration = updateFunctionDeclaration; - function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members, location) { - var node = createNode(226 /* ClassDeclaration */, location); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; - node.name = name; - node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined; - node.heritageClauses = createNodeArray(heritageClauses); + function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { + var node = createSynthesizedNode(229 /* ClassDeclaration */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); + node.typeParameters = asNodeArray(typeParameters); + node.heritageClauses = asNodeArray(heritageClauses); node.members = createNodeArray(members); return node; } ts.createClassDeclaration = createClassDeclaration; function updateClassDeclaration(node, decorators, modifiers, name, typeParameters, heritageClauses, members) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members) { - return updateNode(createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members, node), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.typeParameters !== typeParameters + || node.heritageClauses !== heritageClauses + || node.members !== members + ? updateNode(createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members), node) + : node; } ts.updateClassDeclaration = updateClassDeclaration; - function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier, location) { - var node = createNode(235 /* ImportDeclaration */, location); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createEnumDeclaration(decorators, modifiers, name, members) { + var node = createSynthesizedNode(232 /* EnumDeclaration */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); + node.members = createNodeArray(members); + return node; + } + ts.createEnumDeclaration = createEnumDeclaration; + function updateEnumDeclaration(node, decorators, modifiers, name, members) { + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.members !== members + ? updateNode(createEnumDeclaration(decorators, modifiers, name, members), node) + : node; + } + ts.updateEnumDeclaration = updateEnumDeclaration; + function createModuleDeclaration(decorators, modifiers, name, body, flags) { + var node = createSynthesizedNode(233 /* ModuleDeclaration */); + node.flags |= flags; + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = name; + node.body = body; + return node; + } + ts.createModuleDeclaration = createModuleDeclaration; + function updateModuleDeclaration(node, decorators, modifiers, name, body) { + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.body !== body + ? updateNode(createModuleDeclaration(decorators, modifiers, name, body, node.flags), node) + : node; + } + ts.updateModuleDeclaration = updateModuleDeclaration; + function createModuleBlock(statements) { + var node = createSynthesizedNode(234 /* ModuleBlock */); + node.statements = createNodeArray(statements); + return node; + } + ts.createModuleBlock = createModuleBlock; + function updateModuleBlock(node, statements) { + return node.statements !== statements + ? updateNode(createModuleBlock(statements), node) + : node; + } + ts.updateModuleBlock = updateModuleBlock; + function createCaseBlock(clauses) { + var node = createSynthesizedNode(235 /* CaseBlock */); + node.clauses = createNodeArray(clauses); + return node; + } + ts.createCaseBlock = createCaseBlock; + function updateCaseBlock(node, clauses) { + return node.clauses !== clauses + ? updateNode(createCaseBlock(clauses), node) + : node; + } + ts.updateCaseBlock = updateCaseBlock; + function createImportEqualsDeclaration(decorators, modifiers, name, moduleReference) { + var node = createSynthesizedNode(237 /* ImportEqualsDeclaration */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); + node.moduleReference = moduleReference; + return node; + } + ts.createImportEqualsDeclaration = createImportEqualsDeclaration; + function updateImportEqualsDeclaration(node, decorators, modifiers, name, moduleReference) { + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.moduleReference !== moduleReference + ? updateNode(createImportEqualsDeclaration(decorators, modifiers, name, moduleReference), node) + : node; + } + ts.updateImportEqualsDeclaration = updateImportEqualsDeclaration; + function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) { + var node = createSynthesizedNode(238 /* ImportDeclaration */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.importClause = importClause; node.moduleSpecifier = moduleSpecifier; return node; } ts.createImportDeclaration = createImportDeclaration; function updateImportDeclaration(node, decorators, modifiers, importClause, moduleSpecifier) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier) { - return updateNode(createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier, node), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier + ? updateNode(createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier), node) + : node; } ts.updateImportDeclaration = updateImportDeclaration; - function createImportClause(name, namedBindings, location) { - var node = createNode(236 /* ImportClause */, location); + function createImportClause(name, namedBindings) { + var node = createSynthesizedNode(239 /* ImportClause */); node.name = name; node.namedBindings = namedBindings; return node; } ts.createImportClause = createImportClause; function updateImportClause(node, name, namedBindings) { - if (node.name !== name || node.namedBindings !== namedBindings) { - return updateNode(createImportClause(name, namedBindings, node), node); - } - return node; + return node.name !== name + || node.namedBindings !== namedBindings + ? updateNode(createImportClause(name, namedBindings), node) + : node; } ts.updateImportClause = updateImportClause; - function createNamespaceImport(name, location) { - var node = createNode(237 /* NamespaceImport */, location); + function createNamespaceImport(name) { + var node = createSynthesizedNode(240 /* NamespaceImport */); node.name = name; return node; } ts.createNamespaceImport = createNamespaceImport; function updateNamespaceImport(node, name) { - if (node.name !== name) { - return updateNode(createNamespaceImport(name, node), node); - } - return node; + return node.name !== name + ? updateNode(createNamespaceImport(name), node) + : node; } ts.updateNamespaceImport = updateNamespaceImport; - function createNamedImports(elements, location) { - var node = createNode(238 /* NamedImports */, location); + function createNamedImports(elements) { + var node = createSynthesizedNode(241 /* NamedImports */); node.elements = createNodeArray(elements); return node; } ts.createNamedImports = createNamedImports; function updateNamedImports(node, elements) { - if (node.elements !== elements) { - return updateNode(createNamedImports(elements, node), node); - } - return node; + return node.elements !== elements + ? updateNode(createNamedImports(elements), node) + : node; } ts.updateNamedImports = updateNamedImports; - function createImportSpecifier(propertyName, name, location) { - var node = createNode(239 /* ImportSpecifier */, location); + function createImportSpecifier(propertyName, name) { + var node = createSynthesizedNode(242 /* ImportSpecifier */); node.propertyName = propertyName; node.name = name; return node; } ts.createImportSpecifier = createImportSpecifier; function updateImportSpecifier(node, propertyName, name) { - if (node.propertyName !== propertyName || node.name !== name) { - return updateNode(createImportSpecifier(propertyName, name, node), node); - } - return node; + return node.propertyName !== propertyName + || node.name !== name + ? updateNode(createImportSpecifier(propertyName, name), node) + : node; } ts.updateImportSpecifier = updateImportSpecifier; - function createExportAssignment(decorators, modifiers, isExportEquals, expression, location) { - var node = createNode(240 /* ExportAssignment */, location); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createExportAssignment(decorators, modifiers, isExportEquals, expression) { + var node = createSynthesizedNode(243 /* ExportAssignment */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.isExportEquals = isExportEquals; node.expression = expression; return node; } ts.createExportAssignment = createExportAssignment; function updateExportAssignment(node, decorators, modifiers, expression) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.expression !== expression) { - return updateNode(createExportAssignment(decorators, modifiers, node.isExportEquals, expression, node), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.expression !== expression + ? updateNode(createExportAssignment(decorators, modifiers, node.isExportEquals, expression), node) + : node; } ts.updateExportAssignment = updateExportAssignment; - function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier, location) { - var node = createNode(241 /* ExportDeclaration */, location); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier) { + var node = createSynthesizedNode(244 /* ExportDeclaration */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.exportClause = exportClause; node.moduleSpecifier = moduleSpecifier; return node; } ts.createExportDeclaration = createExportDeclaration; function updateExportDeclaration(node, decorators, modifiers, exportClause, moduleSpecifier) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.exportClause !== exportClause || node.moduleSpecifier !== moduleSpecifier) { - return updateNode(createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier, node), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.exportClause !== exportClause + || node.moduleSpecifier !== moduleSpecifier + ? updateNode(createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier), node) + : node; } ts.updateExportDeclaration = updateExportDeclaration; - function createNamedExports(elements, location) { - var node = createNode(242 /* NamedExports */, location); + function createNamedExports(elements) { + var node = createSynthesizedNode(245 /* NamedExports */); node.elements = createNodeArray(elements); return node; } ts.createNamedExports = createNamedExports; function updateNamedExports(node, elements) { - if (node.elements !== elements) { - return updateNode(createNamedExports(elements, node), node); - } - return node; + return node.elements !== elements + ? updateNode(createNamedExports(elements), node) + : node; } ts.updateNamedExports = updateNamedExports; - function createExportSpecifier(name, propertyName, location) { - var node = createNode(243 /* ExportSpecifier */, location); - node.name = typeof name === "string" ? createIdentifier(name) : name; - node.propertyName = typeof propertyName === "string" ? createIdentifier(propertyName) : propertyName; + function createExportSpecifier(propertyName, name) { + var node = createSynthesizedNode(246 /* ExportSpecifier */); + node.propertyName = asName(propertyName); + node.name = asName(name); return node; } ts.createExportSpecifier = createExportSpecifier; - function updateExportSpecifier(node, name, propertyName) { - if (node.name !== name || node.propertyName !== propertyName) { - return updateNode(createExportSpecifier(name, propertyName, node), node); - } - return node; + function updateExportSpecifier(node, propertyName, name) { + return node.propertyName !== propertyName + || node.name !== name + ? updateNode(createExportSpecifier(propertyName, name), node) + : node; } ts.updateExportSpecifier = updateExportSpecifier; + // Module references + function createExternalModuleReference(expression) { + var node = createSynthesizedNode(248 /* ExternalModuleReference */); + node.expression = expression; + return node; + } + ts.createExternalModuleReference = createExternalModuleReference; + function updateExternalModuleReference(node, expression) { + return node.expression !== expression + ? updateNode(createExternalModuleReference(expression), node) + : node; + } + ts.updateExternalModuleReference = updateExternalModuleReference; // JSX - function createJsxElement(openingElement, children, closingElement, location) { - var node = createNode(246 /* JsxElement */, location); + function createJsxElement(openingElement, children, closingElement) { + var node = createSynthesizedNode(249 /* JsxElement */); node.openingElement = openingElement; node.children = createNodeArray(children); node.closingElement = closingElement; @@ -11850,96 +12550,108 @@ var ts; } ts.createJsxElement = createJsxElement; function updateJsxElement(node, openingElement, children, closingElement) { - if (node.openingElement !== openingElement || node.children !== children || node.closingElement !== closingElement) { - return updateNode(createJsxElement(openingElement, children, closingElement, node), node); - } - return node; + return node.openingElement !== openingElement + || node.children !== children + || node.closingElement !== closingElement + ? updateNode(createJsxElement(openingElement, children, closingElement), node) + : node; } ts.updateJsxElement = updateJsxElement; - function createJsxSelfClosingElement(tagName, attributes, location) { - var node = createNode(247 /* JsxSelfClosingElement */, location); + function createJsxSelfClosingElement(tagName, attributes) { + var node = createSynthesizedNode(250 /* JsxSelfClosingElement */); node.tagName = tagName; - node.attributes = createNodeArray(attributes); + node.attributes = attributes; return node; } ts.createJsxSelfClosingElement = createJsxSelfClosingElement; function updateJsxSelfClosingElement(node, tagName, attributes) { - if (node.tagName !== tagName || node.attributes !== attributes) { - return updateNode(createJsxSelfClosingElement(tagName, attributes, node), node); - } - return node; + return node.tagName !== tagName + || node.attributes !== attributes + ? updateNode(createJsxSelfClosingElement(tagName, attributes), node) + : node; } ts.updateJsxSelfClosingElement = updateJsxSelfClosingElement; - function createJsxOpeningElement(tagName, attributes, location) { - var node = createNode(248 /* JsxOpeningElement */, location); + function createJsxOpeningElement(tagName, attributes) { + var node = createSynthesizedNode(251 /* JsxOpeningElement */); node.tagName = tagName; - node.attributes = createNodeArray(attributes); + node.attributes = attributes; return node; } ts.createJsxOpeningElement = createJsxOpeningElement; function updateJsxOpeningElement(node, tagName, attributes) { - if (node.tagName !== tagName || node.attributes !== attributes) { - return updateNode(createJsxOpeningElement(tagName, attributes, node), node); - } - return node; + return node.tagName !== tagName + || node.attributes !== attributes + ? updateNode(createJsxOpeningElement(tagName, attributes), node) + : node; } ts.updateJsxOpeningElement = updateJsxOpeningElement; - function createJsxClosingElement(tagName, location) { - var node = createNode(249 /* JsxClosingElement */, location); + function createJsxClosingElement(tagName) { + var node = createSynthesizedNode(252 /* JsxClosingElement */); node.tagName = tagName; return node; } ts.createJsxClosingElement = createJsxClosingElement; function updateJsxClosingElement(node, tagName) { - if (node.tagName !== tagName) { - return updateNode(createJsxClosingElement(tagName, node), node); - } - return node; + return node.tagName !== tagName + ? updateNode(createJsxClosingElement(tagName), node) + : node; } ts.updateJsxClosingElement = updateJsxClosingElement; - function createJsxAttribute(name, initializer, location) { - var node = createNode(250 /* JsxAttribute */, location); + function createJsxAttributes(properties) { + var jsxAttributes = createSynthesizedNode(254 /* JsxAttributes */); + jsxAttributes.properties = createNodeArray(properties); + return jsxAttributes; + } + ts.createJsxAttributes = createJsxAttributes; + function updateJsxAttributes(jsxAttributes, properties) { + if (jsxAttributes.properties !== properties) { + return updateNode(createJsxAttributes(properties), jsxAttributes); + } + return jsxAttributes; + } + ts.updateJsxAttributes = updateJsxAttributes; + function createJsxAttribute(name, initializer) { + var node = createSynthesizedNode(253 /* JsxAttribute */); node.name = name; node.initializer = initializer; return node; } ts.createJsxAttribute = createJsxAttribute; function updateJsxAttribute(node, name, initializer) { - if (node.name !== name || node.initializer !== initializer) { - return updateNode(createJsxAttribute(name, initializer, node), node); - } - return node; + return node.name !== name + || node.initializer !== initializer + ? updateNode(createJsxAttribute(name, initializer), node) + : node; } ts.updateJsxAttribute = updateJsxAttribute; - function createJsxSpreadAttribute(expression, location) { - var node = createNode(251 /* JsxSpreadAttribute */, location); + function createJsxSpreadAttribute(expression) { + var node = createSynthesizedNode(255 /* JsxSpreadAttribute */); node.expression = expression; return node; } ts.createJsxSpreadAttribute = createJsxSpreadAttribute; function updateJsxSpreadAttribute(node, expression) { - if (node.expression !== expression) { - return updateNode(createJsxSpreadAttribute(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createJsxSpreadAttribute(expression), node) + : node; } ts.updateJsxSpreadAttribute = updateJsxSpreadAttribute; - function createJsxExpression(expression, location) { - var node = createNode(252 /* JsxExpression */, location); + function createJsxExpression(dotDotDotToken, expression) { + var node = createSynthesizedNode(256 /* JsxExpression */); + node.dotDotDotToken = dotDotDotToken; node.expression = expression; return node; } ts.createJsxExpression = createJsxExpression; function updateJsxExpression(node, expression) { - if (node.expression !== expression) { - return updateNode(createJsxExpression(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createJsxExpression(node.dotDotDotToken, expression), node) + : node; } ts.updateJsxExpression = updateJsxExpression; // Clauses - function createHeritageClause(token, types, location) { - var node = createNode(255 /* HeritageClause */, location); + function createHeritageClause(token, types) { + var node = createSynthesizedNode(259 /* HeritageClause */); node.token = token; node.types = createNodeArray(types); return node; @@ -11947,40 +12659,40 @@ var ts; ts.createHeritageClause = createHeritageClause; function updateHeritageClause(node, types) { if (node.types !== types) { - return updateNode(createHeritageClause(node.token, types, node), node); + return updateNode(createHeritageClause(node.token, types), node); } return node; } ts.updateHeritageClause = updateHeritageClause; - function createCaseClause(expression, statements, location) { - var node = createNode(253 /* CaseClause */, location); - node.expression = parenthesizeExpressionForList(expression); + function createCaseClause(expression, statements) { + var node = createSynthesizedNode(257 /* CaseClause */); + node.expression = ts.parenthesizeExpressionForList(expression); node.statements = createNodeArray(statements); return node; } ts.createCaseClause = createCaseClause; function updateCaseClause(node, expression, statements) { if (node.expression !== expression || node.statements !== statements) { - return updateNode(createCaseClause(expression, statements, node), node); + return updateNode(createCaseClause(expression, statements), node); } return node; } ts.updateCaseClause = updateCaseClause; - function createDefaultClause(statements, location) { - var node = createNode(254 /* DefaultClause */, location); + function createDefaultClause(statements) { + var node = createSynthesizedNode(258 /* DefaultClause */); node.statements = createNodeArray(statements); return node; } ts.createDefaultClause = createDefaultClause; function updateDefaultClause(node, statements) { if (node.statements !== statements) { - return updateNode(createDefaultClause(statements, node), node); + return updateNode(createDefaultClause(statements), node); } return node; } ts.updateDefaultClause = updateDefaultClause; - function createCatchClause(variableDeclaration, block, location) { - var node = createNode(256 /* CatchClause */, location); + function createCatchClause(variableDeclaration, block) { + var node = createSynthesizedNode(260 /* CatchClause */); node.variableDeclaration = typeof variableDeclaration === "string" ? createVariableDeclaration(variableDeclaration) : variableDeclaration; node.block = block; return node; @@ -11988,58 +12700,74 @@ var ts; ts.createCatchClause = createCatchClause; function updateCatchClause(node, variableDeclaration, block) { if (node.variableDeclaration !== variableDeclaration || node.block !== block) { - return updateNode(createCatchClause(variableDeclaration, block, node), node); + return updateNode(createCatchClause(variableDeclaration, block), node); } return node; } ts.updateCatchClause = updateCatchClause; // Property assignments - function createPropertyAssignment(name, initializer, location) { - var node = createNode(257 /* PropertyAssignment */, location); - node.name = typeof name === "string" ? createIdentifier(name) : name; + function createPropertyAssignment(name, initializer) { + var node = createSynthesizedNode(261 /* PropertyAssignment */); + node.name = asName(name); node.questionToken = undefined; - node.initializer = initializer !== undefined ? parenthesizeExpressionForList(initializer) : undefined; + node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; return node; } ts.createPropertyAssignment = createPropertyAssignment; function updatePropertyAssignment(node, name, initializer) { if (node.name !== name || node.initializer !== initializer) { - return updateNode(createPropertyAssignment(name, initializer, node), node); + return updateNode(createPropertyAssignment(name, initializer), node); } return node; } ts.updatePropertyAssignment = updatePropertyAssignment; - function createShorthandPropertyAssignment(name, objectAssignmentInitializer, location) { - var node = createNode(258 /* ShorthandPropertyAssignment */, location); - node.name = typeof name === "string" ? createIdentifier(name) : name; - node.objectAssignmentInitializer = objectAssignmentInitializer !== undefined ? parenthesizeExpressionForList(objectAssignmentInitializer) : undefined; + function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { + var node = createSynthesizedNode(262 /* ShorthandPropertyAssignment */); + node.name = asName(name); + node.objectAssignmentInitializer = objectAssignmentInitializer !== undefined ? ts.parenthesizeExpressionForList(objectAssignmentInitializer) : undefined; return node; } ts.createShorthandPropertyAssignment = createShorthandPropertyAssignment; - function createSpreadAssignment(expression, location) { - var node = createNode(259 /* SpreadAssignment */, location); - node.expression = expression !== undefined ? parenthesizeExpressionForList(expression) : undefined; - return node; - } - ts.createSpreadAssignment = createSpreadAssignment; function updateShorthandPropertyAssignment(node, name, objectAssignmentInitializer) { if (node.name !== name || node.objectAssignmentInitializer !== objectAssignmentInitializer) { - return updateNode(createShorthandPropertyAssignment(name, objectAssignmentInitializer, node), node); + return updateNode(createShorthandPropertyAssignment(name, objectAssignmentInitializer), node); } return node; } ts.updateShorthandPropertyAssignment = updateShorthandPropertyAssignment; + function createSpreadAssignment(expression) { + var node = createSynthesizedNode(263 /* SpreadAssignment */); + node.expression = expression !== undefined ? ts.parenthesizeExpressionForList(expression) : undefined; + return node; + } + ts.createSpreadAssignment = createSpreadAssignment; function updateSpreadAssignment(node, expression) { if (node.expression !== expression) { - return updateNode(createSpreadAssignment(expression, node), node); + return updateNode(createSpreadAssignment(expression), node); } return node; } ts.updateSpreadAssignment = updateSpreadAssignment; + // Enum + function createEnumMember(name, initializer) { + var node = createSynthesizedNode(264 /* EnumMember */); + node.name = asName(name); + node.initializer = initializer && ts.parenthesizeExpressionForList(initializer); + return node; + } + ts.createEnumMember = createEnumMember; + function updateEnumMember(node, name, initializer) { + return node.name !== name + || node.initializer !== initializer + ? updateNode(createEnumMember(name, initializer), node) + : node; + } + ts.updateEnumMember = updateEnumMember; // Top-level nodes function updateSourceFileNode(node, statements) { if (node.statements !== statements) { - var updated = createNode(261 /* SourceFile */, /*location*/ node, node.flags); + var updated = createSynthesizedNode(265 /* SourceFile */); + updated.flags |= node.flags; updated.statements = createNodeArray(statements); updated.endOfFileToken = node.endOfFileToken; updated.fileName = node.fileName; @@ -12098,6 +12826,17 @@ var ts; return node; } ts.updateSourceFileNode = updateSourceFileNode; + /** + * Creates a shallow, memberwise clone of a node for mutation. + */ + function getMutableClone(node) { + var clone = getSynthesizedClone(node); + clone.pos = node.pos; + clone.end = node.end; + clone.parent = node.parent; + return clone; + } + ts.getMutableClone = getMutableClone; // Transformation nodes /** * Creates a synthetic statement to act as a placeholder for a not-emitted statement in @@ -12106,8 +12845,9 @@ var ts; * @param original The original statement. */ function createNotEmittedStatement(original) { - var node = createNode(293 /* NotEmittedStatement */, /*location*/ original); + var node = createSynthesizedNode(295 /* NotEmittedStatement */); node.original = original; + setTextRange(node, original); return node; } ts.createNotEmittedStatement = createNotEmittedStatement; @@ -12115,8 +12855,9 @@ var ts; * Creates a synthetic element to act as a placeholder for the end of an emitted declaration in * order to properly emit exports. */ + /* @internal */ function createEndOfDeclarationMarker(original) { - var node = createNode(296 /* EndOfDeclarationMarker */); + var node = createSynthesizedNode(298 /* EndOfDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -12126,8 +12867,9 @@ var ts; * Creates a synthetic element to act as a placeholder for the beginning of a merged declaration in * order to properly emit exports. */ + /* @internal */ function createMergeDeclarationMarker(original) { - var node = createNode(295 /* MergeDeclarationMarker */); + var node = createSynthesizedNode(297 /* MergeDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -12141,967 +12883,102 @@ var ts; * @param original The original outer expression. * @param location The location for the expression. Defaults to the positions from "original" if provided. */ - function createPartiallyEmittedExpression(expression, original, location) { - var node = createNode(294 /* PartiallyEmittedExpression */, /*location*/ location || original); + function createPartiallyEmittedExpression(expression, original) { + var node = createSynthesizedNode(296 /* PartiallyEmittedExpression */); node.expression = expression; node.original = original; + setTextRange(node, original); return node; } ts.createPartiallyEmittedExpression = createPartiallyEmittedExpression; function updatePartiallyEmittedExpression(node, expression) { if (node.expression !== expression) { - return updateNode(createPartiallyEmittedExpression(expression, node.original, node), node); + return updateNode(createPartiallyEmittedExpression(expression, node.original), node); } return node; } ts.updatePartiallyEmittedExpression = updatePartiallyEmittedExpression; + function createBundle(sourceFiles) { + var node = ts.createNode(266 /* Bundle */); + node.sourceFiles = sourceFiles; + return node; + } + ts.createBundle = createBundle; + function updateBundle(node, sourceFiles) { + if (node.sourceFiles !== sourceFiles) { + return createBundle(sourceFiles); + } + return node; + } + ts.updateBundle = updateBundle; // Compound nodes function createComma(left, right) { - return createBinary(left, 25 /* CommaToken */, right); + return createBinary(left, 26 /* CommaToken */, right); } ts.createComma = createComma; - function createLessThan(left, right, location) { - return createBinary(left, 26 /* LessThanToken */, right, location); + function createLessThan(left, right) { + return createBinary(left, 27 /* LessThanToken */, right); } ts.createLessThan = createLessThan; - function createAssignment(left, right, location) { - return createBinary(left, 57 /* EqualsToken */, right, location); + function createAssignment(left, right) { + return createBinary(left, 58 /* EqualsToken */, right); } ts.createAssignment = createAssignment; function createStrictEquality(left, right) { - return createBinary(left, 33 /* EqualsEqualsEqualsToken */, right); + return createBinary(left, 34 /* EqualsEqualsEqualsToken */, right); } ts.createStrictEquality = createStrictEquality; function createStrictInequality(left, right) { - return createBinary(left, 34 /* ExclamationEqualsEqualsToken */, right); + return createBinary(left, 35 /* ExclamationEqualsEqualsToken */, right); } ts.createStrictInequality = createStrictInequality; function createAdd(left, right) { - return createBinary(left, 36 /* PlusToken */, right); + return createBinary(left, 37 /* PlusToken */, right); } ts.createAdd = createAdd; function createSubtract(left, right) { - return createBinary(left, 37 /* MinusToken */, right); + return createBinary(left, 38 /* MinusToken */, right); } ts.createSubtract = createSubtract; - function createPostfixIncrement(operand, location) { - return createPostfix(operand, 42 /* PlusPlusToken */, location); + function createPostfixIncrement(operand) { + return createPostfix(operand, 43 /* PlusPlusToken */); } ts.createPostfixIncrement = createPostfixIncrement; function createLogicalAnd(left, right) { - return createBinary(left, 52 /* AmpersandAmpersandToken */, right); + return createBinary(left, 53 /* AmpersandAmpersandToken */, right); } ts.createLogicalAnd = createLogicalAnd; function createLogicalOr(left, right) { - return createBinary(left, 53 /* BarBarToken */, right); + return createBinary(left, 54 /* BarBarToken */, right); } ts.createLogicalOr = createLogicalOr; function createLogicalNot(operand) { - return createPrefix(50 /* ExclamationToken */, operand); + return createPrefix(51 /* ExclamationToken */, operand); } ts.createLogicalNot = createLogicalNot; function createVoidZero() { return createVoid(createLiteral(0)); } ts.createVoidZero = createVoidZero; - function createTypeCheck(value, tag) { - return tag === "undefined" - ? createStrictEquality(value, createVoidZero()) - : createStrictEquality(createTypeOf(value), createLiteral(tag)); - } - ts.createTypeCheck = createTypeCheck; - function createMemberAccessForPropertyName(target, memberName, location) { - if (ts.isComputedPropertyName(memberName)) { - return createElementAccess(target, memberName.expression, location); - } - else { - var expression = ts.isIdentifier(memberName) ? createPropertyAccess(target, memberName, location) : createElementAccess(target, memberName, location); - (expression.emitNode || (expression.emitNode = {})).flags |= 64 /* NoNestedSourceMaps */; - return expression; - } - } - ts.createMemberAccessForPropertyName = createMemberAccessForPropertyName; - function createFunctionCall(func, thisArg, argumentsList, location) { - return createCall(createPropertyAccess(func, "call"), - /*typeArguments*/ undefined, [ - thisArg - ].concat(argumentsList), location); - } - ts.createFunctionCall = createFunctionCall; - function createFunctionApply(func, thisArg, argumentsExpression, location) { - return createCall(createPropertyAccess(func, "apply"), - /*typeArguments*/ undefined, [ - thisArg, - argumentsExpression - ], location); - } - ts.createFunctionApply = createFunctionApply; - function createArraySlice(array, start) { - var argumentsList = []; - if (start !== undefined) { - argumentsList.push(typeof start === "number" ? createLiteral(start) : start); - } - return createCall(createPropertyAccess(array, "slice"), /*typeArguments*/ undefined, argumentsList); - } - ts.createArraySlice = createArraySlice; - function createArrayConcat(array, values) { - return createCall(createPropertyAccess(array, "concat"), - /*typeArguments*/ undefined, values); - } - ts.createArrayConcat = createArrayConcat; - function createMathPow(left, right, location) { - return createCall(createPropertyAccess(createIdentifier("Math"), "pow"), - /*typeArguments*/ undefined, [left, right], location); - } - ts.createMathPow = createMathPow; - function createReactNamespace(reactNamespace, parent) { - // To ensure the emit resolver can properly resolve the namespace, we need to - // treat this identifier as if it were a source tree node by clearing the `Synthesized` - // flag and setting a parent node. - var react = createIdentifier(reactNamespace || "React"); - react.flags &= ~8 /* Synthesized */; - // Set the parent that is in parse tree - // this makes sure that parent chain is intact for checker to traverse complete scope tree - react.parent = ts.getParseTreeNode(parent); - return react; - } - function createJsxFactoryExpressionFromEntityName(jsxFactory, parent) { - if (ts.isQualifiedName(jsxFactory)) { - var left = createJsxFactoryExpressionFromEntityName(jsxFactory.left, parent); - var right = createSynthesizedNode(70 /* Identifier */); - right.text = jsxFactory.right.text; - return createPropertyAccess(left, right); - } - else { - return createReactNamespace(jsxFactory.text, parent); - } - } - function createJsxFactoryExpression(jsxFactoryEntity, reactNamespace, parent) { - return jsxFactoryEntity ? - createJsxFactoryExpressionFromEntityName(jsxFactoryEntity, parent) : - createPropertyAccess(createReactNamespace(reactNamespace, parent), "createElement"); - } - function createExpressionForJsxElement(jsxFactoryEntity, reactNamespace, tagName, props, children, parentElement, location) { - var argumentsList = [tagName]; - if (props) { - argumentsList.push(props); - } - if (children && children.length > 0) { - if (!props) { - argumentsList.push(createNull()); - } - if (children.length > 1) { - for (var _i = 0, children_1 = children; _i < children_1.length; _i++) { - var child = children_1[_i]; - child.startsOnNewLine = true; - argumentsList.push(child); - } - } - else { - argumentsList.push(children[0]); - } - } - return createCall(createJsxFactoryExpression(jsxFactoryEntity, reactNamespace, parentElement), - /*typeArguments*/ undefined, argumentsList, location); - } - ts.createExpressionForJsxElement = createExpressionForJsxElement; function createExportDefault(expression) { return createExportAssignment(/*decorators*/ undefined, /*modifiers*/ undefined, /*isExportEquals*/ false, expression); } ts.createExportDefault = createExportDefault; function createExternalModuleExport(exportName) { - return createExportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, createNamedExports([createExportSpecifier(exportName)])); + return createExportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, createNamedExports([createExportSpecifier(/*propertyName*/ undefined, exportName)])); } ts.createExternalModuleExport = createExternalModuleExport; - function createLetStatement(name, initializer, location) { - return createVariableStatement(/*modifiers*/ undefined, createLetDeclarationList([createVariableDeclaration(name, /*type*/ undefined, initializer)]), location); + function asName(name) { + return typeof name === "string" ? createIdentifier(name) : name; } - ts.createLetStatement = createLetStatement; - function createLetDeclarationList(declarations, location) { - return createVariableDeclarationList(declarations, location, 1 /* Let */); + function asExpression(value) { + return typeof value === "string" || typeof value === "number" ? createLiteral(value) : value; } - ts.createLetDeclarationList = createLetDeclarationList; - function createConstDeclarationList(declarations, location) { - return createVariableDeclarationList(declarations, location, 2 /* Const */); + function asNodeArray(array) { + return array ? createNodeArray(array) : undefined; } - ts.createConstDeclarationList = createConstDeclarationList; - // Helpers - function getHelperName(name) { - return setEmitFlags(createIdentifier(name), 4096 /* HelperName */ | 2 /* AdviseOnEmitNode */); - } - ts.getHelperName = getHelperName; - function shouldBeCapturedInTempVariable(node, cacheIdentifiers) { - var target = skipParentheses(node); - switch (target.kind) { - case 70 /* Identifier */: - return cacheIdentifiers; - case 98 /* ThisKeyword */: - case 8 /* NumericLiteral */: - case 9 /* StringLiteral */: - return false; - case 175 /* ArrayLiteralExpression */: - var elements = target.elements; - if (elements.length === 0) { - return false; - } - return true; - case 176 /* ObjectLiteralExpression */: - return target.properties.length > 0; - default: - return true; - } - } - function createCallBinding(expression, recordTempVariable, languageVersion, cacheIdentifiers) { - var callee = skipOuterExpressions(expression, 7 /* All */); - var thisArg; - var target; - if (ts.isSuperProperty(callee)) { - thisArg = createThis(); - target = callee; - } - else if (callee.kind === 96 /* SuperKeyword */) { - thisArg = createThis(); - target = languageVersion < 2 /* ES2015 */ ? createIdentifier("_super", /*location*/ callee) : callee; - } - else { - switch (callee.kind) { - case 177 /* PropertyAccessExpression */: { - if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { - // for `a.b()` target is `(_a = a).b` and thisArg is `_a` - thisArg = createTempVariable(recordTempVariable); - target = createPropertyAccess(createAssignment(thisArg, callee.expression, - /*location*/ callee.expression), callee.name, - /*location*/ callee); - } - else { - thisArg = callee.expression; - target = callee; - } - break; - } - case 178 /* ElementAccessExpression */: { - if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { - // for `a[b]()` target is `(_a = a)[b]` and thisArg is `_a` - thisArg = createTempVariable(recordTempVariable); - target = createElementAccess(createAssignment(thisArg, callee.expression, - /*location*/ callee.expression), callee.argumentExpression, - /*location*/ callee); - } - else { - thisArg = callee.expression; - target = callee; - } - break; - } - default: { - // for `a()` target is `a` and thisArg is `void 0` - thisArg = createVoidZero(); - target = parenthesizeForAccess(expression); - break; - } - } - } - return { target: target, thisArg: thisArg }; - } - ts.createCallBinding = createCallBinding; - function inlineExpressions(expressions) { - return ts.reduceLeft(expressions, createComma); - } - ts.inlineExpressions = inlineExpressions; - function createExpressionFromEntityName(node) { - if (ts.isQualifiedName(node)) { - var left = createExpressionFromEntityName(node.left); - var right = getMutableClone(node.right); - return createPropertyAccess(left, right, /*location*/ node); - } - else { - return getMutableClone(node); - } - } - ts.createExpressionFromEntityName = createExpressionFromEntityName; - function createExpressionForPropertyName(memberName) { - if (ts.isIdentifier(memberName)) { - return createLiteral(memberName, /*location*/ undefined); - } - else if (ts.isComputedPropertyName(memberName)) { - return getMutableClone(memberName.expression); - } - else { - return getMutableClone(memberName); - } - } - ts.createExpressionForPropertyName = createExpressionForPropertyName; - function createExpressionForObjectLiteralElementLike(node, property, receiver) { - switch (property.kind) { - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - return createExpressionForAccessorDeclaration(node.properties, property, receiver, node.multiLine); - case 257 /* PropertyAssignment */: - return createExpressionForPropertyAssignment(property, receiver); - case 258 /* ShorthandPropertyAssignment */: - return createExpressionForShorthandPropertyAssignment(property, receiver); - case 149 /* MethodDeclaration */: - return createExpressionForMethodDeclaration(property, receiver); - } - } - ts.createExpressionForObjectLiteralElementLike = createExpressionForObjectLiteralElementLike; - function createExpressionForAccessorDeclaration(properties, property, receiver, multiLine) { - var _a = ts.getAllAccessorDeclarations(properties, property), firstAccessor = _a.firstAccessor, getAccessor = _a.getAccessor, setAccessor = _a.setAccessor; - if (property === firstAccessor) { - var properties_1 = []; - if (getAccessor) { - var getterFunction = createFunctionExpression(getAccessor.modifiers, - /*asteriskToken*/ undefined, - /*name*/ undefined, - /*typeParameters*/ undefined, getAccessor.parameters, - /*type*/ undefined, getAccessor.body, - /*location*/ getAccessor); - setOriginalNode(getterFunction, getAccessor); - var getter = createPropertyAssignment("get", getterFunction); - properties_1.push(getter); - } - if (setAccessor) { - var setterFunction = createFunctionExpression(setAccessor.modifiers, - /*asteriskToken*/ undefined, - /*name*/ undefined, - /*typeParameters*/ undefined, setAccessor.parameters, - /*type*/ undefined, setAccessor.body, - /*location*/ setAccessor); - setOriginalNode(setterFunction, setAccessor); - var setter = createPropertyAssignment("set", setterFunction); - properties_1.push(setter); - } - properties_1.push(createPropertyAssignment("enumerable", createLiteral(true))); - properties_1.push(createPropertyAssignment("configurable", createLiteral(true))); - var expression = createCall(createPropertyAccess(createIdentifier("Object"), "defineProperty"), - /*typeArguments*/ undefined, [ - receiver, - createExpressionForPropertyName(property.name), - createObjectLiteral(properties_1, /*location*/ undefined, multiLine) - ], - /*location*/ firstAccessor); - return ts.aggregateTransformFlags(expression); - } - return undefined; - } - function createExpressionForPropertyAssignment(property, receiver) { - return ts.aggregateTransformFlags(setOriginalNode(createAssignment(createMemberAccessForPropertyName(receiver, property.name, /*location*/ property.name), property.initializer, - /*location*/ property), - /*original*/ property)); - } - function createExpressionForShorthandPropertyAssignment(property, receiver) { - return ts.aggregateTransformFlags(setOriginalNode(createAssignment(createMemberAccessForPropertyName(receiver, property.name, /*location*/ property.name), getSynthesizedClone(property.name), - /*location*/ property), - /*original*/ property)); - } - function createExpressionForMethodDeclaration(method, receiver) { - return ts.aggregateTransformFlags(setOriginalNode(createAssignment(createMemberAccessForPropertyName(receiver, method.name, /*location*/ method.name), setOriginalNode(createFunctionExpression(method.modifiers, method.asteriskToken, - /*name*/ undefined, - /*typeParameters*/ undefined, method.parameters, - /*type*/ undefined, method.body, - /*location*/ method), - /*original*/ method), - /*location*/ method), - /*original*/ method)); - } - /** - * Gets the local name of a declaration. This is primarily used for declarations that can be - * referred to by name in the declaration's immediate scope (classes, enums, namespaces). A - * local name will *never* be prefixed with an module or namespace export modifier like - * "exports." when emitted as an expression. - * - * @param node The declaration. - * @param allowComments A value indicating whether comments may be emitted for the name. - * @param allowSourceMaps A value indicating whether source maps may be emitted for the name. - */ - function getLocalName(node, allowComments, allowSourceMaps) { - return getName(node, allowComments, allowSourceMaps, 16384 /* LocalName */); - } - ts.getLocalName = getLocalName; - /** - * Gets whether an identifier should only be referred to by its local name. - */ - function isLocalName(node) { - return (getEmitFlags(node) & 16384 /* LocalName */) !== 0; - } - ts.isLocalName = isLocalName; - /** - * Gets the export name of a declaration. This is primarily used for declarations that can be - * referred to by name in the declaration's immediate scope (classes, enums, namespaces). An - * export name will *always* be prefixed with an module or namespace export modifier like - * `"exports."` when emitted as an expression if the name points to an exported symbol. - * - * @param node The declaration. - * @param allowComments A value indicating whether comments may be emitted for the name. - * @param allowSourceMaps A value indicating whether source maps may be emitted for the name. - */ - function getExportName(node, allowComments, allowSourceMaps) { - return getName(node, allowComments, allowSourceMaps, 8192 /* ExportName */); - } - ts.getExportName = getExportName; - /** - * Gets whether an identifier should only be referred to by its export representation if the - * name points to an exported symbol. - */ - function isExportName(node) { - return (getEmitFlags(node) & 8192 /* ExportName */) !== 0; - } - ts.isExportName = isExportName; - /** - * Gets the name of a declaration for use in declarations. - * - * @param node The declaration. - * @param allowComments A value indicating whether comments may be emitted for the name. - * @param allowSourceMaps A value indicating whether source maps may be emitted for the name. - */ - function getDeclarationName(node, allowComments, allowSourceMaps) { - return getName(node, allowComments, allowSourceMaps); - } - ts.getDeclarationName = getDeclarationName; - function getName(node, allowComments, allowSourceMaps, emitFlags) { - if (node.name && ts.isIdentifier(node.name) && !ts.isGeneratedIdentifier(node.name)) { - var name_8 = getMutableClone(node.name); - emitFlags |= getEmitFlags(node.name); - if (!allowSourceMaps) - emitFlags |= 48 /* NoSourceMap */; - if (!allowComments) - emitFlags |= 1536 /* NoComments */; - if (emitFlags) - setEmitFlags(name_8, emitFlags); - return name_8; - } - return getGeneratedNameForNode(node); - } - /** - * Gets the exported name of a declaration for use in expressions. - * - * An exported name will *always* be prefixed with an module or namespace export modifier like - * "exports." if the name points to an exported symbol. - * - * @param ns The namespace identifier. - * @param node The declaration. - * @param allowComments A value indicating whether comments may be emitted for the name. - * @param allowSourceMaps A value indicating whether source maps may be emitted for the name. - */ - function getExternalModuleOrNamespaceExportName(ns, node, allowComments, allowSourceMaps) { - if (ns && ts.hasModifier(node, 1 /* Export */)) { - return getNamespaceMemberName(ns, getName(node), allowComments, allowSourceMaps); - } - return getExportName(node, allowComments, allowSourceMaps); - } - ts.getExternalModuleOrNamespaceExportName = getExternalModuleOrNamespaceExportName; - /** - * Gets a namespace-qualified name for use in expressions. - * - * @param ns The namespace identifier. - * @param name The name. - * @param allowComments A value indicating whether comments may be emitted for the name. - * @param allowSourceMaps A value indicating whether source maps may be emitted for the name. - */ - function getNamespaceMemberName(ns, name, allowComments, allowSourceMaps) { - var qualifiedName = createPropertyAccess(ns, ts.nodeIsSynthesized(name) ? name : getSynthesizedClone(name), /*location*/ name); - var emitFlags; - if (!allowSourceMaps) - emitFlags |= 48 /* NoSourceMap */; - if (!allowComments) - emitFlags |= 1536 /* NoComments */; - if (emitFlags) - setEmitFlags(qualifiedName, emitFlags); - return qualifiedName; - } - ts.getNamespaceMemberName = getNamespaceMemberName; - function convertToFunctionBody(node, multiLine) { - return ts.isBlock(node) ? node : createBlock([createReturn(node, /*location*/ node)], /*location*/ node, multiLine); - } - ts.convertToFunctionBody = convertToFunctionBody; - function isUseStrictPrologue(node) { - return node.expression.text === "use strict"; - } - /** - * Add any necessary prologue-directives into target statement-array. - * The function needs to be called during each transformation step. - * This function needs to be called whenever we transform the statement - * list of a source file, namespace, or function-like body. - * - * @param target: result statements array - * @param source: origin statements array - * @param ensureUseStrict: boolean determining whether the function need to add prologue-directives - * @param visitor: Optional callback used to visit any custom prologue directives. - */ - function addPrologueDirectives(target, source, ensureUseStrict, visitor) { - ts.Debug.assert(target.length === 0, "Prologue directives should be at the first statement in the target statements array"); - var foundUseStrict = false; - var statementOffset = 0; - var numStatements = source.length; - while (statementOffset < numStatements) { - var statement = source[statementOffset]; - if (ts.isPrologueDirective(statement)) { - if (isUseStrictPrologue(statement)) { - foundUseStrict = true; - } - target.push(statement); - } - else { - break; - } - statementOffset++; - } - if (ensureUseStrict && !foundUseStrict) { - target.push(startOnNewLine(createStatement(createLiteral("use strict")))); - } - while (statementOffset < numStatements) { - var statement = source[statementOffset]; - if (getEmitFlags(statement) & 524288 /* CustomPrologue */) { - target.push(visitor ? ts.visitNode(statement, visitor, ts.isStatement) : statement); - } - else { - break; - } - statementOffset++; - } - return statementOffset; - } - ts.addPrologueDirectives = addPrologueDirectives; - function startsWithUseStrict(statements) { - var firstStatement = ts.firstOrUndefined(statements); - return firstStatement !== undefined - && ts.isPrologueDirective(firstStatement) - && isUseStrictPrologue(firstStatement); - } - ts.startsWithUseStrict = startsWithUseStrict; - /** - * Ensures "use strict" directive is added - * - * @param statements An array of statements - */ - function ensureUseStrict(statements) { - var foundUseStrict = false; - for (var _i = 0, statements_1 = statements; _i < statements_1.length; _i++) { - var statement = statements_1[_i]; - if (ts.isPrologueDirective(statement)) { - if (isUseStrictPrologue(statement)) { - foundUseStrict = true; - break; - } - } - else { - break; - } - } - if (!foundUseStrict) { - return createNodeArray([ - startOnNewLine(createStatement(createLiteral("use strict"))) - ].concat(statements), statements); - } - return statements; - } - ts.ensureUseStrict = ensureUseStrict; - /** - * Wraps the operand to a BinaryExpression in parentheses if they are needed to preserve the intended - * order of operations. - * - * @param binaryOperator The operator for the BinaryExpression. - * @param operand The operand for the BinaryExpression. - * @param isLeftSideOfBinary A value indicating whether the operand is the left side of the - * BinaryExpression. - */ - function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { - var skipped = skipPartiallyEmittedExpressions(operand); - // If the resulting expression is already parenthesized, we do not need to do any further processing. - if (skipped.kind === 183 /* ParenthesizedExpression */) { - return operand; - } - return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) - ? createParen(operand) - : operand; - } - ts.parenthesizeBinaryOperand = parenthesizeBinaryOperand; - /** - * Determines whether the operand to a BinaryExpression needs to be parenthesized. - * - * @param binaryOperator The operator for the BinaryExpression. - * @param operand The operand for the BinaryExpression. - * @param isLeftSideOfBinary A value indicating whether the operand is the left side of the - * BinaryExpression. - */ - function binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { - // If the operand has lower precedence, then it needs to be parenthesized to preserve the - // intent of the expression. For example, if the operand is `a + b` and the operator is - // `*`, then we need to parenthesize the operand to preserve the intended order of - // operations: `(a + b) * x`. - // - // If the operand has higher precedence, then it does not need to be parenthesized. For - // example, if the operand is `a * b` and the operator is `+`, then we do not need to - // parenthesize to preserve the intended order of operations: `a * b + x`. - // - // If the operand has the same precedence, then we need to check the associativity of - // the operator based on whether this is the left or right operand of the expression. - // - // For example, if `a / d` is on the right of operator `*`, we need to parenthesize - // to preserve the intended order of operations: `x * (a / d)` - // - // 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(192 /* BinaryExpression */, binaryOperator); - var binaryOperatorAssociativity = ts.getOperatorAssociativity(192 /* BinaryExpression */, binaryOperator); - var emittedOperand = skipPartiallyEmittedExpressions(operand); - var operandPrecedence = ts.getExpressionPrecedence(emittedOperand); - switch (ts.compareValues(operandPrecedence, binaryOperatorPrecedence)) { - case -1 /* LessThan */: - // If the operand is the right side of a right-associative binary operation - // and is a yield expression, then we do not need parentheses. - if (!isLeftSideOfBinary - && binaryOperatorAssociativity === 1 /* Right */ - && operand.kind === 195 /* YieldExpression */) { - return false; - } - return true; - case 1 /* GreaterThan */: - return false; - case 0 /* EqualTo */: - if (isLeftSideOfBinary) { - // No need to parenthesize the left operand when the binary operator is - // left associative: - // (a*b)/x -> a*b/x - // (a**b)/x -> a**b/x - // - // Parentheses are needed for the left operand when the binary operator is - // right associative: - // (a/b)**x -> (a/b)**x - // (a**b)**x -> (a**b)**x - return binaryOperatorAssociativity === 1 /* Right */; - } - else { - if (ts.isBinaryExpression(emittedOperand) - && emittedOperand.operatorToken.kind === binaryOperator) { - // No need to parenthesize the right operand when the binary operator and - // operand are the same and one of the following: - // x*(a*b) => x*a*b - // x|(a|b) => x|a|b - // x&(a&b) => x&a&b - // x^(a^b) => x^a^b - if (operatorHasAssociativeProperty(binaryOperator)) { - return false; - } - // No need to parenthesize the right operand when the binary operator - // is plus (+) if both the left and right operands consist solely of either - // literals of the same kind or binary plus (+) expressions for literals of - // the same kind (recursively). - // "a"+(1+2) => "a"+(1+2) - // "a"+("b"+"c") => "a"+"b"+"c" - if (binaryOperator === 36 /* PlusToken */) { - var leftKind = leftOperand ? getLiteralKindOfBinaryPlusOperand(leftOperand) : 0 /* Unknown */; - if (ts.isLiteralKind(leftKind) && leftKind === getLiteralKindOfBinaryPlusOperand(emittedOperand)) { - return false; - } - } - } - // No need to parenthesize the right operand when the operand is right - // associative: - // x/(a**b) -> x/a**b - // x**(a**b) -> x**a**b - // - // Parentheses are needed for the right operand when the operand is left - // associative: - // x/(a*b) -> x/(a*b) - // x**(a/b) -> x**(a/b) - var operandAssociativity = ts.getExpressionAssociativity(emittedOperand); - return operandAssociativity === 0 /* Left */; - } - } - } - /** - * Determines whether a binary operator is mathematically associative. - * - * @param binaryOperator The binary operator. - */ - function operatorHasAssociativeProperty(binaryOperator) { - // The following operators are associative in JavaScript: - // (a*b)*c -> a*(b*c) -> a*b*c - // (a|b)|c -> a|(b|c) -> a|b|c - // (a&b)&c -> a&(b&c) -> a&b&c - // (a^b)^c -> a^(b^c) -> a^b^c - // - // While addition is associative in mathematics, JavaScript's `+` is not - // guaranteed to be associative as it is overloaded with string concatenation. - return binaryOperator === 38 /* AsteriskToken */ - || binaryOperator === 48 /* BarToken */ - || binaryOperator === 47 /* AmpersandToken */ - || binaryOperator === 49 /* CaretToken */; - } - /** - * This function determines whether an expression consists of a homogeneous set of - * literal expressions or binary plus expressions that all share the same literal kind. - * It is used to determine whether the right-hand operand of a binary plus expression can be - * emitted without parentheses. - */ - function getLiteralKindOfBinaryPlusOperand(node) { - node = skipPartiallyEmittedExpressions(node); - if (ts.isLiteralKind(node.kind)) { - return node.kind; - } - if (node.kind === 192 /* BinaryExpression */ && node.operatorToken.kind === 36 /* PlusToken */) { - if (node.cachedLiteralKind !== undefined) { - return node.cachedLiteralKind; - } - var leftKind = getLiteralKindOfBinaryPlusOperand(node.left); - var literalKind = ts.isLiteralKind(leftKind) - && leftKind === getLiteralKindOfBinaryPlusOperand(node.right) - ? leftKind - : 0 /* Unknown */; - node.cachedLiteralKind = literalKind; - return literalKind; - } - return 0 /* Unknown */; - } - function parenthesizeForConditionalHead(condition) { - var conditionalPrecedence = ts.getOperatorPrecedence(193 /* ConditionalExpression */, 54 /* QuestionToken */); - var emittedCondition = skipPartiallyEmittedExpressions(condition); - var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); - if (ts.compareValues(conditionPrecedence, conditionalPrecedence) === -1 /* LessThan */) { - return createParen(condition); - } - return condition; - } - ts.parenthesizeForConditionalHead = parenthesizeForConditionalHead; - function parenthesizeSubexpressionOfConditionalExpression(e) { - // per ES grammar both 'whenTrue' and 'whenFalse' parts of conditional expression are assignment expressions - // 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 - return e.kind === 192 /* BinaryExpression */ && e.operatorToken.kind === 25 /* CommaToken */ - ? createParen(e) - : e; - } - /** - * Wraps an expression in parentheses if it is needed in order to use the expression - * as the expression of a NewExpression node. - * - * @param expression The Expression node. - */ - function parenthesizeForNew(expression) { - var emittedExpression = skipPartiallyEmittedExpressions(expression); - switch (emittedExpression.kind) { - case 179 /* CallExpression */: - return createParen(expression); - case 180 /* NewExpression */: - return emittedExpression.arguments - ? expression - : createParen(expression); - } - return parenthesizeForAccess(expression); - } - ts.parenthesizeForNew = parenthesizeForNew; - /** - * Wraps an expression in parentheses if it is needed in order to use the expression for - * property or element access. - * - * @param expr The expression node. - */ - function parenthesizeForAccess(expression) { - // isLeftHandSideExpression is almost the correct criterion for when it is not necessary - // to parenthesize the expression before a dot. The known exceptions are: - // - // NewExpression: - // new C.x -> not the same as (new C).x - // NumericLiteral - // 1.x -> not the same as (1).x - // - var emittedExpression = skipPartiallyEmittedExpressions(expression); - if (ts.isLeftHandSideExpression(emittedExpression) - && (emittedExpression.kind !== 180 /* NewExpression */ || emittedExpression.arguments) - && emittedExpression.kind !== 8 /* NumericLiteral */) { - return expression; - } - return createParen(expression, /*location*/ expression); - } - ts.parenthesizeForAccess = parenthesizeForAccess; - function parenthesizePostfixOperand(operand) { - return ts.isLeftHandSideExpression(operand) - ? operand - : createParen(operand, /*location*/ operand); - } - ts.parenthesizePostfixOperand = parenthesizePostfixOperand; - function parenthesizePrefixOperand(operand) { - return ts.isUnaryExpression(operand) - ? operand - : createParen(operand, /*location*/ operand); - } - ts.parenthesizePrefixOperand = parenthesizePrefixOperand; - function parenthesizeListElements(elements) { - var result; - for (var i = 0; i < elements.length; i++) { - var element = parenthesizeExpressionForList(elements[i]); - if (result !== undefined || element !== elements[i]) { - if (result === undefined) { - result = elements.slice(0, i); - } - result.push(element); - } - } - if (result !== undefined) { - return createNodeArray(result, elements, elements.hasTrailingComma); - } - return elements; - } - function parenthesizeExpressionForList(expression) { - var emittedExpression = skipPartiallyEmittedExpressions(expression); - var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression); - var commaPrecedence = ts.getOperatorPrecedence(192 /* BinaryExpression */, 25 /* CommaToken */); - return expressionPrecedence > commaPrecedence - ? expression - : createParen(expression, /*location*/ expression); - } - ts.parenthesizeExpressionForList = parenthesizeExpressionForList; - function parenthesizeExpressionForExpressionStatement(expression) { - var emittedExpression = skipPartiallyEmittedExpressions(expression); - if (ts.isCallExpression(emittedExpression)) { - var callee = emittedExpression.expression; - var kind = skipPartiallyEmittedExpressions(callee).kind; - if (kind === 184 /* FunctionExpression */ || kind === 185 /* ArrowFunction */) { - var mutableCall = getMutableClone(emittedExpression); - mutableCall.expression = createParen(callee, /*location*/ callee); - return recreatePartiallyEmittedExpressions(expression, mutableCall); - } - } - else { - var leftmostExpressionKind = getLeftmostExpression(emittedExpression).kind; - if (leftmostExpressionKind === 176 /* ObjectLiteralExpression */ || leftmostExpressionKind === 184 /* FunctionExpression */) { - return createParen(expression, /*location*/ expression); - } - } - return expression; - } - ts.parenthesizeExpressionForExpressionStatement = parenthesizeExpressionForExpressionStatement; - /** - * Clones a series of not-emitted expressions with a new inner expression. - * - * @param originalOuterExpression The original outer expression. - * @param newInnerExpression The new inner expression. - */ - function recreatePartiallyEmittedExpressions(originalOuterExpression, newInnerExpression) { - if (ts.isPartiallyEmittedExpression(originalOuterExpression)) { - var clone_1 = getMutableClone(originalOuterExpression); - clone_1.expression = recreatePartiallyEmittedExpressions(clone_1.expression, newInnerExpression); - return clone_1; - } - return newInnerExpression; - } - function getLeftmostExpression(node) { - while (true) { - switch (node.kind) { - case 191 /* PostfixUnaryExpression */: - node = node.operand; - continue; - case 192 /* BinaryExpression */: - node = node.left; - continue; - case 193 /* ConditionalExpression */: - node = node.condition; - continue; - case 179 /* CallExpression */: - case 178 /* ElementAccessExpression */: - case 177 /* PropertyAccessExpression */: - node = node.expression; - continue; - case 294 /* PartiallyEmittedExpression */: - node = node.expression; - continue; - } - return node; - } - } - function parenthesizeConciseBody(body) { - var emittedBody = skipPartiallyEmittedExpressions(body); - if (emittedBody.kind === 176 /* ObjectLiteralExpression */) { - return createParen(body, /*location*/ body); - } - return body; - } - ts.parenthesizeConciseBody = parenthesizeConciseBody; - var OuterExpressionKinds; - (function (OuterExpressionKinds) { - OuterExpressionKinds[OuterExpressionKinds["Parentheses"] = 1] = "Parentheses"; - OuterExpressionKinds[OuterExpressionKinds["Assertions"] = 2] = "Assertions"; - OuterExpressionKinds[OuterExpressionKinds["PartiallyEmittedExpressions"] = 4] = "PartiallyEmittedExpressions"; - OuterExpressionKinds[OuterExpressionKinds["All"] = 7] = "All"; - })(OuterExpressionKinds = ts.OuterExpressionKinds || (ts.OuterExpressionKinds = {})); - function skipOuterExpressions(node, kinds) { - if (kinds === void 0) { kinds = 7 /* All */; } - var previousNode; - do { - previousNode = node; - if (kinds & 1 /* Parentheses */) { - node = skipParentheses(node); - } - if (kinds & 2 /* Assertions */) { - node = skipAssertions(node); - } - if (kinds & 4 /* PartiallyEmittedExpressions */) { - node = skipPartiallyEmittedExpressions(node); - } - } while (previousNode !== node); - return node; - } - ts.skipOuterExpressions = skipOuterExpressions; - function skipParentheses(node) { - while (node.kind === 183 /* ParenthesizedExpression */) { - node = node.expression; - } - return node; - } - ts.skipParentheses = skipParentheses; - function skipAssertions(node) { - while (ts.isAssertionExpression(node)) { - node = node.expression; - } - return node; - } - ts.skipAssertions = skipAssertions; - function skipPartiallyEmittedExpressions(node) { - while (node.kind === 294 /* PartiallyEmittedExpression */) { - node = node.expression; - } - return node; - } - ts.skipPartiallyEmittedExpressions = skipPartiallyEmittedExpressions; - function startOnNewLine(node) { - node.startsOnNewLine = true; - return node; - } - ts.startOnNewLine = startOnNewLine; - function setOriginalNode(node, original) { - node.original = original; - if (original) { - var emitNode = original.emitNode; - if (emitNode) - node.emitNode = mergeEmitNode(emitNode, node.emitNode); - } - return node; - } - ts.setOriginalNode = setOriginalNode; - function mergeEmitNode(sourceEmitNode, destEmitNode) { - var flags = sourceEmitNode.flags, commentRange = sourceEmitNode.commentRange, sourceMapRange = sourceEmitNode.sourceMapRange, tokenSourceMapRanges = sourceEmitNode.tokenSourceMapRanges, constantValue = sourceEmitNode.constantValue, helpers = sourceEmitNode.helpers; - if (!destEmitNode) - destEmitNode = {}; - if (flags) - destEmitNode.flags = flags; - if (commentRange) - destEmitNode.commentRange = commentRange; - if (sourceMapRange) - destEmitNode.sourceMapRange = sourceMapRange; - if (tokenSourceMapRanges) - destEmitNode.tokenSourceMapRanges = mergeTokenSourceMapRanges(tokenSourceMapRanges, destEmitNode.tokenSourceMapRanges); - if (constantValue !== undefined) - destEmitNode.constantValue = constantValue; - if (helpers) - destEmitNode.helpers = ts.addRange(destEmitNode.helpers, helpers); - return destEmitNode; - } - function mergeTokenSourceMapRanges(sourceRanges, destRanges) { - if (!destRanges) - destRanges = ts.createMap(); - ts.copyProperties(sourceRanges, destRanges); - return destRanges; + function asToken(value) { + return typeof value === "number" ? createToken(value) : value; } /** * Clears any EmitNode entries from parse-tree nodes. @@ -13128,16 +13005,15 @@ var ts; /** * Associates a node with the current transformation, initializing * various transient transformation properties. - * - * @param node The node. */ + /* @internal */ function getOrCreateEmitNode(node) { if (!node.emitNode) { if (ts.isParseTreeNode(node)) { // 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 === 261 /* SourceFile */) { + if (node.kind === 265 /* SourceFile */) { return node.emitNode = { annotatedNodes: [node] }; } var sourceFile = ts.getSourceFileOfNode(node); @@ -13148,10 +13024,16 @@ var ts; return node.emitNode; } ts.getOrCreateEmitNode = getOrCreateEmitNode; + function setTextRange(range, location) { + if (location) { + range.pos = location.pos; + range.end = location.end; + } + return range; + } + ts.setTextRange = setTextRange; /** * Gets flags that control emit behavior of a node. - * - * @param node The node. */ function getEmitFlags(node) { var emitNode = node.emitNode; @@ -13160,9 +13042,6 @@ var ts; ts.getEmitFlags = getEmitFlags; /** * Sets flags that control emit behavior of a node. - * - * @param node The node. - * @param emitFlags The NodeEmitFlags for the node. */ function setEmitFlags(node, emitFlags) { getOrCreateEmitNode(node).flags = emitFlags; @@ -13171,8 +13050,6 @@ var ts; ts.setEmitFlags = setEmitFlags; /** * Gets a custom text range to use when emitting source maps. - * - * @param node The node. */ function getSourceMapRange(node) { var emitNode = node.emitNode; @@ -13181,9 +13058,6 @@ var ts; ts.getSourceMapRange = getSourceMapRange; /** * Sets a custom text range to use when emitting source maps. - * - * @param node The node. - * @param range The text range. */ function setSourceMapRange(node, range) { getOrCreateEmitNode(node).sourceMapRange = range; @@ -13192,9 +13066,6 @@ var ts; ts.setSourceMapRange = setSourceMapRange; /** * Gets the TextRange to use for source maps for a token of a node. - * - * @param node The node. - * @param token The token. */ function getTokenSourceMapRange(node, token) { var emitNode = node.emitNode; @@ -13204,22 +13075,16 @@ var ts; ts.getTokenSourceMapRange = getTokenSourceMapRange; /** * Sets the TextRange to use for source maps for a token of a node. - * - * @param node The node. - * @param token The token. - * @param range The text range. */ function setTokenSourceMapRange(node, token, range) { var emitNode = getOrCreateEmitNode(node); - var tokenSourceMapRanges = emitNode.tokenSourceMapRanges || (emitNode.tokenSourceMapRanges = ts.createMap()); + var tokenSourceMapRanges = emitNode.tokenSourceMapRanges || (emitNode.tokenSourceMapRanges = []); tokenSourceMapRanges[token] = range; return node; } ts.setTokenSourceMapRange = setTokenSourceMapRange; /** * Gets a custom text range to use when emitting comments. - * - * @param node The node. */ function getCommentRange(node) { var emitNode = node.emitNode; @@ -13234,6 +13099,34 @@ var ts; return node; } ts.setCommentRange = setCommentRange; + function getSyntheticLeadingComments(node) { + var emitNode = node.emitNode; + return emitNode && emitNode.leadingComments; + } + ts.getSyntheticLeadingComments = getSyntheticLeadingComments; + function setSyntheticLeadingComments(node, comments) { + getOrCreateEmitNode(node).leadingComments = comments; + return node; + } + ts.setSyntheticLeadingComments = setSyntheticLeadingComments; + function addSyntheticLeadingComment(node, kind, text, hasTrailingNewLine) { + return setSyntheticLeadingComments(node, ts.append(getSyntheticLeadingComments(node), { kind: kind, pos: -1, end: -1, hasTrailingNewLine: hasTrailingNewLine, text: text })); + } + ts.addSyntheticLeadingComment = addSyntheticLeadingComment; + function getSyntheticTrailingComments(node) { + var emitNode = node.emitNode; + return emitNode && emitNode.trailingComments; + } + ts.getSyntheticTrailingComments = getSyntheticTrailingComments; + function setSyntheticTrailingComments(node, comments) { + getOrCreateEmitNode(node).trailingComments = comments; + return node; + } + ts.setSyntheticTrailingComments = setSyntheticTrailingComments; + function addSyntheticTrailingComment(node, kind, text, hasTrailingNewLine) { + return setSyntheticTrailingComments(node, ts.append(getSyntheticTrailingComments(node), { kind: kind, pos: -1, end: -1, hasTrailingNewLine: hasTrailingNewLine, text: text })); + } + ts.addSyntheticTrailingComment = addSyntheticTrailingComment; /** * Gets the constant value to emit for an expression. */ @@ -13251,32 +13144,6 @@ var ts; return node; } ts.setConstantValue = setConstantValue; - function getExternalHelpersModuleName(node) { - var parseNode = ts.getOriginalNode(node, ts.isSourceFile); - var emitNode = parseNode && parseNode.emitNode; - return emitNode && emitNode.externalHelpersModuleName; - } - ts.getExternalHelpersModuleName = getExternalHelpersModuleName; - function getOrCreateExternalHelpersModuleNameIfNeeded(node, compilerOptions) { - if (compilerOptions.importHelpers && (ts.isExternalModule(node) || compilerOptions.isolatedModules)) { - var externalHelpersModuleName = getExternalHelpersModuleName(node); - if (externalHelpersModuleName) { - return externalHelpersModuleName; - } - var helpers = getEmitHelpers(node); - if (helpers) { - for (var _i = 0, helpers_1 = helpers; _i < helpers_1.length; _i++) { - var helper = helpers_1[_i]; - if (!helper.scoped) { - var parseNode = ts.getOriginalNode(node, ts.isSourceFile); - var emitNode = getOrCreateEmitNode(parseNode); - return emitNode.externalHelpersModuleName || (emitNode.externalHelpersModuleName = createUniqueName(ts.externalHelpersModuleNameText)); - } - } - } - } - } - ts.getOrCreateExternalHelpersModuleNameIfNeeded = getOrCreateExternalHelpersModuleNameIfNeeded; /** * Adds an EmitHelper to a node. */ @@ -13287,13 +13154,13 @@ var ts; } ts.addEmitHelper = addEmitHelper; /** - * Adds an EmitHelper to a node. + * Add EmitHelpers to a node. */ function addEmitHelpers(node, helpers) { if (ts.some(helpers)) { var emitNode = getOrCreateEmitNode(node); - for (var _i = 0, helpers_2 = helpers; _i < helpers_2.length; _i++) { - var helper = helpers_2[_i]; + for (var _i = 0, helpers_1 = helpers; _i < helpers_1.length; _i++) { + var helper = helpers_1[_i]; if (!ts.contains(emitNode.helpers, helper)) { emitNode.helpers = ts.append(emitNode.helpers, helper); } @@ -13351,6 +13218,7 @@ var ts; } } ts.moveEmitHelpers = moveEmitHelpers; + /* @internal */ function compareEmitHelpers(x, y) { if (x === y) return 0 /* EqualTo */; @@ -13363,43 +13231,1067 @@ var ts; return ts.compareValues(x.priority, y.priority); } ts.compareEmitHelpers = compareEmitHelpers; - function setTextRange(node, location) { - if (location) { - node.pos = location.pos; - node.end = location.end; + function setOriginalNode(node, original) { + node.original = original; + if (original) { + var emitNode = original.emitNode; + if (emitNode) + node.emitNode = mergeEmitNode(emitNode, node.emitNode); } return node; } - ts.setTextRange = setTextRange; - function setNodeFlags(node, flags) { - node.flags = flags; + ts.setOriginalNode = setOriginalNode; + function mergeEmitNode(sourceEmitNode, destEmitNode) { + var flags = sourceEmitNode.flags, leadingComments = sourceEmitNode.leadingComments, trailingComments = sourceEmitNode.trailingComments, commentRange = sourceEmitNode.commentRange, sourceMapRange = sourceEmitNode.sourceMapRange, tokenSourceMapRanges = sourceEmitNode.tokenSourceMapRanges, constantValue = sourceEmitNode.constantValue, helpers = sourceEmitNode.helpers; + if (!destEmitNode) + destEmitNode = {}; + if (leadingComments) + destEmitNode.leadingComments = ts.addRange(leadingComments.slice(), destEmitNode.leadingComments); + if (trailingComments) + destEmitNode.trailingComments = ts.addRange(trailingComments.slice(), destEmitNode.trailingComments); + if (flags) + destEmitNode.flags = flags; + if (commentRange) + destEmitNode.commentRange = commentRange; + if (sourceMapRange) + destEmitNode.sourceMapRange = sourceMapRange; + if (tokenSourceMapRanges) + destEmitNode.tokenSourceMapRanges = mergeTokenSourceMapRanges(tokenSourceMapRanges, destEmitNode.tokenSourceMapRanges); + if (constantValue !== undefined) + destEmitNode.constantValue = constantValue; + if (helpers) + destEmitNode.helpers = ts.addRange(destEmitNode.helpers, helpers); + return destEmitNode; + } + function mergeTokenSourceMapRanges(sourceRanges, destRanges) { + if (!destRanges) + destRanges = []; + for (var key in sourceRanges) { + destRanges[key] = sourceRanges[key]; + } + return destRanges; + } +})(ts || (ts = {})); +/* @internal */ +(function (ts) { + // Compound nodes + function createTypeCheck(value, tag) { + return tag === "undefined" + ? ts.createStrictEquality(value, ts.createVoidZero()) + : ts.createStrictEquality(ts.createTypeOf(value), ts.createLiteral(tag)); + } + ts.createTypeCheck = createTypeCheck; + function createMemberAccessForPropertyName(target, memberName, location) { + if (ts.isComputedPropertyName(memberName)) { + return ts.setTextRange(ts.createElementAccess(target, memberName.expression), location); + } + else { + var expression = ts.setTextRange(ts.isIdentifier(memberName) + ? ts.createPropertyAccess(target, memberName) + : ts.createElementAccess(target, memberName), memberName); + ts.getOrCreateEmitNode(expression).flags |= 64 /* NoNestedSourceMaps */; + return expression; + } + } + ts.createMemberAccessForPropertyName = createMemberAccessForPropertyName; + function createFunctionCall(func, thisArg, argumentsList, location) { + return ts.setTextRange(ts.createCall(ts.createPropertyAccess(func, "call"), + /*typeArguments*/ undefined, [ + thisArg + ].concat(argumentsList)), location); + } + ts.createFunctionCall = createFunctionCall; + function createFunctionApply(func, thisArg, argumentsExpression, location) { + return ts.setTextRange(ts.createCall(ts.createPropertyAccess(func, "apply"), + /*typeArguments*/ undefined, [ + thisArg, + argumentsExpression + ]), location); + } + ts.createFunctionApply = createFunctionApply; + function createArraySlice(array, start) { + var argumentsList = []; + if (start !== undefined) { + argumentsList.push(typeof start === "number" ? ts.createLiteral(start) : start); + } + return ts.createCall(ts.createPropertyAccess(array, "slice"), /*typeArguments*/ undefined, argumentsList); + } + ts.createArraySlice = createArraySlice; + function createArrayConcat(array, values) { + return ts.createCall(ts.createPropertyAccess(array, "concat"), + /*typeArguments*/ undefined, values); + } + ts.createArrayConcat = createArrayConcat; + function createMathPow(left, right, location) { + return ts.setTextRange(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Math"), "pow"), + /*typeArguments*/ undefined, [left, right]), location); + } + ts.createMathPow = createMathPow; + function createReactNamespace(reactNamespace, parent) { + // To ensure the emit resolver can properly resolve the namespace, we need to + // treat this identifier as if it were a source tree node by clearing the `Synthesized` + // flag and setting a parent node. + var react = ts.createIdentifier(reactNamespace || "React"); + react.flags &= ~8 /* Synthesized */; + // Set the parent that is in parse tree + // this makes sure that parent chain is intact for checker to traverse complete scope tree + react.parent = ts.getParseTreeNode(parent); + return react; + } + function createJsxFactoryExpressionFromEntityName(jsxFactory, parent) { + if (ts.isQualifiedName(jsxFactory)) { + var left = createJsxFactoryExpressionFromEntityName(jsxFactory.left, parent); + var right = ts.createIdentifier(jsxFactory.right.text); + right.text = jsxFactory.right.text; + return ts.createPropertyAccess(left, right); + } + else { + return createReactNamespace(jsxFactory.text, parent); + } + } + function createJsxFactoryExpression(jsxFactoryEntity, reactNamespace, parent) { + return jsxFactoryEntity ? + createJsxFactoryExpressionFromEntityName(jsxFactoryEntity, parent) : + ts.createPropertyAccess(createReactNamespace(reactNamespace, parent), "createElement"); + } + function createExpressionForJsxElement(jsxFactoryEntity, reactNamespace, tagName, props, children, parentElement, location) { + var argumentsList = [tagName]; + if (props) { + argumentsList.push(props); + } + if (children && children.length > 0) { + if (!props) { + argumentsList.push(ts.createNull()); + } + if (children.length > 1) { + for (var _i = 0, children_1 = children; _i < children_1.length; _i++) { + var child = children_1[_i]; + child.startsOnNewLine = true; + argumentsList.push(child); + } + } + else { + argumentsList.push(children[0]); + } + } + return ts.setTextRange(ts.createCall(createJsxFactoryExpression(jsxFactoryEntity, reactNamespace, parentElement), + /*typeArguments*/ undefined, argumentsList), location); + } + ts.createExpressionForJsxElement = createExpressionForJsxElement; + // Helpers + function getHelperName(name) { + return ts.setEmitFlags(ts.createIdentifier(name), 4096 /* HelperName */ | 2 /* AdviseOnEmitNode */); + } + ts.getHelperName = getHelperName; + var valuesHelper = { + name: "typescript:values", + scoped: false, + text: "\n var __values = (this && this.__values) || function (o) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\n if (m) return m.call(o);\n return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n };\n " + }; + function createValuesHelper(context, expression, location) { + context.requestEmitHelper(valuesHelper); + return ts.setTextRange(ts.createCall(getHelperName("__values"), + /*typeArguments*/ undefined, [expression]), location); + } + ts.createValuesHelper = createValuesHelper; + var readHelper = { + name: "typescript:read", + scoped: false, + text: "\n var __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n };\n " + }; + function createReadHelper(context, iteratorRecord, count, location) { + context.requestEmitHelper(readHelper); + return ts.setTextRange(ts.createCall(getHelperName("__read"), + /*typeArguments*/ undefined, count !== undefined + ? [iteratorRecord, ts.createLiteral(count)] + : [iteratorRecord]), location); + } + ts.createReadHelper = createReadHelper; + var spreadHelper = { + name: "typescript:spread", + scoped: false, + text: "\n var __spread = (this && this.__spread) || function () {\n for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));\n return ar;\n };" + }; + function createSpreadHelper(context, argumentList, location) { + context.requestEmitHelper(readHelper); + context.requestEmitHelper(spreadHelper); + return ts.setTextRange(ts.createCall(getHelperName("__spread"), + /*typeArguments*/ undefined, argumentList), location); + } + ts.createSpreadHelper = createSpreadHelper; + // Utilities + function createForOfBindingStatement(node, boundValue) { + if (ts.isVariableDeclarationList(node)) { + var firstDeclaration = ts.firstOrUndefined(node.declarations); + var updatedDeclaration = ts.updateVariableDeclaration(firstDeclaration, firstDeclaration.name, + /*typeNode*/ undefined, boundValue); + return ts.setTextRange(ts.createVariableStatement( + /*modifiers*/ undefined, ts.updateVariableDeclarationList(node, [updatedDeclaration])), + /*location*/ node); + } + else { + var updatedExpression = ts.setTextRange(ts.createAssignment(node, boundValue), /*location*/ node); + return ts.setTextRange(ts.createStatement(updatedExpression), /*location*/ node); + } + } + ts.createForOfBindingStatement = createForOfBindingStatement; + function insertLeadingStatement(dest, source) { + if (ts.isBlock(dest)) { + return ts.updateBlock(dest, ts.setTextRange(ts.createNodeArray([source].concat(dest.statements)), dest.statements)); + } + else { + return ts.createBlock(ts.createNodeArray([dest, source]), /*multiLine*/ true); + } + } + ts.insertLeadingStatement = insertLeadingStatement; + function restoreEnclosingLabel(node, outermostLabeledStatement, afterRestoreLabelCallback) { + if (!outermostLabeledStatement) { + return node; + } + var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 222 /* LabeledStatement */ + ? restoreEnclosingLabel(node, outermostLabeledStatement.statement) + : node); + if (afterRestoreLabelCallback) { + afterRestoreLabelCallback(outermostLabeledStatement); + } + return updated; + } + ts.restoreEnclosingLabel = restoreEnclosingLabel; + function shouldBeCapturedInTempVariable(node, cacheIdentifiers) { + var target = skipParentheses(node); + switch (target.kind) { + case 71 /* Identifier */: + return cacheIdentifiers; + case 99 /* ThisKeyword */: + case 8 /* NumericLiteral */: + case 9 /* StringLiteral */: + return false; + case 177 /* ArrayLiteralExpression */: + var elements = target.elements; + if (elements.length === 0) { + return false; + } + return true; + case 178 /* ObjectLiteralExpression */: + return target.properties.length > 0; + default: + return true; + } + } + function createCallBinding(expression, recordTempVariable, languageVersion, cacheIdentifiers) { + var callee = skipOuterExpressions(expression, 7 /* All */); + var thisArg; + var target; + if (ts.isSuperProperty(callee)) { + thisArg = ts.createThis(); + target = callee; + } + else if (callee.kind === 97 /* SuperKeyword */) { + thisArg = ts.createThis(); + target = languageVersion < 2 /* ES2015 */ + ? ts.setTextRange(ts.createIdentifier("_super"), callee) + : callee; + } + else if (ts.getEmitFlags(callee) & 4096 /* HelperName */) { + thisArg = ts.createVoidZero(); + target = parenthesizeForAccess(callee); + } + else { + switch (callee.kind) { + case 179 /* PropertyAccessExpression */: { + if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { + // for `a.b()` target is `(_a = a).b` and thisArg is `_a` + thisArg = ts.createTempVariable(recordTempVariable); + target = ts.createPropertyAccess(ts.setTextRange(ts.createAssignment(thisArg, callee.expression), callee.expression), callee.name); + ts.setTextRange(target, callee); + } + else { + thisArg = callee.expression; + target = callee; + } + break; + } + case 180 /* ElementAccessExpression */: { + if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { + // for `a[b]()` target is `(_a = a)[b]` and thisArg is `_a` + thisArg = ts.createTempVariable(recordTempVariable); + target = ts.createElementAccess(ts.setTextRange(ts.createAssignment(thisArg, callee.expression), callee.expression), callee.argumentExpression); + ts.setTextRange(target, callee); + } + else { + thisArg = callee.expression; + target = callee; + } + break; + } + default: { + // for `a()` target is `a` and thisArg is `void 0` + thisArg = ts.createVoidZero(); + target = parenthesizeForAccess(expression); + break; + } + } + } + return { target: target, thisArg: thisArg }; + } + ts.createCallBinding = createCallBinding; + function inlineExpressions(expressions) { + return ts.reduceLeft(expressions, ts.createComma); + } + ts.inlineExpressions = inlineExpressions; + function createExpressionFromEntityName(node) { + if (ts.isQualifiedName(node)) { + var left = createExpressionFromEntityName(node.left); + var right = ts.getMutableClone(node.right); + return ts.setTextRange(ts.createPropertyAccess(left, right), node); + } + else { + return ts.getMutableClone(node); + } + } + ts.createExpressionFromEntityName = createExpressionFromEntityName; + function createExpressionForPropertyName(memberName) { + if (ts.isIdentifier(memberName)) { + return ts.createLiteral(memberName); + } + else if (ts.isComputedPropertyName(memberName)) { + return ts.getMutableClone(memberName.expression); + } + else { + return ts.getMutableClone(memberName); + } + } + ts.createExpressionForPropertyName = createExpressionForPropertyName; + function createExpressionForObjectLiteralElementLike(node, property, receiver) { + switch (property.kind) { + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + return createExpressionForAccessorDeclaration(node.properties, property, receiver, node.multiLine); + case 261 /* PropertyAssignment */: + return createExpressionForPropertyAssignment(property, receiver); + case 262 /* ShorthandPropertyAssignment */: + return createExpressionForShorthandPropertyAssignment(property, receiver); + case 151 /* MethodDeclaration */: + return createExpressionForMethodDeclaration(property, receiver); + } + } + ts.createExpressionForObjectLiteralElementLike = createExpressionForObjectLiteralElementLike; + function createExpressionForAccessorDeclaration(properties, property, receiver, multiLine) { + var _a = ts.getAllAccessorDeclarations(properties, property), firstAccessor = _a.firstAccessor, getAccessor = _a.getAccessor, setAccessor = _a.setAccessor; + if (property === firstAccessor) { + var properties_1 = []; + if (getAccessor) { + var getterFunction = ts.createFunctionExpression(getAccessor.modifiers, + /*asteriskToken*/ undefined, + /*name*/ undefined, + /*typeParameters*/ undefined, getAccessor.parameters, + /*type*/ undefined, getAccessor.body); + ts.setTextRange(getterFunction, getAccessor); + ts.setOriginalNode(getterFunction, getAccessor); + var getter = ts.createPropertyAssignment("get", getterFunction); + properties_1.push(getter); + } + if (setAccessor) { + var setterFunction = ts.createFunctionExpression(setAccessor.modifiers, + /*asteriskToken*/ undefined, + /*name*/ undefined, + /*typeParameters*/ undefined, setAccessor.parameters, + /*type*/ undefined, setAccessor.body); + ts.setTextRange(setterFunction, setAccessor); + ts.setOriginalNode(setterFunction, setAccessor); + var setter = ts.createPropertyAssignment("set", setterFunction); + properties_1.push(setter); + } + properties_1.push(ts.createPropertyAssignment("enumerable", ts.createTrue())); + properties_1.push(ts.createPropertyAssignment("configurable", ts.createTrue())); + var expression = ts.setTextRange(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "defineProperty"), + /*typeArguments*/ undefined, [ + receiver, + createExpressionForPropertyName(property.name), + ts.createObjectLiteral(properties_1, multiLine) + ]), + /*location*/ firstAccessor); + return ts.aggregateTransformFlags(expression); + } + return undefined; + } + function createExpressionForPropertyAssignment(property, receiver) { + return ts.aggregateTransformFlags(ts.setOriginalNode(ts.setTextRange(ts.createAssignment(createMemberAccessForPropertyName(receiver, property.name, /*location*/ property.name), property.initializer), property), property)); + } + function createExpressionForShorthandPropertyAssignment(property, receiver) { + return ts.aggregateTransformFlags(ts.setOriginalNode(ts.setTextRange(ts.createAssignment(createMemberAccessForPropertyName(receiver, property.name, /*location*/ property.name), ts.getSynthesizedClone(property.name)), + /*location*/ property), + /*original*/ property)); + } + function createExpressionForMethodDeclaration(method, receiver) { + return ts.aggregateTransformFlags(ts.setOriginalNode(ts.setTextRange(ts.createAssignment(createMemberAccessForPropertyName(receiver, method.name, /*location*/ method.name), ts.setOriginalNode(ts.setTextRange(ts.createFunctionExpression(method.modifiers, method.asteriskToken, + /*name*/ undefined, + /*typeParameters*/ undefined, method.parameters, + /*type*/ undefined, method.body), + /*location*/ method), + /*original*/ method)), + /*location*/ method), + /*original*/ method)); + } + /** + * Gets the internal name of a declaration. This is primarily used for declarations that can be + * referred to by name in the body of an ES5 class function body. An internal name will *never* + * be prefixed with an module or namespace export modifier like "exports." when emitted as an + * expression. An internal name will also *never* be renamed due to a collision with a block + * scoped variable. + * + * @param node The declaration. + * @param allowComments A value indicating whether comments may be emitted for the name. + * @param allowSourceMaps A value indicating whether source maps may be emitted for the name. + */ + function getInternalName(node, allowComments, allowSourceMaps) { + return getName(node, allowComments, allowSourceMaps, 16384 /* LocalName */ | 32768 /* InternalName */); + } + ts.getInternalName = getInternalName; + /** + * Gets whether an identifier should only be referred to by its internal name. + */ + function isInternalName(node) { + return (ts.getEmitFlags(node) & 32768 /* InternalName */) !== 0; + } + ts.isInternalName = isInternalName; + /** + * Gets the local name of a declaration. This is primarily used for declarations that can be + * referred to by name in the declaration's immediate scope (classes, enums, namespaces). A + * local name will *never* be prefixed with an module or namespace export modifier like + * "exports." when emitted as an expression. + * + * @param node The declaration. + * @param allowComments A value indicating whether comments may be emitted for the name. + * @param allowSourceMaps A value indicating whether source maps may be emitted for the name. + */ + function getLocalName(node, allowComments, allowSourceMaps) { + return getName(node, allowComments, allowSourceMaps, 16384 /* LocalName */); + } + ts.getLocalName = getLocalName; + /** + * Gets whether an identifier should only be referred to by its local name. + */ + function isLocalName(node) { + return (ts.getEmitFlags(node) & 16384 /* LocalName */) !== 0; + } + ts.isLocalName = isLocalName; + /** + * Gets the export name of a declaration. This is primarily used for declarations that can be + * referred to by name in the declaration's immediate scope (classes, enums, namespaces). An + * export name will *always* be prefixed with an module or namespace export modifier like + * `"exports."` when emitted as an expression if the name points to an exported symbol. + * + * @param node The declaration. + * @param allowComments A value indicating whether comments may be emitted for the name. + * @param allowSourceMaps A value indicating whether source maps may be emitted for the name. + */ + function getExportName(node, allowComments, allowSourceMaps) { + return getName(node, allowComments, allowSourceMaps, 8192 /* ExportName */); + } + ts.getExportName = getExportName; + /** + * Gets whether an identifier should only be referred to by its export representation if the + * name points to an exported symbol. + */ + function isExportName(node) { + return (ts.getEmitFlags(node) & 8192 /* ExportName */) !== 0; + } + ts.isExportName = isExportName; + /** + * Gets the name of a declaration for use in declarations. + * + * @param node The declaration. + * @param allowComments A value indicating whether comments may be emitted for the name. + * @param allowSourceMaps A value indicating whether source maps may be emitted for the name. + */ + function getDeclarationName(node, allowComments, allowSourceMaps) { + return getName(node, allowComments, allowSourceMaps); + } + ts.getDeclarationName = getDeclarationName; + function getName(node, allowComments, allowSourceMaps, emitFlags) { + var nodeName = ts.getNameOfDeclaration(node); + if (nodeName && ts.isIdentifier(nodeName) && !ts.isGeneratedIdentifier(nodeName)) { + var name = ts.getMutableClone(nodeName); + emitFlags |= ts.getEmitFlags(nodeName); + if (!allowSourceMaps) + emitFlags |= 48 /* NoSourceMap */; + if (!allowComments) + emitFlags |= 1536 /* NoComments */; + if (emitFlags) + ts.setEmitFlags(name, emitFlags); + return name; + } + return ts.getGeneratedNameForNode(node); + } + /** + * Gets the exported name of a declaration for use in expressions. + * + * An exported name will *always* be prefixed with an module or namespace export modifier like + * "exports." if the name points to an exported symbol. + * + * @param ns The namespace identifier. + * @param node The declaration. + * @param allowComments A value indicating whether comments may be emitted for the name. + * @param allowSourceMaps A value indicating whether source maps may be emitted for the name. + */ + function getExternalModuleOrNamespaceExportName(ns, node, allowComments, allowSourceMaps) { + if (ns && ts.hasModifier(node, 1 /* Export */)) { + return getNamespaceMemberName(ns, getName(node), allowComments, allowSourceMaps); + } + return getExportName(node, allowComments, allowSourceMaps); + } + ts.getExternalModuleOrNamespaceExportName = getExternalModuleOrNamespaceExportName; + /** + * Gets a namespace-qualified name for use in expressions. + * + * @param ns The namespace identifier. + * @param name The name. + * @param allowComments A value indicating whether comments may be emitted for the name. + * @param allowSourceMaps A value indicating whether source maps may be emitted for the name. + */ + function getNamespaceMemberName(ns, name, allowComments, allowSourceMaps) { + var qualifiedName = ts.createPropertyAccess(ns, ts.nodeIsSynthesized(name) ? name : ts.getSynthesizedClone(name)); + ts.setTextRange(qualifiedName, name); + var emitFlags; + if (!allowSourceMaps) + emitFlags |= 48 /* NoSourceMap */; + if (!allowComments) + emitFlags |= 1536 /* NoComments */; + if (emitFlags) + ts.setEmitFlags(qualifiedName, emitFlags); + return qualifiedName; + } + ts.getNamespaceMemberName = getNamespaceMemberName; + function convertToFunctionBody(node, multiLine) { + return ts.isBlock(node) ? node : ts.setTextRange(ts.createBlock([ts.setTextRange(ts.createReturn(node), node)], multiLine), node); + } + ts.convertToFunctionBody = convertToFunctionBody; + function isUseStrictPrologue(node) { + return node.expression.text === "use strict"; + } + /** + * Add any necessary prologue-directives into target statement-array. + * The function needs to be called during each transformation step. + * This function needs to be called whenever we transform the statement + * list of a source file, namespace, or function-like body. + * + * @param target: result statements array + * @param source: origin statements array + * @param ensureUseStrict: boolean determining whether the function need to add prologue-directives + * @param visitor: Optional callback used to visit any custom prologue directives. + */ + function addPrologue(target, source, ensureUseStrict, visitor) { + var offset = addStandardPrologue(target, source, ensureUseStrict); + return addCustomPrologue(target, source, offset, visitor); + } + ts.addPrologue = addPrologue; + /** + * Add just the standard (string-expression) prologue-directives into target statement-array. + * The function needs to be called during each transformation step. + * This function needs to be called whenever we transform the statement + * list of a source file, namespace, or function-like body. + */ + function addStandardPrologue(target, source, ensureUseStrict) { + ts.Debug.assert(target.length === 0, "Prologue directives should be at the first statement in the target statements array"); + var foundUseStrict = false; + var statementOffset = 0; + var numStatements = source.length; + while (statementOffset < numStatements) { + var statement = source[statementOffset]; + if (ts.isPrologueDirective(statement)) { + if (isUseStrictPrologue(statement)) { + foundUseStrict = true; + } + target.push(statement); + } + else { + break; + } + statementOffset++; + } + if (ensureUseStrict && !foundUseStrict) { + target.push(startOnNewLine(ts.createStatement(ts.createLiteral("use strict")))); + } + return statementOffset; + } + ts.addStandardPrologue = addStandardPrologue; + /** + * Add just the custom prologue-directives into target statement-array. + * The function needs to be called during each transformation step. + * This function needs to be called whenever we transform the statement + * list of a source file, namespace, or function-like body. + */ + function addCustomPrologue(target, source, statementOffset, visitor) { + var numStatements = source.length; + while (statementOffset < numStatements) { + var statement = source[statementOffset]; + if (ts.getEmitFlags(statement) & 1048576 /* CustomPrologue */) { + target.push(visitor ? ts.visitNode(statement, visitor, ts.isStatement) : statement); + } + else { + break; + } + statementOffset++; + } + return statementOffset; + } + ts.addCustomPrologue = addCustomPrologue; + function startsWithUseStrict(statements) { + var firstStatement = ts.firstOrUndefined(statements); + return firstStatement !== undefined + && ts.isPrologueDirective(firstStatement) + && isUseStrictPrologue(firstStatement); + } + ts.startsWithUseStrict = startsWithUseStrict; + /** + * Ensures "use strict" directive is added + * + * @param statements An array of statements + */ + function ensureUseStrict(statements) { + var foundUseStrict = false; + for (var _i = 0, statements_1 = statements; _i < statements_1.length; _i++) { + var statement = statements_1[_i]; + if (ts.isPrologueDirective(statement)) { + if (isUseStrictPrologue(statement)) { + foundUseStrict = true; + break; + } + } + else { + break; + } + } + if (!foundUseStrict) { + return ts.setTextRange(ts.createNodeArray([ + startOnNewLine(ts.createStatement(ts.createLiteral("use strict"))) + ].concat(statements)), statements); + } + return statements; + } + ts.ensureUseStrict = ensureUseStrict; + function parenthesizeConditionalHead(condition) { + var conditionalPrecedence = ts.getOperatorPrecedence(195 /* ConditionalExpression */, 55 /* QuestionToken */); + var emittedCondition = skipPartiallyEmittedExpressions(condition); + var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); + if (ts.compareValues(conditionPrecedence, conditionalPrecedence) === -1 /* LessThan */) { + return ts.createParen(condition); + } + return condition; + } + ts.parenthesizeConditionalHead = parenthesizeConditionalHead; + /** + * Wraps the operand to a BinaryExpression in parentheses if they are needed to preserve the intended + * order of operations. + * + * @param binaryOperator The operator for the BinaryExpression. + * @param operand The operand for the BinaryExpression. + * @param isLeftSideOfBinary A value indicating whether the operand is the left side of the + * BinaryExpression. + */ + function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { + var skipped = skipPartiallyEmittedExpressions(operand); + // If the resulting expression is already parenthesized, we do not need to do any further processing. + if (skipped.kind === 185 /* ParenthesizedExpression */) { + return operand; + } + return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) + ? ts.createParen(operand) + : operand; + } + ts.parenthesizeBinaryOperand = parenthesizeBinaryOperand; + /** + * Determines whether the operand to a BinaryExpression needs to be parenthesized. + * + * @param binaryOperator The operator for the BinaryExpression. + * @param operand The operand for the BinaryExpression. + * @param isLeftSideOfBinary A value indicating whether the operand is the left side of the + * BinaryExpression. + */ + function binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { + // If the operand has lower precedence, then it needs to be parenthesized to preserve the + // intent of the expression. For example, if the operand is `a + b` and the operator is + // `*`, then we need to parenthesize the operand to preserve the intended order of + // operations: `(a + b) * x`. + // + // If the operand has higher precedence, then it does not need to be parenthesized. For + // example, if the operand is `a * b` and the operator is `+`, then we do not need to + // parenthesize to preserve the intended order of operations: `a * b + x`. + // + // If the operand has the same precedence, then we need to check the associativity of + // the operator based on whether this is the left or right operand of the expression. + // + // For example, if `a / d` is on the right of operator `*`, we need to parenthesize + // to preserve the intended order of operations: `x * (a / d)` + // + // 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(194 /* BinaryExpression */, binaryOperator); + var binaryOperatorAssociativity = ts.getOperatorAssociativity(194 /* BinaryExpression */, binaryOperator); + var emittedOperand = skipPartiallyEmittedExpressions(operand); + var operandPrecedence = ts.getExpressionPrecedence(emittedOperand); + switch (ts.compareValues(operandPrecedence, binaryOperatorPrecedence)) { + case -1 /* LessThan */: + // If the operand is the right side of a right-associative binary operation + // and is a yield expression, then we do not need parentheses. + if (!isLeftSideOfBinary + && binaryOperatorAssociativity === 1 /* Right */ + && operand.kind === 197 /* YieldExpression */) { + return false; + } + return true; + case 1 /* GreaterThan */: + return false; + case 0 /* EqualTo */: + if (isLeftSideOfBinary) { + // No need to parenthesize the left operand when the binary operator is + // left associative: + // (a*b)/x -> a*b/x + // (a**b)/x -> a**b/x + // + // Parentheses are needed for the left operand when the binary operator is + // right associative: + // (a/b)**x -> (a/b)**x + // (a**b)**x -> (a**b)**x + return binaryOperatorAssociativity === 1 /* Right */; + } + else { + if (ts.isBinaryExpression(emittedOperand) + && emittedOperand.operatorToken.kind === binaryOperator) { + // No need to parenthesize the right operand when the binary operator and + // operand are the same and one of the following: + // x*(a*b) => x*a*b + // x|(a|b) => x|a|b + // x&(a&b) => x&a&b + // x^(a^b) => x^a^b + if (operatorHasAssociativeProperty(binaryOperator)) { + return false; + } + // No need to parenthesize the right operand when the binary operator + // is plus (+) if both the left and right operands consist solely of either + // literals of the same kind or binary plus (+) expressions for literals of + // the same kind (recursively). + // "a"+(1+2) => "a"+(1+2) + // "a"+("b"+"c") => "a"+"b"+"c" + if (binaryOperator === 37 /* PlusToken */) { + var leftKind = leftOperand ? getLiteralKindOfBinaryPlusOperand(leftOperand) : 0 /* Unknown */; + if (ts.isLiteralKind(leftKind) && leftKind === getLiteralKindOfBinaryPlusOperand(emittedOperand)) { + return false; + } + } + } + // No need to parenthesize the right operand when the operand is right + // associative: + // x/(a**b) -> x/a**b + // x**(a**b) -> x**a**b + // + // Parentheses are needed for the right operand when the operand is left + // associative: + // x/(a*b) -> x/(a*b) + // x**(a/b) -> x**(a/b) + var operandAssociativity = ts.getExpressionAssociativity(emittedOperand); + return operandAssociativity === 0 /* Left */; + } + } + } + /** + * Determines whether a binary operator is mathematically associative. + * + * @param binaryOperator The binary operator. + */ + function operatorHasAssociativeProperty(binaryOperator) { + // The following operators are associative in JavaScript: + // (a*b)*c -> a*(b*c) -> a*b*c + // (a|b)|c -> a|(b|c) -> a|b|c + // (a&b)&c -> a&(b&c) -> a&b&c + // (a^b)^c -> a^(b^c) -> a^b^c + // + // While addition is associative in mathematics, JavaScript's `+` is not + // guaranteed to be associative as it is overloaded with string concatenation. + return binaryOperator === 39 /* AsteriskToken */ + || binaryOperator === 49 /* BarToken */ + || binaryOperator === 48 /* AmpersandToken */ + || binaryOperator === 50 /* CaretToken */; + } + /** + * This function determines whether an expression consists of a homogeneous set of + * literal expressions or binary plus expressions that all share the same literal kind. + * It is used to determine whether the right-hand operand of a binary plus expression can be + * emitted without parentheses. + */ + function getLiteralKindOfBinaryPlusOperand(node) { + node = skipPartiallyEmittedExpressions(node); + if (ts.isLiteralKind(node.kind)) { + return node.kind; + } + if (node.kind === 194 /* BinaryExpression */ && node.operatorToken.kind === 37 /* PlusToken */) { + if (node.cachedLiteralKind !== undefined) { + return node.cachedLiteralKind; + } + var leftKind = getLiteralKindOfBinaryPlusOperand(node.left); + var literalKind = ts.isLiteralKind(leftKind) + && leftKind === getLiteralKindOfBinaryPlusOperand(node.right) + ? leftKind + : 0 /* Unknown */; + node.cachedLiteralKind = literalKind; + return literalKind; + } + return 0 /* Unknown */; + } + function parenthesizeForConditionalHead(condition) { + var conditionalPrecedence = ts.getOperatorPrecedence(195 /* ConditionalExpression */, 55 /* QuestionToken */); + var emittedCondition = skipPartiallyEmittedExpressions(condition); + var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); + if (ts.compareValues(conditionPrecedence, conditionalPrecedence) === -1 /* LessThan */) { + return ts.createParen(condition); + } + return condition; + } + ts.parenthesizeForConditionalHead = parenthesizeForConditionalHead; + function parenthesizeSubexpressionOfConditionalExpression(e) { + // per ES grammar both 'whenTrue' and 'whenFalse' parts of conditional expression are assignment expressions + // 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 + return e.kind === 194 /* BinaryExpression */ && e.operatorToken.kind === 26 /* CommaToken */ + ? ts.createParen(e) + : e; + } + ts.parenthesizeSubexpressionOfConditionalExpression = parenthesizeSubexpressionOfConditionalExpression; + /** + * Wraps an expression in parentheses if it is needed in order to use the expression + * as the expression of a NewExpression node. + * + * @param expression The Expression node. + */ + function parenthesizeForNew(expression) { + var emittedExpression = skipPartiallyEmittedExpressions(expression); + switch (emittedExpression.kind) { + case 181 /* CallExpression */: + return ts.createParen(expression); + case 182 /* NewExpression */: + return emittedExpression.arguments + ? expression + : ts.createParen(expression); + } + return parenthesizeForAccess(expression); + } + ts.parenthesizeForNew = parenthesizeForNew; + /** + * Wraps an expression in parentheses if it is needed in order to use the expression for + * property or element access. + * + * @param expr The expression node. + */ + function parenthesizeForAccess(expression) { + // isLeftHandSideExpression is almost the correct criterion for when it is not necessary + // to parenthesize the expression before a dot. The known exception is: + // + // NewExpression: + // new C.x -> not the same as (new C).x + // + var emittedExpression = skipPartiallyEmittedExpressions(expression); + if (ts.isLeftHandSideExpression(emittedExpression) + && (emittedExpression.kind !== 182 /* NewExpression */ || emittedExpression.arguments)) { + return expression; + } + return ts.setTextRange(ts.createParen(expression), expression); + } + ts.parenthesizeForAccess = parenthesizeForAccess; + function parenthesizePostfixOperand(operand) { + return ts.isLeftHandSideExpression(operand) + ? operand + : ts.setTextRange(ts.createParen(operand), operand); + } + ts.parenthesizePostfixOperand = parenthesizePostfixOperand; + function parenthesizePrefixOperand(operand) { + return ts.isUnaryExpression(operand) + ? operand + : ts.setTextRange(ts.createParen(operand), operand); + } + ts.parenthesizePrefixOperand = parenthesizePrefixOperand; + function parenthesizeListElements(elements) { + var result; + for (var i = 0; i < elements.length; i++) { + var element = parenthesizeExpressionForList(elements[i]); + if (result !== undefined || element !== elements[i]) { + if (result === undefined) { + result = elements.slice(0, i); + } + result.push(element); + } + } + if (result !== undefined) { + return ts.setTextRange(ts.createNodeArray(result, elements.hasTrailingComma), elements); + } + return elements; + } + ts.parenthesizeListElements = parenthesizeListElements; + function parenthesizeExpressionForList(expression) { + var emittedExpression = skipPartiallyEmittedExpressions(expression); + var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression); + var commaPrecedence = ts.getOperatorPrecedence(194 /* BinaryExpression */, 26 /* CommaToken */); + return expressionPrecedence > commaPrecedence + ? expression + : ts.setTextRange(ts.createParen(expression), expression); + } + ts.parenthesizeExpressionForList = parenthesizeExpressionForList; + function parenthesizeExpressionForExpressionStatement(expression) { + var emittedExpression = skipPartiallyEmittedExpressions(expression); + if (ts.isCallExpression(emittedExpression)) { + var callee = emittedExpression.expression; + var kind = skipPartiallyEmittedExpressions(callee).kind; + if (kind === 186 /* FunctionExpression */ || kind === 187 /* ArrowFunction */) { + var mutableCall = ts.getMutableClone(emittedExpression); + mutableCall.expression = ts.setTextRange(ts.createParen(callee), callee); + return recreatePartiallyEmittedExpressions(expression, mutableCall); + } + } + else { + var leftmostExpressionKind = getLeftmostExpression(emittedExpression).kind; + if (leftmostExpressionKind === 178 /* ObjectLiteralExpression */ || leftmostExpressionKind === 186 /* FunctionExpression */) { + return ts.setTextRange(ts.createParen(expression), expression); + } + } + return expression; + } + ts.parenthesizeExpressionForExpressionStatement = parenthesizeExpressionForExpressionStatement; + /** + * Clones a series of not-emitted expressions with a new inner expression. + * + * @param originalOuterExpression The original outer expression. + * @param newInnerExpression The new inner expression. + */ + function recreatePartiallyEmittedExpressions(originalOuterExpression, newInnerExpression) { + if (ts.isPartiallyEmittedExpression(originalOuterExpression)) { + var clone_1 = ts.getMutableClone(originalOuterExpression); + clone_1.expression = recreatePartiallyEmittedExpressions(clone_1.expression, newInnerExpression); + return clone_1; + } + return newInnerExpression; + } + function getLeftmostExpression(node) { + while (true) { + switch (node.kind) { + case 193 /* PostfixUnaryExpression */: + node = node.operand; + continue; + case 194 /* BinaryExpression */: + node = node.left; + continue; + case 195 /* ConditionalExpression */: + node = node.condition; + continue; + case 181 /* CallExpression */: + case 180 /* ElementAccessExpression */: + case 179 /* PropertyAccessExpression */: + node = node.expression; + continue; + case 296 /* PartiallyEmittedExpression */: + node = node.expression; + continue; + } + return node; + } + } + function parenthesizeConciseBody(body) { + if (!ts.isBlock(body) && getLeftmostExpression(body).kind === 178 /* ObjectLiteralExpression */) { + return ts.setTextRange(ts.createParen(body), body); + } + return body; + } + ts.parenthesizeConciseBody = parenthesizeConciseBody; + var OuterExpressionKinds; + (function (OuterExpressionKinds) { + OuterExpressionKinds[OuterExpressionKinds["Parentheses"] = 1] = "Parentheses"; + OuterExpressionKinds[OuterExpressionKinds["Assertions"] = 2] = "Assertions"; + OuterExpressionKinds[OuterExpressionKinds["PartiallyEmittedExpressions"] = 4] = "PartiallyEmittedExpressions"; + OuterExpressionKinds[OuterExpressionKinds["All"] = 7] = "All"; + })(OuterExpressionKinds = ts.OuterExpressionKinds || (ts.OuterExpressionKinds = {})); + function skipOuterExpressions(node, kinds) { + if (kinds === void 0) { kinds = 7 /* All */; } + var previousNode; + do { + previousNode = node; + if (kinds & 1 /* Parentheses */) { + node = skipParentheses(node); + } + if (kinds & 2 /* Assertions */) { + node = skipAssertions(node); + } + if (kinds & 4 /* PartiallyEmittedExpressions */) { + node = skipPartiallyEmittedExpressions(node); + } + } while (previousNode !== node); return node; } - ts.setNodeFlags = setNodeFlags; - function setMultiLine(node, multiLine) { - node.multiLine = multiLine; + ts.skipOuterExpressions = skipOuterExpressions; + function skipParentheses(node) { + while (node.kind === 185 /* ParenthesizedExpression */) { + node = node.expression; + } return node; } - ts.setMultiLine = setMultiLine; - function setHasTrailingComma(nodes, hasTrailingComma) { - nodes.hasTrailingComma = hasTrailingComma; - return nodes; + ts.skipParentheses = skipParentheses; + function skipAssertions(node) { + while (ts.isAssertionExpression(node)) { + node = node.expression; + } + return node; } - ts.setHasTrailingComma = setHasTrailingComma; + ts.skipAssertions = skipAssertions; + function skipPartiallyEmittedExpressions(node) { + while (node.kind === 296 /* PartiallyEmittedExpression */) { + node = node.expression; + } + return node; + } + ts.skipPartiallyEmittedExpressions = skipPartiallyEmittedExpressions; + function startOnNewLine(node) { + node.startsOnNewLine = true; + return node; + } + ts.startOnNewLine = startOnNewLine; + function getExternalHelpersModuleName(node) { + var parseNode = ts.getOriginalNode(node, ts.isSourceFile); + var emitNode = parseNode && parseNode.emitNode; + return emitNode && emitNode.externalHelpersModuleName; + } + ts.getExternalHelpersModuleName = getExternalHelpersModuleName; + function getOrCreateExternalHelpersModuleNameIfNeeded(node, compilerOptions) { + if (compilerOptions.importHelpers && (ts.isExternalModule(node) || compilerOptions.isolatedModules)) { + var externalHelpersModuleName = getExternalHelpersModuleName(node); + if (externalHelpersModuleName) { + return externalHelpersModuleName; + } + var helpers = ts.getEmitHelpers(node); + if (helpers) { + for (var _i = 0, helpers_2 = helpers; _i < helpers_2.length; _i++) { + var helper = helpers_2[_i]; + if (!helper.scoped) { + var parseNode = ts.getOriginalNode(node, ts.isSourceFile); + var emitNode = ts.getOrCreateEmitNode(parseNode); + return emitNode.externalHelpersModuleName || (emitNode.externalHelpersModuleName = ts.createUniqueName(ts.externalHelpersModuleNameText)); + } + } + } + } + } + ts.getOrCreateExternalHelpersModuleNameIfNeeded = getOrCreateExternalHelpersModuleNameIfNeeded; /** * Get the name of that target module from an import or export declaration */ function getLocalNameForExternalImport(node, sourceFile) { var namespaceDeclaration = ts.getNamespaceDeclarationNode(node); if (namespaceDeclaration && !ts.isDefaultImport(node)) { - var name_9 = namespaceDeclaration.name; - return ts.isGeneratedIdentifier(name_9) ? name_9 : createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, namespaceDeclaration.name)); + var name = namespaceDeclaration.name; + return ts.isGeneratedIdentifier(name) ? name : ts.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, namespaceDeclaration.name)); } - if (node.kind === 235 /* ImportDeclaration */ && node.importClause) { - return getGeneratedNameForNode(node); + if (node.kind === 238 /* ImportDeclaration */ && node.importClause) { + return ts.getGeneratedNameForNode(node); } - if (node.kind === 241 /* ExportDeclaration */ && node.moduleSpecifier) { - return getGeneratedNameForNode(node); + if (node.kind === 244 /* ExportDeclaration */ && node.moduleSpecifier) { + return ts.getGeneratedNameForNode(node); } return undefined; } @@ -13417,7 +14309,7 @@ var ts; if (moduleName.kind === 9 /* StringLiteral */) { return tryGetModuleNameFromDeclaration(importNode, host, resolver, compilerOptions) || tryRenameExternalModule(moduleName, sourceFile) - || getSynthesizedClone(moduleName); + || ts.getSynthesizedClone(moduleName); } return undefined; } @@ -13427,10 +14319,8 @@ var ts; * Here we check if alternative name was provided for a given moduleName and return it if possible. */ function tryRenameExternalModule(moduleName, sourceFile) { - if (sourceFile.renamedDependencies && ts.hasProperty(sourceFile.renamedDependencies, moduleName.text)) { - return createLiteral(sourceFile.renamedDependencies[moduleName.text]); - } - return undefined; + var rename = sourceFile.renamedDependencies && sourceFile.renamedDependencies.get(moduleName.text); + return rename && ts.createLiteral(rename); } /** * Get the name of a module as should be written in the emitted output. @@ -13444,10 +14334,10 @@ var ts; return undefined; } if (file.moduleName) { - return createLiteral(file.moduleName); + return ts.createLiteral(file.moduleName); } if (!ts.isDeclarationFile(file) && (options.out || options.outFile)) { - return createLiteral(ts.getExternalModuleNameFromPath(host, file.fileName)); + return ts.createLiteral(ts.getExternalModuleNameFromPath(host, file.fileName)); } return undefined; } @@ -13518,7 +14408,7 @@ var ts; } if (ts.isObjectLiteralElementLike(bindingElement)) { switch (bindingElement.kind) { - case 257 /* PropertyAssignment */: + case 261 /* PropertyAssignment */: // `b` in `({ a: b } = ...)` // `b` in `({ a: b = 1 } = ...)` // `{b}` in `({ a: {b} } = ...)` @@ -13530,11 +14420,11 @@ var ts; // `b[0]` in `({ a: b[0] } = ...)` // `b[0]` in `({ a: b[0] = 1 } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); - case 258 /* ShorthandPropertyAssignment */: + case 262 /* ShorthandPropertyAssignment */: // `a` in `({ a } = ...)` // `a` in `({ a = 1 } = ...)` return bindingElement.name; - case 259 /* SpreadAssignment */: + case 263 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.expression); } @@ -13566,12 +14456,12 @@ var ts; */ function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 144 /* Parameter */: - case 174 /* BindingElement */: + case 146 /* Parameter */: + case 176 /* BindingElement */: // `...` in `let [...a] = ...` return bindingElement.dotDotDotToken; - case 196 /* SpreadElement */: - case 259 /* SpreadAssignment */: + case 198 /* SpreadElement */: + case 263 /* SpreadAssignment */: // `...` in `[...a] = ...` return bindingElement; } @@ -13583,7 +14473,7 @@ var ts; */ function getPropertyNameOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 174 /* BindingElement */: + case 176 /* BindingElement */: // `a` in `let { a: b } = ...` // `[a]` in `let { [a]: b } = ...` // `"a"` in `let { "a": b } = ...` @@ -13595,7 +14485,7 @@ var ts; : propertyName; } break; - case 257 /* PropertyAssignment */: + case 261 /* PropertyAssignment */: // `a` in `({ a: b } = ...)` // `[a]` in `({ [a]: b } = ...)` // `"a"` in `({ "a": b } = ...)` @@ -13607,7 +14497,7 @@ var ts; : propertyName; } break; - case 259 /* SpreadAssignment */: + case 263 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` return bindingElement.name; } @@ -13625,13 +14515,13 @@ var ts; */ function getElementsOfBindingOrAssignmentPattern(name) { switch (name.kind) { - case 172 /* ObjectBindingPattern */: - case 173 /* ArrayBindingPattern */: - case 175 /* ArrayLiteralExpression */: + case 174 /* ObjectBindingPattern */: + case 175 /* ArrayBindingPattern */: + case 177 /* ArrayLiteralExpression */: // `a` in `{a}` // `a` in `[a]` return name.elements; - case 176 /* ObjectLiteralExpression */: + case 178 /* ObjectLiteralExpression */: // `a` in `{a}` return name.properties; } @@ -13641,10 +14531,12 @@ var ts; if (ts.isBindingElement(element)) { if (element.dotDotDotToken) { ts.Debug.assertNode(element.name, ts.isIdentifier); - return setOriginalNode(createSpread(element.name, element), element); + return ts.setOriginalNode(ts.setTextRange(ts.createSpread(element.name), element), element); } var expression = convertToAssignmentElementTarget(element.name); - return element.initializer ? setOriginalNode(createAssignment(expression, element.initializer, element), element) : expression; + return element.initializer + ? ts.setOriginalNode(ts.setTextRange(ts.createAssignment(expression, element.initializer), element), element) + : expression; } ts.Debug.assertNode(element, ts.isExpression); return element; @@ -13654,14 +14546,14 @@ var ts; if (ts.isBindingElement(element)) { if (element.dotDotDotToken) { ts.Debug.assertNode(element.name, ts.isIdentifier); - return setOriginalNode(createSpreadAssignment(element.name, element), element); + return ts.setOriginalNode(ts.setTextRange(ts.createSpreadAssignment(element.name), element), element); } if (element.propertyName) { var expression = convertToAssignmentElementTarget(element.name); - return setOriginalNode(createPropertyAssignment(element.propertyName, element.initializer ? createAssignment(expression, element.initializer) : expression, element), element); + return ts.setOriginalNode(ts.setTextRange(ts.createPropertyAssignment(element.propertyName, element.initializer ? ts.createAssignment(expression, element.initializer) : expression), element), element); } ts.Debug.assertNode(element.name, ts.isIdentifier); - return setOriginalNode(createShorthandPropertyAssignment(element.name, element.initializer, element), element); + return ts.setOriginalNode(ts.setTextRange(ts.createShorthandPropertyAssignment(element.name, element.initializer), element), element); } ts.Debug.assertNode(element, ts.isObjectLiteralElementLike); return element; @@ -13669,18 +14561,18 @@ var ts; ts.convertToObjectAssignmentElement = convertToObjectAssignmentElement; function convertToAssignmentPattern(node) { switch (node.kind) { - case 173 /* ArrayBindingPattern */: - case 175 /* ArrayLiteralExpression */: + case 175 /* ArrayBindingPattern */: + case 177 /* ArrayLiteralExpression */: return convertToArrayAssignmentPattern(node); - case 172 /* ObjectBindingPattern */: - case 176 /* ObjectLiteralExpression */: + case 174 /* ObjectBindingPattern */: + case 178 /* ObjectLiteralExpression */: return convertToObjectAssignmentPattern(node); } } ts.convertToAssignmentPattern = convertToAssignmentPattern; function convertToObjectAssignmentPattern(node) { if (ts.isObjectBindingPattern(node)) { - return setOriginalNode(createObjectLiteral(ts.map(node.elements, convertToObjectAssignmentElement), node), node); + return ts.setOriginalNode(ts.setTextRange(ts.createObjectLiteral(ts.map(node.elements, convertToObjectAssignmentElement)), node), node); } ts.Debug.assertNode(node, ts.isObjectLiteralExpression); return node; @@ -13688,7 +14580,7 @@ var ts; ts.convertToObjectAssignmentPattern = convertToObjectAssignmentPattern; function convertToArrayAssignmentPattern(node) { if (ts.isArrayBindingPattern(node)) { - return setOriginalNode(createArrayLiteral(ts.map(node.elements, convertToArrayAssignmentElement), node), node); + return ts.setOriginalNode(ts.setTextRange(ts.createArrayLiteral(ts.map(node.elements, convertToArrayAssignmentElement)), node), node); } ts.Debug.assertNode(node, ts.isArrayLiteralExpression); return node; @@ -13704,37 +14596,37 @@ var ts; ts.convertToAssignmentElementTarget = convertToAssignmentElementTarget; function collectExternalModuleInfo(sourceFile, resolver, compilerOptions) { var externalImports = []; - var exportSpecifiers = ts.createMap(); - var exportedBindings = ts.createMap(); + var exportSpecifiers = ts.createMultiMap(); + var exportedBindings = []; var uniqueExports = ts.createMap(); var exportedNames; var hasExportDefault = false; var exportEquals = undefined; var hasExportStarsToExportValues = false; var externalHelpersModuleName = getOrCreateExternalHelpersModuleNameIfNeeded(sourceFile, compilerOptions); - var externalHelpersImportDeclaration = externalHelpersModuleName && createImportDeclaration( + var externalHelpersImportDeclaration = externalHelpersModuleName && ts.createImportDeclaration( /*decorators*/ undefined, - /*modifiers*/ undefined, createImportClause(/*name*/ undefined, createNamespaceImport(externalHelpersModuleName)), createLiteral(ts.externalHelpersModuleNameText)); + /*modifiers*/ undefined, ts.createImportClause(/*name*/ undefined, ts.createNamespaceImport(externalHelpersModuleName)), ts.createLiteral(ts.externalHelpersModuleNameText)); if (externalHelpersImportDeclaration) { externalImports.push(externalHelpersImportDeclaration); } for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var node = _a[_i]; switch (node.kind) { - case 235 /* ImportDeclaration */: + case 238 /* ImportDeclaration */: // import "mod" // import x from "mod" // import * as x from "mod" // import { x, y } from "mod" externalImports.push(node); break; - case 234 /* ImportEqualsDeclaration */: - if (node.moduleReference.kind === 245 /* ExternalModuleReference */) { + case 237 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind === 248 /* ExternalModuleReference */) { // import x = require("mod") externalImports.push(node); } break; - case 241 /* ExportDeclaration */: + case 244 /* ExportDeclaration */: if (node.moduleSpecifier) { if (!node.exportClause) { // export * from "mod" @@ -13750,27 +14642,27 @@ var ts; // export { x, y } for (var _b = 0, _c = node.exportClause.elements; _b < _c.length; _b++) { var specifier = _c[_b]; - if (!uniqueExports[specifier.name.text]) { - var name_10 = specifier.propertyName || specifier.name; - ts.multiMapAdd(exportSpecifiers, name_10.text, specifier); - var decl = resolver.getReferencedImportDeclaration(name_10) - || resolver.getReferencedValueDeclaration(name_10); + if (!uniqueExports.get(specifier.name.text)) { + var name = specifier.propertyName || specifier.name; + exportSpecifiers.add(name.text, specifier); + var decl = resolver.getReferencedImportDeclaration(name) + || resolver.getReferencedValueDeclaration(name); if (decl) { - ts.multiMapAdd(exportedBindings, ts.getOriginalNodeId(decl), specifier.name); + multiMapSparseArrayAdd(exportedBindings, ts.getOriginalNodeId(decl), specifier.name); } - uniqueExports[specifier.name.text] = true; + uniqueExports.set(specifier.name.text, true); exportedNames = ts.append(exportedNames, specifier.name); } } } break; - case 240 /* ExportAssignment */: + case 243 /* ExportAssignment */: if (node.isExportEquals && !exportEquals) { // export = x exportEquals = node; } break; - case 205 /* VariableStatement */: + case 208 /* VariableStatement */: if (ts.hasModifier(node, 1 /* Export */)) { for (var _d = 0, _e = node.declarationList.declarations; _d < _e.length; _d++) { var decl = _e[_d]; @@ -13778,42 +14670,42 @@ var ts; } } break; - case 225 /* FunctionDeclaration */: + case 228 /* FunctionDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default function() { } if (!hasExportDefault) { - ts.multiMapAdd(exportedBindings, ts.getOriginalNodeId(node), getDeclarationName(node)); + multiMapSparseArrayAdd(exportedBindings, ts.getOriginalNodeId(node), getDeclarationName(node)); hasExportDefault = true; } } else { // export function x() { } - var name_11 = node.name; - if (!uniqueExports[name_11.text]) { - ts.multiMapAdd(exportedBindings, ts.getOriginalNodeId(node), name_11); - uniqueExports[name_11.text] = true; - exportedNames = ts.append(exportedNames, name_11); + var name = node.name; + if (!uniqueExports.get(name.text)) { + multiMapSparseArrayAdd(exportedBindings, ts.getOriginalNodeId(node), name); + uniqueExports.set(name.text, true); + exportedNames = ts.append(exportedNames, name); } } } break; - case 226 /* ClassDeclaration */: + case 229 /* ClassDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default class { } if (!hasExportDefault) { - ts.multiMapAdd(exportedBindings, ts.getOriginalNodeId(node), getDeclarationName(node)); + multiMapSparseArrayAdd(exportedBindings, ts.getOriginalNodeId(node), getDeclarationName(node)); hasExportDefault = true; } } else { // export class x { } - var name_12 = node.name; - if (!uniqueExports[name_12.text]) { - ts.multiMapAdd(exportedBindings, ts.getOriginalNodeId(node), name_12); - uniqueExports[name_12.text] = true; - exportedNames = ts.append(exportedNames, name_12); + var name = node.name; + if (!uniqueExports.get(name.text)) { + multiMapSparseArrayAdd(exportedBindings, ts.getOriginalNodeId(node), name); + uniqueExports.set(name.text, true); + exportedNames = ts.append(exportedNames, name); } } } @@ -13833,13 +14725,24 @@ var ts; } } else if (!ts.isGeneratedIdentifier(decl.name)) { - if (!uniqueExports[decl.name.text]) { - uniqueExports[decl.name.text] = true; + if (!uniqueExports.get(decl.name.text)) { + uniqueExports.set(decl.name.text, true); exportedNames = ts.append(exportedNames, decl.name); } } return exportedNames; } + /** Use a sparse array as a multi-map. */ + function multiMapSparseArrayAdd(map, key, value) { + var values = map[key]; + if (values) { + values.push(value); + } + else { + map[key] = values = [value]; + } + return values; + } })(ts || (ts = {})); /// /// @@ -13851,13 +14754,13 @@ var ts; var IdentifierConstructor; var SourceFileConstructor; function createNode(kind, pos, end) { - if (kind === 261 /* SourceFile */) { + if (kind === 265 /* SourceFile */) { return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); } - else if (kind === 70 /* Identifier */) { + else if (kind === 71 /* Identifier */) { return new (IdentifierConstructor || (IdentifierConstructor = ts.objectAllocator.getIdentifierConstructor()))(kind, pos, end); } - else if (kind < 141 /* FirstNode */) { + else if (kind < 143 /* FirstNode */) { return new (TokenConstructor || (TokenConstructor = ts.objectAllocator.getTokenConstructor()))(kind, pos, end); } else { @@ -13900,28 +14803,29 @@ var ts; var visitNodes = cbNodeArray ? visitNodeArray : visitEachNode; var cbNodes = cbNodeArray || cbNode; switch (node.kind) { - case 141 /* QualifiedName */: + case 143 /* QualifiedName */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 143 /* TypeParameter */: + case 145 /* TypeParameter */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || + visitNode(cbNode, node.default) || visitNode(cbNode, node.expression); - case 258 /* ShorthandPropertyAssignment */: + case 262 /* ShorthandPropertyAssignment */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 259 /* SpreadAssignment */: + case 263 /* SpreadAssignment */: return visitNode(cbNode, node.expression); - case 144 /* Parameter */: - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 257 /* PropertyAssignment */: - case 223 /* VariableDeclaration */: - case 174 /* BindingElement */: + case 146 /* Parameter */: + case 149 /* PropertyDeclaration */: + case 148 /* PropertySignature */: + case 261 /* PropertyAssignment */: + case 226 /* VariableDeclaration */: + case 176 /* BindingElement */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.propertyName) || @@ -13930,24 +14834,24 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 158 /* FunctionType */: - case 159 /* ConstructorType */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: + case 160 /* FunctionType */: + case 161 /* ConstructorType */: + case 155 /* CallSignature */: + case 156 /* ConstructSignature */: + case 157 /* IndexSignature */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 184 /* FunctionExpression */: - case 225 /* FunctionDeclaration */: - case 185 /* ArrowFunction */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: + case 152 /* Constructor */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + case 186 /* FunctionExpression */: + case 228 /* FunctionDeclaration */: + case 187 /* ArrowFunction */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -13958,320 +14862,326 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 157 /* TypeReference */: + case 159 /* TypeReference */: return visitNode(cbNode, node.typeName) || visitNodes(cbNodes, node.typeArguments); - case 156 /* TypePredicate */: + case 158 /* TypePredicate */: return visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 160 /* TypeQuery */: + case 162 /* TypeQuery */: return visitNode(cbNode, node.exprName); - case 161 /* TypeLiteral */: + case 163 /* TypeLiteral */: return visitNodes(cbNodes, node.members); - case 162 /* ArrayType */: + case 164 /* ArrayType */: return visitNode(cbNode, node.elementType); - case 163 /* TupleType */: + case 165 /* TupleType */: return visitNodes(cbNodes, node.elementTypes); - case 164 /* UnionType */: - case 165 /* IntersectionType */: + case 166 /* UnionType */: + case 167 /* IntersectionType */: return visitNodes(cbNodes, node.types); - case 166 /* ParenthesizedType */: - case 168 /* TypeOperator */: + case 168 /* ParenthesizedType */: + case 170 /* TypeOperator */: return visitNode(cbNode, node.type); - case 169 /* IndexedAccessType */: + case 171 /* IndexedAccessType */: return visitNode(cbNode, node.objectType) || visitNode(cbNode, node.indexType); - case 170 /* MappedType */: + case 172 /* MappedType */: return visitNode(cbNode, node.readonlyToken) || visitNode(cbNode, node.typeParameter) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 171 /* LiteralType */: + case 173 /* LiteralType */: return visitNode(cbNode, node.literal); - case 172 /* ObjectBindingPattern */: - case 173 /* ArrayBindingPattern */: + case 174 /* ObjectBindingPattern */: + case 175 /* ArrayBindingPattern */: return visitNodes(cbNodes, node.elements); - case 175 /* ArrayLiteralExpression */: + case 177 /* ArrayLiteralExpression */: return visitNodes(cbNodes, node.elements); - case 176 /* ObjectLiteralExpression */: + case 178 /* ObjectLiteralExpression */: return visitNodes(cbNodes, node.properties); - case 177 /* PropertyAccessExpression */: + case 179 /* PropertyAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.name); - case 178 /* ElementAccessExpression */: + case 180 /* ElementAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.argumentExpression); - case 179 /* CallExpression */: - case 180 /* NewExpression */: + case 181 /* CallExpression */: + case 182 /* NewExpression */: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments) || visitNodes(cbNodes, node.arguments); - case 181 /* TaggedTemplateExpression */: + case 183 /* TaggedTemplateExpression */: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.template); - case 182 /* TypeAssertionExpression */: + case 184 /* TypeAssertionExpression */: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 183 /* ParenthesizedExpression */: + case 185 /* ParenthesizedExpression */: return visitNode(cbNode, node.expression); - case 186 /* DeleteExpression */: + case 188 /* DeleteExpression */: return visitNode(cbNode, node.expression); - case 187 /* TypeOfExpression */: + case 189 /* TypeOfExpression */: return visitNode(cbNode, node.expression); - case 188 /* VoidExpression */: + case 190 /* VoidExpression */: return visitNode(cbNode, node.expression); - case 190 /* PrefixUnaryExpression */: + case 192 /* PrefixUnaryExpression */: return visitNode(cbNode, node.operand); - case 195 /* YieldExpression */: + case 197 /* YieldExpression */: return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); - case 189 /* AwaitExpression */: + case 191 /* AwaitExpression */: return visitNode(cbNode, node.expression); - case 191 /* PostfixUnaryExpression */: + case 193 /* PostfixUnaryExpression */: return visitNode(cbNode, node.operand); - case 192 /* BinaryExpression */: + case 194 /* BinaryExpression */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 200 /* AsExpression */: + case 202 /* AsExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 201 /* NonNullExpression */: + case 203 /* NonNullExpression */: return visitNode(cbNode, node.expression); - case 193 /* ConditionalExpression */: + case 204 /* MetaProperty */: + return visitNode(cbNode, node.name); + case 195 /* ConditionalExpression */: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 196 /* SpreadElement */: + case 198 /* SpreadElement */: return visitNode(cbNode, node.expression); - case 204 /* Block */: - case 231 /* ModuleBlock */: + case 207 /* Block */: + case 234 /* ModuleBlock */: return visitNodes(cbNodes, node.statements); - case 261 /* SourceFile */: + case 265 /* SourceFile */: return visitNodes(cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 205 /* VariableStatement */: + case 208 /* VariableStatement */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 224 /* VariableDeclarationList */: + case 227 /* VariableDeclarationList */: return visitNodes(cbNodes, node.declarations); - case 207 /* ExpressionStatement */: + case 210 /* ExpressionStatement */: return visitNode(cbNode, node.expression); - case 208 /* IfStatement */: + case 211 /* IfStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 209 /* DoStatement */: + case 212 /* DoStatement */: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 210 /* WhileStatement */: + case 213 /* WhileStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 211 /* ForStatement */: + case 214 /* ForStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 212 /* ForInStatement */: + case 215 /* ForInStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 213 /* ForOfStatement */: - return visitNode(cbNode, node.initializer) || + case 216 /* ForOfStatement */: + return visitNode(cbNode, node.awaitModifier) || + visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 214 /* ContinueStatement */: - case 215 /* BreakStatement */: + case 217 /* ContinueStatement */: + case 218 /* BreakStatement */: return visitNode(cbNode, node.label); - case 216 /* ReturnStatement */: + case 219 /* ReturnStatement */: return visitNode(cbNode, node.expression); - case 217 /* WithStatement */: + case 220 /* WithStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 218 /* SwitchStatement */: + case 221 /* SwitchStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 232 /* CaseBlock */: + case 235 /* CaseBlock */: return visitNodes(cbNodes, node.clauses); - case 253 /* CaseClause */: + case 257 /* CaseClause */: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.statements); - case 254 /* DefaultClause */: + case 258 /* DefaultClause */: return visitNodes(cbNodes, node.statements); - case 219 /* LabeledStatement */: + case 222 /* LabeledStatement */: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 220 /* ThrowStatement */: + case 223 /* ThrowStatement */: return visitNode(cbNode, node.expression); - case 221 /* TryStatement */: + case 224 /* TryStatement */: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 256 /* CatchClause */: + case 260 /* CatchClause */: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 145 /* Decorator */: + case 147 /* Decorator */: return visitNode(cbNode, node.expression); - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: + case 229 /* ClassDeclaration */: + case 199 /* ClassExpression */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.heritageClauses) || visitNodes(cbNodes, node.members); - case 227 /* InterfaceDeclaration */: + case 230 /* InterfaceDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.heritageClauses) || visitNodes(cbNodes, node.members); - case 228 /* TypeAliasDeclaration */: + case 231 /* TypeAliasDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || visitNode(cbNode, node.type); - case 229 /* EnumDeclaration */: + case 232 /* EnumDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.members); - case 260 /* EnumMember */: + case 264 /* EnumMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 230 /* ModuleDeclaration */: + case 233 /* ModuleDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 234 /* ImportEqualsDeclaration */: + case 237 /* ImportEqualsDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 235 /* ImportDeclaration */: + case 238 /* ImportDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 236 /* ImportClause */: + case 239 /* ImportClause */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 233 /* NamespaceExportDeclaration */: + case 236 /* NamespaceExportDeclaration */: return visitNode(cbNode, node.name); - case 237 /* NamespaceImport */: + case 240 /* NamespaceImport */: return visitNode(cbNode, node.name); - case 238 /* NamedImports */: - case 242 /* NamedExports */: + case 241 /* NamedImports */: + case 245 /* NamedExports */: return visitNodes(cbNodes, node.elements); - case 241 /* ExportDeclaration */: + case 244 /* ExportDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 239 /* ImportSpecifier */: - case 243 /* ExportSpecifier */: + case 242 /* ImportSpecifier */: + case 246 /* ExportSpecifier */: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 240 /* ExportAssignment */: + case 243 /* ExportAssignment */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 194 /* TemplateExpression */: + case 196 /* TemplateExpression */: return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans); - case 202 /* TemplateSpan */: + case 205 /* TemplateSpan */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 142 /* ComputedPropertyName */: + case 144 /* ComputedPropertyName */: return visitNode(cbNode, node.expression); - case 255 /* HeritageClause */: + case 259 /* HeritageClause */: return visitNodes(cbNodes, node.types); - case 199 /* ExpressionWithTypeArguments */: + case 201 /* ExpressionWithTypeArguments */: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments); - case 245 /* ExternalModuleReference */: + case 248 /* ExternalModuleReference */: return visitNode(cbNode, node.expression); - case 244 /* MissingDeclaration */: + case 247 /* MissingDeclaration */: return visitNodes(cbNodes, node.decorators); - case 246 /* JsxElement */: + case 249 /* JsxElement */: return visitNode(cbNode, node.openingElement) || visitNodes(cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 247 /* JsxSelfClosingElement */: - case 248 /* JsxOpeningElement */: + case 250 /* JsxSelfClosingElement */: + case 251 /* JsxOpeningElement */: return visitNode(cbNode, node.tagName) || - visitNodes(cbNodes, node.attributes); - case 250 /* JsxAttribute */: + visitNode(cbNode, node.attributes); + case 254 /* JsxAttributes */: + return visitNodes(cbNodes, node.properties); + case 253 /* JsxAttribute */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 251 /* JsxSpreadAttribute */: + case 255 /* JsxSpreadAttribute */: return visitNode(cbNode, node.expression); - case 252 /* JsxExpression */: - return visitNode(cbNode, node.expression); - case 249 /* JsxClosingElement */: + case 256 /* JsxExpression */: + return visitNode(cbNode, node.dotDotDotToken) || + visitNode(cbNode, node.expression); + case 252 /* JsxClosingElement */: return visitNode(cbNode, node.tagName); - case 262 /* JSDocTypeExpression */: + case 267 /* JSDocTypeExpression */: return visitNode(cbNode, node.type); - case 266 /* JSDocUnionType */: + case 271 /* JSDocUnionType */: return visitNodes(cbNodes, node.types); - case 267 /* JSDocTupleType */: + case 272 /* JSDocTupleType */: return visitNodes(cbNodes, node.types); - case 265 /* JSDocArrayType */: + case 270 /* JSDocArrayType */: return visitNode(cbNode, node.elementType); - case 269 /* JSDocNonNullableType */: + case 274 /* JSDocNonNullableType */: return visitNode(cbNode, node.type); - case 268 /* JSDocNullableType */: + case 273 /* JSDocNullableType */: return visitNode(cbNode, node.type); - case 270 /* JSDocRecordType */: + case 275 /* JSDocRecordType */: return visitNode(cbNode, node.literal); - case 272 /* JSDocTypeReference */: + case 277 /* JSDocTypeReference */: return visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeArguments); - case 273 /* JSDocOptionalType */: + case 278 /* JSDocOptionalType */: return visitNode(cbNode, node.type); - case 274 /* JSDocFunctionType */: + case 279 /* JSDocFunctionType */: return visitNodes(cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 275 /* JSDocVariadicType */: + case 280 /* JSDocVariadicType */: return visitNode(cbNode, node.type); - case 276 /* JSDocConstructorType */: + case 281 /* JSDocConstructorType */: return visitNode(cbNode, node.type); - case 277 /* JSDocThisType */: + case 282 /* JSDocThisType */: return visitNode(cbNode, node.type); - case 271 /* JSDocRecordMember */: + case 276 /* JSDocRecordMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.type); - case 278 /* JSDocComment */: + case 283 /* JSDocComment */: return visitNodes(cbNodes, node.tags); - case 281 /* JSDocParameterTag */: + case 286 /* JSDocParameterTag */: return visitNode(cbNode, node.preParameterName) || visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.postParameterName); - case 282 /* JSDocReturnTag */: + case 287 /* JSDocReturnTag */: return visitNode(cbNode, node.typeExpression); - case 283 /* JSDocTypeTag */: + case 288 /* JSDocTypeTag */: return visitNode(cbNode, node.typeExpression); - case 280 /* JSDocAugmentsTag */: + case 285 /* JSDocAugmentsTag */: return visitNode(cbNode, node.typeExpression); - case 284 /* JSDocTemplateTag */: + case 289 /* JSDocTemplateTag */: return visitNodes(cbNodes, node.typeParameters); - case 285 /* JSDocTypedefTag */: + case 290 /* JSDocTypedefTag */: return visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.fullName) || visitNode(cbNode, node.name) || visitNode(cbNode, node.jsDocTypeLiteral); - case 287 /* JSDocTypeLiteral */: + case 292 /* JSDocTypeLiteral */: return visitNodes(cbNodes, node.jsDocPropertyTags); - case 286 /* JSDocPropertyTag */: + case 291 /* JSDocPropertyTag */: return visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.name); - case 294 /* PartiallyEmittedExpression */: + case 296 /* PartiallyEmittedExpression */: return visitNode(cbNode, node.expression); - case 288 /* JSDocLiteralType */: + case 293 /* JSDocLiteralType */: return visitNode(cbNode, node.literal); } } @@ -14289,6 +15199,7 @@ var ts; return Parser.parseIsolatedEntityName(text, languageVersion); } ts.parseIsolatedEntityName = parseIsolatedEntityName; + // See also `isExternalOrCommonJsModule` in utilities.ts function isExternalModule(file) { return file.externalModuleIndicator !== undefined; } @@ -14543,7 +15454,7 @@ var ts; function createSourceFile(fileName, languageVersion, scriptKind) { // 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(261 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); + var sourceFile = new SourceFileConstructor(265 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; @@ -14747,20 +15658,20 @@ var ts; } // Ignore strict mode flag because we will report an error in type checker instead. function isIdentifier() { - if (token() === 70 /* Identifier */) { + if (token() === 71 /* Identifier */) { return true; } // If we have a 'yield' keyword, and we're in the [yield] context, then 'yield' is // considered a keyword and is not an identifier. - if (token() === 115 /* YieldKeyword */ && inYieldContext()) { + if (token() === 116 /* YieldKeyword */ && inYieldContext()) { return false; } // If we have a 'await' keyword, and we're in the [Await] context, then 'await' is // considered a keyword and is not an identifier. - if (token() === 120 /* AwaitKeyword */ && inAwaitContext()) { + if (token() === 121 /* AwaitKeyword */ && inAwaitContext()) { return false; } - return token() > 106 /* LastReservedWord */; + return token() > 107 /* LastReservedWord */; } function parseExpected(kind, diagnosticMessage, shouldAdvance) { if (shouldAdvance === void 0) { shouldAdvance = true; } @@ -14803,22 +15714,22 @@ var ts; } function canParseSemicolon() { // If there's a real semicolon, then we can always parse it out. - if (token() === 24 /* SemicolonToken */) { + if (token() === 25 /* SemicolonToken */) { return true; } // We can parse out an optional semicolon in ASI cases in the following cases. - return token() === 17 /* CloseBraceToken */ || token() === 1 /* EndOfFileToken */ || scanner.hasPrecedingLineBreak(); + return token() === 18 /* CloseBraceToken */ || token() === 1 /* EndOfFileToken */ || scanner.hasPrecedingLineBreak(); } function parseSemicolon() { if (canParseSemicolon()) { - if (token() === 24 /* SemicolonToken */) { + if (token() === 25 /* SemicolonToken */) { // consume the semicolon if it was explicitly provided. nextToken(); } return true; } else { - return parseExpected(24 /* SemicolonToken */); + return parseExpected(25 /* SemicolonToken */); } } // note: this function creates only node @@ -14827,8 +15738,8 @@ var ts; if (!(pos >= 0)) { pos = scanner.getStartPos(); } - return kind >= 141 /* FirstNode */ ? new NodeConstructor(kind, pos, pos) : - kind === 70 /* Identifier */ ? new IdentifierConstructor(kind, pos, pos) : + return kind >= 143 /* FirstNode */ ? new NodeConstructor(kind, pos, pos) : + kind === 71 /* Identifier */ ? new IdentifierConstructor(kind, pos, pos) : new TokenConstructor(kind, pos, pos); } function createNodeArray(elements, pos) { @@ -14867,7 +15778,11 @@ var ts; } function internIdentifier(text) { text = ts.escapeIdentifier(text); - return identifiers[text] || (identifiers[text] = text); + var identifier = identifiers.get(text); + if (identifier === undefined) { + identifiers.set(text, identifier = text); + } + return identifier; } // An identifier that starts with two underscores has an extra underscore character prepended to it to avoid issues // with magic property names like '__proto__'. The 'identifiers' object is used to share a single string instance for @@ -14875,16 +15790,16 @@ var ts; function createIdentifier(isIdentifier, diagnosticMessage) { identifierCount++; if (isIdentifier) { - var node = createNode(70 /* Identifier */); + var node = createNode(71 /* Identifier */); // Store original token kind if it is not just an Identifier so we can report appropriate error later in type checker - if (token() !== 70 /* Identifier */) { + if (token() !== 71 /* Identifier */) { node.originalKeywordKind = token(); } node.text = internIdentifier(scanner.getTokenValue()); nextToken(); return finishNode(node); } - return createMissingNode(70 /* Identifier */, /*reportAtCurrentPosition*/ false, diagnosticMessage || ts.Diagnostics.Identifier_expected); + return createMissingNode(71 /* Identifier */, /*reportAtCurrentPosition*/ false, diagnosticMessage || ts.Diagnostics.Identifier_expected); } function parseIdentifier(diagnosticMessage) { return createIdentifier(isIdentifier(), diagnosticMessage); @@ -14901,7 +15816,7 @@ var ts; if (token() === 9 /* StringLiteral */ || token() === 8 /* NumericLiteral */) { return parseLiteralNode(/*internName*/ true); } - if (allowComputedPropertyNames && token() === 20 /* OpenBracketToken */) { + if (allowComputedPropertyNames && token() === 21 /* OpenBracketToken */) { return parseComputedPropertyName(); } return parseIdentifierName(); @@ -14919,13 +15834,13 @@ var ts; // PropertyName [Yield]: // LiteralPropertyName // ComputedPropertyName[?Yield] - var node = createNode(142 /* ComputedPropertyName */); - parseExpected(20 /* OpenBracketToken */); + var node = createNode(144 /* 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 // will error if it sees a comma expression. node.expression = allowInAnd(parseExpression); - parseExpected(21 /* CloseBracketToken */); + parseExpected(22 /* CloseBracketToken */); return finishNode(node); } function parseContextualModifier(t) { @@ -14939,21 +15854,21 @@ var ts; return canFollowModifier(); } function nextTokenCanFollowModifier() { - if (token() === 75 /* ConstKeyword */) { + if (token() === 76 /* ConstKeyword */) { // 'const' is only a modifier if followed by 'enum'. - return nextToken() === 82 /* EnumKeyword */; + return nextToken() === 83 /* EnumKeyword */; } - if (token() === 83 /* ExportKeyword */) { + if (token() === 84 /* ExportKeyword */) { nextToken(); - if (token() === 78 /* DefaultKeyword */) { + if (token() === 79 /* DefaultKeyword */) { return lookAhead(nextTokenIsClassOrFunctionOrAsync); } - return token() !== 38 /* AsteriskToken */ && token() !== 117 /* AsKeyword */ && token() !== 16 /* OpenBraceToken */ && canFollowModifier(); + return token() !== 39 /* AsteriskToken */ && token() !== 118 /* AsKeyword */ && token() !== 17 /* OpenBraceToken */ && canFollowModifier(); } - if (token() === 78 /* DefaultKeyword */) { + if (token() === 79 /* DefaultKeyword */) { return nextTokenIsClassOrFunctionOrAsync(); } - if (token() === 114 /* StaticKeyword */) { + if (token() === 115 /* StaticKeyword */) { nextToken(); return canFollowModifier(); } @@ -14963,16 +15878,17 @@ var ts; return ts.isModifierKind(token()) && tryParse(nextTokenCanFollowModifier); } function canFollowModifier() { - return token() === 20 /* OpenBracketToken */ - || token() === 16 /* OpenBraceToken */ - || token() === 38 /* AsteriskToken */ - || token() === 23 /* DotDotDotToken */ + return token() === 21 /* OpenBracketToken */ + || token() === 17 /* OpenBraceToken */ + || token() === 39 /* AsteriskToken */ + || token() === 24 /* DotDotDotToken */ || isLiteralPropertyName(); } function nextTokenIsClassOrFunctionOrAsync() { nextToken(); - return token() === 74 /* ClassKeyword */ || token() === 88 /* FunctionKeyword */ || - (token() === 119 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine)); + return token() === 75 /* ClassKeyword */ || token() === 89 /* FunctionKeyword */ || + (token() === 117 /* AbstractKeyword */ && lookAhead(nextTokenIsClassKeywordOnSameLine)) || + (token() === 120 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine)); } // True if positioned at the start of a list element function isListElement(parsingContext, inErrorRecovery) { @@ -14990,9 +15906,9 @@ var ts; // we're parsing. For example, if we have a semicolon in the middle of a class, then // we really don't want to assume the class is over and we're on a statement in the // outer module. We just want to consume and move on. - return !(token() === 24 /* SemicolonToken */ && inErrorRecovery) && isStartOfStatement(); + return !(token() === 25 /* SemicolonToken */ && inErrorRecovery) && isStartOfStatement(); case 2 /* SwitchClauses */: - return token() === 72 /* CaseKeyword */ || token() === 78 /* DefaultKeyword */; + return token() === 73 /* CaseKeyword */ || token() === 79 /* DefaultKeyword */; case 4 /* TypeMembers */: return lookAhead(isTypeMemberStart); case 5 /* ClassMembers */: @@ -15000,21 +15916,21 @@ var ts; // not in error recovery. If we're in error recovery, we don't want an errant // semicolon to be treated as a class member (since they're almost always used // for statements. - return lookAhead(isClassMemberStart) || (token() === 24 /* SemicolonToken */ && !inErrorRecovery); + return lookAhead(isClassMemberStart) || (token() === 25 /* SemicolonToken */ && !inErrorRecovery); case 6 /* EnumMembers */: // Include open bracket computed properties. This technically also lets in indexers, // which would be a candidate for improved error reporting. - return token() === 20 /* OpenBracketToken */ || isLiteralPropertyName(); + return token() === 21 /* OpenBracketToken */ || isLiteralPropertyName(); case 12 /* ObjectLiteralMembers */: - return token() === 20 /* OpenBracketToken */ || token() === 38 /* AsteriskToken */ || token() === 23 /* DotDotDotToken */ || isLiteralPropertyName(); + return token() === 21 /* OpenBracketToken */ || token() === 39 /* AsteriskToken */ || token() === 24 /* DotDotDotToken */ || isLiteralPropertyName(); case 17 /* RestProperties */: return isLiteralPropertyName(); case 9 /* ObjectBindingElements */: - return token() === 20 /* OpenBracketToken */ || token() === 23 /* DotDotDotToken */ || isLiteralPropertyName(); + return token() === 21 /* OpenBracketToken */ || token() === 24 /* DotDotDotToken */ || isLiteralPropertyName(); case 7 /* HeritageClauseElement */: - // If we see { } then only consume it as an expression if it is followed by , or { + // If we see `{ ... }` then only consume it as an expression if it is followed by `,` or `{` // That way we won't consume the body of a class in its heritage clause. - if (token() === 16 /* OpenBraceToken */) { + if (token() === 17 /* OpenBraceToken */) { return lookAhead(isValidHeritageClauseObjectLiteral); } if (!inErrorRecovery) { @@ -15029,23 +15945,23 @@ var ts; case 8 /* VariableDeclarations */: return isIdentifierOrPattern(); case 10 /* ArrayBindingElements */: - return token() === 25 /* CommaToken */ || token() === 23 /* DotDotDotToken */ || isIdentifierOrPattern(); + return token() === 26 /* CommaToken */ || token() === 24 /* DotDotDotToken */ || isIdentifierOrPattern(); case 18 /* TypeParameters */: return isIdentifier(); case 11 /* ArgumentExpressions */: case 15 /* ArrayLiteralMembers */: - return token() === 25 /* CommaToken */ || token() === 23 /* DotDotDotToken */ || isStartOfExpression(); + return token() === 26 /* CommaToken */ || token() === 24 /* DotDotDotToken */ || isStartOfExpression(); case 16 /* Parameters */: return isStartOfParameter(); case 19 /* TypeArguments */: case 20 /* TupleElementTypes */: - return token() === 25 /* CommaToken */ || isStartOfType(); + return token() === 26 /* CommaToken */ || isStartOfType(); case 21 /* HeritageClauses */: return isHeritageClause(); case 22 /* ImportOrExportSpecifiers */: return ts.tokenIsIdentifierOrKeyword(token()); case 13 /* JsxAttributes */: - return ts.tokenIsIdentifierOrKeyword(token()) || token() === 16 /* OpenBraceToken */; + return ts.tokenIsIdentifierOrKeyword(token()) || token() === 17 /* OpenBraceToken */; case 14 /* JsxChildren */: return true; case 23 /* JSDocFunctionParameters */: @@ -15058,8 +15974,8 @@ var ts; ts.Debug.fail("Non-exhaustive case in 'isListElement'."); } function isValidHeritageClauseObjectLiteral() { - ts.Debug.assert(token() === 16 /* OpenBraceToken */); - if (nextToken() === 17 /* CloseBraceToken */) { + ts.Debug.assert(token() === 17 /* OpenBraceToken */); + if (nextToken() === 18 /* CloseBraceToken */) { // if we see "extends {}" then only treat the {} as what we're extending (and not // the class body) if we have: // @@ -15068,7 +15984,7 @@ var ts; // extends {} extends // extends {} implements var next = nextToken(); - return next === 25 /* CommaToken */ || next === 16 /* OpenBraceToken */ || next === 84 /* ExtendsKeyword */ || next === 107 /* ImplementsKeyword */; + return next === 26 /* CommaToken */ || next === 17 /* OpenBraceToken */ || next === 85 /* ExtendsKeyword */ || next === 108 /* ImplementsKeyword */; } return true; } @@ -15081,8 +15997,8 @@ var ts; return ts.tokenIsIdentifierOrKeyword(token()); } function isHeritageClauseExtendsOrImplementsKeyword() { - if (token() === 107 /* ImplementsKeyword */ || - token() === 84 /* ExtendsKeyword */) { + if (token() === 108 /* ImplementsKeyword */ || + token() === 85 /* ExtendsKeyword */) { return lookAhead(nextTokenIsStartOfExpression); } return false; @@ -15106,44 +16022,44 @@ var ts; case 12 /* ObjectLiteralMembers */: case 9 /* ObjectBindingElements */: case 22 /* ImportOrExportSpecifiers */: - return token() === 17 /* CloseBraceToken */; + return token() === 18 /* CloseBraceToken */; case 3 /* SwitchClauseStatements */: - return token() === 17 /* CloseBraceToken */ || token() === 72 /* CaseKeyword */ || token() === 78 /* DefaultKeyword */; + return token() === 18 /* CloseBraceToken */ || token() === 73 /* CaseKeyword */ || token() === 79 /* DefaultKeyword */; case 7 /* HeritageClauseElement */: - return token() === 16 /* OpenBraceToken */ || token() === 84 /* ExtendsKeyword */ || token() === 107 /* ImplementsKeyword */; + return token() === 17 /* OpenBraceToken */ || token() === 85 /* ExtendsKeyword */ || token() === 108 /* ImplementsKeyword */; case 8 /* VariableDeclarations */: return isVariableDeclaratorListTerminator(); case 18 /* TypeParameters */: // Tokens other than '>' are here for better error recovery - return token() === 28 /* GreaterThanToken */ || token() === 18 /* OpenParenToken */ || token() === 16 /* OpenBraceToken */ || token() === 84 /* ExtendsKeyword */ || token() === 107 /* ImplementsKeyword */; + return token() === 29 /* GreaterThanToken */ || token() === 19 /* OpenParenToken */ || token() === 17 /* OpenBraceToken */ || token() === 85 /* ExtendsKeyword */ || token() === 108 /* ImplementsKeyword */; case 11 /* ArgumentExpressions */: // Tokens other than ')' are here for better error recovery - return token() === 19 /* CloseParenToken */ || token() === 24 /* SemicolonToken */; + return token() === 20 /* CloseParenToken */ || token() === 25 /* SemicolonToken */; case 15 /* ArrayLiteralMembers */: case 20 /* TupleElementTypes */: case 10 /* ArrayBindingElements */: - return token() === 21 /* CloseBracketToken */; + return token() === 22 /* CloseBracketToken */; case 16 /* Parameters */: case 17 /* RestProperties */: // Tokens other than ')' and ']' (the latter for index signatures) are here for better error recovery - return token() === 19 /* CloseParenToken */ || token() === 21 /* CloseBracketToken */ /*|| token === SyntaxKind.OpenBraceToken*/; + return token() === 20 /* CloseParenToken */ || token() === 22 /* CloseBracketToken */ /*|| token === SyntaxKind.OpenBraceToken*/; case 19 /* TypeArguments */: // All other tokens should cause the type-argument to terminate except comma token - return token() !== 25 /* CommaToken */; + return token() !== 26 /* CommaToken */; case 21 /* HeritageClauses */: - return token() === 16 /* OpenBraceToken */ || token() === 17 /* CloseBraceToken */; + return token() === 17 /* OpenBraceToken */ || token() === 18 /* CloseBraceToken */; case 13 /* JsxAttributes */: - return token() === 28 /* GreaterThanToken */ || token() === 40 /* SlashToken */; + return token() === 29 /* GreaterThanToken */ || token() === 41 /* SlashToken */; case 14 /* JsxChildren */: - return token() === 26 /* LessThanToken */ && lookAhead(nextTokenIsSlash); + return token() === 27 /* LessThanToken */ && lookAhead(nextTokenIsSlash); case 23 /* JSDocFunctionParameters */: - return token() === 19 /* CloseParenToken */ || token() === 55 /* ColonToken */ || token() === 17 /* CloseBraceToken */; + return token() === 20 /* CloseParenToken */ || token() === 56 /* ColonToken */ || token() === 18 /* CloseBraceToken */; case 24 /* JSDocTypeArguments */: - return token() === 28 /* GreaterThanToken */ || token() === 17 /* CloseBraceToken */; + return token() === 29 /* GreaterThanToken */ || token() === 18 /* CloseBraceToken */; case 26 /* JSDocTupleTypes */: - return token() === 21 /* CloseBracketToken */ || token() === 17 /* CloseBraceToken */; + return token() === 22 /* CloseBracketToken */ || token() === 18 /* CloseBraceToken */; case 25 /* JSDocRecordMembers */: - return token() === 17 /* CloseBraceToken */; + return token() === 18 /* CloseBraceToken */; } } function isVariableDeclaratorListTerminator() { @@ -15161,7 +16077,7 @@ var ts; // For better error recovery, if we see an '=>' then we just stop immediately. We've got an // arrow function here and it's going to be very unlikely that we'll resynchronize and get // another variable declaration. - if (token() === 35 /* EqualsGreaterThanToken */) { + if (token() === 36 /* EqualsGreaterThanToken */) { return true; } // Keep trying to parse out variable declarators. @@ -15326,20 +16242,20 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 150 /* Constructor */: - case 155 /* IndexSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 147 /* PropertyDeclaration */: - case 203 /* SemicolonClassElement */: + case 152 /* Constructor */: + case 157 /* IndexSignature */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + case 149 /* PropertyDeclaration */: + case 206 /* SemicolonClassElement */: return true; - case 149 /* MethodDeclaration */: + case 151 /* 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. var methodDeclaration = node; - var nameIsConstructor = methodDeclaration.name.kind === 70 /* Identifier */ && - methodDeclaration.name.originalKeywordKind === 122 /* ConstructorKeyword */; + var nameIsConstructor = methodDeclaration.name.kind === 71 /* Identifier */ && + methodDeclaration.name.originalKeywordKind === 123 /* ConstructorKeyword */; return !nameIsConstructor; } } @@ -15348,8 +16264,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 253 /* CaseClause */: - case 254 /* DefaultClause */: + case 257 /* CaseClause */: + case 258 /* DefaultClause */: return true; } } @@ -15358,58 +16274,58 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 225 /* FunctionDeclaration */: - case 205 /* VariableStatement */: - case 204 /* Block */: - case 208 /* IfStatement */: - case 207 /* ExpressionStatement */: - case 220 /* ThrowStatement */: - case 216 /* ReturnStatement */: - case 218 /* SwitchStatement */: - case 215 /* BreakStatement */: - case 214 /* ContinueStatement */: - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: - case 211 /* ForStatement */: - case 210 /* WhileStatement */: - case 217 /* WithStatement */: - case 206 /* EmptyStatement */: - case 221 /* TryStatement */: - case 219 /* LabeledStatement */: - case 209 /* DoStatement */: - case 222 /* DebuggerStatement */: - case 235 /* ImportDeclaration */: - case 234 /* ImportEqualsDeclaration */: - case 241 /* ExportDeclaration */: - case 240 /* ExportAssignment */: - case 230 /* ModuleDeclaration */: - case 226 /* ClassDeclaration */: - case 227 /* InterfaceDeclaration */: - case 229 /* EnumDeclaration */: - case 228 /* TypeAliasDeclaration */: + case 228 /* FunctionDeclaration */: + case 208 /* VariableStatement */: + case 207 /* Block */: + case 211 /* IfStatement */: + case 210 /* ExpressionStatement */: + case 223 /* ThrowStatement */: + case 219 /* ReturnStatement */: + case 221 /* SwitchStatement */: + case 218 /* BreakStatement */: + case 217 /* ContinueStatement */: + case 215 /* ForInStatement */: + case 216 /* ForOfStatement */: + case 214 /* ForStatement */: + case 213 /* WhileStatement */: + case 220 /* WithStatement */: + case 209 /* EmptyStatement */: + case 224 /* TryStatement */: + case 222 /* LabeledStatement */: + case 212 /* DoStatement */: + case 225 /* DebuggerStatement */: + case 238 /* ImportDeclaration */: + case 237 /* ImportEqualsDeclaration */: + case 244 /* ExportDeclaration */: + case 243 /* ExportAssignment */: + case 233 /* ModuleDeclaration */: + case 229 /* ClassDeclaration */: + case 230 /* InterfaceDeclaration */: + case 232 /* EnumDeclaration */: + case 231 /* TypeAliasDeclaration */: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 260 /* EnumMember */; + return node.kind === 264 /* EnumMember */; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 154 /* ConstructSignature */: - case 148 /* MethodSignature */: - case 155 /* IndexSignature */: - case 146 /* PropertySignature */: - case 153 /* CallSignature */: + case 156 /* ConstructSignature */: + case 150 /* MethodSignature */: + case 157 /* IndexSignature */: + case 148 /* PropertySignature */: + case 155 /* CallSignature */: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 223 /* VariableDeclaration */) { + if (node.kind !== 226 /* VariableDeclaration */) { return false; } // Very subtle incremental parsing bug. Consider the following code: @@ -15430,7 +16346,7 @@ var ts; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 144 /* Parameter */) { + if (node.kind !== 146 /* Parameter */) { return false; } // See the comment in isReusableVariableDeclaration for why we do this. @@ -15477,7 +16393,6 @@ var ts; case 25 /* JSDocRecordMembers */: return ts.Diagnostics.Property_assignment_expected; } } - ; // Parses a comma-delimited list of elements function parseDelimitedList(kind, parseElement, considerSemicolonAsDelimiter) { var saveParsingContext = parsingContext; @@ -15488,7 +16403,7 @@ var ts; if (isListElement(kind, /*inErrorRecovery*/ false)) { result.push(parseListElement(kind, parseElement)); commaStart = scanner.getTokenPos(); - if (parseOptional(25 /* CommaToken */)) { + if (parseOptional(26 /* CommaToken */)) { continue; } commaStart = -1; // Back to the state where the last token was not a comma @@ -15497,13 +16412,13 @@ var ts; } // We didn't get a comma, and the list wasn't terminated, explicitly parse // out a comma so we give a good error message. - parseExpected(25 /* CommaToken */); + parseExpected(26 /* CommaToken */); // If the token was a semicolon, and the caller allows that, then skip it and // continue. This ensures we get back on track and don't result in tons of // parse errors. For example, this can happen when people do things like use // a semicolon to delimit object literal members. Note: we'll have already // reported an error when we called parseExpected above. - if (considerSemicolonAsDelimiter && token() === 24 /* SemicolonToken */ && !scanner.hasPrecedingLineBreak()) { + if (considerSemicolonAsDelimiter && token() === 25 /* SemicolonToken */ && !scanner.hasPrecedingLineBreak()) { nextToken(); } continue; @@ -15542,8 +16457,8 @@ var ts; // The allowReservedWords parameter controls whether reserved words are permitted after the first dot function parseEntityName(allowReservedWords, diagnosticMessage) { var entity = parseIdentifier(diagnosticMessage); - while (parseOptional(22 /* DotToken */)) { - var node = createNode(141 /* QualifiedName */, entity.pos); // !!! + while (parseOptional(23 /* DotToken */)) { + var node = createNode(143 /* QualifiedName */, entity.pos); // !!! node.left = entity; node.right = parseRightSideOfDot(allowReservedWords); entity = finishNode(node); @@ -15576,33 +16491,33 @@ var ts; // Report that we need an identifier. However, report it right after the dot, // and not on the next token. This is because the next token might actually // be an identifier and the error would be quite confusing. - return createMissingNode(70 /* Identifier */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Identifier_expected); + return createMissingNode(71 /* Identifier */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Identifier_expected); } } return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression() { - var template = createNode(194 /* TemplateExpression */); + var template = createNode(196 /* TemplateExpression */); template.head = parseTemplateHead(); - ts.Debug.assert(template.head.kind === 13 /* TemplateHead */, "Template head has wrong token kind"); + ts.Debug.assert(template.head.kind === 14 /* TemplateHead */, "Template head has wrong token kind"); var templateSpans = createNodeArray(); do { templateSpans.push(parseTemplateSpan()); - } while (ts.lastOrUndefined(templateSpans).literal.kind === 14 /* TemplateMiddle */); + } while (ts.lastOrUndefined(templateSpans).literal.kind === 15 /* TemplateMiddle */); templateSpans.end = getNodeEnd(); template.templateSpans = templateSpans; return finishNode(template); } function parseTemplateSpan() { - var span = createNode(202 /* TemplateSpan */); + var span = createNode(205 /* TemplateSpan */); span.expression = allowInAnd(parseExpression); var literal; - if (token() === 17 /* CloseBraceToken */) { + if (token() === 18 /* CloseBraceToken */) { reScanTemplateToken(); literal = parseTemplateMiddleOrTemplateTail(); } else { - literal = parseExpectedToken(15 /* TemplateTail */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(17 /* CloseBraceToken */)); + literal = parseExpectedToken(16 /* TemplateTail */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(18 /* CloseBraceToken */)); } span.literal = literal; return finishNode(span); @@ -15612,12 +16527,12 @@ var ts; } function parseTemplateHead() { var fragment = parseLiteralLikeNode(token(), /*internName*/ false); - ts.Debug.assert(fragment.kind === 13 /* TemplateHead */, "Template head has wrong token kind"); + ts.Debug.assert(fragment.kind === 14 /* TemplateHead */, "Template head has wrong token kind"); return fragment; } function parseTemplateMiddleOrTemplateTail() { var fragment = parseLiteralLikeNode(token(), /*internName*/ false); - ts.Debug.assert(fragment.kind === 14 /* TemplateMiddle */ || fragment.kind === 15 /* TemplateTail */, "Template fragment has wrong token kind"); + ts.Debug.assert(fragment.kind === 15 /* TemplateMiddle */ || fragment.kind === 16 /* TemplateTail */, "Template fragment has wrong token kind"); return fragment; } function parseLiteralLikeNode(kind, internName) { @@ -15630,54 +16545,50 @@ var ts; if (scanner.isUnterminated()) { node.isUnterminated = true; } - var tokenPos = scanner.getTokenPos(); - nextToken(); - finishNode(node); // Octal literals are not allowed in strict mode or ES5 // Note that theoretically the following condition would hold true literals like 009, // which is not octal.But because of how the scanner separates the tokens, we would // never get a token like this. Instead, we would get 00 and 9 as two separate tokens. // We also do not need to check for negatives because any prefix operator would be part of a // parent unary expression. - if (node.kind === 8 /* NumericLiteral */ - && sourceText.charCodeAt(tokenPos) === 48 /* _0 */ - && ts.isOctalDigit(sourceText.charCodeAt(tokenPos + 1))) { - node.isOctalLiteral = true; + if (node.kind === 8 /* NumericLiteral */) { + node.numericLiteralFlags = scanner.getNumericLiteralFlags(); } + nextToken(); + finishNode(node); return node; } // TYPES function parseTypeReference() { - var typeName = parseEntityName(/*allowReservedWords*/ false, ts.Diagnostics.Type_expected); - var node = createNode(157 /* TypeReference */, typeName.pos); - node.typeName = typeName; - if (!scanner.hasPrecedingLineBreak() && token() === 26 /* LessThanToken */) { - node.typeArguments = parseBracketedList(19 /* TypeArguments */, parseType, 26 /* LessThanToken */, 28 /* GreaterThanToken */); + var node = createNode(159 /* TypeReference */); + node.typeName = parseEntityName(/*allowReservedWords*/ false, ts.Diagnostics.Type_expected); + if (!scanner.hasPrecedingLineBreak() && token() === 27 /* LessThanToken */) { + node.typeArguments = parseBracketedList(19 /* TypeArguments */, parseType, 27 /* LessThanToken */, 29 /* GreaterThanToken */); } return finishNode(node); } function parseThisTypePredicate(lhs) { nextToken(); - var node = createNode(156 /* TypePredicate */, lhs.pos); + var node = createNode(158 /* TypePredicate */, lhs.pos); node.parameterName = lhs; node.type = parseType(); return finishNode(node); } function parseThisTypeNode() { - var node = createNode(167 /* ThisType */); + var node = createNode(169 /* ThisType */); nextToken(); return finishNode(node); } function parseTypeQuery() { - var node = createNode(160 /* TypeQuery */); - parseExpected(102 /* TypeOfKeyword */); + var node = createNode(162 /* TypeQuery */); + parseExpected(103 /* TypeOfKeyword */); node.exprName = parseEntityName(/*allowReservedWords*/ true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(143 /* TypeParameter */); + var node = createNode(145 /* TypeParameter */); node.name = parseIdentifier(); - if (parseOptional(84 /* ExtendsKeyword */)) { + if (parseOptional(85 /* ExtendsKeyword */)) { // It's not uncommon for people to write improper constraints to a generic. If the // user writes a constraint that is an expression and not an actual type, then parse // it out as an expression (so we can recover well), but report that a type is needed @@ -15696,32 +16607,35 @@ var ts; node.expression = parseUnaryExpressionOrHigher(); } } + if (parseOptional(58 /* EqualsToken */)) { + node.default = parseType(); + } return finishNode(node); } function parseTypeParameters() { - if (token() === 26 /* LessThanToken */) { - return parseBracketedList(18 /* TypeParameters */, parseTypeParameter, 26 /* LessThanToken */, 28 /* GreaterThanToken */); + if (token() === 27 /* LessThanToken */) { + return parseBracketedList(18 /* TypeParameters */, parseTypeParameter, 27 /* LessThanToken */, 29 /* GreaterThanToken */); } } function parseParameterType() { - if (parseOptional(55 /* ColonToken */)) { + if (parseOptional(56 /* ColonToken */)) { return parseType(); } return undefined; } function isStartOfParameter() { - return token() === 23 /* DotDotDotToken */ || isIdentifierOrPattern() || ts.isModifierKind(token()) || token() === 56 /* AtToken */ || token() === 98 /* ThisKeyword */; + return token() === 24 /* DotDotDotToken */ || isIdentifierOrPattern() || ts.isModifierKind(token()) || token() === 57 /* AtToken */ || token() === 99 /* ThisKeyword */; } function parseParameter() { - var node = createNode(144 /* Parameter */); - if (token() === 98 /* ThisKeyword */) { - node.name = createIdentifier(/*isIdentifier*/ true, undefined); + var node = createNode(146 /* Parameter */); + if (token() === 99 /* ThisKeyword */) { + node.name = createIdentifier(/*isIdentifier*/ true); node.type = parseParameterType(); return finishNode(node); } node.decorators = parseDecorators(); node.modifiers = parseModifiers(); - node.dotDotDotToken = parseOptionalToken(23 /* DotDotDotToken */); + node.dotDotDotToken = parseOptionalToken(24 /* DotDotDotToken */); // FormalParameter [Yield,Await]: // BindingElement[?Yield,?Await] node.name = parseIdentifierOrPattern(); @@ -15736,7 +16650,7 @@ var ts; // to avoid this we'll advance cursor to the next token. nextToken(); } - node.questionToken = parseOptionalToken(54 /* QuestionToken */); + node.questionToken = parseOptionalToken(55 /* QuestionToken */); node.type = parseParameterType(); node.initializer = parseBindingElementInitializer(/*inParameter*/ true); // Do not check for initializers in an ambient context for parameters. This is not @@ -15756,7 +16670,7 @@ var ts; return parseInitializer(/*inParameter*/ true); } function fillSignature(returnToken, yieldContext, awaitContext, requireCompleteParameterList, signature) { - var returnTokenRequired = returnToken === 35 /* EqualsGreaterThanToken */; + var returnTokenRequired = returnToken === 36 /* EqualsGreaterThanToken */; signature.typeParameters = parseTypeParameters(); signature.parameters = parseParameterList(yieldContext, awaitContext, requireCompleteParameterList); if (returnTokenRequired) { @@ -15781,7 +16695,7 @@ var ts; // // SingleNameBinding [Yield,Await]: // BindingIdentifier[?Yield,?Await]Initializer [In, ?Yield,?Await] opt - if (parseExpected(18 /* OpenParenToken */)) { + if (parseExpected(19 /* OpenParenToken */)) { var savedYieldContext = inYieldContext(); var savedAwaitContext = inAwaitContext(); setYieldContext(yieldContext); @@ -15789,7 +16703,7 @@ var ts; var result = parseDelimitedList(16 /* Parameters */, parseParameter); setYieldContext(savedYieldContext); setAwaitContext(savedAwaitContext); - if (!parseExpected(19 /* CloseParenToken */) && requireCompleteParameterList) { + if (!parseExpected(20 /* CloseParenToken */) && requireCompleteParameterList) { // Caller insisted that we had to end with a ) We didn't. So just return // undefined here. return undefined; @@ -15804,7 +16718,7 @@ var ts; function parseTypeMemberSemicolon() { // We allow type members to be separated by commas or (possibly ASI) semicolons. // First check if it was a comma. If so, we're done with the member. - if (parseOptional(25 /* CommaToken */)) { + if (parseOptional(26 /* CommaToken */)) { return; } // Didn't have a comma. We must have a (possible ASI) semicolon. @@ -15812,15 +16726,15 @@ var ts; } function parseSignatureMember(kind) { var node = createNode(kind); - if (kind === 154 /* ConstructSignature */) { - parseExpected(93 /* NewKeyword */); + if (kind === 156 /* ConstructSignature */) { + parseExpected(94 /* NewKeyword */); } - fillSignature(55 /* ColonToken */, /*yieldContext*/ false, /*awaitContext*/ false, /*requireCompleteParameterList*/ false, node); + fillSignature(56 /* ColonToken */, /*yieldContext*/ false, /*awaitContext*/ false, /*requireCompleteParameterList*/ false, node); parseTypeMemberSemicolon(); return addJSDocComment(finishNode(node)); } function isIndexSignature() { - if (token() !== 20 /* OpenBracketToken */) { + if (token() !== 21 /* OpenBracketToken */) { return false; } return lookAhead(isUnambiguouslyIndexSignature); @@ -15843,7 +16757,7 @@ var ts; // [] // nextToken(); - if (token() === 23 /* DotDotDotToken */ || token() === 21 /* CloseBracketToken */) { + if (token() === 24 /* DotDotDotToken */ || token() === 22 /* CloseBracketToken */) { return true; } if (ts.isModifierKind(token())) { @@ -15862,49 +16776,49 @@ var ts; // A colon signifies a well formed indexer // A comma should be a badly formed indexer because comma expressions are not allowed // in computed properties. - if (token() === 55 /* ColonToken */ || token() === 25 /* CommaToken */) { + if (token() === 56 /* ColonToken */ || token() === 26 /* CommaToken */) { return true; } // Question mark could be an indexer with an optional property, // or it could be a conditional expression in a computed property. - if (token() !== 54 /* QuestionToken */) { + if (token() !== 55 /* QuestionToken */) { return false; } // If any of the following tokens are after the question mark, it cannot // be a conditional expression, so treat it as an indexer. nextToken(); - return token() === 55 /* ColonToken */ || token() === 25 /* CommaToken */ || token() === 21 /* CloseBracketToken */; + return token() === 56 /* ColonToken */ || token() === 26 /* CommaToken */ || token() === 22 /* CloseBracketToken */; } function parseIndexSignatureDeclaration(fullStart, decorators, modifiers) { - var node = createNode(155 /* IndexSignature */, fullStart); + var node = createNode(157 /* IndexSignature */, fullStart); node.decorators = decorators; node.modifiers = modifiers; - node.parameters = parseBracketedList(16 /* Parameters */, parseParameter, 20 /* OpenBracketToken */, 21 /* CloseBracketToken */); + node.parameters = parseBracketedList(16 /* Parameters */, parseParameter, 21 /* OpenBracketToken */, 22 /* CloseBracketToken */); node.type = parseTypeAnnotation(); parseTypeMemberSemicolon(); return finishNode(node); } function parsePropertyOrMethodSignature(fullStart, modifiers) { var name = parsePropertyName(); - var questionToken = parseOptionalToken(54 /* QuestionToken */); - if (token() === 18 /* OpenParenToken */ || token() === 26 /* LessThanToken */) { - var method = createNode(148 /* MethodSignature */, fullStart); + var questionToken = parseOptionalToken(55 /* QuestionToken */); + if (token() === 19 /* OpenParenToken */ || token() === 27 /* LessThanToken */) { + var method = createNode(150 /* MethodSignature */, fullStart); method.modifiers = modifiers; method.name = name; method.questionToken = questionToken; // Method signatures don't exist in expression contexts. So they have neither // [Yield] nor [Await] - fillSignature(55 /* ColonToken */, /*yieldContext*/ false, /*awaitContext*/ false, /*requireCompleteParameterList*/ false, method); + fillSignature(56 /* ColonToken */, /*yieldContext*/ false, /*awaitContext*/ false, /*requireCompleteParameterList*/ false, method); parseTypeMemberSemicolon(); return addJSDocComment(finishNode(method)); } else { - var property = createNode(146 /* PropertySignature */, fullStart); + var property = createNode(148 /* PropertySignature */, fullStart); property.modifiers = modifiers; property.name = name; property.questionToken = questionToken; property.type = parseTypeAnnotation(); - if (token() === 57 /* EqualsToken */) { + if (token() === 58 /* EqualsToken */) { // Although type literal properties cannot not have initializers, we attempt // to parse an initializer so we can report in the checker that an interface // property or type literal property cannot have an initializer. @@ -15915,43 +16829,43 @@ var ts; } } function isTypeMemberStart() { - var idToken; // Return true if we have the start of a signature member - if (token() === 18 /* OpenParenToken */ || token() === 26 /* LessThanToken */) { + if (token() === 19 /* OpenParenToken */ || token() === 27 /* LessThanToken */) { return true; } + var idToken; // Eat up all modifiers, but hold on to the last one in case it is actually an identifier while (ts.isModifierKind(token())) { - idToken = token(); + idToken = true; nextToken(); } // Index signatures and computed property names are type members - if (token() === 20 /* OpenBracketToken */) { + if (token() === 21 /* OpenBracketToken */) { return true; } // Try to get the first property-like token following all modifiers if (isLiteralPropertyName()) { - idToken = token(); + idToken = true; nextToken(); } // If we were able to get any potential identifier, check that it is // the start of a member declaration if (idToken) { - return token() === 18 /* OpenParenToken */ || - token() === 26 /* LessThanToken */ || - token() === 54 /* QuestionToken */ || - token() === 55 /* ColonToken */ || - token() === 25 /* CommaToken */ || + return token() === 19 /* OpenParenToken */ || + token() === 27 /* LessThanToken */ || + token() === 55 /* QuestionToken */ || + token() === 56 /* ColonToken */ || + token() === 26 /* CommaToken */ || canParseSemicolon(); } return false; } function parseTypeMember() { - if (token() === 18 /* OpenParenToken */ || token() === 26 /* LessThanToken */) { - return parseSignatureMember(153 /* CallSignature */); + if (token() === 19 /* OpenParenToken */ || token() === 27 /* LessThanToken */) { + return parseSignatureMember(155 /* CallSignature */); } - if (token() === 93 /* NewKeyword */ && lookAhead(isStartOfConstructSignature)) { - return parseSignatureMember(154 /* ConstructSignature */); + if (token() === 94 /* NewKeyword */ && lookAhead(isStartOfConstructSignature)) { + return parseSignatureMember(156 /* ConstructSignature */); } var fullStart = getNodePos(); var modifiers = parseModifiers(); @@ -15962,18 +16876,18 @@ var ts; } function isStartOfConstructSignature() { nextToken(); - return token() === 18 /* OpenParenToken */ || token() === 26 /* LessThanToken */; + return token() === 19 /* OpenParenToken */ || token() === 27 /* LessThanToken */; } function parseTypeLiteral() { - var node = createNode(161 /* TypeLiteral */); + var node = createNode(163 /* TypeLiteral */); node.members = parseObjectTypeMembers(); return finishNode(node); } function parseObjectTypeMembers() { var members; - if (parseExpected(16 /* OpenBraceToken */)) { + if (parseExpected(17 /* OpenBraceToken */)) { members = parseList(4 /* TypeMembers */, parseTypeMember); - parseExpected(17 /* CloseBraceToken */); + parseExpected(18 /* CloseBraceToken */); } else { members = createMissingList(); @@ -15982,57 +16896,57 @@ var ts; } function isStartOfMappedType() { nextToken(); - if (token() === 130 /* ReadonlyKeyword */) { + if (token() === 131 /* ReadonlyKeyword */) { nextToken(); } - return token() === 20 /* OpenBracketToken */ && nextTokenIsIdentifier() && nextToken() === 91 /* InKeyword */; + return token() === 21 /* OpenBracketToken */ && nextTokenIsIdentifier() && nextToken() === 92 /* InKeyword */; } function parseMappedTypeParameter() { - var node = createNode(143 /* TypeParameter */); + var node = createNode(145 /* TypeParameter */); node.name = parseIdentifier(); - parseExpected(91 /* InKeyword */); + parseExpected(92 /* InKeyword */); node.constraint = parseType(); return finishNode(node); } function parseMappedType() { - var node = createNode(170 /* MappedType */); - parseExpected(16 /* OpenBraceToken */); - node.readonlyToken = parseOptionalToken(130 /* ReadonlyKeyword */); - parseExpected(20 /* OpenBracketToken */); + var node = createNode(172 /* MappedType */); + parseExpected(17 /* OpenBraceToken */); + node.readonlyToken = parseOptionalToken(131 /* ReadonlyKeyword */); + parseExpected(21 /* OpenBracketToken */); node.typeParameter = parseMappedTypeParameter(); - parseExpected(21 /* CloseBracketToken */); - node.questionToken = parseOptionalToken(54 /* QuestionToken */); + parseExpected(22 /* CloseBracketToken */); + node.questionToken = parseOptionalToken(55 /* QuestionToken */); node.type = parseTypeAnnotation(); parseSemicolon(); - parseExpected(17 /* CloseBraceToken */); + parseExpected(18 /* CloseBraceToken */); return finishNode(node); } function parseTupleType() { - var node = createNode(163 /* TupleType */); - node.elementTypes = parseBracketedList(20 /* TupleElementTypes */, parseType, 20 /* OpenBracketToken */, 21 /* CloseBracketToken */); + var node = createNode(165 /* TupleType */); + node.elementTypes = parseBracketedList(20 /* TupleElementTypes */, parseType, 21 /* OpenBracketToken */, 22 /* CloseBracketToken */); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(166 /* ParenthesizedType */); - parseExpected(18 /* OpenParenToken */); + var node = createNode(168 /* ParenthesizedType */); + parseExpected(19 /* OpenParenToken */); node.type = parseType(); - parseExpected(19 /* CloseParenToken */); + parseExpected(20 /* CloseParenToken */); return finishNode(node); } function parseFunctionOrConstructorType(kind) { var node = createNode(kind); - if (kind === 159 /* ConstructorType */) { - parseExpected(93 /* NewKeyword */); + if (kind === 161 /* ConstructorType */) { + parseExpected(94 /* NewKeyword */); } - fillSignature(35 /* EqualsGreaterThanToken */, /*yieldContext*/ false, /*awaitContext*/ false, /*requireCompleteParameterList*/ false, node); + fillSignature(36 /* EqualsGreaterThanToken */, /*yieldContext*/ false, /*awaitContext*/ false, /*requireCompleteParameterList*/ false, node); return finishNode(node); } function parseKeywordAndNoDot() { var node = parseTokenNode(); - return token() === 22 /* DotToken */ ? undefined : node; + return token() === 23 /* DotToken */ ? undefined : node; } function parseLiteralTypeNode() { - var node = createNode(171 /* LiteralType */); + var node = createNode(173 /* LiteralType */); node.literal = parseSimpleUnaryExpression(); finishNode(node); return node; @@ -16042,42 +16956,43 @@ var ts; } function parseNonArrayType() { switch (token()) { - case 118 /* AnyKeyword */: - case 134 /* StringKeyword */: - case 132 /* NumberKeyword */: - case 121 /* BooleanKeyword */: - case 135 /* SymbolKeyword */: - case 137 /* UndefinedKeyword */: - case 129 /* NeverKeyword */: + case 119 /* AnyKeyword */: + case 136 /* StringKeyword */: + case 133 /* NumberKeyword */: + case 122 /* BooleanKeyword */: + case 137 /* SymbolKeyword */: + case 139 /* UndefinedKeyword */: + case 130 /* NeverKeyword */: + case 134 /* ObjectKeyword */: // If these are followed by a dot, then parse these out as a dotted type reference instead. var node = tryParse(parseKeywordAndNoDot); return node || parseTypeReference(); case 9 /* StringLiteral */: case 8 /* NumericLiteral */: - case 100 /* TrueKeyword */: - case 85 /* FalseKeyword */: + case 101 /* TrueKeyword */: + case 86 /* FalseKeyword */: return parseLiteralTypeNode(); - case 37 /* MinusToken */: + case 38 /* MinusToken */: return lookAhead(nextTokenIsNumericLiteral) ? parseLiteralTypeNode() : parseTypeReference(); - case 104 /* VoidKeyword */: - case 94 /* NullKeyword */: + case 105 /* VoidKeyword */: + case 95 /* NullKeyword */: return parseTokenNode(); - case 98 /* ThisKeyword */: { + case 99 /* ThisKeyword */: { var thisKeyword = parseThisTypeNode(); - if (token() === 125 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 126 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { return parseThisTypePredicate(thisKeyword); } else { return thisKeyword; } } - case 102 /* TypeOfKeyword */: + case 103 /* TypeOfKeyword */: return parseTypeQuery(); - case 16 /* OpenBraceToken */: + case 17 /* OpenBraceToken */: return lookAhead(isStartOfMappedType) ? parseMappedType() : parseTypeLiteral(); - case 20 /* OpenBracketToken */: + case 21 /* OpenBracketToken */: return parseTupleType(); - case 18 /* OpenParenToken */: + case 19 /* OpenParenToken */: return parseParenthesizedType(); default: return parseTypeReference(); @@ -16085,31 +17000,32 @@ var ts; } function isStartOfType() { switch (token()) { - case 118 /* AnyKeyword */: - case 134 /* StringKeyword */: - case 132 /* NumberKeyword */: - case 121 /* BooleanKeyword */: - case 135 /* SymbolKeyword */: - case 104 /* VoidKeyword */: - case 137 /* UndefinedKeyword */: - case 94 /* NullKeyword */: - case 98 /* ThisKeyword */: - case 102 /* TypeOfKeyword */: - case 129 /* NeverKeyword */: - case 16 /* OpenBraceToken */: - case 20 /* OpenBracketToken */: - case 26 /* LessThanToken */: - case 48 /* BarToken */: - case 47 /* AmpersandToken */: - case 93 /* NewKeyword */: + case 119 /* AnyKeyword */: + case 136 /* StringKeyword */: + case 133 /* NumberKeyword */: + case 122 /* BooleanKeyword */: + case 137 /* SymbolKeyword */: + case 105 /* VoidKeyword */: + case 139 /* UndefinedKeyword */: + case 95 /* NullKeyword */: + case 99 /* ThisKeyword */: + case 103 /* TypeOfKeyword */: + case 130 /* NeverKeyword */: + case 17 /* OpenBraceToken */: + case 21 /* OpenBracketToken */: + case 27 /* LessThanToken */: + case 49 /* BarToken */: + case 48 /* AmpersandToken */: + case 94 /* NewKeyword */: case 9 /* StringLiteral */: case 8 /* NumericLiteral */: - case 100 /* TrueKeyword */: - case 85 /* FalseKeyword */: + case 101 /* TrueKeyword */: + case 86 /* FalseKeyword */: + case 134 /* ObjectKeyword */: return true; - case 37 /* MinusToken */: + case 38 /* MinusToken */: return lookAhead(nextTokenIsNumericLiteral); - case 18 /* OpenParenToken */: + case 19 /* OpenParenToken */: // Only consider '(' the start of a type if followed by ')', '...', an identifier, a modifier, // or something that starts a type. We don't want to consider things like '(1)' a type. return lookAhead(isStartOfParenthesizedOrFunctionType); @@ -16119,29 +17035,29 @@ var ts; } function isStartOfParenthesizedOrFunctionType() { nextToken(); - return token() === 19 /* CloseParenToken */ || isStartOfParameter() || isStartOfType(); + return token() === 20 /* CloseParenToken */ || isStartOfParameter() || isStartOfType(); } function parseArrayTypeOrHigher() { var type = parseNonArrayType(); - while (!scanner.hasPrecedingLineBreak() && parseOptional(20 /* OpenBracketToken */)) { + while (!scanner.hasPrecedingLineBreak() && parseOptional(21 /* OpenBracketToken */)) { if (isStartOfType()) { - var node = createNode(169 /* IndexedAccessType */, type.pos); + var node = createNode(171 /* IndexedAccessType */, type.pos); node.objectType = type; node.indexType = parseType(); - parseExpected(21 /* CloseBracketToken */); + parseExpected(22 /* CloseBracketToken */); type = finishNode(node); } else { - var node = createNode(162 /* ArrayType */, type.pos); + var node = createNode(164 /* ArrayType */, type.pos); node.elementType = type; - parseExpected(21 /* CloseBracketToken */); + parseExpected(22 /* CloseBracketToken */); type = finishNode(node); } } return type; } function parseTypeOperator(operator) { - var node = createNode(168 /* TypeOperator */); + var node = createNode(170 /* TypeOperator */); parseExpected(operator); node.operator = operator; node.type = parseTypeOperatorOrHigher(); @@ -16149,8 +17065,8 @@ var ts; } function parseTypeOperatorOrHigher() { switch (token()) { - case 126 /* KeyOfKeyword */: - return parseTypeOperator(126 /* KeyOfKeyword */); + case 127 /* KeyOfKeyword */: + return parseTypeOperator(127 /* KeyOfKeyword */); } return parseArrayTypeOrHigher(); } @@ -16170,27 +17086,27 @@ var ts; return type; } function parseIntersectionTypeOrHigher() { - return parseUnionOrIntersectionType(165 /* IntersectionType */, parseTypeOperatorOrHigher, 47 /* AmpersandToken */); + return parseUnionOrIntersectionType(167 /* IntersectionType */, parseTypeOperatorOrHigher, 48 /* AmpersandToken */); } function parseUnionTypeOrHigher() { - return parseUnionOrIntersectionType(164 /* UnionType */, parseIntersectionTypeOrHigher, 48 /* BarToken */); + return parseUnionOrIntersectionType(166 /* UnionType */, parseIntersectionTypeOrHigher, 49 /* BarToken */); } function isStartOfFunctionType() { - if (token() === 26 /* LessThanToken */) { + if (token() === 27 /* LessThanToken */) { return true; } - return token() === 18 /* OpenParenToken */ && lookAhead(isUnambiguouslyStartOfFunctionType); + return token() === 19 /* OpenParenToken */ && lookAhead(isUnambiguouslyStartOfFunctionType); } function skipParameterStart() { if (ts.isModifierKind(token())) { // Skip modifiers parseModifiers(); } - if (isIdentifier() || token() === 98 /* ThisKeyword */) { + if (isIdentifier() || token() === 99 /* ThisKeyword */) { nextToken(); return true; } - if (token() === 20 /* OpenBracketToken */ || token() === 16 /* OpenBraceToken */) { + if (token() === 21 /* OpenBracketToken */ || token() === 17 /* OpenBraceToken */) { // Return true if we can parse an array or object binding pattern with no errors var previousErrorCount = parseDiagnostics.length; parseIdentifierOrPattern(); @@ -16200,7 +17116,7 @@ var ts; } function isUnambiguouslyStartOfFunctionType() { nextToken(); - if (token() === 19 /* CloseParenToken */ || token() === 23 /* DotDotDotToken */) { + if (token() === 20 /* CloseParenToken */ || token() === 24 /* DotDotDotToken */) { // ( ) // ( ... return true; @@ -16208,17 +17124,17 @@ var ts; if (skipParameterStart()) { // We successfully skipped modifiers (if any) and an identifier or binding pattern, // now see if we have something that indicates a parameter declaration - if (token() === 55 /* ColonToken */ || token() === 25 /* CommaToken */ || - token() === 54 /* QuestionToken */ || token() === 57 /* EqualsToken */) { + if (token() === 56 /* ColonToken */ || token() === 26 /* CommaToken */ || + token() === 55 /* QuestionToken */ || token() === 58 /* EqualsToken */) { // ( xxx : // ( xxx , // ( xxx ? // ( xxx = return true; } - if (token() === 19 /* CloseParenToken */) { + if (token() === 20 /* CloseParenToken */) { nextToken(); - if (token() === 35 /* EqualsGreaterThanToken */) { + if (token() === 36 /* EqualsGreaterThanToken */) { // ( xxx ) => return true; } @@ -16230,7 +17146,7 @@ var ts; var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix); var type = parseType(); if (typePredicateVariable) { - var node = createNode(156 /* TypePredicate */, typePredicateVariable.pos); + var node = createNode(158 /* TypePredicate */, typePredicateVariable.pos); node.parameterName = typePredicateVariable; node.type = type; return finishNode(node); @@ -16241,7 +17157,7 @@ var ts; } function parseTypePredicatePrefix() { var id = parseIdentifier(); - if (token() === 125 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 126 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { nextToken(); return id; } @@ -16253,37 +17169,37 @@ var ts; } function parseTypeWorker() { if (isStartOfFunctionType()) { - return parseFunctionOrConstructorType(158 /* FunctionType */); + return parseFunctionOrConstructorType(160 /* FunctionType */); } - if (token() === 93 /* NewKeyword */) { - return parseFunctionOrConstructorType(159 /* ConstructorType */); + if (token() === 94 /* NewKeyword */) { + return parseFunctionOrConstructorType(161 /* ConstructorType */); } return parseUnionTypeOrHigher(); } function parseTypeAnnotation() { - return parseOptional(55 /* ColonToken */) ? parseType() : undefined; + return parseOptional(56 /* ColonToken */) ? parseType() : undefined; } // EXPRESSIONS function isStartOfLeftHandSideExpression() { switch (token()) { - case 98 /* ThisKeyword */: - case 96 /* SuperKeyword */: - case 94 /* NullKeyword */: - case 100 /* TrueKeyword */: - case 85 /* FalseKeyword */: + case 99 /* ThisKeyword */: + case 97 /* SuperKeyword */: + case 95 /* NullKeyword */: + case 101 /* TrueKeyword */: + case 86 /* FalseKeyword */: case 8 /* NumericLiteral */: case 9 /* StringLiteral */: - case 12 /* NoSubstitutionTemplateLiteral */: - case 13 /* TemplateHead */: - case 18 /* OpenParenToken */: - case 20 /* OpenBracketToken */: - case 16 /* OpenBraceToken */: - case 88 /* FunctionKeyword */: - case 74 /* ClassKeyword */: - case 93 /* NewKeyword */: - case 40 /* SlashToken */: - case 62 /* SlashEqualsToken */: - case 70 /* Identifier */: + case 13 /* NoSubstitutionTemplateLiteral */: + case 14 /* TemplateHead */: + case 19 /* OpenParenToken */: + case 21 /* OpenBracketToken */: + case 17 /* OpenBraceToken */: + case 89 /* FunctionKeyword */: + case 75 /* ClassKeyword */: + case 94 /* NewKeyword */: + case 41 /* SlashToken */: + case 63 /* SlashEqualsToken */: + case 71 /* Identifier */: return true; default: return isIdentifier(); @@ -16294,18 +17210,18 @@ var ts; return true; } switch (token()) { - case 36 /* PlusToken */: - case 37 /* MinusToken */: - case 51 /* TildeToken */: - case 50 /* ExclamationToken */: - case 79 /* DeleteKeyword */: - case 102 /* TypeOfKeyword */: - case 104 /* VoidKeyword */: - case 42 /* PlusPlusToken */: - case 43 /* MinusMinusToken */: - case 26 /* LessThanToken */: - case 120 /* AwaitKeyword */: - case 115 /* YieldKeyword */: + case 37 /* PlusToken */: + case 38 /* MinusToken */: + case 52 /* TildeToken */: + case 51 /* ExclamationToken */: + case 80 /* DeleteKeyword */: + case 103 /* TypeOfKeyword */: + case 105 /* VoidKeyword */: + case 43 /* PlusPlusToken */: + case 44 /* MinusMinusToken */: + case 27 /* LessThanToken */: + case 121 /* AwaitKeyword */: + case 116 /* YieldKeyword */: // Yield/await always starts an expression. Either it is an identifier (in which case // it is definitely an expression). Or it's a keyword (either because we're in // a generator or async function, or in strict mode (or both)) and it started a yield or await expression. @@ -16323,10 +17239,10 @@ var ts; } function isStartOfExpressionStatement() { // As per the grammar, none of '{' or 'function' or 'class' can start an expression statement. - return token() !== 16 /* OpenBraceToken */ && - token() !== 88 /* FunctionKeyword */ && - token() !== 74 /* ClassKeyword */ && - token() !== 56 /* AtToken */ && + return token() !== 17 /* OpenBraceToken */ && + token() !== 89 /* FunctionKeyword */ && + token() !== 75 /* ClassKeyword */ && + token() !== 57 /* AtToken */ && isStartOfExpression(); } function parseExpression() { @@ -16340,7 +17256,7 @@ var ts; } var expr = parseAssignmentExpressionOrHigher(); var operatorToken; - while ((operatorToken = parseOptionalToken(25 /* CommaToken */))) { + while ((operatorToken = parseOptionalToken(26 /* CommaToken */))) { expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher()); } if (saveDecoratorContext) { @@ -16349,7 +17265,7 @@ var ts; return expr; } function parseInitializer(inParameter) { - if (token() !== 57 /* EqualsToken */) { + if (token() !== 58 /* EqualsToken */) { // It's not uncommon during typing for the user to miss writing the '=' token. Check if // there is no newline after the last token and if we're on an expression. If so, parse // this as an equals-value clause with a missing equals. @@ -16358,7 +17274,7 @@ var ts; // it's more likely that a { would be a allowed (as an object literal). While this // is also allowed for parameters, the risk is that we consume the { as an object // literal when it really will be for the block following the parameter. - if (scanner.hasPrecedingLineBreak() || (inParameter && token() === 16 /* OpenBraceToken */) || !isStartOfExpression()) { + if (scanner.hasPrecedingLineBreak() || (inParameter && token() === 17 /* OpenBraceToken */) || !isStartOfExpression()) { // preceding line break, open brace in a parameter (likely a function body) or current token is not an expression - // do not try to parse initializer return undefined; @@ -16366,7 +17282,7 @@ var ts; } // Initializer[In, Yield] : // = AssignmentExpression[?In, ?Yield] - parseExpected(57 /* EqualsToken */); + parseExpected(58 /* EqualsToken */); return parseAssignmentExpressionOrHigher(); } function parseAssignmentExpressionOrHigher() { @@ -16412,7 +17328,7 @@ var ts; // To avoid a look-ahead, we did not handle the case of an arrow function with a single un-parenthesized // parameter ('x => ...') above. We handle it here by checking if the parsed expression was a single // identifier and the current token is an arrow. - if (expr.kind === 70 /* Identifier */ && token() === 35 /* EqualsGreaterThanToken */) { + if (expr.kind === 71 /* Identifier */ && token() === 36 /* EqualsGreaterThanToken */) { return parseSimpleArrowFunctionExpression(expr); } // Now see if we might be in cases '2' or '3'. @@ -16428,7 +17344,7 @@ var ts; return parseConditionalExpressionRest(expr); } function isYieldExpression() { - if (token() === 115 /* YieldKeyword */) { + if (token() === 116 /* YieldKeyword */) { // If we have a 'yield' keyword, and this is a context where yield expressions are // allowed, then definitely parse out a yield expression. if (inYieldContext()) { @@ -16457,15 +17373,15 @@ var ts; return !scanner.hasPrecedingLineBreak() && isIdentifier(); } function parseYieldExpression() { - var node = createNode(195 /* YieldExpression */); + var node = createNode(197 /* YieldExpression */); // YieldExpression[In] : // yield // yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] // yield [no LineTerminator here] * [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] nextToken(); if (!scanner.hasPrecedingLineBreak() && - (token() === 38 /* AsteriskToken */ || isStartOfExpression())) { - node.asteriskToken = parseOptionalToken(38 /* AsteriskToken */); + (token() === 39 /* AsteriskToken */ || isStartOfExpression())) { + node.asteriskToken = parseOptionalToken(39 /* AsteriskToken */); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } @@ -16476,21 +17392,21 @@ var ts; } } function parseSimpleArrowFunctionExpression(identifier, asyncModifier) { - ts.Debug.assert(token() === 35 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); + ts.Debug.assert(token() === 36 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); var node; if (asyncModifier) { - node = createNode(185 /* ArrowFunction */, asyncModifier.pos); + node = createNode(187 /* ArrowFunction */, asyncModifier.pos); node.modifiers = asyncModifier; } else { - node = createNode(185 /* ArrowFunction */, identifier.pos); + node = createNode(187 /* ArrowFunction */, identifier.pos); } - var parameter = createNode(144 /* Parameter */, identifier.pos); + var parameter = createNode(146 /* Parameter */, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = createNodeArray([parameter], parameter.pos); node.parameters.end = parameter.end; - node.equalsGreaterThanToken = parseExpectedToken(35 /* EqualsGreaterThanToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, "=>"); + node.equalsGreaterThanToken = parseExpectedToken(36 /* EqualsGreaterThanToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, "=>"); node.body = parseArrowFunctionExpressionBody(/*isAsync*/ !!asyncModifier); return addJSDocComment(finishNode(node)); } @@ -16515,8 +17431,8 @@ 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(35 /* EqualsGreaterThanToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, "=>"); - arrowFunction.body = (lastToken === 35 /* EqualsGreaterThanToken */ || lastToken === 16 /* OpenBraceToken */) + arrowFunction.equalsGreaterThanToken = parseExpectedToken(36 /* EqualsGreaterThanToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, "=>"); + arrowFunction.body = (lastToken === 36 /* EqualsGreaterThanToken */ || lastToken === 17 /* OpenBraceToken */) ? parseArrowFunctionExpressionBody(isAsync) : parseIdentifier(); return addJSDocComment(finishNode(arrowFunction)); @@ -16526,10 +17442,10 @@ var ts; // Unknown -> There *might* be a parenthesized arrow function here. // Speculatively look ahead to be sure, and rollback if not. function isParenthesizedArrowFunctionExpression() { - if (token() === 18 /* OpenParenToken */ || token() === 26 /* LessThanToken */ || token() === 119 /* AsyncKeyword */) { + if (token() === 19 /* OpenParenToken */ || token() === 27 /* LessThanToken */ || token() === 120 /* AsyncKeyword */) { return lookAhead(isParenthesizedArrowFunctionExpressionWorker); } - if (token() === 35 /* EqualsGreaterThanToken */) { + if (token() === 36 /* EqualsGreaterThanToken */) { // ERROR RECOVERY TWEAK: // If we see a standalone => try to parse it as an arrow function expression as that's // likely what the user intended to write. @@ -16539,28 +17455,28 @@ var ts; return 0 /* False */; } function isParenthesizedArrowFunctionExpressionWorker() { - if (token() === 119 /* AsyncKeyword */) { + if (token() === 120 /* AsyncKeyword */) { nextToken(); if (scanner.hasPrecedingLineBreak()) { return 0 /* False */; } - if (token() !== 18 /* OpenParenToken */ && token() !== 26 /* LessThanToken */) { + if (token() !== 19 /* OpenParenToken */ && token() !== 27 /* LessThanToken */) { return 0 /* False */; } } var first = token(); var second = nextToken(); - if (first === 18 /* OpenParenToken */) { - if (second === 19 /* CloseParenToken */) { + if (first === 19 /* OpenParenToken */) { + if (second === 20 /* CloseParenToken */) { // Simple cases: "() =>", "(): ", and "() {". // This is an arrow function with no parameters. // The last one is not actually an arrow function, // but this is probably what the user intended. var third = nextToken(); switch (third) { - case 35 /* EqualsGreaterThanToken */: - case 55 /* ColonToken */: - case 16 /* OpenBraceToken */: + case 36 /* EqualsGreaterThanToken */: + case 56 /* ColonToken */: + case 17 /* OpenBraceToken */: return 1 /* True */; default: return 0 /* False */; @@ -16572,12 +17488,12 @@ var ts; // ({ x }) => { } // ([ x ]) // ({ x }) - if (second === 20 /* OpenBracketToken */ || second === 16 /* OpenBraceToken */) { + if (second === 21 /* OpenBracketToken */ || second === 17 /* OpenBraceToken */) { return 2 /* Unknown */; } // Simple case: "(..." // This is an arrow function with a rest parameter. - if (second === 23 /* DotDotDotToken */) { + if (second === 24 /* DotDotDotToken */) { return 1 /* True */; } // If we had "(" followed by something that's not an identifier, @@ -16590,7 +17506,7 @@ var ts; } // If we have something like "(a:", then we must have a // type-annotated parameter in an arrow function expression. - if (nextToken() === 55 /* ColonToken */) { + if (nextToken() === 56 /* ColonToken */) { return 1 /* True */; } // This *could* be a parenthesized arrow function. @@ -16598,7 +17514,7 @@ var ts; return 2 /* Unknown */; } else { - ts.Debug.assert(first === 26 /* LessThanToken */); + ts.Debug.assert(first === 27 /* LessThanToken */); // If we have "<" not followed by an identifier, // then this definitely is not an arrow function. if (!isIdentifier()) { @@ -16608,17 +17524,17 @@ var ts; if (sourceFile.languageVariant === 1 /* JSX */) { var isArrowFunctionInJsx = lookAhead(function () { var third = nextToken(); - if (third === 84 /* ExtendsKeyword */) { + if (third === 85 /* ExtendsKeyword */) { var fourth = nextToken(); switch (fourth) { - case 57 /* EqualsToken */: - case 28 /* GreaterThanToken */: + case 58 /* EqualsToken */: + case 29 /* GreaterThanToken */: return false; default: return true; } } - else if (third === 25 /* CommaToken */) { + else if (third === 26 /* CommaToken */) { return true; } return false; @@ -16637,7 +17553,7 @@ var ts; } function tryParseAsyncSimpleArrowFunctionExpression() { // We do a check here so that we won't be doing unnecessarily call to "lookAhead" - if (token() === 119 /* AsyncKeyword */) { + if (token() === 120 /* AsyncKeyword */) { var isUnParenthesizedAsyncArrowFunction = lookAhead(isUnParenthesizedAsyncArrowFunctionWorker); if (isUnParenthesizedAsyncArrowFunction === 1 /* True */) { var asyncModifier = parseModifiersForArrowFunction(); @@ -16651,23 +17567,23 @@ var ts; // AsyncArrowFunctionExpression: // 1) async[no LineTerminator here]AsyncArrowBindingIdentifier[?Yield][no LineTerminator here]=>AsyncConciseBody[?In] // 2) CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await][no LineTerminator here]=>AsyncConciseBody[?In] - if (token() === 119 /* AsyncKeyword */) { + if (token() === 120 /* AsyncKeyword */) { nextToken(); // If the "async" is followed by "=>" token then it is not a begining of an async arrow-function // but instead a simple arrow-function which will be parsed inside "parseAssignmentExpressionOrHigher" - if (scanner.hasPrecedingLineBreak() || token() === 35 /* EqualsGreaterThanToken */) { + if (scanner.hasPrecedingLineBreak() || token() === 36 /* EqualsGreaterThanToken */) { return 0 /* False */; } // Check for un-parenthesized AsyncArrowFunction var expr = parseBinaryExpressionOrHigher(/*precedence*/ 0); - if (!scanner.hasPrecedingLineBreak() && expr.kind === 70 /* Identifier */ && token() === 35 /* EqualsGreaterThanToken */) { + if (!scanner.hasPrecedingLineBreak() && expr.kind === 71 /* Identifier */ && token() === 36 /* EqualsGreaterThanToken */) { return 1 /* True */; } } return 0 /* False */; } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNode(185 /* ArrowFunction */); + var node = createNode(187 /* ArrowFunction */); node.modifiers = parseModifiersForArrowFunction(); var isAsync = !!(ts.getModifierFlags(node) & 256 /* Async */); // Arrow functions are never generators. @@ -16677,7 +17593,7 @@ var ts; // a => (b => c) // And think that "(b =>" was actually a parenthesized arrow function with a missing // close paren. - fillSignature(55 /* ColonToken */, /*yieldContext*/ false, /*awaitContext*/ isAsync, /*requireCompleteParameterList*/ !allowAmbiguity, node); + fillSignature(56 /* ColonToken */, /*yieldContext*/ false, /*awaitContext*/ isAsync, /*requireCompleteParameterList*/ !allowAmbiguity, node); // If we couldn't get parameters, we definitely could not parse out an arrow function. if (!node.parameters) { return undefined; @@ -16690,19 +17606,19 @@ var ts; // - "a ? (b): c" will have "(b):" parsed as a signature with a return type annotation. // // So we need just a bit of lookahead to ensure that it can only be a signature. - if (!allowAmbiguity && token() !== 35 /* EqualsGreaterThanToken */ && token() !== 16 /* OpenBraceToken */) { + if (!allowAmbiguity && token() !== 36 /* EqualsGreaterThanToken */ && token() !== 17 /* OpenBraceToken */) { // Returning undefined here will cause our caller to rewind to where we started from. return undefined; } return node; } function parseArrowFunctionExpressionBody(isAsync) { - if (token() === 16 /* OpenBraceToken */) { + if (token() === 17 /* OpenBraceToken */) { return parseFunctionBlock(/*allowYield*/ false, /*allowAwait*/ isAsync, /*ignoreMissingOpenBrace*/ false); } - if (token() !== 24 /* SemicolonToken */ && - token() !== 88 /* FunctionKeyword */ && - token() !== 74 /* ClassKeyword */ && + if (token() !== 25 /* SemicolonToken */ && + token() !== 89 /* FunctionKeyword */ && + token() !== 75 /* ClassKeyword */ && isStartOfStatement() && !isStartOfExpressionStatement()) { // Check if we got a plain statement (i.e. no expression-statements, no function/class expressions/declarations) @@ -16727,17 +17643,17 @@ var ts; } function parseConditionalExpressionRest(leftOperand) { // Note: we are passed in an expression which was produced from parseBinaryExpressionOrHigher. - var questionToken = parseOptionalToken(54 /* QuestionToken */); + var questionToken = parseOptionalToken(55 /* QuestionToken */); if (!questionToken) { return leftOperand; } // Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and // we do not that for the 'whenFalse' part. - var node = createNode(193 /* ConditionalExpression */, leftOperand.pos); + var node = createNode(195 /* ConditionalExpression */, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); - node.colonToken = parseExpectedToken(55 /* ColonToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(55 /* ColonToken */)); + node.colonToken = parseExpectedToken(56 /* ColonToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(56 /* ColonToken */)); node.whenFalse = parseAssignmentExpressionOrHigher(); return finishNode(node); } @@ -16746,7 +17662,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 91 /* InKeyword */ || t === 140 /* OfKeyword */; + return t === 92 /* InKeyword */ || t === 142 /* OfKeyword */; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -16775,16 +17691,16 @@ var ts; // ^^token; leftOperand = b. Return b ** c to the caller as a rightOperand // a ** b - c // ^token; leftOperand = b. Return b to the caller as a rightOperand - var consumeCurrentOperator = token() === 39 /* AsteriskAsteriskToken */ ? + var consumeCurrentOperator = token() === 40 /* AsteriskAsteriskToken */ ? newPrecedence >= precedence : newPrecedence > precedence; if (!consumeCurrentOperator) { break; } - if (token() === 91 /* InKeyword */ && inDisallowInContext()) { + if (token() === 92 /* InKeyword */ && inDisallowInContext()) { break; } - if (token() === 117 /* AsKeyword */) { + if (token() === 118 /* AsKeyword */) { // Make sure we *do* perform ASI for constructs like this: // var x = foo // as (Bar) @@ -16805,48 +17721,48 @@ var ts; return leftOperand; } function isBinaryOperator() { - if (inDisallowInContext() && token() === 91 /* InKeyword */) { + if (inDisallowInContext() && token() === 92 /* InKeyword */) { return false; } return getBinaryOperatorPrecedence() > 0; } function getBinaryOperatorPrecedence() { switch (token()) { - case 53 /* BarBarToken */: + case 54 /* BarBarToken */: return 1; - case 52 /* AmpersandAmpersandToken */: + case 53 /* AmpersandAmpersandToken */: return 2; - case 48 /* BarToken */: + case 49 /* BarToken */: return 3; - case 49 /* CaretToken */: + case 50 /* CaretToken */: return 4; - case 47 /* AmpersandToken */: + case 48 /* AmpersandToken */: return 5; - case 31 /* EqualsEqualsToken */: - case 32 /* ExclamationEqualsToken */: - case 33 /* EqualsEqualsEqualsToken */: - case 34 /* ExclamationEqualsEqualsToken */: + case 32 /* EqualsEqualsToken */: + case 33 /* ExclamationEqualsToken */: + case 34 /* EqualsEqualsEqualsToken */: + case 35 /* ExclamationEqualsEqualsToken */: return 6; - case 26 /* LessThanToken */: - case 28 /* GreaterThanToken */: - case 29 /* LessThanEqualsToken */: - case 30 /* GreaterThanEqualsToken */: - case 92 /* InstanceOfKeyword */: - case 91 /* InKeyword */: - case 117 /* AsKeyword */: + case 27 /* LessThanToken */: + case 29 /* GreaterThanToken */: + case 30 /* LessThanEqualsToken */: + case 31 /* GreaterThanEqualsToken */: + case 93 /* InstanceOfKeyword */: + case 92 /* InKeyword */: + case 118 /* AsKeyword */: return 7; - case 44 /* LessThanLessThanToken */: - case 45 /* GreaterThanGreaterThanToken */: - case 46 /* GreaterThanGreaterThanGreaterThanToken */: + case 45 /* LessThanLessThanToken */: + case 46 /* GreaterThanGreaterThanToken */: + case 47 /* GreaterThanGreaterThanGreaterThanToken */: return 8; - case 36 /* PlusToken */: - case 37 /* MinusToken */: + case 37 /* PlusToken */: + case 38 /* MinusToken */: return 9; - case 38 /* AsteriskToken */: - case 40 /* SlashToken */: - case 41 /* PercentToken */: + case 39 /* AsteriskToken */: + case 41 /* SlashToken */: + case 42 /* PercentToken */: return 10; - case 39 /* AsteriskAsteriskToken */: + case 40 /* AsteriskAsteriskToken */: return 11; } // -1 is lower than all other precedences. Returning it will cause binary expression @@ -16854,45 +17770,45 @@ var ts; return -1; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(192 /* BinaryExpression */, left.pos); + var node = createNode(194 /* BinaryExpression */, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function makeAsExpression(left, right) { - var node = createNode(200 /* AsExpression */, left.pos); + var node = createNode(202 /* AsExpression */, left.pos); node.expression = left; node.type = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(190 /* PrefixUnaryExpression */); + var node = createNode(192 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseSimpleUnaryExpression(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(186 /* DeleteExpression */); + var node = createNode(188 /* DeleteExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(187 /* TypeOfExpression */); + var node = createNode(189 /* TypeOfExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(188 /* VoidExpression */); + var node = createNode(190 /* VoidExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function isAwaitExpression() { - if (token() === 120 /* AwaitKeyword */) { + if (token() === 121 /* AwaitKeyword */) { if (inAwaitContext()) { return true; } @@ -16902,7 +17818,7 @@ var ts; return false; } function parseAwaitExpression() { - var node = createNode(189 /* AwaitExpression */); + var node = createNode(191 /* AwaitExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -16926,7 +17842,7 @@ var ts; */ if (isUpdateExpression()) { var incrementExpression = parseIncrementExpression(); - return token() === 39 /* AsteriskAsteriskToken */ ? + return token() === 40 /* AsteriskAsteriskToken */ ? parseBinaryExpressionRest(getBinaryOperatorPrecedence(), incrementExpression) : incrementExpression; } @@ -16943,9 +17859,9 @@ var ts; */ var unaryOperator = token(); var simpleUnaryExpression = parseSimpleUnaryExpression(); - if (token() === 39 /* AsteriskAsteriskToken */) { + if (token() === 40 /* AsteriskAsteriskToken */) { var start = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); - if (simpleUnaryExpression.kind === 182 /* TypeAssertionExpression */) { + if (simpleUnaryExpression.kind === 184 /* 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 { @@ -16970,26 +17886,27 @@ var ts; */ function parseSimpleUnaryExpression() { switch (token()) { - case 36 /* PlusToken */: - case 37 /* MinusToken */: - case 51 /* TildeToken */: - case 50 /* ExclamationToken */: + case 37 /* PlusToken */: + case 38 /* MinusToken */: + case 52 /* TildeToken */: + case 51 /* ExclamationToken */: return parsePrefixUnaryExpression(); - case 79 /* DeleteKeyword */: + case 80 /* DeleteKeyword */: return parseDeleteExpression(); - case 102 /* TypeOfKeyword */: + case 103 /* TypeOfKeyword */: return parseTypeOfExpression(); - case 104 /* VoidKeyword */: + case 105 /* VoidKeyword */: return parseVoidExpression(); - case 26 /* LessThanToken */: + case 27 /* LessThanToken */: // This is modified UnaryExpression grammar in TypeScript // UnaryExpression (modified): // < type > UnaryExpression return parseTypeAssertion(); - case 120 /* AwaitKeyword */: + case 121 /* AwaitKeyword */: if (isAwaitExpression()) { return parseAwaitExpression(); } + // falls through default: return parseIncrementExpression(); } @@ -17008,22 +17925,22 @@ var ts; // This function is called inside parseUnaryExpression to decide // whether to call parseSimpleUnaryExpression or call parseIncrementExpression directly switch (token()) { - case 36 /* PlusToken */: - case 37 /* MinusToken */: - case 51 /* TildeToken */: - case 50 /* ExclamationToken */: - case 79 /* DeleteKeyword */: - case 102 /* TypeOfKeyword */: - case 104 /* VoidKeyword */: - case 120 /* AwaitKeyword */: + case 37 /* PlusToken */: + case 38 /* MinusToken */: + case 52 /* TildeToken */: + case 51 /* ExclamationToken */: + case 80 /* DeleteKeyword */: + case 103 /* TypeOfKeyword */: + case 105 /* VoidKeyword */: + case 121 /* AwaitKeyword */: return false; - case 26 /* LessThanToken */: + case 27 /* LessThanToken */: // If we are not in JSX context, we are parsing TypeAssertion which is an UnaryExpression if (sourceFile.languageVariant !== 1 /* JSX */) { return false; } // We are in JSX context and the token is part of JSXElement. - // Fall through + // falls through default: return true; } @@ -17040,21 +17957,21 @@ var ts; * In TypeScript (2), (3) are parsed as PostfixUnaryExpression. (4), (5) are parsed as PrefixUnaryExpression */ function parseIncrementExpression() { - if (token() === 42 /* PlusPlusToken */ || token() === 43 /* MinusMinusToken */) { - var node = createNode(190 /* PrefixUnaryExpression */); + if (token() === 43 /* PlusPlusToken */ || token() === 44 /* MinusMinusToken */) { + var node = createNode(192 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseLeftHandSideExpressionOrHigher(); return finishNode(node); } - else if (sourceFile.languageVariant === 1 /* JSX */ && token() === 26 /* LessThanToken */ && lookAhead(nextTokenIsIdentifierOrKeyword)) { + else if (sourceFile.languageVariant === 1 /* JSX */ && token() === 27 /* LessThanToken */ && lookAhead(nextTokenIsIdentifierOrKeyword)) { // JSXElement is part of primaryExpression return parseJsxElementOrSelfClosingElement(/*inExpressionContext*/ true); } var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); - if ((token() === 42 /* PlusPlusToken */ || token() === 43 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(191 /* PostfixUnaryExpression */, expression.pos); + if ((token() === 43 /* PlusPlusToken */ || token() === 44 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { + var node = createNode(193 /* PostfixUnaryExpression */, expression.pos); node.operand = expression; node.operator = token(); nextToken(); @@ -17093,7 +18010,7 @@ var ts; // the last two CallExpression productions. Or we have a MemberExpression which either // completes the LeftHandSideExpression, or starts the beginning of the first four // CallExpression productions. - var expression = token() === 96 /* SuperKeyword */ + var expression = token() === 97 /* SuperKeyword */ ? parseSuperExpression() : parseMemberExpressionOrHigher(); // Now, we *may* be complete. However, we might have consumed the start of a @@ -17153,14 +18070,14 @@ var ts; } function parseSuperExpression() { var expression = parseTokenNode(); - if (token() === 18 /* OpenParenToken */ || token() === 22 /* DotToken */ || token() === 20 /* OpenBracketToken */) { + if (token() === 19 /* OpenParenToken */ || token() === 23 /* DotToken */ || token() === 21 /* OpenBracketToken */) { return expression; } // 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(177 /* PropertyAccessExpression */, expression.pos); + var node = createNode(179 /* PropertyAccessExpression */, expression.pos); node.expression = expression; - parseExpectedToken(22 /* DotToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); + parseExpectedToken(23 /* DotToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); node.name = parseRightSideOfDot(/*allowIdentifierNames*/ true); return finishNode(node); } @@ -17168,10 +18085,10 @@ var ts; if (lhs.kind !== rhs.kind) { return false; } - if (lhs.kind === 70 /* Identifier */) { + if (lhs.kind === 71 /* Identifier */) { return lhs.text === rhs.text; } - if (lhs.kind === 98 /* ThisKeyword */) { + if (lhs.kind === 99 /* ThisKeyword */) { return true; } // If we are at this statement then we must have PropertyAccessExpression and because tag name in Jsx element can only @@ -17183,8 +18100,8 @@ var ts; function parseJsxElementOrSelfClosingElement(inExpressionContext) { var opening = parseJsxOpeningOrSelfClosingElement(inExpressionContext); var result; - if (opening.kind === 248 /* JsxOpeningElement */) { - var node = createNode(246 /* JsxElement */, opening.pos); + if (opening.kind === 251 /* JsxOpeningElement */) { + var node = createNode(249 /* JsxElement */, opening.pos); node.openingElement = opening; node.children = parseJsxChildren(node.openingElement.tagName); node.closingElement = parseJsxClosingElement(inExpressionContext); @@ -17194,7 +18111,7 @@ var ts; result = finishNode(node); } else { - ts.Debug.assert(opening.kind === 247 /* JsxSelfClosingElement */); + ts.Debug.assert(opening.kind === 250 /* JsxSelfClosingElement */); // Nothing else to do for self-closing elements result = opening; } @@ -17205,15 +18122,15 @@ var ts; // does less damage and we can report a better error. // Since JSX elements are invalid < operands anyway, this lookahead parse will only occur in error scenarios // of one sort or another. - if (inExpressionContext && token() === 26 /* LessThanToken */) { + if (inExpressionContext && token() === 27 /* LessThanToken */) { var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElement(/*inExpressionContext*/ true); }); if (invalidElement) { parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element); - var badNode = createNode(192 /* BinaryExpression */, result.pos); + var badNode = createNode(194 /* BinaryExpression */, result.pos); badNode.end = invalidElement.end; badNode.left = result; badNode.right = invalidElement; - badNode.operatorToken = createMissingNode(25 /* CommaToken */, /*reportAtCurrentPosition*/ false, /*diagnosticMessage*/ undefined); + badNode.operatorToken = createMissingNode(26 /* CommaToken */, /*reportAtCurrentPosition*/ false, /*diagnosticMessage*/ undefined); badNode.operatorToken.pos = badNode.operatorToken.end = badNode.right.pos; return badNode; } @@ -17222,16 +18139,18 @@ var ts; } function parseJsxText() { var node = createNode(10 /* JsxText */, scanner.getStartPos()); + node.containsOnlyWhiteSpaces = currentToken === 11 /* JsxTextAllWhiteSpaces */; currentToken = scanner.scanJsxToken(); return finishNode(node); } function parseJsxChild() { switch (token()) { case 10 /* JsxText */: + case 11 /* JsxTextAllWhiteSpaces */: return parseJsxText(); - case 16 /* OpenBraceToken */: + case 17 /* OpenBraceToken */: return parseJsxExpression(/*inExpressionContext*/ false); - case 26 /* LessThanToken */: + case 27 /* LessThanToken */: return parseJsxElementOrSelfClosingElement(/*inExpressionContext*/ false); } ts.Debug.fail("Unknown JSX child kind " + token()); @@ -17242,7 +18161,7 @@ var ts; parsingContext |= 1 << 14 /* JsxChildren */; while (true) { currentToken = scanner.reScanJsxToken(); - if (token() === 27 /* LessThanSlashToken */) { + if (token() === 28 /* LessThanSlashToken */) { // Closing tag break; } @@ -17252,35 +18171,46 @@ var ts; parseErrorAtPosition(openingTagName.pos, openingTagName.end - openingTagName.pos, ts.Diagnostics.JSX_element_0_has_no_corresponding_closing_tag, ts.getTextOfNodeFromSourceText(sourceText, openingTagName)); break; } - result.push(parseJsxChild()); + else if (token() === 7 /* ConflictMarkerTrivia */) { + break; + } + var child = parseJsxChild(); + if (child) { + result.push(child); + } } result.end = scanner.getTokenPos(); parsingContext = saveParsingContext; return result; } + function parseJsxAttributes() { + var jsxAttributes = createNode(254 /* JsxAttributes */); + jsxAttributes.properties = parseList(13 /* JsxAttributes */, parseJsxAttribute); + return finishNode(jsxAttributes); + } function parseJsxOpeningOrSelfClosingElement(inExpressionContext) { var fullStart = scanner.getStartPos(); - parseExpected(26 /* LessThanToken */); + parseExpected(27 /* LessThanToken */); var tagName = parseJsxElementName(); - var attributes = parseList(13 /* JsxAttributes */, parseJsxAttribute); + var attributes = parseJsxAttributes(); var node; - if (token() === 28 /* GreaterThanToken */) { + if (token() === 29 /* GreaterThanToken */) { // 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(248 /* JsxOpeningElement */, fullStart); + node = createNode(251 /* JsxOpeningElement */, fullStart); scanJsxText(); } else { - parseExpected(40 /* SlashToken */); + parseExpected(41 /* SlashToken */); if (inExpressionContext) { - parseExpected(28 /* GreaterThanToken */); + parseExpected(29 /* GreaterThanToken */); } else { - parseExpected(28 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false); + parseExpected(29 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false); scanJsxText(); } - node = createNode(247 /* JsxSelfClosingElement */, fullStart); + node = createNode(250 /* JsxSelfClosingElement */, fullStart); } node.tagName = tagName; node.attributes = attributes; @@ -17293,10 +18223,10 @@ var ts; // primaryExpression in the form of an identifier and "this" keyword // We can't just simply use parseLeftHandSideExpressionOrHigher because then we will start consider class,function etc as a keyword // We only want to consider "this" as a primaryExpression - var expression = token() === 98 /* ThisKeyword */ ? + var expression = token() === 99 /* ThisKeyword */ ? parseTokenNode() : parseIdentifierName(); - while (parseOptional(22 /* DotToken */)) { - var propertyAccess = createNode(177 /* PropertyAccessExpression */, expression.pos); + while (parseOptional(23 /* DotToken */)) { + var propertyAccess = createNode(179 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true); expression = finishNode(propertyAccess); @@ -17304,28 +18234,29 @@ var ts; return expression; } function parseJsxExpression(inExpressionContext) { - var node = createNode(252 /* JsxExpression */); - parseExpected(16 /* OpenBraceToken */); - if (token() !== 17 /* CloseBraceToken */) { + var node = createNode(256 /* JsxExpression */); + parseExpected(17 /* OpenBraceToken */); + if (token() !== 18 /* CloseBraceToken */) { + node.dotDotDotToken = parseOptionalToken(24 /* DotDotDotToken */); node.expression = parseAssignmentExpressionOrHigher(); } if (inExpressionContext) { - parseExpected(17 /* CloseBraceToken */); + parseExpected(18 /* CloseBraceToken */); } else { - parseExpected(17 /* CloseBraceToken */, /*message*/ undefined, /*shouldAdvance*/ false); + parseExpected(18 /* CloseBraceToken */, /*message*/ undefined, /*shouldAdvance*/ false); scanJsxText(); } return finishNode(node); } function parseJsxAttribute() { - if (token() === 16 /* OpenBraceToken */) { + if (token() === 17 /* OpenBraceToken */) { return parseJsxSpreadAttribute(); } scanJsxIdentifier(); - var node = createNode(250 /* JsxAttribute */); + var node = createNode(253 /* JsxAttribute */); node.name = parseIdentifierName(); - if (token() === 57 /* EqualsToken */) { + if (token() === 58 /* EqualsToken */) { switch (scanJsxAttributeValue()) { case 9 /* StringLiteral */: node.initializer = parseLiteralNode(); @@ -17338,72 +18269,72 @@ var ts; return finishNode(node); } function parseJsxSpreadAttribute() { - var node = createNode(251 /* JsxSpreadAttribute */); - parseExpected(16 /* OpenBraceToken */); - parseExpected(23 /* DotDotDotToken */); + var node = createNode(255 /* JsxSpreadAttribute */); + parseExpected(17 /* OpenBraceToken */); + parseExpected(24 /* DotDotDotToken */); node.expression = parseExpression(); - parseExpected(17 /* CloseBraceToken */); + parseExpected(18 /* CloseBraceToken */); return finishNode(node); } function parseJsxClosingElement(inExpressionContext) { - var node = createNode(249 /* JsxClosingElement */); - parseExpected(27 /* LessThanSlashToken */); + var node = createNode(252 /* JsxClosingElement */); + parseExpected(28 /* LessThanSlashToken */); node.tagName = parseJsxElementName(); if (inExpressionContext) { - parseExpected(28 /* GreaterThanToken */); + parseExpected(29 /* GreaterThanToken */); } else { - parseExpected(28 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false); + parseExpected(29 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false); scanJsxText(); } return finishNode(node); } function parseTypeAssertion() { - var node = createNode(182 /* TypeAssertionExpression */); - parseExpected(26 /* LessThanToken */); + var node = createNode(184 /* TypeAssertionExpression */); + parseExpected(27 /* LessThanToken */); node.type = parseType(); - parseExpected(28 /* GreaterThanToken */); + parseExpected(29 /* GreaterThanToken */); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseMemberExpressionRest(expression) { while (true) { - var dotToken = parseOptionalToken(22 /* DotToken */); + var dotToken = parseOptionalToken(23 /* DotToken */); if (dotToken) { - var propertyAccess = createNode(177 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(179 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true); expression = finishNode(propertyAccess); continue; } - if (token() === 50 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 51 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { nextToken(); - var nonNullExpression = createNode(201 /* NonNullExpression */, expression.pos); + var nonNullExpression = createNode(203 /* 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(20 /* OpenBracketToken */)) { - var indexedAccess = createNode(178 /* ElementAccessExpression */, expression.pos); + if (!inDecoratorContext() && parseOptional(21 /* OpenBracketToken */)) { + var indexedAccess = createNode(180 /* 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. - if (token() !== 21 /* CloseBracketToken */) { + if (token() !== 22 /* CloseBracketToken */) { indexedAccess.argumentExpression = allowInAnd(parseExpression); if (indexedAccess.argumentExpression.kind === 9 /* StringLiteral */ || indexedAccess.argumentExpression.kind === 8 /* NumericLiteral */) { var literal = indexedAccess.argumentExpression; literal.text = internIdentifier(literal.text); } } - parseExpected(21 /* CloseBracketToken */); + parseExpected(22 /* CloseBracketToken */); expression = finishNode(indexedAccess); continue; } - if (token() === 12 /* NoSubstitutionTemplateLiteral */ || token() === 13 /* TemplateHead */) { - var tagExpression = createNode(181 /* TaggedTemplateExpression */, expression.pos); + if (token() === 13 /* NoSubstitutionTemplateLiteral */ || token() === 14 /* TemplateHead */) { + var tagExpression = createNode(183 /* TaggedTemplateExpression */, expression.pos); tagExpression.tag = expression; - tagExpression.template = token() === 12 /* NoSubstitutionTemplateLiteral */ + tagExpression.template = token() === 13 /* NoSubstitutionTemplateLiteral */ ? parseLiteralNode() : parseTemplateExpression(); expression = finishNode(tagExpression); @@ -17415,7 +18346,7 @@ var ts; function parseCallExpressionRest(expression) { while (true) { expression = parseMemberExpressionRest(expression); - if (token() === 26 /* LessThanToken */) { + if (token() === 27 /* LessThanToken */) { // See if this is the start of a generic invocation. If so, consume it and // keep checking for postfix expressions. Otherwise, it's just a '<' that's // part of an arithmetic expression. Break out so we consume it higher in the @@ -17424,15 +18355,15 @@ var ts; if (!typeArguments) { return expression; } - var callExpr = createNode(179 /* CallExpression */, expression.pos); + var callExpr = createNode(181 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); expression = finishNode(callExpr); continue; } - else if (token() === 18 /* OpenParenToken */) { - var callExpr = createNode(179 /* CallExpression */, expression.pos); + else if (token() === 19 /* OpenParenToken */) { + var callExpr = createNode(181 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.arguments = parseArgumentList(); expression = finishNode(callExpr); @@ -17442,17 +18373,17 @@ var ts; } } function parseArgumentList() { - parseExpected(18 /* OpenParenToken */); + parseExpected(19 /* OpenParenToken */); var result = parseDelimitedList(11 /* ArgumentExpressions */, parseArgumentExpression); - parseExpected(19 /* CloseParenToken */); + parseExpected(20 /* CloseParenToken */); return result; } function parseTypeArgumentsInExpression() { - if (!parseOptional(26 /* LessThanToken */)) { + if (!parseOptional(27 /* LessThanToken */)) { return undefined; } var typeArguments = parseDelimitedList(19 /* TypeArguments */, parseType); - if (!parseExpected(28 /* GreaterThanToken */)) { + if (!parseExpected(29 /* GreaterThanToken */)) { // If it doesn't have the closing > then it's definitely not an type argument list. return undefined; } @@ -17464,32 +18395,32 @@ var ts; } function canFollowTypeArgumentsInExpression() { switch (token()) { - case 18 /* OpenParenToken */: // foo( + case 19 /* OpenParenToken */: // foo( // this case are the only case where this token can legally follow a type argument // list. So we definitely want to treat this as a type arg list. - case 22 /* DotToken */: // foo. - case 19 /* CloseParenToken */: // foo) - case 21 /* CloseBracketToken */: // foo] - case 55 /* ColonToken */: // foo: - case 24 /* SemicolonToken */: // foo; - case 54 /* QuestionToken */: // foo? - case 31 /* EqualsEqualsToken */: // foo == - case 33 /* EqualsEqualsEqualsToken */: // foo === - case 32 /* ExclamationEqualsToken */: // foo != - case 34 /* ExclamationEqualsEqualsToken */: // foo !== - case 52 /* AmpersandAmpersandToken */: // foo && - case 53 /* BarBarToken */: // foo || - case 49 /* CaretToken */: // foo ^ - case 47 /* AmpersandToken */: // foo & - case 48 /* BarToken */: // foo | - case 17 /* CloseBraceToken */: // foo } + case 23 /* DotToken */: // foo. + case 20 /* CloseParenToken */: // foo) + case 22 /* CloseBracketToken */: // foo] + case 56 /* ColonToken */: // foo: + case 25 /* SemicolonToken */: // foo; + case 55 /* QuestionToken */: // foo? + case 32 /* EqualsEqualsToken */: // foo == + case 34 /* EqualsEqualsEqualsToken */: // foo === + case 33 /* ExclamationEqualsToken */: // foo != + case 35 /* ExclamationEqualsEqualsToken */: // foo !== + case 53 /* AmpersandAmpersandToken */: // foo && + case 54 /* BarBarToken */: // foo || + case 50 /* CaretToken */: // foo ^ + case 48 /* AmpersandToken */: // foo & + case 49 /* BarToken */: // foo | + case 18 /* CloseBraceToken */: // foo } case 1 /* EndOfFileToken */: // 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. return true; - case 25 /* CommaToken */: // foo, - case 16 /* OpenBraceToken */: // foo { + case 26 /* CommaToken */: // foo, + case 17 /* OpenBraceToken */: // foo { // We don't want to treat these as type arguments. Otherwise we'll parse this // as an invocation expression. Instead, we want to parse out the expression // in isolation from the type arguments. @@ -17502,21 +18433,21 @@ var ts; switch (token()) { case 8 /* NumericLiteral */: case 9 /* StringLiteral */: - case 12 /* NoSubstitutionTemplateLiteral */: + case 13 /* NoSubstitutionTemplateLiteral */: return parseLiteralNode(); - case 98 /* ThisKeyword */: - case 96 /* SuperKeyword */: - case 94 /* NullKeyword */: - case 100 /* TrueKeyword */: - case 85 /* FalseKeyword */: + case 99 /* ThisKeyword */: + case 97 /* SuperKeyword */: + case 95 /* NullKeyword */: + case 101 /* TrueKeyword */: + case 86 /* FalseKeyword */: return parseTokenNode(); - case 18 /* OpenParenToken */: + case 19 /* OpenParenToken */: return parseParenthesizedExpression(); - case 20 /* OpenBracketToken */: + case 21 /* OpenBracketToken */: return parseArrayLiteralExpression(); - case 16 /* OpenBraceToken */: + case 17 /* OpenBraceToken */: return parseObjectLiteralExpression(); - case 119 /* AsyncKeyword */: + case 120 /* AsyncKeyword */: // Async arrow functions are parsed earlier in parseAssignmentExpressionOrHigher. // If we encounter `async [no LineTerminator here] function` then this is an async // function; otherwise, its an identifier. @@ -17524,68 +18455,68 @@ var ts; break; } return parseFunctionExpression(); - case 74 /* ClassKeyword */: + case 75 /* ClassKeyword */: return parseClassExpression(); - case 88 /* FunctionKeyword */: + case 89 /* FunctionKeyword */: return parseFunctionExpression(); - case 93 /* NewKeyword */: + case 94 /* NewKeyword */: return parseNewExpression(); - case 40 /* SlashToken */: - case 62 /* SlashEqualsToken */: - if (reScanSlashToken() === 11 /* RegularExpressionLiteral */) { + case 41 /* SlashToken */: + case 63 /* SlashEqualsToken */: + if (reScanSlashToken() === 12 /* RegularExpressionLiteral */) { return parseLiteralNode(); } break; - case 13 /* TemplateHead */: + case 14 /* TemplateHead */: return parseTemplateExpression(); } return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNode(183 /* ParenthesizedExpression */); - parseExpected(18 /* OpenParenToken */); + var node = createNode(185 /* ParenthesizedExpression */); + parseExpected(19 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); - parseExpected(19 /* CloseParenToken */); + parseExpected(20 /* CloseParenToken */); return finishNode(node); } function parseSpreadElement() { - var node = createNode(196 /* SpreadElement */); - parseExpected(23 /* DotDotDotToken */); + var node = createNode(198 /* SpreadElement */); + parseExpected(24 /* DotDotDotToken */); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { - return token() === 23 /* DotDotDotToken */ ? parseSpreadElement() : - token() === 25 /* CommaToken */ ? createNode(198 /* OmittedExpression */) : + return token() === 24 /* DotDotDotToken */ ? parseSpreadElement() : + token() === 26 /* CommaToken */ ? createNode(200 /* OmittedExpression */) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(175 /* ArrayLiteralExpression */); - parseExpected(20 /* OpenBracketToken */); + var node = createNode(177 /* ArrayLiteralExpression */); + parseExpected(21 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; } node.elements = parseDelimitedList(15 /* ArrayLiteralMembers */, parseArgumentOrArrayLiteralElement); - parseExpected(21 /* CloseBracketToken */); + parseExpected(22 /* CloseBracketToken */); return finishNode(node); } function tryParseAccessorDeclaration(fullStart, decorators, modifiers) { - if (parseContextualModifier(124 /* GetKeyword */)) { - return parseAccessorDeclaration(151 /* GetAccessor */, fullStart, decorators, modifiers); + if (parseContextualModifier(125 /* GetKeyword */)) { + return parseAccessorDeclaration(153 /* GetAccessor */, fullStart, decorators, modifiers); } - else if (parseContextualModifier(133 /* SetKeyword */)) { - return parseAccessorDeclaration(152 /* SetAccessor */, fullStart, decorators, modifiers); + else if (parseContextualModifier(135 /* SetKeyword */)) { + return parseAccessorDeclaration(154 /* SetAccessor */, fullStart, decorators, modifiers); } return undefined; } function parseObjectLiteralElement() { var fullStart = scanner.getStartPos(); - var dotDotDotToken = parseOptionalToken(23 /* DotDotDotToken */); + var dotDotDotToken = parseOptionalToken(24 /* DotDotDotToken */); if (dotDotDotToken) { - var spreadElement = createNode(259 /* SpreadAssignment */, fullStart); + var spreadElement = createNode(263 /* SpreadAssignment */, fullStart); spreadElement.expression = parseAssignmentExpressionOrHigher(); return addJSDocComment(finishNode(spreadElement)); } @@ -17595,12 +18526,12 @@ var ts; if (accessor) { return accessor; } - var asteriskToken = parseOptionalToken(38 /* AsteriskToken */); + var asteriskToken = parseOptionalToken(39 /* AsteriskToken */); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); // Disallowing of optional property assignments happens in the grammar checker. - var questionToken = parseOptionalToken(54 /* QuestionToken */); - if (asteriskToken || token() === 18 /* OpenParenToken */ || token() === 26 /* LessThanToken */) { + var questionToken = parseOptionalToken(55 /* QuestionToken */); + if (asteriskToken || token() === 19 /* OpenParenToken */ || token() === 27 /* LessThanToken */) { return parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, propertyName, questionToken); } // check if it is short-hand property assignment or normal property assignment @@ -17608,12 +18539,12 @@ var ts; // CoverInitializedName[Yield] : // IdentifierReference[?Yield] Initializer[In, ?Yield] // this is necessary because ObjectLiteral productions are also used to cover grammar for ObjectAssignmentPattern - var isShorthandPropertyAssignment = tokenIsIdentifier && (token() === 25 /* CommaToken */ || token() === 17 /* CloseBraceToken */ || token() === 57 /* EqualsToken */); + var isShorthandPropertyAssignment = tokenIsIdentifier && (token() === 26 /* CommaToken */ || token() === 18 /* CloseBraceToken */ || token() === 58 /* EqualsToken */); if (isShorthandPropertyAssignment) { - var shorthandDeclaration = createNode(258 /* ShorthandPropertyAssignment */, fullStart); + var shorthandDeclaration = createNode(262 /* ShorthandPropertyAssignment */, fullStart); shorthandDeclaration.name = propertyName; shorthandDeclaration.questionToken = questionToken; - var equalsToken = parseOptionalToken(57 /* EqualsToken */); + var equalsToken = parseOptionalToken(58 /* EqualsToken */); if (equalsToken) { shorthandDeclaration.equalsToken = equalsToken; shorthandDeclaration.objectAssignmentInitializer = allowInAnd(parseAssignmentExpressionOrHigher); @@ -17621,23 +18552,23 @@ var ts; return addJSDocComment(finishNode(shorthandDeclaration)); } else { - var propertyAssignment = createNode(257 /* PropertyAssignment */, fullStart); + var propertyAssignment = createNode(261 /* PropertyAssignment */, fullStart); propertyAssignment.modifiers = modifiers; propertyAssignment.name = propertyName; propertyAssignment.questionToken = questionToken; - parseExpected(55 /* ColonToken */); + parseExpected(56 /* ColonToken */); propertyAssignment.initializer = allowInAnd(parseAssignmentExpressionOrHigher); return addJSDocComment(finishNode(propertyAssignment)); } } function parseObjectLiteralExpression() { - var node = createNode(176 /* ObjectLiteralExpression */); - parseExpected(16 /* OpenBraceToken */); + var node = createNode(178 /* ObjectLiteralExpression */); + parseExpected(17 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; } node.properties = parseDelimitedList(12 /* ObjectLiteralMembers */, parseObjectLiteralElement, /*considerSemicolonAsDelimiter*/ true); - parseExpected(17 /* CloseBraceToken */); + parseExpected(18 /* CloseBraceToken */); return finishNode(node); } function parseFunctionExpression() { @@ -17650,10 +18581,10 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(/*val*/ false); } - var node = createNode(184 /* FunctionExpression */); + var node = createNode(186 /* FunctionExpression */); node.modifiers = parseModifiers(); - parseExpected(88 /* FunctionKeyword */); - node.asteriskToken = parseOptionalToken(38 /* AsteriskToken */); + parseExpected(89 /* FunctionKeyword */); + node.asteriskToken = parseOptionalToken(39 /* AsteriskToken */); var isGenerator = !!node.asteriskToken; var isAsync = !!(ts.getModifierFlags(node) & 256 /* Async */); node.name = @@ -17661,7 +18592,7 @@ var ts; isGenerator ? doInYieldContext(parseOptionalIdentifier) : isAsync ? doInAwaitContext(parseOptionalIdentifier) : parseOptionalIdentifier(); - fillSignature(55 /* ColonToken */, /*yieldContext*/ isGenerator, /*awaitContext*/ isAsync, /*requireCompleteParameterList*/ false, node); + fillSignature(56 /* ColonToken */, /*yieldContext*/ isGenerator, /*awaitContext*/ isAsync, /*requireCompleteParameterList*/ false, node); node.body = parseFunctionBlock(/*allowYield*/ isGenerator, /*allowAwait*/ isAsync, /*ignoreMissingOpenBrace*/ false); if (saveDecoratorContext) { setDecoratorContext(/*val*/ true); @@ -17672,24 +18603,31 @@ var ts; return isIdentifier() ? parseIdentifier() : undefined; } function parseNewExpression() { - var node = createNode(180 /* NewExpression */); - parseExpected(93 /* NewKeyword */); + var fullStart = scanner.getStartPos(); + parseExpected(94 /* NewKeyword */); + if (parseOptional(23 /* DotToken */)) { + var node_1 = createNode(204 /* MetaProperty */, fullStart); + node_1.keywordToken = 94 /* NewKeyword */; + node_1.name = parseIdentifierName(); + return finishNode(node_1); + } + var node = createNode(182 /* NewExpression */, fullStart); node.expression = parseMemberExpressionOrHigher(); node.typeArguments = tryParse(parseTypeArgumentsInExpression); - if (node.typeArguments || token() === 18 /* OpenParenToken */) { + if (node.typeArguments || token() === 19 /* OpenParenToken */) { node.arguments = parseArgumentList(); } return finishNode(node); } // STATEMENTS function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { - var node = createNode(204 /* Block */); - if (parseExpected(16 /* OpenBraceToken */, diagnosticMessage) || ignoreMissingOpenBrace) { + var node = createNode(207 /* Block */); + if (parseExpected(17 /* OpenBraceToken */, diagnosticMessage) || ignoreMissingOpenBrace) { if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; } node.statements = parseList(1 /* BlockStatements */, parseStatement); - parseExpected(17 /* CloseBraceToken */); + parseExpected(18 /* CloseBraceToken */); } else { node.statements = createMissingList(); @@ -17716,51 +18654,52 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(206 /* EmptyStatement */); - parseExpected(24 /* SemicolonToken */); + var node = createNode(209 /* EmptyStatement */); + parseExpected(25 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(208 /* IfStatement */); - parseExpected(89 /* IfKeyword */); - parseExpected(18 /* OpenParenToken */); + var node = createNode(211 /* IfStatement */); + parseExpected(90 /* IfKeyword */); + parseExpected(19 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); - parseExpected(19 /* CloseParenToken */); + parseExpected(20 /* CloseParenToken */); node.thenStatement = parseStatement(); - node.elseStatement = parseOptional(81 /* ElseKeyword */) ? parseStatement() : undefined; + node.elseStatement = parseOptional(82 /* ElseKeyword */) ? parseStatement() : undefined; return finishNode(node); } function parseDoStatement() { - var node = createNode(209 /* DoStatement */); - parseExpected(80 /* DoKeyword */); + var node = createNode(212 /* DoStatement */); + parseExpected(81 /* DoKeyword */); node.statement = parseStatement(); - parseExpected(105 /* WhileKeyword */); - parseExpected(18 /* OpenParenToken */); + parseExpected(106 /* WhileKeyword */); + parseExpected(19 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); - parseExpected(19 /* CloseParenToken */); + parseExpected(20 /* CloseParenToken */); // From: https://mail.mozilla.org/pipermail/es-discuss/2011-August/016188.html // 157 min --- All allen at wirfs-brock.com CONF --- "do{;}while(false)false" prohibited in // spec but allowed in consensus reality. Approved -- this is the de-facto standard whereby // do;while(0)x will have a semicolon inserted before x. - parseOptional(24 /* SemicolonToken */); + parseOptional(25 /* SemicolonToken */); return finishNode(node); } function parseWhileStatement() { - var node = createNode(210 /* WhileStatement */); - parseExpected(105 /* WhileKeyword */); - parseExpected(18 /* OpenParenToken */); + var node = createNode(213 /* WhileStatement */); + parseExpected(106 /* WhileKeyword */); + parseExpected(19 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); - parseExpected(19 /* CloseParenToken */); + parseExpected(20 /* CloseParenToken */); node.statement = parseStatement(); return finishNode(node); } function parseForOrForInOrForOfStatement() { var pos = getNodePos(); - parseExpected(87 /* ForKeyword */); - parseExpected(18 /* OpenParenToken */); + parseExpected(88 /* ForKeyword */); + var awaitToken = parseOptionalToken(121 /* AwaitKeyword */); + parseExpected(19 /* OpenParenToken */); var initializer = undefined; - if (token() !== 24 /* SemicolonToken */) { - if (token() === 103 /* VarKeyword */ || token() === 109 /* LetKeyword */ || token() === 75 /* ConstKeyword */) { + if (token() !== 25 /* SemicolonToken */) { + if (token() === 104 /* VarKeyword */ || token() === 110 /* LetKeyword */ || token() === 76 /* ConstKeyword */) { initializer = parseVariableDeclarationList(/*inForStatementInitializer*/ true); } else { @@ -17768,32 +18707,33 @@ var ts; } } var forOrForInOrForOfStatement; - if (parseOptional(91 /* InKeyword */)) { - var forInStatement = createNode(212 /* ForInStatement */, pos); - forInStatement.initializer = initializer; - forInStatement.expression = allowInAnd(parseExpression); - parseExpected(19 /* CloseParenToken */); - forOrForInOrForOfStatement = forInStatement; - } - else if (parseOptional(140 /* OfKeyword */)) { - var forOfStatement = createNode(213 /* ForOfStatement */, pos); + if (awaitToken ? parseExpected(142 /* OfKeyword */) : parseOptional(142 /* OfKeyword */)) { + var forOfStatement = createNode(216 /* ForOfStatement */, pos); + forOfStatement.awaitModifier = awaitToken; forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); - parseExpected(19 /* CloseParenToken */); + parseExpected(20 /* CloseParenToken */); forOrForInOrForOfStatement = forOfStatement; } + else if (parseOptional(92 /* InKeyword */)) { + var forInStatement = createNode(215 /* ForInStatement */, pos); + forInStatement.initializer = initializer; + forInStatement.expression = allowInAnd(parseExpression); + parseExpected(20 /* CloseParenToken */); + forOrForInOrForOfStatement = forInStatement; + } else { - var forStatement = createNode(211 /* ForStatement */, pos); + var forStatement = createNode(214 /* ForStatement */, pos); forStatement.initializer = initializer; - parseExpected(24 /* SemicolonToken */); - if (token() !== 24 /* SemicolonToken */ && token() !== 19 /* CloseParenToken */) { + parseExpected(25 /* SemicolonToken */); + if (token() !== 25 /* SemicolonToken */ && token() !== 20 /* CloseParenToken */) { forStatement.condition = allowInAnd(parseExpression); } - parseExpected(24 /* SemicolonToken */); - if (token() !== 19 /* CloseParenToken */) { + parseExpected(25 /* SemicolonToken */); + if (token() !== 20 /* CloseParenToken */) { forStatement.incrementor = allowInAnd(parseExpression); } - parseExpected(19 /* CloseParenToken */); + parseExpected(20 /* CloseParenToken */); forOrForInOrForOfStatement = forStatement; } forOrForInOrForOfStatement.statement = parseStatement(); @@ -17801,7 +18741,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 215 /* BreakStatement */ ? 71 /* BreakKeyword */ : 76 /* ContinueKeyword */); + parseExpected(kind === 218 /* BreakStatement */ ? 72 /* BreakKeyword */ : 77 /* ContinueKeyword */); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -17809,8 +18749,8 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(216 /* ReturnStatement */); - parseExpected(95 /* ReturnKeyword */); + var node = createNode(219 /* ReturnStatement */); + parseExpected(96 /* ReturnKeyword */); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); } @@ -17818,42 +18758,42 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(217 /* WithStatement */); - parseExpected(106 /* WithKeyword */); - parseExpected(18 /* OpenParenToken */); + var node = createNode(220 /* WithStatement */); + parseExpected(107 /* WithKeyword */); + parseExpected(19 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); - parseExpected(19 /* CloseParenToken */); + parseExpected(20 /* CloseParenToken */); node.statement = parseStatement(); return finishNode(node); } function parseCaseClause() { - var node = createNode(253 /* CaseClause */); - parseExpected(72 /* CaseKeyword */); + var node = createNode(257 /* CaseClause */); + parseExpected(73 /* CaseKeyword */); node.expression = allowInAnd(parseExpression); - parseExpected(55 /* ColonToken */); + parseExpected(56 /* ColonToken */); node.statements = parseList(3 /* SwitchClauseStatements */, parseStatement); return finishNode(node); } function parseDefaultClause() { - var node = createNode(254 /* DefaultClause */); - parseExpected(78 /* DefaultKeyword */); - parseExpected(55 /* ColonToken */); + var node = createNode(258 /* DefaultClause */); + parseExpected(79 /* DefaultKeyword */); + parseExpected(56 /* ColonToken */); node.statements = parseList(3 /* SwitchClauseStatements */, parseStatement); return finishNode(node); } function parseCaseOrDefaultClause() { - return token() === 72 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); + return token() === 73 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(218 /* SwitchStatement */); - parseExpected(97 /* SwitchKeyword */); - parseExpected(18 /* OpenParenToken */); + var node = createNode(221 /* SwitchStatement */); + parseExpected(98 /* SwitchKeyword */); + parseExpected(19 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); - parseExpected(19 /* CloseParenToken */); - var caseBlock = createNode(232 /* CaseBlock */, scanner.getStartPos()); - parseExpected(16 /* OpenBraceToken */); + parseExpected(20 /* CloseParenToken */); + var caseBlock = createNode(235 /* CaseBlock */, scanner.getStartPos()); + parseExpected(17 /* OpenBraceToken */); caseBlock.clauses = parseList(2 /* SwitchClauses */, parseCaseOrDefaultClause); - parseExpected(17 /* CloseBraceToken */); + parseExpected(18 /* CloseBraceToken */); node.caseBlock = finishNode(caseBlock); return finishNode(node); } @@ -17865,39 +18805,39 @@ 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(220 /* ThrowStatement */); - parseExpected(99 /* ThrowKeyword */); + var node = createNode(223 /* ThrowStatement */); + parseExpected(100 /* ThrowKeyword */); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); return finishNode(node); } // TODO: Review for error recovery function parseTryStatement() { - var node = createNode(221 /* TryStatement */); - parseExpected(101 /* TryKeyword */); + var node = createNode(224 /* TryStatement */); + parseExpected(102 /* TryKeyword */); node.tryBlock = parseBlock(/*ignoreMissingOpenBrace*/ false); - node.catchClause = token() === 73 /* CatchKeyword */ ? parseCatchClause() : undefined; + node.catchClause = token() === 74 /* CatchKeyword */ ? parseCatchClause() : undefined; // If we don't have a catch clause, then we must have a finally clause. Try to parse // one out no matter what. - if (!node.catchClause || token() === 86 /* FinallyKeyword */) { - parseExpected(86 /* FinallyKeyword */); + if (!node.catchClause || token() === 87 /* FinallyKeyword */) { + parseExpected(87 /* FinallyKeyword */); node.finallyBlock = parseBlock(/*ignoreMissingOpenBrace*/ false); } return finishNode(node); } function parseCatchClause() { - var result = createNode(256 /* CatchClause */); - parseExpected(73 /* CatchKeyword */); - if (parseExpected(18 /* OpenParenToken */)) { + var result = createNode(260 /* CatchClause */); + parseExpected(74 /* CatchKeyword */); + if (parseExpected(19 /* OpenParenToken */)) { result.variableDeclaration = parseVariableDeclaration(); } - parseExpected(19 /* CloseParenToken */); + parseExpected(20 /* CloseParenToken */); result.block = parseBlock(/*ignoreMissingOpenBrace*/ false); return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(222 /* DebuggerStatement */); - parseExpected(77 /* DebuggerKeyword */); + var node = createNode(225 /* DebuggerStatement */); + parseExpected(78 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); } @@ -17907,14 +18847,14 @@ var ts; // a colon. var fullStart = scanner.getStartPos(); var expression = allowInAnd(parseExpression); - if (expression.kind === 70 /* Identifier */ && parseOptional(55 /* ColonToken */)) { - var labeledStatement = createNode(219 /* LabeledStatement */, fullStart); + if (expression.kind === 71 /* Identifier */ && parseOptional(56 /* ColonToken */)) { + var labeledStatement = createNode(222 /* LabeledStatement */, fullStart); labeledStatement.label = expression; labeledStatement.statement = parseStatement(); return addJSDocComment(finishNode(labeledStatement)); } else { - var expressionStatement = createNode(207 /* ExpressionStatement */, fullStart); + var expressionStatement = createNode(210 /* ExpressionStatement */, fullStart); expressionStatement.expression = expression; parseSemicolon(); return addJSDocComment(finishNode(expressionStatement)); @@ -17924,9 +18864,13 @@ var ts; nextToken(); return ts.tokenIsIdentifierOrKeyword(token()) && !scanner.hasPrecedingLineBreak(); } + function nextTokenIsClassKeywordOnSameLine() { + nextToken(); + return token() === 75 /* ClassKeyword */ && !scanner.hasPrecedingLineBreak(); + } function nextTokenIsFunctionKeywordOnSameLine() { nextToken(); - return token() === 88 /* FunctionKeyword */ && !scanner.hasPrecedingLineBreak(); + return token() === 89 /* FunctionKeyword */ && !scanner.hasPrecedingLineBreak(); } function nextTokenIsIdentifierOrKeywordOrNumberOnSameLine() { nextToken(); @@ -17935,12 +18879,12 @@ var ts; function isDeclaration() { while (true) { switch (token()) { - case 103 /* VarKeyword */: - case 109 /* LetKeyword */: - case 75 /* ConstKeyword */: - case 88 /* FunctionKeyword */: - case 74 /* ClassKeyword */: - case 82 /* EnumKeyword */: + case 104 /* VarKeyword */: + case 110 /* LetKeyword */: + case 76 /* ConstKeyword */: + case 89 /* FunctionKeyword */: + case 75 /* ClassKeyword */: + case 83 /* EnumKeyword */: return true; // 'declare', 'module', 'namespace', 'interface'* and 'type' are all legal JavaScript identifiers; // however, an identifier cannot be followed by another identifier on the same line. This is what we @@ -17963,41 +18907,41 @@ var ts; // I {} // // could be legal, it would add complexity for very little gain. - case 108 /* InterfaceKeyword */: - case 136 /* TypeKeyword */: + case 109 /* InterfaceKeyword */: + case 138 /* TypeKeyword */: return nextTokenIsIdentifierOnSameLine(); - case 127 /* ModuleKeyword */: - case 128 /* NamespaceKeyword */: + case 128 /* ModuleKeyword */: + case 129 /* NamespaceKeyword */: return nextTokenIsIdentifierOrStringLiteralOnSameLine(); - case 116 /* AbstractKeyword */: - case 119 /* AsyncKeyword */: - case 123 /* DeclareKeyword */: - case 111 /* PrivateKeyword */: - case 112 /* ProtectedKeyword */: - case 113 /* PublicKeyword */: - case 130 /* ReadonlyKeyword */: + case 117 /* AbstractKeyword */: + case 120 /* AsyncKeyword */: + case 124 /* DeclareKeyword */: + case 112 /* PrivateKeyword */: + case 113 /* ProtectedKeyword */: + case 114 /* PublicKeyword */: + case 131 /* ReadonlyKeyword */: nextToken(); // ASI takes effect for this modifier. if (scanner.hasPrecedingLineBreak()) { return false; } continue; - case 139 /* GlobalKeyword */: + case 141 /* GlobalKeyword */: nextToken(); - return token() === 16 /* OpenBraceToken */ || token() === 70 /* Identifier */ || token() === 83 /* ExportKeyword */; - case 90 /* ImportKeyword */: + return token() === 17 /* OpenBraceToken */ || token() === 71 /* Identifier */ || token() === 84 /* ExportKeyword */; + case 91 /* ImportKeyword */: nextToken(); - return token() === 9 /* StringLiteral */ || token() === 38 /* AsteriskToken */ || - token() === 16 /* OpenBraceToken */ || ts.tokenIsIdentifierOrKeyword(token()); - case 83 /* ExportKeyword */: + return token() === 9 /* StringLiteral */ || token() === 39 /* AsteriskToken */ || + token() === 17 /* OpenBraceToken */ || ts.tokenIsIdentifierOrKeyword(token()); + case 84 /* ExportKeyword */: nextToken(); - if (token() === 57 /* EqualsToken */ || token() === 38 /* AsteriskToken */ || - token() === 16 /* OpenBraceToken */ || token() === 78 /* DefaultKeyword */ || - token() === 117 /* AsKeyword */) { + if (token() === 58 /* EqualsToken */ || token() === 39 /* AsteriskToken */ || + token() === 17 /* OpenBraceToken */ || token() === 79 /* DefaultKeyword */ || + token() === 118 /* AsKeyword */) { return true; } continue; - case 114 /* StaticKeyword */: + case 115 /* StaticKeyword */: nextToken(); continue; default: @@ -18010,49 +18954,49 @@ var ts; } function isStartOfStatement() { switch (token()) { - case 56 /* AtToken */: - case 24 /* SemicolonToken */: - case 16 /* OpenBraceToken */: - case 103 /* VarKeyword */: - case 109 /* LetKeyword */: - case 88 /* FunctionKeyword */: - case 74 /* ClassKeyword */: - case 82 /* EnumKeyword */: - case 89 /* IfKeyword */: - case 80 /* DoKeyword */: - case 105 /* WhileKeyword */: - case 87 /* ForKeyword */: - case 76 /* ContinueKeyword */: - case 71 /* BreakKeyword */: - case 95 /* ReturnKeyword */: - case 106 /* WithKeyword */: - case 97 /* SwitchKeyword */: - case 99 /* ThrowKeyword */: - case 101 /* TryKeyword */: - case 77 /* DebuggerKeyword */: + case 57 /* AtToken */: + case 25 /* SemicolonToken */: + case 17 /* OpenBraceToken */: + case 104 /* VarKeyword */: + case 110 /* LetKeyword */: + case 89 /* FunctionKeyword */: + case 75 /* ClassKeyword */: + case 83 /* EnumKeyword */: + case 90 /* IfKeyword */: + case 81 /* DoKeyword */: + case 106 /* WhileKeyword */: + case 88 /* ForKeyword */: + case 77 /* ContinueKeyword */: + case 72 /* BreakKeyword */: + case 96 /* ReturnKeyword */: + case 107 /* WithKeyword */: + case 98 /* SwitchKeyword */: + case 100 /* ThrowKeyword */: + case 102 /* TryKeyword */: + case 78 /* DebuggerKeyword */: // 'catch' and 'finally' do not actually indicate that the code is part of a statement, // however, we say they are here so that we may gracefully parse them and error later. - case 73 /* CatchKeyword */: - case 86 /* FinallyKeyword */: + case 74 /* CatchKeyword */: + case 87 /* FinallyKeyword */: return true; - case 75 /* ConstKeyword */: - case 83 /* ExportKeyword */: - case 90 /* ImportKeyword */: + case 76 /* ConstKeyword */: + case 84 /* ExportKeyword */: + case 91 /* ImportKeyword */: return isStartOfDeclaration(); - case 119 /* AsyncKeyword */: - case 123 /* DeclareKeyword */: - case 108 /* InterfaceKeyword */: - case 127 /* ModuleKeyword */: - case 128 /* NamespaceKeyword */: - case 136 /* TypeKeyword */: - case 139 /* GlobalKeyword */: + case 120 /* AsyncKeyword */: + case 124 /* DeclareKeyword */: + case 109 /* InterfaceKeyword */: + case 128 /* ModuleKeyword */: + case 129 /* NamespaceKeyword */: + case 138 /* TypeKeyword */: + case 141 /* GlobalKeyword */: // When these don't start a declaration, they're an identifier in an expression statement return true; - case 113 /* PublicKeyword */: - case 111 /* PrivateKeyword */: - case 112 /* ProtectedKeyword */: - case 114 /* StaticKeyword */: - case 130 /* ReadonlyKeyword */: + case 114 /* PublicKeyword */: + case 112 /* PrivateKeyword */: + case 113 /* ProtectedKeyword */: + case 115 /* StaticKeyword */: + case 131 /* 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); @@ -18062,7 +19006,7 @@ var ts; } function nextTokenIsIdentifierOrStartOfDestructuring() { nextToken(); - return isIdentifier() || token() === 16 /* OpenBraceToken */ || token() === 20 /* OpenBracketToken */; + return isIdentifier() || token() === 17 /* OpenBraceToken */ || token() === 21 /* OpenBracketToken */; } function isLetDeclaration() { // In ES6 'let' always starts a lexical declaration if followed by an identifier or { @@ -18071,67 +19015,67 @@ var ts; } function parseStatement() { switch (token()) { - case 24 /* SemicolonToken */: + case 25 /* SemicolonToken */: return parseEmptyStatement(); - case 16 /* OpenBraceToken */: + case 17 /* OpenBraceToken */: return parseBlock(/*ignoreMissingOpenBrace*/ false); - case 103 /* VarKeyword */: + case 104 /* VarKeyword */: return parseVariableStatement(scanner.getStartPos(), /*decorators*/ undefined, /*modifiers*/ undefined); - case 109 /* LetKeyword */: + case 110 /* LetKeyword */: if (isLetDeclaration()) { return parseVariableStatement(scanner.getStartPos(), /*decorators*/ undefined, /*modifiers*/ undefined); } break; - case 88 /* FunctionKeyword */: + case 89 /* FunctionKeyword */: return parseFunctionDeclaration(scanner.getStartPos(), /*decorators*/ undefined, /*modifiers*/ undefined); - case 74 /* ClassKeyword */: + case 75 /* ClassKeyword */: return parseClassDeclaration(scanner.getStartPos(), /*decorators*/ undefined, /*modifiers*/ undefined); - case 89 /* IfKeyword */: + case 90 /* IfKeyword */: return parseIfStatement(); - case 80 /* DoKeyword */: + case 81 /* DoKeyword */: return parseDoStatement(); - case 105 /* WhileKeyword */: + case 106 /* WhileKeyword */: return parseWhileStatement(); - case 87 /* ForKeyword */: + case 88 /* ForKeyword */: return parseForOrForInOrForOfStatement(); - case 76 /* ContinueKeyword */: - return parseBreakOrContinueStatement(214 /* ContinueStatement */); - case 71 /* BreakKeyword */: - return parseBreakOrContinueStatement(215 /* BreakStatement */); - case 95 /* ReturnKeyword */: + case 77 /* ContinueKeyword */: + return parseBreakOrContinueStatement(217 /* ContinueStatement */); + case 72 /* BreakKeyword */: + return parseBreakOrContinueStatement(218 /* BreakStatement */); + case 96 /* ReturnKeyword */: return parseReturnStatement(); - case 106 /* WithKeyword */: + case 107 /* WithKeyword */: return parseWithStatement(); - case 97 /* SwitchKeyword */: + case 98 /* SwitchKeyword */: return parseSwitchStatement(); - case 99 /* ThrowKeyword */: + case 100 /* ThrowKeyword */: return parseThrowStatement(); - case 101 /* TryKeyword */: + case 102 /* TryKeyword */: // Include 'catch' and 'finally' for error recovery. - case 73 /* CatchKeyword */: - case 86 /* FinallyKeyword */: + case 74 /* CatchKeyword */: + case 87 /* FinallyKeyword */: return parseTryStatement(); - case 77 /* DebuggerKeyword */: + case 78 /* DebuggerKeyword */: return parseDebuggerStatement(); - case 56 /* AtToken */: + case 57 /* AtToken */: return parseDeclaration(); - case 119 /* AsyncKeyword */: - case 108 /* InterfaceKeyword */: - case 136 /* TypeKeyword */: - case 127 /* ModuleKeyword */: - case 128 /* NamespaceKeyword */: - case 123 /* DeclareKeyword */: - case 75 /* ConstKeyword */: - case 82 /* EnumKeyword */: - case 83 /* ExportKeyword */: - case 90 /* ImportKeyword */: - case 111 /* PrivateKeyword */: - case 112 /* ProtectedKeyword */: - case 113 /* PublicKeyword */: - case 116 /* AbstractKeyword */: - case 114 /* StaticKeyword */: - case 130 /* ReadonlyKeyword */: - case 139 /* GlobalKeyword */: + case 120 /* AsyncKeyword */: + case 109 /* InterfaceKeyword */: + case 138 /* TypeKeyword */: + case 128 /* ModuleKeyword */: + case 129 /* NamespaceKeyword */: + case 124 /* DeclareKeyword */: + case 76 /* ConstKeyword */: + case 83 /* EnumKeyword */: + case 84 /* ExportKeyword */: + case 91 /* ImportKeyword */: + case 112 /* PrivateKeyword */: + case 113 /* ProtectedKeyword */: + case 114 /* PublicKeyword */: + case 117 /* AbstractKeyword */: + case 115 /* StaticKeyword */: + case 131 /* ReadonlyKeyword */: + case 141 /* GlobalKeyword */: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -18144,33 +19088,33 @@ var ts; var decorators = parseDecorators(); var modifiers = parseModifiers(); switch (token()) { - case 103 /* VarKeyword */: - case 109 /* LetKeyword */: - case 75 /* ConstKeyword */: + case 104 /* VarKeyword */: + case 110 /* LetKeyword */: + case 76 /* ConstKeyword */: return parseVariableStatement(fullStart, decorators, modifiers); - case 88 /* FunctionKeyword */: + case 89 /* FunctionKeyword */: return parseFunctionDeclaration(fullStart, decorators, modifiers); - case 74 /* ClassKeyword */: + case 75 /* ClassKeyword */: return parseClassDeclaration(fullStart, decorators, modifiers); - case 108 /* InterfaceKeyword */: + case 109 /* InterfaceKeyword */: return parseInterfaceDeclaration(fullStart, decorators, modifiers); - case 136 /* TypeKeyword */: + case 138 /* TypeKeyword */: return parseTypeAliasDeclaration(fullStart, decorators, modifiers); - case 82 /* EnumKeyword */: + case 83 /* EnumKeyword */: return parseEnumDeclaration(fullStart, decorators, modifiers); - case 139 /* GlobalKeyword */: - case 127 /* ModuleKeyword */: - case 128 /* NamespaceKeyword */: + case 141 /* GlobalKeyword */: + case 128 /* ModuleKeyword */: + case 129 /* NamespaceKeyword */: return parseModuleDeclaration(fullStart, decorators, modifiers); - case 90 /* ImportKeyword */: + case 91 /* ImportKeyword */: return parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers); - case 83 /* ExportKeyword */: + case 84 /* ExportKeyword */: nextToken(); switch (token()) { - case 78 /* DefaultKeyword */: - case 57 /* EqualsToken */: + case 79 /* DefaultKeyword */: + case 58 /* EqualsToken */: return parseExportAssignment(fullStart, decorators, modifiers); - case 117 /* AsKeyword */: + case 118 /* AsKeyword */: return parseNamespaceExportDeclaration(fullStart, decorators, modifiers); default: return parseExportDeclaration(fullStart, decorators, modifiers); @@ -18179,7 +19123,7 @@ var ts; if (decorators || 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 node = createMissingNode(244 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); + var node = createMissingNode(247 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); node.pos = fullStart; node.decorators = decorators; node.modifiers = modifiers; @@ -18192,7 +19136,7 @@ var ts; return !scanner.hasPrecedingLineBreak() && (isIdentifier() || token() === 9 /* StringLiteral */); } function parseFunctionBlockOrSemicolon(isGenerator, isAsync, diagnosticMessage) { - if (token() !== 16 /* OpenBraceToken */ && canParseSemicolon()) { + if (token() !== 17 /* OpenBraceToken */ && canParseSemicolon()) { parseSemicolon(); return; } @@ -18200,25 +19144,25 @@ var ts; } // DECLARATIONS function parseArrayBindingElement() { - if (token() === 25 /* CommaToken */) { - return createNode(198 /* OmittedExpression */); + if (token() === 26 /* CommaToken */) { + return createNode(200 /* OmittedExpression */); } - var node = createNode(174 /* BindingElement */); - node.dotDotDotToken = parseOptionalToken(23 /* DotDotDotToken */); + var node = createNode(176 /* BindingElement */); + node.dotDotDotToken = parseOptionalToken(24 /* DotDotDotToken */); node.name = parseIdentifierOrPattern(); node.initializer = parseBindingElementInitializer(/*inParameter*/ false); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(174 /* BindingElement */); - node.dotDotDotToken = parseOptionalToken(23 /* DotDotDotToken */); + var node = createNode(176 /* BindingElement */); + node.dotDotDotToken = parseOptionalToken(24 /* DotDotDotToken */); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); - if (tokenIsIdentifier && token() !== 55 /* ColonToken */) { + if (tokenIsIdentifier && token() !== 56 /* ColonToken */) { node.name = propertyName; } else { - parseExpected(55 /* ColonToken */); + parseExpected(56 /* ColonToken */); node.propertyName = propertyName; node.name = parseIdentifierOrPattern(); } @@ -18226,33 +19170,33 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(172 /* ObjectBindingPattern */); - parseExpected(16 /* OpenBraceToken */); + var node = createNode(174 /* ObjectBindingPattern */); + parseExpected(17 /* OpenBraceToken */); node.elements = parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement); - parseExpected(17 /* CloseBraceToken */); + parseExpected(18 /* CloseBraceToken */); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(173 /* ArrayBindingPattern */); - parseExpected(20 /* OpenBracketToken */); + var node = createNode(175 /* ArrayBindingPattern */); + parseExpected(21 /* OpenBracketToken */); node.elements = parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement); - parseExpected(21 /* CloseBracketToken */); + parseExpected(22 /* CloseBracketToken */); return finishNode(node); } function isIdentifierOrPattern() { - return token() === 16 /* OpenBraceToken */ || token() === 20 /* OpenBracketToken */ || isIdentifier(); + return token() === 17 /* OpenBraceToken */ || token() === 21 /* OpenBracketToken */ || isIdentifier(); } function parseIdentifierOrPattern() { - if (token() === 20 /* OpenBracketToken */) { + if (token() === 21 /* OpenBracketToken */) { return parseArrayBindingPattern(); } - if (token() === 16 /* OpenBraceToken */) { + if (token() === 17 /* OpenBraceToken */) { return parseObjectBindingPattern(); } return parseIdentifier(); } function parseVariableDeclaration() { - var node = createNode(223 /* VariableDeclaration */); + var node = createNode(226 /* VariableDeclaration */); node.name = parseIdentifierOrPattern(); node.type = parseTypeAnnotation(); if (!isInOrOfKeyword(token())) { @@ -18261,14 +19205,14 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(224 /* VariableDeclarationList */); + var node = createNode(227 /* VariableDeclarationList */); switch (token()) { - case 103 /* VarKeyword */: + case 104 /* VarKeyword */: break; - case 109 /* LetKeyword */: + case 110 /* LetKeyword */: node.flags |= 1 /* Let */; break; - case 75 /* ConstKeyword */: + case 76 /* ConstKeyword */: node.flags |= 2 /* Const */; break; default: @@ -18284,7 +19228,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() === 140 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { + if (token() === 142 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -18296,10 +19240,10 @@ var ts; return finishNode(node); } function canFollowContextualOfKeyword() { - return nextTokenIsIdentifier() && nextToken() === 19 /* CloseParenToken */; + return nextTokenIsIdentifier() && nextToken() === 20 /* CloseParenToken */; } function parseVariableStatement(fullStart, decorators, modifiers) { - var node = createNode(205 /* VariableStatement */, fullStart); + var node = createNode(208 /* VariableStatement */, fullStart); node.decorators = decorators; node.modifiers = modifiers; node.declarationList = parseVariableDeclarationList(/*inForStatementInitializer*/ false); @@ -18307,29 +19251,29 @@ var ts; return addJSDocComment(finishNode(node)); } function parseFunctionDeclaration(fullStart, decorators, modifiers) { - var node = createNode(225 /* FunctionDeclaration */, fullStart); + var node = createNode(228 /* FunctionDeclaration */, fullStart); node.decorators = decorators; node.modifiers = modifiers; - parseExpected(88 /* FunctionKeyword */); - node.asteriskToken = parseOptionalToken(38 /* AsteriskToken */); + parseExpected(89 /* FunctionKeyword */); + node.asteriskToken = parseOptionalToken(39 /* AsteriskToken */); node.name = ts.hasModifier(node, 512 /* Default */) ? parseOptionalIdentifier() : parseIdentifier(); var isGenerator = !!node.asteriskToken; var isAsync = ts.hasModifier(node, 256 /* Async */); - fillSignature(55 /* ColonToken */, /*yieldContext*/ isGenerator, /*awaitContext*/ isAsync, /*requireCompleteParameterList*/ false, node); + fillSignature(56 /* ColonToken */, /*yieldContext*/ isGenerator, /*awaitContext*/ isAsync, /*requireCompleteParameterList*/ false, node); node.body = parseFunctionBlockOrSemicolon(isGenerator, isAsync, ts.Diagnostics.or_expected); return addJSDocComment(finishNode(node)); } function parseConstructorDeclaration(pos, decorators, modifiers) { - var node = createNode(150 /* Constructor */, pos); + var node = createNode(152 /* Constructor */, pos); node.decorators = decorators; node.modifiers = modifiers; - parseExpected(122 /* ConstructorKeyword */); - fillSignature(55 /* ColonToken */, /*yieldContext*/ false, /*awaitContext*/ false, /*requireCompleteParameterList*/ false, node); + parseExpected(123 /* ConstructorKeyword */); + fillSignature(56 /* ColonToken */, /*yieldContext*/ false, /*awaitContext*/ false, /*requireCompleteParameterList*/ false, node); node.body = parseFunctionBlockOrSemicolon(/*isGenerator*/ false, /*isAsync*/ false, ts.Diagnostics.or_expected); return addJSDocComment(finishNode(node)); } function parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, name, questionToken, diagnosticMessage) { - var method = createNode(149 /* MethodDeclaration */, fullStart); + var method = createNode(151 /* MethodDeclaration */, fullStart); method.decorators = decorators; method.modifiers = modifiers; method.asteriskToken = asteriskToken; @@ -18337,12 +19281,12 @@ var ts; method.questionToken = questionToken; var isGenerator = !!asteriskToken; var isAsync = ts.hasModifier(method, 256 /* Async */); - fillSignature(55 /* ColonToken */, /*yieldContext*/ isGenerator, /*awaitContext*/ isAsync, /*requireCompleteParameterList*/ false, method); + fillSignature(56 /* ColonToken */, /*yieldContext*/ isGenerator, /*awaitContext*/ isAsync, /*requireCompleteParameterList*/ false, method); method.body = parseFunctionBlockOrSemicolon(isGenerator, isAsync, diagnosticMessage); return addJSDocComment(finishNode(method)); } function parsePropertyDeclaration(fullStart, decorators, modifiers, name, questionToken) { - var property = createNode(147 /* PropertyDeclaration */, fullStart); + var property = createNode(149 /* PropertyDeclaration */, fullStart); property.decorators = decorators; property.modifiers = modifiers; property.name = name; @@ -18364,12 +19308,12 @@ var ts; return addJSDocComment(finishNode(property)); } function parsePropertyOrMethodDeclaration(fullStart, decorators, modifiers) { - var asteriskToken = parseOptionalToken(38 /* AsteriskToken */); + var asteriskToken = parseOptionalToken(39 /* AsteriskToken */); var name = parsePropertyName(); // Note: this is not legal as per the grammar. But we allow it in the parser and // report an error in the grammar checker. - var questionToken = parseOptionalToken(54 /* QuestionToken */); - if (asteriskToken || token() === 18 /* OpenParenToken */ || token() === 26 /* LessThanToken */) { + var questionToken = parseOptionalToken(55 /* QuestionToken */); + if (asteriskToken || token() === 19 /* OpenParenToken */ || token() === 27 /* LessThanToken */) { return parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, name, questionToken, ts.Diagnostics.or_expected); } else { @@ -18384,17 +19328,17 @@ var ts; node.decorators = decorators; node.modifiers = modifiers; node.name = parsePropertyName(); - fillSignature(55 /* ColonToken */, /*yieldContext*/ false, /*awaitContext*/ false, /*requireCompleteParameterList*/ false, node); + fillSignature(56 /* ColonToken */, /*yieldContext*/ false, /*awaitContext*/ false, /*requireCompleteParameterList*/ false, node); node.body = parseFunctionBlockOrSemicolon(/*isGenerator*/ false, /*isAsync*/ false); return addJSDocComment(finishNode(node)); } function isClassMemberModifier(idToken) { switch (idToken) { - case 113 /* PublicKeyword */: - case 111 /* PrivateKeyword */: - case 112 /* ProtectedKeyword */: - case 114 /* StaticKeyword */: - case 130 /* ReadonlyKeyword */: + case 114 /* PublicKeyword */: + case 112 /* PrivateKeyword */: + case 113 /* ProtectedKeyword */: + case 115 /* StaticKeyword */: + case 131 /* ReadonlyKeyword */: return true; default: return false; @@ -18402,7 +19346,7 @@ var ts; } function isClassMemberStart() { var idToken; - if (token() === 56 /* AtToken */) { + if (token() === 57 /* AtToken */) { return true; } // Eat up all modifiers, but hold on to the last one in case it is actually an identifier. @@ -18419,7 +19363,7 @@ var ts; } nextToken(); } - if (token() === 38 /* AsteriskToken */) { + if (token() === 39 /* AsteriskToken */) { return true; } // Try to get the first property-like token following all modifiers. @@ -18429,23 +19373,23 @@ var ts; nextToken(); } // Index signatures and computed properties are class members; we can parse. - if (token() === 20 /* OpenBracketToken */) { + if (token() === 21 /* OpenBracketToken */) { return true; } // 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 === 133 /* SetKeyword */ || idToken === 124 /* GetKeyword */) { + if (!ts.isKeyword(idToken) || idToken === 135 /* SetKeyword */ || idToken === 125 /* GetKeyword */) { return true; } // If it *is* a keyword, but not an accessor, check a little farther along // to see if it should actually be parsed as a class member. switch (token()) { - case 18 /* OpenParenToken */: // Method declaration - case 26 /* LessThanToken */: // Generic Method declaration - case 55 /* ColonToken */: // Type Annotation for declaration - case 57 /* EqualsToken */: // Initializer for declaration - case 54 /* QuestionToken */: + case 19 /* OpenParenToken */: // Method declaration + case 27 /* LessThanToken */: // Generic Method declaration + case 56 /* ColonToken */: // Type Annotation for declaration + case 58 /* EqualsToken */: // Initializer for declaration + case 55 /* QuestionToken */: return true; default: // Covers @@ -18462,10 +19406,10 @@ var ts; var decorators; while (true) { var decoratorStart = getNodePos(); - if (!parseOptional(56 /* AtToken */)) { + if (!parseOptional(57 /* AtToken */)) { break; } - var decorator = createNode(145 /* Decorator */, decoratorStart); + var decorator = createNode(147 /* Decorator */, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); finishNode(decorator); if (!decorators) { @@ -18492,7 +19436,7 @@ var ts; while (true) { var modifierStart = scanner.getStartPos(); var modifierKind = token(); - if (token() === 75 /* ConstKeyword */ && permitInvalidConstAsModifier) { + if (token() === 76 /* ConstKeyword */ && permitInvalidConstAsModifier) { // We need to ensure that any subsequent modifiers appear on the same line // so that when 'const' is a standalone declaration, we don't issue an error. if (!tryParse(nextTokenIsOnSameLineAndCanFollowModifier)) { @@ -18519,7 +19463,7 @@ var ts; } function parseModifiersForArrowFunction() { var modifiers; - if (token() === 119 /* AsyncKeyword */) { + if (token() === 120 /* AsyncKeyword */) { var modifierStart = scanner.getStartPos(); var modifierKind = token(); nextToken(); @@ -18530,8 +19474,8 @@ var ts; return modifiers; } function parseClassElement() { - if (token() === 24 /* SemicolonToken */) { - var result = createNode(203 /* SemicolonClassElement */); + if (token() === 25 /* SemicolonToken */) { + var result = createNode(206 /* SemicolonClassElement */); nextToken(); return finishNode(result); } @@ -18542,7 +19486,7 @@ var ts; if (accessor) { return accessor; } - if (token() === 122 /* ConstructorKeyword */) { + if (token() === 123 /* ConstructorKeyword */) { return parseConstructorDeclaration(fullStart, decorators, modifiers); } if (isIndexSignature()) { @@ -18553,14 +19497,14 @@ var ts; if (ts.tokenIsIdentifierOrKeyword(token()) || token() === 9 /* StringLiteral */ || token() === 8 /* NumericLiteral */ || - token() === 38 /* AsteriskToken */ || - token() === 20 /* OpenBracketToken */) { + token() === 39 /* AsteriskToken */ || + token() === 21 /* OpenBracketToken */) { return parsePropertyOrMethodDeclaration(fullStart, decorators, modifiers); } if (decorators || modifiers) { // treat this as a property declaration with a missing name. - var name_13 = createMissingNode(70 /* Identifier */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); - return parsePropertyDeclaration(fullStart, decorators, modifiers, name_13, /*questionToken*/ undefined); + var name = createMissingNode(71 /* Identifier */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); + return parsePropertyDeclaration(fullStart, decorators, modifiers, name, /*questionToken*/ undefined); } // 'isClassMemberStart' should have hinted not to attempt parsing. ts.Debug.fail("Should not have attempted to parse class member declaration."); @@ -18569,24 +19513,24 @@ var ts; return parseClassDeclarationOrExpression( /*fullStart*/ scanner.getStartPos(), /*decorators*/ undefined, - /*modifiers*/ undefined, 197 /* ClassExpression */); + /*modifiers*/ undefined, 199 /* ClassExpression */); } function parseClassDeclaration(fullStart, decorators, modifiers) { - return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 226 /* ClassDeclaration */); + return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 229 /* ClassDeclaration */); } function parseClassDeclarationOrExpression(fullStart, decorators, modifiers, kind) { var node = createNode(kind, fullStart); node.decorators = decorators; node.modifiers = modifiers; - parseExpected(74 /* ClassKeyword */); + parseExpected(75 /* ClassKeyword */); node.name = parseNameOfClassDeclarationOrExpression(); node.typeParameters = parseTypeParameters(); node.heritageClauses = parseHeritageClauses(); - if (parseExpected(16 /* OpenBraceToken */)) { + if (parseExpected(17 /* OpenBraceToken */)) { // ClassTail[Yield,Await] : (Modified) See 14.5 // ClassHeritage[?Yield,?Await]opt { ClassBody[?Yield,?Await]opt } node.members = parseClassMembers(); - parseExpected(17 /* CloseBraceToken */); + parseExpected(18 /* CloseBraceToken */); } else { node.members = createMissingList(); @@ -18604,7 +19548,7 @@ var ts; : undefined; } function isImplementsClause() { - return token() === 107 /* ImplementsKeyword */ && lookAhead(nextTokenIsIdentifierOrKeyword); + return token() === 108 /* ImplementsKeyword */ && lookAhead(nextTokenIsIdentifierOrKeyword); } function parseHeritageClauses() { // ClassTail[Yield,Await] : (Modified) See 14.5 @@ -18615,9 +19559,10 @@ var ts; return undefined; } function parseHeritageClause() { - if (token() === 84 /* ExtendsKeyword */ || token() === 107 /* ImplementsKeyword */) { - var node = createNode(255 /* HeritageClause */); - node.token = token(); + var tok = token(); + if (tok === 85 /* ExtendsKeyword */ || tok === 108 /* ImplementsKeyword */) { + var node = createNode(259 /* HeritageClause */); + node.token = tok; nextToken(); node.types = parseDelimitedList(7 /* HeritageClauseElement */, parseExpressionWithTypeArguments); return finishNode(node); @@ -18625,24 +19570,24 @@ var ts; return undefined; } function parseExpressionWithTypeArguments() { - var node = createNode(199 /* ExpressionWithTypeArguments */); + var node = createNode(201 /* ExpressionWithTypeArguments */); node.expression = parseLeftHandSideExpressionOrHigher(); - if (token() === 26 /* LessThanToken */) { - node.typeArguments = parseBracketedList(19 /* TypeArguments */, parseType, 26 /* LessThanToken */, 28 /* GreaterThanToken */); + if (token() === 27 /* LessThanToken */) { + node.typeArguments = parseBracketedList(19 /* TypeArguments */, parseType, 27 /* LessThanToken */, 29 /* GreaterThanToken */); } return finishNode(node); } function isHeritageClause() { - return token() === 84 /* ExtendsKeyword */ || token() === 107 /* ImplementsKeyword */; + return token() === 85 /* ExtendsKeyword */ || token() === 108 /* ImplementsKeyword */; } function parseClassMembers() { return parseList(5 /* ClassMembers */, parseClassElement); } function parseInterfaceDeclaration(fullStart, decorators, modifiers) { - var node = createNode(227 /* InterfaceDeclaration */, fullStart); + var node = createNode(230 /* InterfaceDeclaration */, fullStart); node.decorators = decorators; node.modifiers = modifiers; - parseExpected(108 /* InterfaceKeyword */); + parseExpected(109 /* InterfaceKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); node.heritageClauses = parseHeritageClauses(); @@ -18650,13 +19595,13 @@ var ts; return addJSDocComment(finishNode(node)); } function parseTypeAliasDeclaration(fullStart, decorators, modifiers) { - var node = createNode(228 /* TypeAliasDeclaration */, fullStart); + var node = createNode(231 /* TypeAliasDeclaration */, fullStart); node.decorators = decorators; node.modifiers = modifiers; - parseExpected(136 /* TypeKeyword */); + parseExpected(138 /* TypeKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); - parseExpected(57 /* EqualsToken */); + parseExpected(58 /* EqualsToken */); node.type = parseType(); parseSemicolon(); return addJSDocComment(finishNode(node)); @@ -18666,20 +19611,20 @@ 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 = createNode(260 /* EnumMember */, scanner.getStartPos()); + var node = createNode(264 /* EnumMember */, scanner.getStartPos()); node.name = parsePropertyName(); node.initializer = allowInAnd(parseNonParameterInitializer); return addJSDocComment(finishNode(node)); } function parseEnumDeclaration(fullStart, decorators, modifiers) { - var node = createNode(229 /* EnumDeclaration */, fullStart); + var node = createNode(232 /* EnumDeclaration */, fullStart); node.decorators = decorators; node.modifiers = modifiers; - parseExpected(82 /* EnumKeyword */); + parseExpected(83 /* EnumKeyword */); node.name = parseIdentifier(); - if (parseExpected(16 /* OpenBraceToken */)) { + if (parseExpected(17 /* OpenBraceToken */)) { node.members = parseDelimitedList(6 /* EnumMembers */, parseEnumMember); - parseExpected(17 /* CloseBraceToken */); + parseExpected(18 /* CloseBraceToken */); } else { node.members = createMissingList(); @@ -18687,10 +19632,10 @@ var ts; return addJSDocComment(finishNode(node)); } function parseModuleBlock() { - var node = createNode(231 /* ModuleBlock */, scanner.getStartPos()); - if (parseExpected(16 /* OpenBraceToken */)) { + var node = createNode(234 /* ModuleBlock */, scanner.getStartPos()); + if (parseExpected(17 /* OpenBraceToken */)) { node.statements = parseList(1 /* BlockStatements */, parseStatement); - parseExpected(17 /* CloseBraceToken */); + parseExpected(18 /* CloseBraceToken */); } else { node.statements = createMissingList(); @@ -18698,7 +19643,7 @@ var ts; return finishNode(node); } function parseModuleOrNamespaceDeclaration(fullStart, decorators, modifiers, flags) { - var node = createNode(230 /* ModuleDeclaration */, fullStart); + var node = createNode(233 /* ModuleDeclaration */, fullStart); // 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 */; @@ -18706,16 +19651,16 @@ var ts; node.modifiers = modifiers; node.flags |= flags; node.name = parseIdentifier(); - node.body = parseOptional(22 /* DotToken */) + node.body = parseOptional(23 /* DotToken */) ? parseModuleOrNamespaceDeclaration(getNodePos(), /*decorators*/ undefined, /*modifiers*/ undefined, 4 /* NestedNamespace */ | namespaceFlag) : parseModuleBlock(); return addJSDocComment(finishNode(node)); } function parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) { - var node = createNode(230 /* ModuleDeclaration */, fullStart); + var node = createNode(233 /* ModuleDeclaration */, fullStart); node.decorators = decorators; node.modifiers = modifiers; - if (token() === 139 /* GlobalKeyword */) { + if (token() === 141 /* GlobalKeyword */) { // parse 'global' as name of global scope augmentation node.name = parseIdentifier(); node.flags |= 512 /* GlobalAugmentation */; @@ -18723,7 +19668,7 @@ var ts; else { node.name = parseLiteralNode(/*internName*/ true); } - if (token() === 16 /* OpenBraceToken */) { + if (token() === 17 /* OpenBraceToken */) { node.body = parseModuleBlock(); } else { @@ -18733,15 +19678,15 @@ var ts; } function parseModuleDeclaration(fullStart, decorators, modifiers) { var flags = 0; - if (token() === 139 /* GlobalKeyword */) { + if (token() === 141 /* GlobalKeyword */) { // global augmentation return parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers); } - else if (parseOptional(128 /* NamespaceKeyword */)) { + else if (parseOptional(129 /* NamespaceKeyword */)) { flags |= 16 /* Namespace */; } else { - parseExpected(127 /* ModuleKeyword */); + parseExpected(128 /* ModuleKeyword */); if (token() === 9 /* StringLiteral */) { return parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers); } @@ -18749,62 +19694,62 @@ var ts; return parseModuleOrNamespaceDeclaration(fullStart, decorators, modifiers, flags); } function isExternalModuleReference() { - return token() === 131 /* RequireKeyword */ && + return token() === 132 /* RequireKeyword */ && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { - return nextToken() === 18 /* OpenParenToken */; + return nextToken() === 19 /* OpenParenToken */; } function nextTokenIsSlash() { - return nextToken() === 40 /* SlashToken */; + return nextToken() === 41 /* SlashToken */; } function parseNamespaceExportDeclaration(fullStart, decorators, modifiers) { - var exportDeclaration = createNode(233 /* NamespaceExportDeclaration */, fullStart); + var exportDeclaration = createNode(236 /* NamespaceExportDeclaration */, fullStart); exportDeclaration.decorators = decorators; exportDeclaration.modifiers = modifiers; - parseExpected(117 /* AsKeyword */); - parseExpected(128 /* NamespaceKeyword */); + parseExpected(118 /* AsKeyword */); + parseExpected(129 /* NamespaceKeyword */); exportDeclaration.name = parseIdentifier(); parseSemicolon(); return finishNode(exportDeclaration); } function parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers) { - parseExpected(90 /* ImportKeyword */); + parseExpected(91 /* ImportKeyword */); var afterImportPos = scanner.getStartPos(); var identifier; if (isIdentifier()) { identifier = parseIdentifier(); - if (token() !== 25 /* CommaToken */ && token() !== 138 /* FromKeyword */) { - // ImportEquals declaration of type: - // import x = require("mod"); or - // import x = M.x; - var importEqualsDeclaration = createNode(234 /* ImportEqualsDeclaration */, fullStart); - importEqualsDeclaration.decorators = decorators; - importEqualsDeclaration.modifiers = modifiers; - importEqualsDeclaration.name = identifier; - parseExpected(57 /* EqualsToken */); - importEqualsDeclaration.moduleReference = parseModuleReference(); - parseSemicolon(); - return addJSDocComment(finishNode(importEqualsDeclaration)); + if (token() !== 26 /* CommaToken */ && token() !== 140 /* FromKeyword */) { + return parseImportEqualsDeclaration(fullStart, decorators, modifiers, identifier); } } // Import statement - var importDeclaration = createNode(235 /* ImportDeclaration */, fullStart); + var importDeclaration = createNode(238 /* ImportDeclaration */, fullStart); importDeclaration.decorators = decorators; importDeclaration.modifiers = modifiers; // ImportDeclaration: // import ImportClause from ModuleSpecifier ; // import ModuleSpecifier; if (identifier || - token() === 38 /* AsteriskToken */ || - token() === 16 /* OpenBraceToken */) { + token() === 39 /* AsteriskToken */ || + token() === 17 /* OpenBraceToken */) { importDeclaration.importClause = parseImportClause(identifier, afterImportPos); - parseExpected(138 /* FromKeyword */); + parseExpected(140 /* FromKeyword */); } importDeclaration.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); return finishNode(importDeclaration); } + function parseImportEqualsDeclaration(fullStart, decorators, modifiers, identifier) { + var importEqualsDeclaration = createNode(237 /* ImportEqualsDeclaration */, fullStart); + importEqualsDeclaration.decorators = decorators; + importEqualsDeclaration.modifiers = modifiers; + importEqualsDeclaration.name = identifier; + parseExpected(58 /* EqualsToken */); + importEqualsDeclaration.moduleReference = parseModuleReference(); + parseSemicolon(); + return addJSDocComment(finishNode(importEqualsDeclaration)); + } function parseImportClause(identifier, fullStart) { // ImportClause: // ImportedDefaultBinding @@ -18812,7 +19757,7 @@ var ts; // NamedImports // ImportedDefaultBinding, NameSpaceImport // ImportedDefaultBinding, NamedImports - var importClause = createNode(236 /* ImportClause */, fullStart); + var importClause = createNode(239 /* ImportClause */, fullStart); if (identifier) { // ImportedDefaultBinding: // ImportedBinding @@ -18821,8 +19766,8 @@ var ts; // If there was no default import or if there is comma token after default import // parse namespace or named imports if (!importClause.name || - parseOptional(25 /* CommaToken */)) { - importClause.namedBindings = token() === 38 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(238 /* NamedImports */); + parseOptional(26 /* CommaToken */)) { + importClause.namedBindings = token() === 39 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(241 /* NamedImports */); } return finishNode(importClause); } @@ -18832,11 +19777,11 @@ var ts; : parseEntityName(/*allowReservedWords*/ false); } function parseExternalModuleReference() { - var node = createNode(245 /* ExternalModuleReference */); - parseExpected(131 /* RequireKeyword */); - parseExpected(18 /* OpenParenToken */); + var node = createNode(248 /* ExternalModuleReference */); + parseExpected(132 /* RequireKeyword */); + parseExpected(19 /* OpenParenToken */); node.expression = parseModuleSpecifier(); - parseExpected(19 /* CloseParenToken */); + parseExpected(20 /* CloseParenToken */); return finishNode(node); } function parseModuleSpecifier() { @@ -18855,9 +19800,9 @@ var ts; function parseNamespaceImport() { // NameSpaceImport: // * as ImportedBinding - var namespaceImport = createNode(237 /* NamespaceImport */); - parseExpected(38 /* AsteriskToken */); - parseExpected(117 /* AsKeyword */); + var namespaceImport = createNode(240 /* NamespaceImport */); + parseExpected(39 /* AsteriskToken */); + parseExpected(118 /* AsKeyword */); namespaceImport.name = parseIdentifier(); return finishNode(namespaceImport); } @@ -18870,14 +19815,14 @@ var ts; // ImportsList: // ImportSpecifier // ImportsList, ImportSpecifier - node.elements = parseBracketedList(22 /* ImportOrExportSpecifiers */, kind === 238 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 16 /* OpenBraceToken */, 17 /* CloseBraceToken */); + node.elements = parseBracketedList(22 /* ImportOrExportSpecifiers */, kind === 241 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 17 /* OpenBraceToken */, 18 /* CloseBraceToken */); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(243 /* ExportSpecifier */); + return parseImportOrExportSpecifier(246 /* ExportSpecifier */); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(239 /* ImportSpecifier */); + return parseImportOrExportSpecifier(242 /* ImportSpecifier */); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -18891,9 +19836,9 @@ var ts; var checkIdentifierStart = scanner.getTokenPos(); var checkIdentifierEnd = scanner.getTextPos(); var identifierName = parseIdentifierName(); - if (token() === 117 /* AsKeyword */) { + if (token() === 118 /* AsKeyword */) { node.propertyName = identifierName; - parseExpected(117 /* AsKeyword */); + parseExpected(118 /* AsKeyword */); checkIdentifierIsKeyword = ts.isKeyword(token()) && !isIdentifier(); checkIdentifierStart = scanner.getTokenPos(); checkIdentifierEnd = scanner.getTextPos(); @@ -18902,27 +19847,27 @@ var ts; else { node.name = identifierName; } - if (kind === 239 /* ImportSpecifier */ && checkIdentifierIsKeyword) { + if (kind === 242 /* ImportSpecifier */ && checkIdentifierIsKeyword) { // Report error identifier expected parseErrorAtPosition(checkIdentifierStart, checkIdentifierEnd - checkIdentifierStart, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseExportDeclaration(fullStart, decorators, modifiers) { - var node = createNode(241 /* ExportDeclaration */, fullStart); + var node = createNode(244 /* ExportDeclaration */, fullStart); node.decorators = decorators; node.modifiers = modifiers; - if (parseOptional(38 /* AsteriskToken */)) { - parseExpected(138 /* FromKeyword */); + if (parseOptional(39 /* AsteriskToken */)) { + parseExpected(140 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(242 /* NamedExports */); + node.exportClause = parseNamedImportsOrExports(245 /* 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() === 138 /* FromKeyword */ || (token() === 9 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { - parseExpected(138 /* FromKeyword */); + if (token() === 140 /* FromKeyword */ || (token() === 9 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { + parseExpected(140 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } } @@ -18930,14 +19875,14 @@ var ts; return finishNode(node); } function parseExportAssignment(fullStart, decorators, modifiers) { - var node = createNode(240 /* ExportAssignment */, fullStart); + var node = createNode(243 /* ExportAssignment */, fullStart); node.decorators = decorators; node.modifiers = modifiers; - if (parseOptional(57 /* EqualsToken */)) { + if (parseOptional(58 /* EqualsToken */)) { node.isExportEquals = true; } else { - parseExpected(78 /* DefaultKeyword */); + parseExpected(79 /* DefaultKeyword */); } node.expression = parseAssignmentExpressionOrHigher(); parseSemicolon(); @@ -18949,6 +19894,7 @@ var ts; 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. @@ -18962,7 +19908,11 @@ var ts; break; } } - var range = { pos: triviaScanner.getTokenPos(), end: triviaScanner.getTextPos(), kind: triviaScanner.getToken() }; + 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) { @@ -19002,20 +19952,30 @@ var ts; amdDependencies.push(amdDependency); } } + var checkJsDirectiveRegEx = /^\/\/\/?\s*(@ts-check|@ts-nocheck)\s*$/gim; + var checkJsDirectiveMatchResult = checkJsDirectiveRegEx.exec(comment); + if (checkJsDirectiveMatchResult) { + checkJsDirective = { + enabled: ts.compareStrings(checkJsDirectiveMatchResult[1], "@ts-check", /*ignoreCase*/ true) === 0 /* EqualTo */, + end: range.end, + pos: range.pos + }; + } } } sourceFile.referencedFiles = referencedFiles; sourceFile.typeReferenceDirectives = typeReferenceDirectives; sourceFile.amdDependencies = amdDependencies; sourceFile.moduleName = amdModuleName; + sourceFile.checkJsDirective = checkJsDirective; } function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { return ts.hasModifier(node, 1 /* Export */) - || node.kind === 234 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 245 /* ExternalModuleReference */ - || node.kind === 235 /* ImportDeclaration */ - || node.kind === 240 /* ExportAssignment */ - || node.kind === 241 /* ExportDeclaration */ + || node.kind === 237 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 248 /* ExternalModuleReference */ + || node.kind === 238 /* ImportDeclaration */ + || node.kind === 243 /* ExportAssignment */ + || node.kind === 244 /* ExportDeclaration */ ? node : undefined; }); @@ -19061,16 +20021,16 @@ var ts; (function (JSDocParser) { function isJSDocType() { switch (token()) { - case 38 /* AsteriskToken */: - case 54 /* QuestionToken */: - case 18 /* OpenParenToken */: - case 20 /* OpenBracketToken */: - case 50 /* ExclamationToken */: - case 16 /* OpenBraceToken */: - case 88 /* FunctionKeyword */: - case 23 /* DotDotDotToken */: - case 93 /* NewKeyword */: - case 98 /* ThisKeyword */: + case 39 /* AsteriskToken */: + case 55 /* QuestionToken */: + case 19 /* OpenParenToken */: + case 21 /* OpenBracketToken */: + case 51 /* ExclamationToken */: + case 17 /* OpenBraceToken */: + case 89 /* FunctionKeyword */: + case 24 /* DotDotDotToken */: + case 94 /* NewKeyword */: + case 99 /* ThisKeyword */: return true; } return ts.tokenIsIdentifierOrKeyword(token()); @@ -19090,23 +20050,23 @@ var ts; // Parses out a JSDoc type expression. /* @internal */ function parseJSDocTypeExpression() { - var result = createNode(262 /* JSDocTypeExpression */, scanner.getTokenPos()); - parseExpected(16 /* OpenBraceToken */); + var result = createNode(267 /* JSDocTypeExpression */, scanner.getTokenPos()); + parseExpected(17 /* OpenBraceToken */); result.type = parseJSDocTopLevelType(); - parseExpected(17 /* CloseBraceToken */); + parseExpected(18 /* CloseBraceToken */); fixupParentReferences(result); return finishNode(result); } JSDocParser.parseJSDocTypeExpression = parseJSDocTypeExpression; function parseJSDocTopLevelType() { var type = parseJSDocType(); - if (token() === 48 /* BarToken */) { - var unionType = createNode(266 /* JSDocUnionType */, type.pos); + if (token() === 49 /* BarToken */) { + var unionType = createNode(271 /* JSDocUnionType */, type.pos); unionType.types = parseJSDocTypeList(type); type = finishNode(unionType); } - if (token() === 57 /* EqualsToken */) { - var optionalType = createNode(273 /* JSDocOptionalType */, type.pos); + if (token() === 58 /* EqualsToken */) { + var optionalType = createNode(278 /* JSDocOptionalType */, type.pos); nextToken(); optionalType.type = type; type = finishNode(optionalType); @@ -19116,21 +20076,21 @@ var ts; function parseJSDocType() { var type = parseBasicTypeExpression(); while (true) { - if (token() === 20 /* OpenBracketToken */) { - var arrayType = createNode(265 /* JSDocArrayType */, type.pos); + if (token() === 21 /* OpenBracketToken */) { + var arrayType = createNode(270 /* JSDocArrayType */, type.pos); arrayType.elementType = type; nextToken(); - parseExpected(21 /* CloseBracketToken */); + parseExpected(22 /* CloseBracketToken */); type = finishNode(arrayType); } - else if (token() === 54 /* QuestionToken */) { - var nullableType = createNode(268 /* JSDocNullableType */, type.pos); + else if (token() === 55 /* QuestionToken */) { + var nullableType = createNode(273 /* JSDocNullableType */, type.pos); nullableType.type = type; nextToken(); type = finishNode(nullableType); } - else if (token() === 50 /* ExclamationToken */) { - var nonNullableType = createNode(269 /* JSDocNonNullableType */, type.pos); + else if (token() === 51 /* ExclamationToken */) { + var nonNullableType = createNode(274 /* JSDocNonNullableType */, type.pos); nonNullableType.type = type; nextToken(); type = finishNode(nonNullableType); @@ -19143,95 +20103,96 @@ var ts; } function parseBasicTypeExpression() { switch (token()) { - case 38 /* AsteriskToken */: + case 39 /* AsteriskToken */: return parseJSDocAllType(); - case 54 /* QuestionToken */: + case 55 /* QuestionToken */: return parseJSDocUnknownOrNullableType(); - case 18 /* OpenParenToken */: + case 19 /* OpenParenToken */: return parseJSDocUnionType(); - case 20 /* OpenBracketToken */: + case 21 /* OpenBracketToken */: return parseJSDocTupleType(); - case 50 /* ExclamationToken */: + case 51 /* ExclamationToken */: return parseJSDocNonNullableType(); - case 16 /* OpenBraceToken */: + case 17 /* OpenBraceToken */: return parseJSDocRecordType(); - case 88 /* FunctionKeyword */: + case 89 /* FunctionKeyword */: return parseJSDocFunctionType(); - case 23 /* DotDotDotToken */: + case 24 /* DotDotDotToken */: return parseJSDocVariadicType(); - case 93 /* NewKeyword */: + case 94 /* NewKeyword */: return parseJSDocConstructorType(); - case 98 /* ThisKeyword */: + case 99 /* ThisKeyword */: return parseJSDocThisType(); - case 118 /* AnyKeyword */: - case 134 /* StringKeyword */: - case 132 /* NumberKeyword */: - case 121 /* BooleanKeyword */: - case 135 /* SymbolKeyword */: - case 104 /* VoidKeyword */: - case 94 /* NullKeyword */: - case 137 /* UndefinedKeyword */: - case 129 /* NeverKeyword */: + case 119 /* AnyKeyword */: + case 136 /* StringKeyword */: + case 133 /* NumberKeyword */: + case 122 /* BooleanKeyword */: + case 137 /* SymbolKeyword */: + case 105 /* VoidKeyword */: + case 95 /* NullKeyword */: + case 139 /* UndefinedKeyword */: + case 130 /* NeverKeyword */: + case 134 /* ObjectKeyword */: return parseTokenNode(); case 9 /* StringLiteral */: case 8 /* NumericLiteral */: - case 100 /* TrueKeyword */: - case 85 /* FalseKeyword */: + case 101 /* TrueKeyword */: + case 86 /* FalseKeyword */: return parseJSDocLiteralType(); } return parseJSDocTypeReference(); } function parseJSDocThisType() { - var result = createNode(277 /* JSDocThisType */); + var result = createNode(282 /* JSDocThisType */); nextToken(); - parseExpected(55 /* ColonToken */); + parseExpected(56 /* ColonToken */); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocConstructorType() { - var result = createNode(276 /* JSDocConstructorType */); + var result = createNode(281 /* JSDocConstructorType */); nextToken(); - parseExpected(55 /* ColonToken */); + parseExpected(56 /* ColonToken */); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocVariadicType() { - var result = createNode(275 /* JSDocVariadicType */); + var result = createNode(280 /* JSDocVariadicType */); nextToken(); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocFunctionType() { - var result = createNode(274 /* JSDocFunctionType */); + var result = createNode(279 /* JSDocFunctionType */); nextToken(); - parseExpected(18 /* OpenParenToken */); + parseExpected(19 /* OpenParenToken */); result.parameters = parseDelimitedList(23 /* JSDocFunctionParameters */, parseJSDocParameter); checkForTrailingComma(result.parameters); - parseExpected(19 /* CloseParenToken */); - if (token() === 55 /* ColonToken */) { + parseExpected(20 /* CloseParenToken */); + if (token() === 56 /* ColonToken */) { nextToken(); result.type = parseJSDocType(); } return finishNode(result); } function parseJSDocParameter() { - var parameter = createNode(144 /* Parameter */); + var parameter = createNode(146 /* Parameter */); parameter.type = parseJSDocType(); - if (parseOptional(57 /* EqualsToken */)) { + if (parseOptional(58 /* EqualsToken */)) { // TODO(rbuckton): Can this be changed to SyntaxKind.QuestionToken? - parameter.questionToken = createNode(57 /* EqualsToken */); + parameter.questionToken = createNode(58 /* EqualsToken */); } return finishNode(parameter); } function parseJSDocTypeReference() { - var result = createNode(272 /* JSDocTypeReference */); + var result = createNode(277 /* JSDocTypeReference */); result.name = parseSimplePropertyName(); - if (token() === 26 /* LessThanToken */) { + if (token() === 27 /* LessThanToken */) { result.typeArguments = parseTypeArguments(); } else { - while (parseOptional(22 /* DotToken */)) { - if (token() === 26 /* LessThanToken */) { + while (parseOptional(23 /* DotToken */)) { + if (token() === 27 /* LessThanToken */) { result.typeArguments = parseTypeArguments(); break; } @@ -19248,7 +20209,7 @@ var ts; var typeArguments = parseDelimitedList(24 /* JSDocTypeArguments */, parseJSDocType); checkForTrailingComma(typeArguments); checkForEmptyTypeArgumentList(typeArguments); - parseExpected(28 /* GreaterThanToken */); + parseExpected(29 /* GreaterThanToken */); return typeArguments; } function checkForEmptyTypeArgumentList(typeArguments) { @@ -19259,28 +20220,28 @@ var ts; } } function parseQualifiedName(left) { - var result = createNode(141 /* QualifiedName */, left.pos); + var result = createNode(143 /* QualifiedName */, left.pos); result.left = left; result.right = parseIdentifierName(); return finishNode(result); } function parseJSDocRecordType() { - var result = createNode(270 /* JSDocRecordType */); + var result = createNode(275 /* JSDocRecordType */); result.literal = parseTypeLiteral(); return finishNode(result); } function parseJSDocNonNullableType() { - var result = createNode(269 /* JSDocNonNullableType */); + var result = createNode(274 /* JSDocNonNullableType */); nextToken(); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocTupleType() { - var result = createNode(267 /* JSDocTupleType */); + var result = createNode(272 /* JSDocTupleType */); nextToken(); result.types = parseDelimitedList(26 /* JSDocTupleTypes */, parseJSDocType); checkForTrailingComma(result.types); - parseExpected(21 /* CloseBracketToken */); + parseExpected(22 /* CloseBracketToken */); return finishNode(result); } function checkForTrailingComma(list) { @@ -19290,28 +20251,28 @@ var ts; } } function parseJSDocUnionType() { - var result = createNode(266 /* JSDocUnionType */); + var result = createNode(271 /* JSDocUnionType */); nextToken(); result.types = parseJSDocTypeList(parseJSDocType()); - parseExpected(19 /* CloseParenToken */); + parseExpected(20 /* CloseParenToken */); return finishNode(result); } function parseJSDocTypeList(firstType) { ts.Debug.assert(!!firstType); var types = createNodeArray([firstType], firstType.pos); - while (parseOptional(48 /* BarToken */)) { + while (parseOptional(49 /* BarToken */)) { types.push(parseJSDocType()); } types.end = scanner.getStartPos(); return types; } function parseJSDocAllType() { - var result = createNode(263 /* JSDocAllType */); + var result = createNode(268 /* JSDocAllType */); nextToken(); return finishNode(result); } function parseJSDocLiteralType() { - var result = createNode(288 /* JSDocLiteralType */); + var result = createNode(293 /* JSDocLiteralType */); result.literal = parseLiteralTypeNode(); return finishNode(result); } @@ -19328,17 +20289,17 @@ var ts; // Foo // Foo(?= // (?| - if (token() === 25 /* CommaToken */ || - token() === 17 /* CloseBraceToken */ || - token() === 19 /* CloseParenToken */ || - token() === 28 /* GreaterThanToken */ || - token() === 57 /* EqualsToken */ || - token() === 48 /* BarToken */) { - var result = createNode(264 /* JSDocUnknownType */, pos); + if (token() === 26 /* CommaToken */ || + token() === 18 /* CloseBraceToken */ || + token() === 20 /* CloseParenToken */ || + token() === 29 /* GreaterThanToken */ || + token() === 58 /* EqualsToken */ || + token() === 49 /* BarToken */) { + var result = createNode(269 /* JSDocUnknownType */, pos); return finishNode(result); } else { - var result = createNode(268 /* JSDocNullableType */, pos); + var result = createNode(273 /* JSDocNullableType */, pos); result.type = parseJSDocType(); return finishNode(result); } @@ -19414,7 +20375,7 @@ var ts; } while (token() !== 1 /* EndOfFileToken */) { switch (token()) { - case 56 /* AtToken */: + case 57 /* AtToken */: if (state === 0 /* BeginningOfLine */ || state === 1 /* SawAsterisk */) { removeTrailingNewlines(comments); parseTag(indent); @@ -19435,7 +20396,7 @@ var ts; state = 0 /* BeginningOfLine */; indent = 0; break; - case 38 /* AsteriskToken */: + case 39 /* AsteriskToken */: var asterisk = scanner.getTokenText(); if (state === 1 /* SawAsterisk */ || state === 2 /* SavingComments */) { // If we've already seen an asterisk, then we can no longer parse a tag on this line @@ -19448,7 +20409,7 @@ var ts; indent += asterisk.length; } break; - case 70 /* Identifier */: + case 71 /* Identifier */: // Anything else is doc comment text. We just save it. Because it // wasn't a tag, we can no longer parse a tag on this line until we hit the next // line break. @@ -19503,7 +20464,7 @@ var ts; content.charCodeAt(start + 3) !== 42 /* asterisk */; } function createJSDocComment() { - var result = createNode(278 /* JSDocComment */, start); + var result = createNode(283 /* JSDocComment */, start); result.tags = tags; result.comment = comments.length ? comments.join("") : undefined; return finishNode(result, end); @@ -19514,8 +20475,8 @@ var ts; } } function parseTag(indent) { - ts.Debug.assert(token() === 56 /* AtToken */); - var atToken = createNode(56 /* AtToken */, scanner.getTokenPos()); + ts.Debug.assert(token() === 57 /* AtToken */); + var atToken = createNode(57 /* AtToken */, scanner.getTokenPos()); atToken.end = scanner.getTextPos(); nextJSDocToken(); var tagName = parseJSDocIdentifierName(); @@ -19570,7 +20531,7 @@ var ts; comments.push(text); indent += text.length; } - while (token() !== 56 /* AtToken */ && token() !== 1 /* EndOfFileToken */) { + while (token() !== 57 /* AtToken */ && token() !== 1 /* EndOfFileToken */) { switch (token()) { case 4 /* NewLineTrivia */: if (state >= 1 /* SawAsterisk */) { @@ -19579,7 +20540,7 @@ var ts; } indent = 0; break; - case 56 /* AtToken */: + case 57 /* AtToken */: // Done break; case 5 /* WhitespaceTrivia */: @@ -19595,20 +20556,21 @@ var ts; indent += whitespace.length; } break; - case 38 /* AsteriskToken */: + case 39 /* AsteriskToken */: if (state === 0 /* BeginningOfLine */) { // leading asterisks start recording on the *next* (non-whitespace) token state = 1 /* SawAsterisk */; indent += scanner.getTokenText().length; break; } - // FALLTHROUGH otherwise to record the * as a comment + // record the * as a comment + // falls through default: state = 2 /* SavingComments */; // leading identifiers start recording as well pushComment(scanner.getTokenText()); break; } - if (token() === 56 /* AtToken */) { + if (token() === 57 /* AtToken */) { // Done break; } @@ -19619,7 +20581,7 @@ var ts; return comments; } function parseUnknownTag(atToken, tagName) { - var result = createNode(279 /* JSDocTag */, atToken.pos); + var result = createNode(284 /* JSDocTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; return finishNode(result); @@ -19637,7 +20599,7 @@ var ts; function tryParseTypeExpression() { return tryParse(function () { skipWhitespace(); - if (token() !== 16 /* OpenBraceToken */) { + if (token() !== 17 /* OpenBraceToken */) { return undefined; } return parseJSDocTypeExpression(); @@ -19649,15 +20611,15 @@ var ts; var name; var isBracketed; // Looking for something like '[foo]' or 'foo' - if (parseOptionalToken(20 /* OpenBracketToken */)) { + if (parseOptionalToken(21 /* OpenBracketToken */)) { name = parseJSDocIdentifierName(); skipWhitespace(); isBracketed = true; // May have an optional default, e.g. '[foo = 42]' - if (parseOptionalToken(57 /* EqualsToken */)) { + if (parseOptionalToken(58 /* EqualsToken */)) { parseExpression(); } - parseExpected(21 /* CloseBracketToken */); + parseExpected(22 /* CloseBracketToken */); } else if (ts.tokenIsIdentifierOrKeyword(token())) { name = parseJSDocIdentifierName(); @@ -19676,7 +20638,7 @@ var ts; if (!typeExpression) { typeExpression = tryParseTypeExpression(); } - var result = createNode(281 /* JSDocParameterTag */, atToken.pos); + var result = createNode(286 /* JSDocParameterTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.preParameterName = preName; @@ -19687,20 +20649,20 @@ var ts; return finishNode(result); } function parseReturnTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 282 /* JSDocReturnTag */; })) { + if (ts.forEach(tags, function (t) { return t.kind === 287 /* JSDocReturnTag */; })) { parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } - var result = createNode(282 /* JSDocReturnTag */, atToken.pos); + var result = createNode(287 /* JSDocReturnTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result); } function parseTypeTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 283 /* JSDocTypeTag */; })) { + if (ts.forEach(tags, function (t) { return t.kind === 288 /* JSDocTypeTag */; })) { parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } - var result = createNode(283 /* JSDocTypeTag */, atToken.pos); + var result = createNode(288 /* JSDocTypeTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); @@ -19715,7 +20677,7 @@ var ts; parseErrorAtPosition(scanner.getStartPos(), /*length*/ 0, ts.Diagnostics.Identifier_expected); return undefined; } - var result = createNode(286 /* JSDocPropertyTag */, atToken.pos); + var result = createNode(291 /* JSDocPropertyTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.name = name; @@ -19724,7 +20686,7 @@ var ts; } function parseAugmentsTag(atToken, tagName) { var typeExpression = tryParseTypeExpression(); - var result = createNode(280 /* JSDocAugmentsTag */, atToken.pos); + var result = createNode(285 /* JSDocAugmentsTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = typeExpression; @@ -19733,25 +20695,30 @@ var ts; function parseTypedefTag(atToken, tagName) { var typeExpression = tryParseTypeExpression(); skipWhitespace(); - var typedefTag = createNode(285 /* JSDocTypedefTag */, atToken.pos); + var typedefTag = createNode(290 /* JSDocTypedefTag */, atToken.pos); typedefTag.atToken = atToken; typedefTag.tagName = tagName; typedefTag.fullName = parseJSDocTypeNameWithNamespace(/*flags*/ 0); if (typedefTag.fullName) { var rightNode = typedefTag.fullName; - while (rightNode.kind !== 70 /* Identifier */) { + while (true) { + if (rightNode.kind === 71 /* Identifier */ || !rightNode.body) { + // if node is identifier - use it as name + // otherwise use name of the rightmost part that we were able to parse + typedefTag.name = rightNode.kind === 71 /* Identifier */ ? rightNode : rightNode.name; + break; + } rightNode = rightNode.body; } - typedefTag.name = rightNode; } typedefTag.typeExpression = typeExpression; skipWhitespace(); if (typeExpression) { - if (typeExpression.type.kind === 272 /* JSDocTypeReference */) { + if (typeExpression.type.kind === 277 /* JSDocTypeReference */) { var jsDocTypeReference = typeExpression.type; - if (jsDocTypeReference.name.kind === 70 /* Identifier */) { - var name_14 = jsDocTypeReference.name; - if (name_14.text === "Object") { + if (jsDocTypeReference.name.kind === 71 /* Identifier */) { + var name = jsDocTypeReference.name; + if (name.text === "Object") { typedefTag.jsDocTypeLiteral = scanChildTags(); } } @@ -19765,7 +20732,7 @@ var ts; } return finishNode(typedefTag); function scanChildTags() { - var jsDocTypeLiteral = createNode(287 /* JSDocTypeLiteral */, scanner.getStartPos()); + var jsDocTypeLiteral = createNode(292 /* JSDocTypeLiteral */, scanner.getStartPos()); var resumePos = scanner.getStartPos(); var canParseTag = true; var seenAsterisk = false; @@ -19773,7 +20740,7 @@ var ts; while (token() !== 1 /* EndOfFileToken */ && !parentTagTerminated) { nextJSDocToken(); switch (token()) { - case 56 /* AtToken */: + case 57 /* AtToken */: if (canParseTag) { parentTagTerminated = !tryParseChildTag(jsDocTypeLiteral); if (!parentTagTerminated) { @@ -19787,14 +20754,15 @@ var ts; canParseTag = true; seenAsterisk = false; break; - case 38 /* AsteriskToken */: + case 39 /* AsteriskToken */: if (seenAsterisk) { canParseTag = false; } seenAsterisk = true; break; - case 70 /* Identifier */: + case 71 /* Identifier */: canParseTag = false; + break; case 1 /* EndOfFileToken */: break; } @@ -19805,8 +20773,8 @@ var ts; function parseJSDocTypeNameWithNamespace(flags) { var pos = scanner.getTokenPos(); var typeNameOrNamespaceName = parseJSDocIdentifierName(); - if (typeNameOrNamespaceName && parseOptional(22 /* DotToken */)) { - var jsDocNamespaceNode = createNode(230 /* ModuleDeclaration */, pos); + if (typeNameOrNamespaceName && parseOptional(23 /* DotToken */)) { + var jsDocNamespaceNode = createNode(233 /* ModuleDeclaration */, pos); jsDocNamespaceNode.flags |= flags; jsDocNamespaceNode.name = typeNameOrNamespaceName; jsDocNamespaceNode.body = parseJSDocTypeNameWithNamespace(4 /* NestedNamespace */); @@ -19819,8 +20787,8 @@ var ts; } } function tryParseChildTag(parentTag) { - ts.Debug.assert(token() === 56 /* AtToken */); - var atToken = createNode(56 /* AtToken */, scanner.getStartPos()); + ts.Debug.assert(token() === 57 /* AtToken */); + var atToken = createNode(57 /* AtToken */, scanner.getStartPos()); atToken.end = scanner.getTextPos(); nextJSDocToken(); var tagName = parseJSDocIdentifierName(); @@ -19852,23 +20820,23 @@ var ts; return false; } function parseTemplateTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 284 /* JSDocTemplateTag */; })) { + if (ts.forEach(tags, function (t) { return t.kind === 289 /* JSDocTemplateTag */; })) { parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } // Type parameter list looks like '@template T,U,V' var typeParameters = createNodeArray(); while (true) { - var name_15 = parseJSDocIdentifierName(); + var name = parseJSDocIdentifierName(); skipWhitespace(); - if (!name_15) { + if (!name) { parseErrorAtPosition(scanner.getStartPos(), 0, ts.Diagnostics.Identifier_expected); return undefined; } - var typeParameter = createNode(143 /* TypeParameter */, name_15.pos); - typeParameter.name = name_15; + var typeParameter = createNode(145 /* TypeParameter */, name.pos); + typeParameter.name = name; finishNode(typeParameter); typeParameters.push(typeParameter); - if (token() === 25 /* CommaToken */) { + if (token() === 26 /* CommaToken */) { nextJSDocToken(); skipWhitespace(); } @@ -19876,7 +20844,7 @@ var ts; break; } } - var result = createNode(284 /* JSDocTemplateTag */, atToken.pos); + var result = createNode(289 /* JSDocTemplateTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeParameters = typeParameters; @@ -19897,7 +20865,7 @@ var ts; } var pos = scanner.getTokenPos(); var end = scanner.getTextPos(); - var result = createNode(70 /* Identifier */, pos); + var result = createNode(71 /* Identifier */, pos); result.text = content.substring(pos, end); finishNode(result, end); nextJSDocToken(); @@ -20025,7 +20993,7 @@ var ts; switch (node.kind) { case 9 /* StringLiteral */: case 8 /* NumericLiteral */: - case 70 /* Identifier */: + case 71 /* Identifier */: return true; } return false; @@ -20350,7 +21318,7 @@ var ts; if (position >= array.pos && position < array.end) { // position was in this array. Search through this array to see if we find a // viable element. - for (var i = 0, n = array.length; i < n; i++) { + for (var i = 0; i < array.length; i++) { var child = array[i]; if (child) { if (child.pos === position) { @@ -20396,16 +21364,16 @@ var ts; function getModuleInstanceState(node) { // A module is uninstantiated if it contains only // 1. interface declarations, type alias declarations - if (node.kind === 227 /* InterfaceDeclaration */ || node.kind === 228 /* TypeAliasDeclaration */) { + if (node.kind === 230 /* InterfaceDeclaration */ || node.kind === 231 /* TypeAliasDeclaration */) { return 0 /* NonInstantiated */; } else if (ts.isConstEnumDeclaration(node)) { return 2 /* ConstEnumOnly */; } - else if ((node.kind === 235 /* ImportDeclaration */ || node.kind === 234 /* ImportEqualsDeclaration */) && !(ts.hasModifier(node, 1 /* Export */))) { + else if ((node.kind === 238 /* ImportDeclaration */ || node.kind === 237 /* ImportEqualsDeclaration */) && !(ts.hasModifier(node, 1 /* Export */))) { return 0 /* NonInstantiated */; } - else if (node.kind === 231 /* ModuleBlock */) { + else if (node.kind === 234 /* ModuleBlock */) { var state_1 = 0 /* NonInstantiated */; ts.forEachChild(node, function (n) { switch (getModuleInstanceState(n)) { @@ -20424,11 +21392,11 @@ var ts; }); return state_1; } - else if (node.kind === 230 /* ModuleDeclaration */) { + else if (node.kind === 233 /* ModuleDeclaration */) { var body = node.body; return body ? getModuleInstanceState(body) : 1 /* Instantiated */; } - else if (node.kind === 70 /* Identifier */ && node.isInJSDocNamespace) { + else if (node.kind === 71 /* Identifier */ && node.isInJSDocNamespace) { return 0 /* NonInstantiated */; } else { @@ -20537,7 +21505,7 @@ var ts; } return bindSourceFile; function bindInStrictMode(file, opts) { - if (opts.alwaysStrict && !ts.isDeclarationFile(file)) { + if ((opts.alwaysStrict === undefined ? opts.strict : opts.alwaysStrict) && !ts.isDeclarationFile(file)) { // bind in strict mode source files with alwaysStrict option return true; } @@ -20565,7 +21533,7 @@ var ts; if (symbolFlags & 107455 /* Value */) { var valueDeclaration = symbol.valueDeclaration; if (!valueDeclaration || - (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 230 /* ModuleDeclaration */)) { + (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 233 /* ModuleDeclaration */)) { // other kinds of value declarations take precedence over modules symbol.valueDeclaration = node; } @@ -20574,12 +21542,13 @@ 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.name) { + var name = ts.getNameOfDeclaration(node); + if (name) { if (ts.isAmbientModule(node)) { - return ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + node.name.text + "\""; + return ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + name.text + "\""; } - if (node.name.kind === 142 /* ComputedPropertyName */) { - var nameExpression = node.name.expression; + if (name.kind === 144 /* ComputedPropertyName */) { + var nameExpression = name.expression; // treat computed property names where expression is string/numeric literal as just string/numeric literal if (ts.isStringOrNumericLiteral(nameExpression)) { return nameExpression.text; @@ -20587,30 +21556,31 @@ var ts; ts.Debug.assert(ts.isWellKnownSymbolSyntactically(nameExpression)); return ts.getPropertyNameForKnownSymbolName(nameExpression.name.text); } - return node.name.text; + return name.text; } switch (node.kind) { - case 150 /* Constructor */: + case 152 /* Constructor */: return "__constructor"; - case 158 /* FunctionType */: - case 153 /* CallSignature */: + case 160 /* FunctionType */: + case 155 /* CallSignature */: return "__call"; - case 159 /* ConstructorType */: - case 154 /* ConstructSignature */: + case 161 /* ConstructorType */: + case 156 /* ConstructSignature */: return "__new"; - case 155 /* IndexSignature */: + case 157 /* IndexSignature */: return "__index"; - case 241 /* ExportDeclaration */: + case 244 /* ExportDeclaration */: return "__export"; - case 240 /* ExportAssignment */: + case 243 /* ExportAssignment */: return node.isExportEquals ? "export=" : "default"; - case 192 /* BinaryExpression */: + case 194 /* BinaryExpression */: switch (ts.getSpecialPropertyAssignmentKind(node)) { case 2 /* ModuleExports */: // module.exports = ... return "export="; case 1 /* ExportsProperty */: case 4 /* ThisProperty */: + case 5 /* Property */: // exports.x = ... or this.y = ... return node.left.name.text; case 3 /* PrototypeProperty */: @@ -20619,25 +21589,25 @@ var ts; } ts.Debug.fail("Unknown binary declaration kind"); break; - case 225 /* FunctionDeclaration */: - case 226 /* ClassDeclaration */: + case 228 /* FunctionDeclaration */: + case 229 /* ClassDeclaration */: return ts.hasModifier(node, 512 /* Default */) ? "default" : undefined; - case 274 /* JSDocFunctionType */: + case 279 /* JSDocFunctionType */: return ts.isJSDocConstructSignature(node) ? "__new" : "__call"; - case 144 /* Parameter */: + case 146 /* 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 === 274 /* JSDocFunctionType */); + ts.Debug.assert(node.parent.kind === 279 /* JSDocFunctionType */); var functionType = node.parent; var index = ts.indexOf(functionType.parameters, node); return "arg" + index; - case 285 /* JSDocTypedefTag */: + case 290 /* JSDocTypedefTag */: var parentNode = node.parent && node.parent.parent; var nameFromParentNode = void 0; - if (parentNode && parentNode.kind === 205 /* VariableStatement */) { + if (parentNode && parentNode.kind === 208 /* VariableStatement */) { if (parentNode.declarationList.declarations.length > 0) { var nameIdentifier = parentNode.declarationList.declarations[0].name; - if (nameIdentifier.kind === 70 /* Identifier */) { + if (nameIdentifier.kind === 71 /* Identifier */) { nameFromParentNode = nameIdentifier.text; } } @@ -20689,15 +21659,18 @@ var ts; // Otherwise, we'll be merging into a compatible existing symbol (for example when // you have multiple 'vars' with the same name in the same container). In this case // just add this node into the declarations list of the symbol. - symbol = symbolTable[name] || (symbolTable[name] = createSymbol(0 /* None */, name)); + symbol = symbolTable.get(name); + if (!symbol) { + symbolTable.set(name, symbol = createSymbol(0 /* None */, name)); + } if (name && (includes & 788448 /* Classifiable */)) { - classifiableNames[name] = name; + classifiableNames.set(name, name); } if (symbol.flags & excludes) { if (symbol.isReplaceableByMethod) { // Javascript constructor-declared symbols can be discarded in favor of // prototype symbols like methods. - symbol = symbolTable[name] = createSymbol(0 /* None */, name); + symbolTable.set(name, symbol = createSymbol(0 /* None */, name)); } else { if (node.name) { @@ -20721,15 +21694,15 @@ 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 === 240 /* ExportAssignment */ && !node.isExportEquals))) { + (isDefaultExport || (node.kind === 243 /* ExportAssignment */ && !node.isExportEquals))) { message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; } } } ts.forEach(symbol.declarations, function (declaration) { - file.bindDiagnostics.push(ts.createDiagnosticForNode(declaration.name || declaration, message_1, getDisplayName(declaration))); + file.bindDiagnostics.push(ts.createDiagnosticForNode(ts.getNameOfDeclaration(declaration) || declaration, message_1, getDisplayName(declaration))); }); - file.bindDiagnostics.push(ts.createDiagnosticForNode(node.name || node, message_1, getDisplayName(node))); + file.bindDiagnostics.push(ts.createDiagnosticForNode(ts.getNameOfDeclaration(node) || node, message_1, getDisplayName(node))); symbol = createSymbol(0 /* None */, name); } } @@ -20741,11 +21714,11 @@ var ts; function declareModuleMember(node, symbolFlags, symbolExcludes) { var hasExportModifier = ts.getCombinedModifierFlags(node) & 1 /* Export */; if (symbolFlags & 8388608 /* Alias */) { - if (node.kind === 243 /* ExportSpecifier */ || (node.kind === 234 /* ImportEqualsDeclaration */ && hasExportModifier)) { + if (node.kind === 246 /* ExportSpecifier */ || (node.kind === 237 /* ImportEqualsDeclaration */ && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { - return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); + return declareSymbol(container.locals, /*parent*/ undefined, node, symbolFlags, symbolExcludes); } } else { @@ -20764,21 +21737,21 @@ 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. - var isJSDocTypedefInJSDocNamespace = node.kind === 285 /* JSDocTypedefTag */ && + var isJSDocTypedefInJSDocNamespace = node.kind === 290 /* JSDocTypedefTag */ && node.name && - node.name.kind === 70 /* Identifier */ && + 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) | (symbolFlags & 793064 /* Type */ ? 2097152 /* ExportType */ : 0) | (symbolFlags & 1920 /* Namespace */ ? 4194304 /* ExportNamespace */ : 0); - var local = declareSymbol(container.locals, undefined, node, exportKind, symbolExcludes); + var local = declareSymbol(container.locals, /*parent*/ undefined, node, exportKind, symbolExcludes); local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); node.localSymbol = local; return local; } else { - return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); + return declareSymbol(container.locals, /*parent*/ undefined, node, symbolFlags, symbolExcludes); } } } @@ -20851,7 +21824,7 @@ var ts; if (hasExplicitReturn) node.flags |= 256 /* HasExplicitReturn */; } - if (node.kind === 261 /* SourceFile */) { + if (node.kind === 265 /* SourceFile */) { node.flags |= emitFlags; } if (isIIFE) { @@ -20930,66 +21903,72 @@ var ts; return; } switch (node.kind) { - case 210 /* WhileStatement */: + case 213 /* WhileStatement */: bindWhileStatement(node); break; - case 209 /* DoStatement */: + case 212 /* DoStatement */: bindDoStatement(node); break; - case 211 /* ForStatement */: + case 214 /* ForStatement */: bindForStatement(node); break; - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: + case 215 /* ForInStatement */: + case 216 /* ForOfStatement */: bindForInOrForOfStatement(node); break; - case 208 /* IfStatement */: + case 211 /* IfStatement */: bindIfStatement(node); break; - case 216 /* ReturnStatement */: - case 220 /* ThrowStatement */: + case 219 /* ReturnStatement */: + case 223 /* ThrowStatement */: bindReturnOrThrow(node); break; - case 215 /* BreakStatement */: - case 214 /* ContinueStatement */: + case 218 /* BreakStatement */: + case 217 /* ContinueStatement */: bindBreakOrContinueStatement(node); break; - case 221 /* TryStatement */: + case 224 /* TryStatement */: bindTryStatement(node); break; - case 218 /* SwitchStatement */: + case 221 /* SwitchStatement */: bindSwitchStatement(node); break; - case 232 /* CaseBlock */: + case 235 /* CaseBlock */: bindCaseBlock(node); break; - case 253 /* CaseClause */: + case 257 /* CaseClause */: bindCaseClause(node); break; - case 219 /* LabeledStatement */: + case 222 /* LabeledStatement */: bindLabeledStatement(node); break; - case 190 /* PrefixUnaryExpression */: + case 192 /* PrefixUnaryExpression */: bindPrefixUnaryExpressionFlow(node); break; - case 191 /* PostfixUnaryExpression */: + case 193 /* PostfixUnaryExpression */: bindPostfixUnaryExpressionFlow(node); break; - case 192 /* BinaryExpression */: + case 194 /* BinaryExpression */: bindBinaryExpressionFlow(node); break; - case 186 /* DeleteExpression */: + case 188 /* DeleteExpression */: bindDeleteExpressionFlow(node); break; - case 193 /* ConditionalExpression */: + case 195 /* ConditionalExpression */: bindConditionalExpressionFlow(node); break; - case 223 /* VariableDeclaration */: + case 226 /* VariableDeclaration */: bindVariableDeclarationFlow(node); break; - case 179 /* CallExpression */: + case 181 /* CallExpression */: bindCallExpressionFlow(node); break; + case 283 /* JSDocComment */: + bindJSDocComment(node); + break; + case 290 /* JSDocTypedefTag */: + bindJSDocTypedefTag(node); + break; default: bindEachChild(node); break; @@ -20997,25 +21976,26 @@ var ts; } function isNarrowingExpression(expr) { switch (expr.kind) { - case 70 /* Identifier */: - case 98 /* ThisKeyword */: - case 177 /* PropertyAccessExpression */: + case 71 /* Identifier */: + case 99 /* ThisKeyword */: + case 179 /* PropertyAccessExpression */: return isNarrowableReference(expr); - case 179 /* CallExpression */: + case 181 /* CallExpression */: return hasNarrowableArgument(expr); - case 183 /* ParenthesizedExpression */: + case 185 /* ParenthesizedExpression */: return isNarrowingExpression(expr.expression); - case 192 /* BinaryExpression */: + case 194 /* BinaryExpression */: return isNarrowingBinaryExpression(expr); - case 190 /* PrefixUnaryExpression */: - return expr.operator === 50 /* ExclamationToken */ && isNarrowingExpression(expr.operand); + case 192 /* PrefixUnaryExpression */: + return expr.operator === 51 /* ExclamationToken */ && isNarrowingExpression(expr.operand); } return false; } function isNarrowableReference(expr) { - return expr.kind === 70 /* Identifier */ || - expr.kind === 98 /* ThisKeyword */ || - expr.kind === 177 /* PropertyAccessExpression */ && isNarrowableReference(expr.expression); + return expr.kind === 71 /* Identifier */ || + expr.kind === 99 /* ThisKeyword */ || + expr.kind === 97 /* SuperKeyword */ || + expr.kind === 179 /* PropertyAccessExpression */ && isNarrowableReference(expr.expression); } function hasNarrowableArgument(expr) { if (expr.arguments) { @@ -21026,41 +22006,41 @@ var ts; } } } - if (expr.expression.kind === 177 /* PropertyAccessExpression */ && + if (expr.expression.kind === 179 /* PropertyAccessExpression */ && isNarrowableReference(expr.expression.expression)) { return true; } return false; } function isNarrowingTypeofOperands(expr1, expr2) { - return expr1.kind === 187 /* TypeOfExpression */ && isNarrowableOperand(expr1.expression) && expr2.kind === 9 /* StringLiteral */; + return expr1.kind === 189 /* TypeOfExpression */ && isNarrowableOperand(expr1.expression) && expr2.kind === 9 /* StringLiteral */; } function isNarrowingBinaryExpression(expr) { switch (expr.operatorToken.kind) { - case 57 /* EqualsToken */: + case 58 /* EqualsToken */: return isNarrowableReference(expr.left); - case 31 /* EqualsEqualsToken */: - case 32 /* ExclamationEqualsToken */: - case 33 /* EqualsEqualsEqualsToken */: - case 34 /* ExclamationEqualsEqualsToken */: + case 32 /* EqualsEqualsToken */: + case 33 /* ExclamationEqualsToken */: + case 34 /* EqualsEqualsEqualsToken */: + case 35 /* ExclamationEqualsEqualsToken */: return isNarrowableOperand(expr.left) || isNarrowableOperand(expr.right) || isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right); - case 92 /* InstanceOfKeyword */: + case 93 /* InstanceOfKeyword */: return isNarrowableOperand(expr.left); - case 25 /* CommaToken */: + case 26 /* CommaToken */: return isNarrowingExpression(expr.right); } return false; } function isNarrowableOperand(expr) { switch (expr.kind) { - case 183 /* ParenthesizedExpression */: + case 185 /* ParenthesizedExpression */: return isNarrowableOperand(expr.expression); - case 192 /* BinaryExpression */: + case 194 /* BinaryExpression */: switch (expr.operatorToken.kind) { - case 57 /* EqualsToken */: + case 58 /* EqualsToken */: return isNarrowableOperand(expr.left); - case 25 /* CommaToken */: + case 26 /* CommaToken */: return isNarrowableOperand(expr.right); } } @@ -21095,8 +22075,8 @@ var ts; if (!expression) { return flags & 32 /* TrueCondition */ ? antecedent : unreachableFlow; } - if (expression.kind === 100 /* TrueKeyword */ && flags & 64 /* FalseCondition */ || - expression.kind === 85 /* FalseKeyword */ && flags & 32 /* TrueCondition */) { + if (expression.kind === 101 /* TrueKeyword */ && flags & 64 /* FalseCondition */ || + expression.kind === 86 /* FalseKeyword */ && flags & 32 /* TrueCondition */) { return unreachableFlow; } if (!isNarrowingExpression(expression)) { @@ -21151,34 +22131,34 @@ var ts; function isStatementCondition(node) { var parent = node.parent; switch (parent.kind) { - case 208 /* IfStatement */: - case 210 /* WhileStatement */: - case 209 /* DoStatement */: + case 211 /* IfStatement */: + case 213 /* WhileStatement */: + case 212 /* DoStatement */: return parent.expression === node; - case 211 /* ForStatement */: - case 193 /* ConditionalExpression */: + case 214 /* ForStatement */: + case 195 /* ConditionalExpression */: return parent.condition === node; } return false; } function isLogicalExpression(node) { while (true) { - if (node.kind === 183 /* ParenthesizedExpression */) { + if (node.kind === 185 /* ParenthesizedExpression */) { node = node.expression; } - else if (node.kind === 190 /* PrefixUnaryExpression */ && node.operator === 50 /* ExclamationToken */) { + else if (node.kind === 192 /* PrefixUnaryExpression */ && node.operator === 51 /* ExclamationToken */) { node = node.operand; } else { - return node.kind === 192 /* BinaryExpression */ && (node.operatorToken.kind === 52 /* AmpersandAmpersandToken */ || - node.operatorToken.kind === 53 /* BarBarToken */); + return node.kind === 194 /* BinaryExpression */ && (node.operatorToken.kind === 53 /* AmpersandAmpersandToken */ || + node.operatorToken.kind === 54 /* BarBarToken */); } } } function isTopLevelLogicalExpression(node) { - while (node.parent.kind === 183 /* ParenthesizedExpression */ || - node.parent.kind === 190 /* PrefixUnaryExpression */ && - node.parent.operator === 50 /* ExclamationToken */) { + while (node.parent.kind === 185 /* ParenthesizedExpression */ || + node.parent.kind === 192 /* PrefixUnaryExpression */ && + node.parent.operator === 51 /* ExclamationToken */) { node = node.parent; } return !isStatementCondition(node) && !isLogicalExpression(node.parent); @@ -21219,7 +22199,7 @@ var ts; } function bindDoStatement(node) { var preDoLabel = createLoopLabel(); - var enclosingLabeledStatement = node.parent.kind === 219 /* LabeledStatement */ + var enclosingLabeledStatement = node.parent.kind === 222 /* LabeledStatement */ ? ts.lastOrUndefined(activeLabels) : undefined; // if do statement is wrapped in labeled statement then target labels for break/continue with or without @@ -21253,10 +22233,13 @@ var ts; var postLoopLabel = createBranchLabel(); addAntecedent(preLoopLabel, currentFlow); currentFlow = preLoopLabel; + if (node.kind === 216 /* ForOfStatement */) { + bind(node.awaitModifier); + } bind(node.expression); addAntecedent(postLoopLabel, currentFlow); bind(node.initializer); - if (node.initializer.kind !== 224 /* VariableDeclarationList */) { + if (node.initializer.kind !== 227 /* VariableDeclarationList */) { bindAssignmentTargetFlow(node.initializer); } bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); @@ -21278,7 +22261,7 @@ var ts; } function bindReturnOrThrow(node) { bind(node.expression); - if (node.kind === 216 /* ReturnStatement */) { + if (node.kind === 219 /* ReturnStatement */) { hasExplicitReturn = true; if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); @@ -21298,7 +22281,7 @@ var ts; return undefined; } function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { - var flowLabel = node.kind === 215 /* BreakStatement */ ? breakTarget : continueTarget; + var flowLabel = node.kind === 218 /* BreakStatement */ ? breakTarget : continueTarget; if (flowLabel) { addAntecedent(flowLabel, currentFlow); currentFlow = unreachableFlow; @@ -21334,7 +22317,32 @@ var ts; if (node.finallyBlock) { // in finally flow is combined from pre-try/flow from try/flow from catch // pre-flow is necessary to make sure that finally is reachable even if finally flows in both try and finally blocks are unreachable - addAntecedent(preFinallyLabel, preTryFlow); + // also for finally blocks we inject two extra edges into the flow graph. + // first -> edge that connects pre-try flow with the label at the beginning of the finally block, it has lock associated with it + // second -> edge that represents post-finally flow. + // these edges are used in following scenario: + // let a; (1) + // try { a = someOperation(); (2)} + // finally { (3) console.log(a) } (4) + // (5) a + // flow graph for this case looks roughly like this (arrows show ): + // (1-pre-try-flow) <--.. <-- (2-post-try-flow) + // ^ ^ + // |*****(3-pre-finally-label) -----| + // ^ + // |-- ... <-- (4-post-finally-label) <--- (5) + // In case when we walk the flow starting from inside the finally block we want to take edge '*****' into account + // since it ensures that finally is always reachable. However when we start outside the finally block and go through label (5) + // then edge '*****' should be discarded because label 4 is only reachable if post-finally label-4 is reachable + // Simply speaking code inside finally block is treated as reachable as pre-try-flow + // since we conservatively assume that any line in try block can throw or return in which case we'll enter finally. + // However code after finally is reachable only if control flow was not abrupted in try/catch or finally blocks - it should be composed from + // final flows of these blocks without taking pre-try flow into account. + // + // extra edges that we inject allows to control this behavior + // if when walking the flow we step on post-finally edge - we can mark matching pre-finally edge as locked so it will be skipped. + var preFinallyFlow = { flags: 2048 /* PreFinally */, antecedent: preTryFlow, lock: {} }; + addAntecedent(preFinallyLabel, preFinallyFlow); currentFlow = finishFlowLabel(preFinallyLabel); bind(node.finallyBlock); // if flow after finally is unreachable - keep it @@ -21350,6 +22358,11 @@ var ts; : unreachableFlow; } } + if (!(currentFlow.flags & 1 /* Unreachable */)) { + var afterFinallyFlow = { flags: 4096 /* AfterFinally */, antecedent: currentFlow }; + preFinallyFlow.lock = afterFinallyFlow; + currentFlow = afterFinallyFlow; + } } else { currentFlow = finishFlowLabel(preFinallyLabel); @@ -21364,7 +22377,7 @@ var ts; preSwitchCaseFlow = currentFlow; bind(node.caseBlock); addAntecedent(postSwitchLabel, currentFlow); - var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 254 /* DefaultClause */; }); + var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 258 /* 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; @@ -21431,14 +22444,14 @@ var ts; if (!activeLabel.referenced && !options.allowUnusedLabels) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node.label, ts.Diagnostics.Unused_label)); } - if (!node.statement || node.statement.kind !== 209 /* DoStatement */) { + if (!node.statement || node.statement.kind !== 212 /* DoStatement */) { // do statement sets current flow inside bindDoStatement addAntecedent(postStatementLabel, currentFlow); currentFlow = finishFlowLabel(postStatementLabel); } } function bindDestructuringTargetFlow(node) { - if (node.kind === 192 /* BinaryExpression */ && node.operatorToken.kind === 57 /* EqualsToken */) { + if (node.kind === 194 /* BinaryExpression */ && node.operatorToken.kind === 58 /* EqualsToken */) { bindAssignmentTargetFlow(node.left); } else { @@ -21449,10 +22462,10 @@ var ts; if (isNarrowableReference(node)) { currentFlow = createFlowAssignment(currentFlow, node); } - else if (node.kind === 175 /* ArrayLiteralExpression */) { + else if (node.kind === 177 /* ArrayLiteralExpression */) { for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { var e = _a[_i]; - if (e.kind === 196 /* SpreadElement */) { + if (e.kind === 198 /* SpreadElement */) { bindAssignmentTargetFlow(e.expression); } else { @@ -21460,16 +22473,16 @@ var ts; } } } - else if (node.kind === 176 /* ObjectLiteralExpression */) { + else if (node.kind === 178 /* ObjectLiteralExpression */) { for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var p = _c[_b]; - if (p.kind === 257 /* PropertyAssignment */) { + if (p.kind === 261 /* PropertyAssignment */) { bindDestructuringTargetFlow(p.initializer); } - else if (p.kind === 258 /* ShorthandPropertyAssignment */) { + else if (p.kind === 262 /* ShorthandPropertyAssignment */) { bindAssignmentTargetFlow(p.name); } - else if (p.kind === 259 /* SpreadAssignment */) { + else if (p.kind === 263 /* SpreadAssignment */) { bindAssignmentTargetFlow(p.expression); } } @@ -21477,7 +22490,7 @@ var ts; } function bindLogicalExpression(node, trueTarget, falseTarget) { var preRightLabel = createBranchLabel(); - if (node.operatorToken.kind === 52 /* AmpersandAmpersandToken */) { + if (node.operatorToken.kind === 53 /* AmpersandAmpersandToken */) { bindCondition(node.left, preRightLabel, falseTarget); } else { @@ -21488,7 +22501,7 @@ var ts; bindCondition(node.right, trueTarget, falseTarget); } function bindPrefixUnaryExpressionFlow(node) { - if (node.operator === 50 /* ExclamationToken */) { + if (node.operator === 51 /* ExclamationToken */) { var saveTrueTarget = currentTrueTarget; currentTrueTarget = currentFalseTarget; currentFalseTarget = saveTrueTarget; @@ -21498,20 +22511,20 @@ var ts; } else { bindEachChild(node); - if (node.operator === 42 /* PlusPlusToken */ || node.operator === 43 /* MinusMinusToken */) { + if (node.operator === 43 /* PlusPlusToken */ || node.operator === 44 /* MinusMinusToken */) { bindAssignmentTargetFlow(node.operand); } } } function bindPostfixUnaryExpressionFlow(node) { bindEachChild(node); - if (node.operator === 42 /* PlusPlusToken */ || node.operator === 43 /* MinusMinusToken */) { + if (node.operator === 43 /* PlusPlusToken */ || node.operator === 44 /* MinusMinusToken */) { bindAssignmentTargetFlow(node.operand); } } function bindBinaryExpressionFlow(node) { var operator = node.operatorToken.kind; - if (operator === 52 /* AmpersandAmpersandToken */ || operator === 53 /* BarBarToken */) { + if (operator === 53 /* AmpersandAmpersandToken */ || operator === 54 /* BarBarToken */) { if (isTopLevelLogicalExpression(node)) { var postExpressionLabel = createBranchLabel(); bindLogicalExpression(node, postExpressionLabel, postExpressionLabel); @@ -21525,7 +22538,7 @@ var ts; bindEachChild(node); if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) { bindAssignmentTargetFlow(node.left); - if (operator === 57 /* EqualsToken */ && node.left.kind === 178 /* ElementAccessExpression */) { + if (operator === 58 /* EqualsToken */ && node.left.kind === 180 /* ElementAccessExpression */) { var elementAccess = node.left; if (isNarrowableOperand(elementAccess.expression)) { currentFlow = createFlowArrayMutation(currentFlow, node); @@ -21536,7 +22549,7 @@ var ts; } function bindDeleteExpressionFlow(node) { bindEachChild(node); - if (node.expression.kind === 177 /* PropertyAccessExpression */) { + if (node.expression.kind === 179 /* PropertyAccessExpression */) { bindAssignmentTargetFlow(node.expression); } } @@ -21569,19 +22582,37 @@ var ts; } function bindVariableDeclarationFlow(node) { bindEachChild(node); - if (node.initializer || node.parent.parent.kind === 212 /* ForInStatement */ || node.parent.parent.kind === 213 /* ForOfStatement */) { + if (node.initializer || node.parent.parent.kind === 215 /* ForInStatement */ || node.parent.parent.kind === 216 /* ForOfStatement */) { bindInitializedVariableFlow(node); } } + function bindJSDocComment(node) { + ts.forEachChild(node, function (n) { + if (n.kind !== 290 /* JSDocTypedefTag */) { + bind(n); + } + }); + } + function bindJSDocTypedefTag(node) { + ts.forEachChild(node, function (n) { + // if the node has a fullName "A.B.C", that means symbol "C" was already bound + // when we visit "fullName"; so when we visit the name "C" as the next child of + // the jsDocTypedefTag, we should skip binding it. + if (node.fullName && n === node.name && node.fullName.kind !== 71 /* Identifier */) { + return; + } + bind(n); + }); + } function bindCallExpressionFlow(node) { // If the target of the call expression is a function expression or arrow function we have // 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 === 183 /* ParenthesizedExpression */) { + while (expr.kind === 185 /* ParenthesizedExpression */) { expr = expr.expression; } - if (expr.kind === 184 /* FunctionExpression */ || expr.kind === 185 /* ArrowFunction */) { + if (expr.kind === 186 /* FunctionExpression */ || expr.kind === 187 /* ArrowFunction */) { bindEach(node.typeArguments); bindEach(node.arguments); bind(node.expression); @@ -21589,7 +22620,7 @@ var ts; else { bindEachChild(node); } - if (node.expression.kind === 177 /* PropertyAccessExpression */) { + if (node.expression.kind === 179 /* PropertyAccessExpression */) { var propertyAccess = node.expression; if (isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) { currentFlow = createFlowArrayMutation(currentFlow, node); @@ -21598,52 +22629,54 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 197 /* ClassExpression */: - case 226 /* ClassDeclaration */: - case 229 /* EnumDeclaration */: - case 176 /* ObjectLiteralExpression */: - case 161 /* TypeLiteral */: - case 287 /* JSDocTypeLiteral */: - case 270 /* JSDocRecordType */: + case 199 /* ClassExpression */: + case 229 /* ClassDeclaration */: + case 232 /* EnumDeclaration */: + case 178 /* ObjectLiteralExpression */: + case 163 /* TypeLiteral */: + case 292 /* JSDocTypeLiteral */: + case 275 /* JSDocRecordType */: + case 254 /* JsxAttributes */: return 1 /* IsContainer */; - case 227 /* InterfaceDeclaration */: + case 230 /* InterfaceDeclaration */: return 1 /* IsContainer */ | 64 /* IsInterface */; - case 274 /* JSDocFunctionType */: - case 230 /* ModuleDeclaration */: - case 228 /* TypeAliasDeclaration */: - case 170 /* MappedType */: + case 279 /* JSDocFunctionType */: + case 233 /* ModuleDeclaration */: + case 231 /* TypeAliasDeclaration */: + case 172 /* MappedType */: return 1 /* IsContainer */ | 32 /* HasLocals */; - case 261 /* SourceFile */: + case 265 /* SourceFile */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */; - case 149 /* MethodDeclaration */: + case 151 /* MethodDeclaration */: if (ts.isObjectLiteralOrClassExpressionMethod(node)) { return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethod */; } - case 150 /* Constructor */: - case 225 /* FunctionDeclaration */: - case 148 /* MethodSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: - case 158 /* FunctionType */: - case 159 /* ConstructorType */: + // falls through + case 152 /* Constructor */: + case 228 /* FunctionDeclaration */: + case 150 /* MethodSignature */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + case 155 /* CallSignature */: + case 156 /* ConstructSignature */: + case 157 /* IndexSignature */: + case 160 /* FunctionType */: + case 161 /* ConstructorType */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */; - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: + case 186 /* FunctionExpression */: + case 187 /* ArrowFunction */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */; - case 231 /* ModuleBlock */: + case 234 /* ModuleBlock */: return 4 /* IsControlFlowContainer */; - case 147 /* PropertyDeclaration */: + case 149 /* PropertyDeclaration */: return node.initializer ? 4 /* IsControlFlowContainer */ : 0; - case 256 /* CatchClause */: - case 211 /* ForStatement */: - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: - case 232 /* CaseBlock */: + case 260 /* CatchClause */: + case 214 /* ForStatement */: + case 215 /* ForInStatement */: + case 216 /* ForOfStatement */: + case 235 /* CaseBlock */: return 2 /* IsBlockScopedContainer */; - case 204 /* Block */: + case 207 /* 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 @@ -21680,42 +22713,43 @@ 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 230 /* ModuleDeclaration */: + case 233 /* ModuleDeclaration */: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 261 /* SourceFile */: + case 265 /* SourceFile */: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 197 /* ClassExpression */: - case 226 /* ClassDeclaration */: + case 199 /* ClassExpression */: + case 229 /* ClassDeclaration */: return declareClassMember(node, symbolFlags, symbolExcludes); - case 229 /* EnumDeclaration */: + case 232 /* EnumDeclaration */: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 161 /* TypeLiteral */: - case 176 /* ObjectLiteralExpression */: - case 227 /* InterfaceDeclaration */: - case 270 /* JSDocRecordType */: - case 287 /* JSDocTypeLiteral */: + case 163 /* TypeLiteral */: + case 178 /* ObjectLiteralExpression */: + case 230 /* InterfaceDeclaration */: + case 275 /* JSDocRecordType */: + case 292 /* JSDocTypeLiteral */: + case 254 /* 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 158 /* FunctionType */: - case 159 /* ConstructorType */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - case 274 /* JSDocFunctionType */: - case 228 /* TypeAliasDeclaration */: - case 170 /* MappedType */: + case 160 /* FunctionType */: + case 161 /* ConstructorType */: + case 155 /* CallSignature */: + case 156 /* ConstructSignature */: + case 157 /* IndexSignature */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: + case 152 /* Constructor */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + case 228 /* FunctionDeclaration */: + case 186 /* FunctionExpression */: + case 187 /* ArrowFunction */: + case 279 /* JSDocFunctionType */: + case 231 /* TypeAliasDeclaration */: + case 172 /* 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 @@ -21733,14 +22767,14 @@ var ts; function declareSourceFileMember(node, symbolFlags, symbolExcludes) { return ts.isExternalModule(file) ? declareModuleMember(node, symbolFlags, symbolExcludes) - : declareSymbol(file.locals, undefined, node, symbolFlags, symbolExcludes); + : declareSymbol(file.locals, /*parent*/ undefined, node, symbolFlags, symbolExcludes); } function hasExportDeclarations(node) { - var body = node.kind === 261 /* SourceFile */ ? node : node.body; - if (body && (body.kind === 261 /* SourceFile */ || body.kind === 231 /* ModuleBlock */)) { + var body = node.kind === 265 /* SourceFile */ ? node : node.body; + if (body && (body.kind === 265 /* SourceFile */ || body.kind === 234 /* ModuleBlock */)) { for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { var stat = _a[_i]; - if (stat.kind === 241 /* ExportDeclaration */ || stat.kind === 240 /* ExportAssignment */) { + if (stat.kind === 244 /* ExportDeclaration */ || stat.kind === 243 /* ExportAssignment */) { return true; } } @@ -21764,7 +22798,7 @@ var ts; errorOnFirstToken(node, ts.Diagnostics.export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible); } if (ts.isExternalModuleAugmentation(node)) { - declareSymbolAndAddToSymbolTable(node, 1024 /* NamespaceModule */, 0 /* NamespaceModuleExcludes */); + declareModuleSymbol(node); } else { var pattern = void 0; @@ -21784,12 +22818,8 @@ var ts; } } else { - var state = getModuleInstanceState(node); - if (state === 0 /* NonInstantiated */) { - declareSymbolAndAddToSymbolTable(node, 1024 /* NamespaceModule */, 0 /* NamespaceModuleExcludes */); - } - else { - declareSymbolAndAddToSymbolTable(node, 512 /* ValueModule */, 106639 /* ValueModuleExcludes */); + var state = declareModuleSymbol(node); + if (state !== 0 /* NonInstantiated */) { if (node.symbol.flags & (16 /* Function */ | 32 /* Class */ | 256 /* RegularEnum */)) { // if module was already merged with some function, class or non-const enum // treat is a non-const-enum-only @@ -21809,6 +22839,12 @@ 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 */); + return state; + } function bindFunctionOrConstructorType(node) { // For a given function symbol "<...>(...) => T" we want to generate a symbol identical // to the one we would get for: { <...>(...): T } @@ -21821,7 +22857,7 @@ var ts; var typeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type"); addDeclarationToSymbol(typeLiteralSymbol, node, 2048 /* TypeLiteral */); typeLiteralSymbol.members = ts.createMap(); - typeLiteralSymbol.members[symbol.name] = symbol; + typeLiteralSymbol.members.set(symbol.name, symbol); } function bindObjectLiteralExpression(node) { var ElementKind; @@ -21833,7 +22869,7 @@ var ts; var seen = ts.createMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 259 /* SpreadAssignment */ || prop.name.kind !== 70 /* Identifier */) { + if (prop.kind === 263 /* SpreadAssignment */ || prop.name.kind !== 71 /* Identifier */) { continue; } var identifier = prop.name; @@ -21845,12 +22881,12 @@ 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 === 257 /* PropertyAssignment */ || prop.kind === 258 /* ShorthandPropertyAssignment */ || prop.kind === 149 /* MethodDeclaration */ + var currentKind = prop.kind === 261 /* PropertyAssignment */ || prop.kind === 262 /* ShorthandPropertyAssignment */ || prop.kind === 151 /* MethodDeclaration */ ? 1 /* Property */ : 2 /* Accessor */; - var existingKind = seen[identifier.text]; + var existingKind = seen.get(identifier.text); if (!existingKind) { - seen[identifier.text] = currentKind; + seen.set(identifier.text, currentKind); continue; } if (currentKind === 1 /* Property */ && existingKind === 1 /* Property */) { @@ -21861,27 +22897,33 @@ var ts; } return bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__object"); } + function bindJsxAttributes(node) { + return bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__jsxAttributes"); + } + function bindJsxAttribute(node, symbolFlags, symbolExcludes) { + return declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes); + } function bindAnonymousDeclaration(node, symbolFlags, name) { var symbol = createSymbol(symbolFlags, name); addDeclarationToSymbol(symbol, node, symbolFlags); } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 230 /* ModuleDeclaration */: + case 233 /* ModuleDeclaration */: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 261 /* SourceFile */: + case 265 /* SourceFile */: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; } - // fall through. + // falls through default: if (!blockScopeContainer.locals) { blockScopeContainer.locals = ts.createMap(); addToContainerChain(blockScopeContainer); } - declareSymbol(blockScopeContainer.locals, undefined, node, symbolFlags, symbolExcludes); + declareSymbol(blockScopeContainer.locals, /*parent*/ undefined, node, symbolFlags, symbolExcludes); } } function bindBlockScopedVariableDeclaration(node) { @@ -21891,8 +22933,8 @@ var ts; // check for reserved words used as identifiers in strict mode code. function checkStrictModeIdentifier(node) { if (inStrictMode && - node.originalKeywordKind >= 107 /* FirstFutureReservedWord */ && - node.originalKeywordKind <= 115 /* LastFutureReservedWord */ && + node.originalKeywordKind >= 108 /* FirstFutureReservedWord */ && + node.originalKeywordKind <= 116 /* LastFutureReservedWord */ && !ts.isIdentifierName(node) && !ts.isInAmbientContext(node)) { // Report error only if there are no parse errors in file @@ -21928,7 +22970,7 @@ var ts; } function checkStrictModeDeleteExpression(node) { // Grammar checking - if (inStrictMode && node.expression.kind === 70 /* Identifier */) { + if (inStrictMode && node.expression.kind === 71 /* Identifier */) { // When a delete operator occurs within strict mode code, a SyntaxError is thrown if its // UnaryExpression is a direct reference to a variable, function argument, or function name var span_2 = ts.getErrorSpanForNode(file, node.expression); @@ -21936,11 +22978,11 @@ var ts; } } function isEvalOrArgumentsIdentifier(node) { - return node.kind === 70 /* Identifier */ && + return node.kind === 71 /* Identifier */ && (node.text === "eval" || node.text === "arguments"); } function checkStrictModeEvalOrArguments(contextNode, name) { - if (name && name.kind === 70 /* Identifier */) { + if (name && name.kind === 71 /* Identifier */) { var identifier = name; if (isEvalOrArgumentsIdentifier(identifier)) { // We check first if the name is inside class declaration or class expression; if so give explicit message @@ -21981,8 +23023,8 @@ var ts; function checkStrictModeFunctionDeclaration(node) { if (languageVersion < 2 /* ES2015 */) { // Report error if function is not top level function declaration - if (blockScopeContainer.kind !== 261 /* SourceFile */ && - blockScopeContainer.kind !== 230 /* ModuleDeclaration */ && + if (blockScopeContainer.kind !== 265 /* SourceFile */ && + blockScopeContainer.kind !== 233 /* 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. @@ -21992,7 +23034,7 @@ var ts; } } function checkStrictModeNumericLiteral(node) { - if (inStrictMode && node.isOctalLiteral) { + if (inStrictMode && node.numericLiteralFlags & 4 /* Octal */) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode)); } } @@ -22008,7 +23050,7 @@ var ts; function checkStrictModePrefixUnaryExpression(node) { // Grammar checking if (inStrictMode) { - if (node.operator === 42 /* PlusPlusToken */ || node.operator === 43 /* MinusMinusToken */) { + if (node.operator === 43 /* PlusPlusToken */ || node.operator === 44 /* MinusMinusToken */) { checkStrictModeEvalOrArguments(node, node.operand); } } @@ -22032,6 +23074,18 @@ var ts; } node.parent = parent; var saveInStrictMode = inStrictMode; + // Even though in the AST the jsdoc @typedef node belongs to the current node, + // its symbol might be in the same scope with the current node's symbol. Consider: + // + // /** @typedef {string | number} MyType */ + // function foo(); + // + // Here the current node is "foo", which is a container, but the scope of "MyType" should + // not be inside "foo". Therefore we always bind @typedef before bind the parent node, + // and skip binding this tag later when binding all the other jsdoc tags. + if (ts.isInJavaScriptFile(node)) { + bindJSDocTypedefTagIfAny(node); + } // First we bind declaration nodes to a symbol if possible. We'll both create a symbol // and then potentially add the symbol to an appropriate symbol table. Possible // destination symbol tables are: @@ -22048,7 +23102,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 > 140 /* LastToken */) { + if (node.kind > 142 /* LastToken */) { var saveParent = parent; parent = node; var containerFlags = getContainerFlags(node); @@ -22065,6 +23119,26 @@ var ts; } inStrictMode = saveInStrictMode; } + function bindJSDocTypedefTagIfAny(node) { + if (!node.jsDoc) { + return; + } + for (var _i = 0, _a = node.jsDoc; _i < _a.length; _i++) { + var jsDoc = _a[_i]; + if (!jsDoc.tags) { + continue; + } + for (var _b = 0, _c = jsDoc.tags; _b < _c.length; _b++) { + var tag = _c[_b]; + if (tag.kind === 290 /* JSDocTypedefTag */) { + var savedParent = parent; + parent = jsDoc; + bind(tag); + parent = savedParent; + } + } + } + } function updateStrictModeStatementList(statements) { if (!inStrictMode) { for (var _i = 0, statements_2 = statements; _i < statements_2.length; _i++) { @@ -22089,95 +23163,97 @@ var ts; function bindWorker(node) { switch (node.kind) { /* Strict mode checks */ - case 70 /* Identifier */: + case 71 /* Identifier */: // for typedef type names with namespaces, bind the new jsdoc type symbol here // because it requires all containing namespaces to be in effect, namely the // current "blockScopeContainer" needs to be set to its immediate namespace parent. if (node.isInJSDocNamespace) { var parentNode = node.parent; - while (parentNode && parentNode.kind !== 285 /* JSDocTypedefTag */) { + while (parentNode && parentNode.kind !== 290 /* JSDocTypedefTag */) { parentNode = parentNode.parent; } bindBlockScopedDeclaration(parentNode, 524288 /* TypeAlias */, 793064 /* TypeAliasExcludes */); break; } - case 98 /* ThisKeyword */: - if (currentFlow && (ts.isExpression(node) || parent.kind === 258 /* ShorthandPropertyAssignment */)) { + // falls through + case 99 /* ThisKeyword */: + if (currentFlow && (ts.isExpression(node) || parent.kind === 262 /* ShorthandPropertyAssignment */)) { node.flowNode = currentFlow; } return checkStrictModeIdentifier(node); - case 177 /* PropertyAccessExpression */: + case 179 /* PropertyAccessExpression */: if (currentFlow && isNarrowableReference(node)) { node.flowNode = currentFlow; } break; - case 192 /* BinaryExpression */: - if (ts.isInJavaScriptFile(node)) { - var specialKind = ts.getSpecialPropertyAssignmentKind(node); - switch (specialKind) { - case 1 /* ExportsProperty */: - bindExportsPropertyAssignment(node); - break; - case 2 /* ModuleExports */: - bindModuleExportsAssignment(node); - break; - case 3 /* PrototypeProperty */: - bindPrototypePropertyAssignment(node); - break; - case 4 /* ThisProperty */: - bindThisPropertyAssignment(node); - break; - case 0 /* None */: - // Nothing to do - break; - default: - ts.Debug.fail("Unknown special property assignment kind"); - } + case 194 /* BinaryExpression */: + var specialKind = ts.getSpecialPropertyAssignmentKind(node); + switch (specialKind) { + case 1 /* ExportsProperty */: + bindExportsPropertyAssignment(node); + break; + case 2 /* ModuleExports */: + bindModuleExportsAssignment(node); + break; + case 3 /* PrototypeProperty */: + bindPrototypePropertyAssignment(node); + break; + case 4 /* ThisProperty */: + bindThisPropertyAssignment(node); + break; + case 5 /* Property */: + bindStaticPropertyAssignment(node); + break; + case 0 /* None */: + // Nothing to do + break; + default: + ts.Debug.fail("Unknown special property assignment kind"); } return checkStrictModeBinaryExpression(node); - case 256 /* CatchClause */: + case 260 /* CatchClause */: return checkStrictModeCatchClause(node); - case 186 /* DeleteExpression */: + case 188 /* DeleteExpression */: return checkStrictModeDeleteExpression(node); case 8 /* NumericLiteral */: return checkStrictModeNumericLiteral(node); - case 191 /* PostfixUnaryExpression */: + case 193 /* PostfixUnaryExpression */: return checkStrictModePostfixUnaryExpression(node); - case 190 /* PrefixUnaryExpression */: + case 192 /* PrefixUnaryExpression */: return checkStrictModePrefixUnaryExpression(node); - case 217 /* WithStatement */: + case 220 /* WithStatement */: return checkStrictModeWithStatement(node); - case 167 /* ThisType */: + case 169 /* ThisType */: seenThisKeyword = true; return; - case 156 /* TypePredicate */: + case 158 /* TypePredicate */: return checkTypePredicate(node); - case 143 /* TypeParameter */: + case 145 /* TypeParameter */: return declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 530920 /* TypeParameterExcludes */); - case 144 /* Parameter */: + case 146 /* Parameter */: return bindParameter(node); - case 223 /* VariableDeclaration */: - case 174 /* BindingElement */: + case 226 /* VariableDeclaration */: + case 176 /* BindingElement */: return bindVariableDeclarationOrBindingElement(node); - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 271 /* JSDocRecordMember */: - return bindPropertyOrMethodOrAccessor(node, 4 /* Property */ | (node.questionToken ? 536870912 /* Optional */ : 0 /* None */), 0 /* PropertyExcludes */); - case 286 /* JSDocPropertyTag */: + case 149 /* PropertyDeclaration */: + case 148 /* PropertySignature */: + case 276 /* JSDocRecordMember */: + return bindPropertyOrMethodOrAccessor(node, 4 /* Property */ | (node.questionToken ? 67108864 /* Optional */ : 0 /* None */), 0 /* PropertyExcludes */); + case 291 /* JSDocPropertyTag */: return bindJSDocProperty(node); - case 257 /* PropertyAssignment */: - case 258 /* ShorthandPropertyAssignment */: + case 261 /* PropertyAssignment */: + case 262 /* ShorthandPropertyAssignment */: return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */); - case 260 /* EnumMember */: + case 264 /* EnumMember */: return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */); - case 259 /* SpreadAssignment */: - case 251 /* JsxSpreadAttribute */: + case 263 /* SpreadAssignment */: + case 255 /* JsxSpreadAttribute */: var root = container; var hasRest = false; while (root.parent) { - if (root.kind === 176 /* ObjectLiteralExpression */ && - root.parent.kind === 192 /* BinaryExpression */ && - root.parent.operatorToken.kind === 57 /* EqualsToken */ && + if (root.kind === 178 /* ObjectLiteralExpression */ && + root.parent.kind === 194 /* BinaryExpression */ && + root.parent.operatorToken.kind === 58 /* EqualsToken */ && root.parent.left === root) { hasRest = true; break; @@ -22185,95 +23261,100 @@ var ts; root = root.parent; } return; - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: + case 155 /* CallSignature */: + case 156 /* ConstructSignature */: + case 157 /* IndexSignature */: return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */); - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 151 /* MethodDeclaration */: + case 150 /* 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 ? 536870912 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 99263 /* MethodExcludes */); - case 225 /* FunctionDeclaration */: + return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 67108864 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 99263 /* MethodExcludes */); + case 228 /* FunctionDeclaration */: return bindFunctionDeclaration(node); - case 150 /* Constructor */: + case 152 /* Constructor */: return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, /*symbolExcludes:*/ 0 /* None */); - case 151 /* GetAccessor */: + case 153 /* GetAccessor */: return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 41919 /* GetAccessorExcludes */); - case 152 /* SetAccessor */: + case 154 /* SetAccessor */: return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 74687 /* SetAccessorExcludes */); - case 158 /* FunctionType */: - case 159 /* ConstructorType */: - case 274 /* JSDocFunctionType */: + case 160 /* FunctionType */: + case 161 /* ConstructorType */: + case 279 /* JSDocFunctionType */: return bindFunctionOrConstructorType(node); - case 161 /* TypeLiteral */: - case 170 /* MappedType */: - case 287 /* JSDocTypeLiteral */: - case 270 /* JSDocRecordType */: + case 163 /* TypeLiteral */: + case 172 /* MappedType */: + case 292 /* JSDocTypeLiteral */: + case 275 /* JSDocRecordType */: return bindAnonymousDeclaration(node, 2048 /* TypeLiteral */, "__type"); - case 176 /* ObjectLiteralExpression */: + case 178 /* ObjectLiteralExpression */: return bindObjectLiteralExpression(node); - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: + case 186 /* FunctionExpression */: + case 187 /* ArrowFunction */: return bindFunctionExpression(node); - case 179 /* CallExpression */: + case 181 /* CallExpression */: if (ts.isInJavaScriptFile(node)) { bindCallExpression(node); } break; // Members of classes, interfaces, and modules - case 197 /* ClassExpression */: - case 226 /* ClassDeclaration */: + case 199 /* ClassExpression */: + case 229 /* ClassDeclaration */: // All classes are automatically in strict mode in ES6. inStrictMode = true; return bindClassLikeDeclaration(node); - case 227 /* InterfaceDeclaration */: + case 230 /* InterfaceDeclaration */: return bindBlockScopedDeclaration(node, 64 /* Interface */, 792968 /* InterfaceExcludes */); - case 285 /* JSDocTypedefTag */: - if (!node.fullName || node.fullName.kind === 70 /* Identifier */) { + case 290 /* JSDocTypedefTag */: + if (!node.fullName || node.fullName.kind === 71 /* Identifier */) { return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 793064 /* TypeAliasExcludes */); } break; - case 228 /* TypeAliasDeclaration */: + case 231 /* TypeAliasDeclaration */: return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 793064 /* TypeAliasExcludes */); - case 229 /* EnumDeclaration */: + case 232 /* EnumDeclaration */: return bindEnumDeclaration(node); - case 230 /* ModuleDeclaration */: + case 233 /* ModuleDeclaration */: return bindModuleDeclaration(node); + // Jsx-attributes + case 254 /* JsxAttributes */: + return bindJsxAttributes(node); + case 253 /* JsxAttribute */: + return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */); // Imports and exports - case 234 /* ImportEqualsDeclaration */: - case 237 /* NamespaceImport */: - case 239 /* ImportSpecifier */: - case 243 /* ExportSpecifier */: + case 237 /* ImportEqualsDeclaration */: + case 240 /* NamespaceImport */: + case 242 /* ImportSpecifier */: + case 246 /* ExportSpecifier */: return declareSymbolAndAddToSymbolTable(node, 8388608 /* Alias */, 8388608 /* AliasExcludes */); - case 233 /* NamespaceExportDeclaration */: + case 236 /* NamespaceExportDeclaration */: return bindNamespaceExportDeclaration(node); - case 236 /* ImportClause */: + case 239 /* ImportClause */: return bindImportClause(node); - case 241 /* ExportDeclaration */: + case 244 /* ExportDeclaration */: return bindExportDeclaration(node); - case 240 /* ExportAssignment */: + case 243 /* ExportAssignment */: return bindExportAssignment(node); - case 261 /* SourceFile */: + case 265 /* SourceFile */: updateStrictModeStatementList(node.statements); return bindSourceFileIfExternalModule(); - case 204 /* Block */: + case 207 /* Block */: if (!ts.isFunctionLike(node.parent)) { return; } - // Fall through - case 231 /* ModuleBlock */: + // falls through + case 234 /* ModuleBlock */: return updateStrictModeStatementList(node.statements); } } function checkTypePredicate(node) { var parameterName = node.parameterName, type = node.type; - if (parameterName && parameterName.kind === 70 /* Identifier */) { + if (parameterName && parameterName.kind === 71 /* Identifier */) { checkStrictModeIdentifier(parameterName); } - if (parameterName && parameterName.kind === 167 /* ThisType */) { + if (parameterName && parameterName.kind === 169 /* ThisType */) { seenThisKeyword = true; } bind(type); @@ -22296,7 +23377,7 @@ var ts; // An export default clause with an expression exports a value // We want to exclude both class and function here, this is necessary to issue an error when there are both // default export-assignment and default export function and class declaration. - var flags = node.kind === 240 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) + var flags = node.kind === 243 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) ? 8388608 /* Alias */ : 4 /* Property */; declareSymbol(container.symbol.exports, container.symbol, node, flags, 4 /* Property */ | 8388608 /* AliasExcludes */ | 32 /* Class */ | 16 /* Function */); @@ -22306,17 +23387,17 @@ var ts; if (node.modifiers && node.modifiers.length) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Modifiers_cannot_appear_here)); } - if (node.parent.kind !== 261 /* SourceFile */) { + if (node.parent.kind !== 265 /* SourceFile */) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Global_module_exports_may_only_appear_at_top_level)); return; } else { - var parent_4 = node.parent; - if (!ts.isExternalModule(parent_4)) { + var parent_1 = node.parent; + if (!ts.isExternalModule(parent_1)) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Global_module_exports_may_only_appear_in_module_files)); return; } - if (!parent_4.isDeclarationFile) { + if (!parent_1.isDeclarationFile) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Global_module_exports_may_only_appear_in_declaration_files)); return; } @@ -22327,11 +23408,11 @@ var ts; function bindExportDeclaration(node) { if (!container.symbol || !container.symbol.exports) { // Export * in some sort of block construct - bindAnonymousDeclaration(node, 1073741824 /* ExportStar */, getDeclarationName(node)); + bindAnonymousDeclaration(node, 33554432 /* ExportStar */, getDeclarationName(node)); } else if (!node.exportClause) { // All export * declarations are collected in an __export symbol - declareSymbol(container.symbol.exports, container.symbol, node, 1073741824 /* ExportStar */, 0 /* None */); + declareSymbol(container.symbol.exports, container.symbol, node, 33554432 /* ExportStar */, 0 /* None */); } } function bindImportClause(node) { @@ -22353,30 +23434,67 @@ var ts; setCommonJsModuleIndicator(node); declareSymbol(file.symbol.exports, file.symbol, node.left, 4 /* Property */ | 7340032 /* Export */, 0 /* None */); } + function isExportsOrModuleExportsOrAlias(node) { + return ts.isExportsIdentifier(node) || + ts.isModuleExportsPropertyAccessExpression(node) || + isNameOfExportsOrModuleExportsAliasDeclaration(node); + } + function isNameOfExportsOrModuleExportsAliasDeclaration(node) { + if (node.kind === 71 /* Identifier */) { + var symbol = lookupSymbolForName(node.text); + if (symbol && symbol.valueDeclaration && symbol.valueDeclaration.kind === 226 /* VariableDeclaration */) { + var declaration = symbol.valueDeclaration; + if (declaration.initializer) { + return isExportsOrModuleExportsOrAliasOrAssignemnt(declaration.initializer); + } + } + } + return false; + } + function isExportsOrModuleExportsOrAliasOrAssignemnt(node) { + return isExportsOrModuleExportsOrAlias(node) || + (ts.isAssignmentExpression(node, /*excludeCompoundAssignements*/ true) && (isExportsOrModuleExportsOrAliasOrAssignemnt(node.left) || isExportsOrModuleExportsOrAliasOrAssignemnt(node.right))); + } function bindModuleExportsAssignment(node) { + // A common practice in node modules is to set 'export = module.exports = {}', this ensures that 'exports' + // is still pointing to 'module.exports'. + // We do not want to consider this as 'export=' since a module can have only one of these. + // Similarlly we do not want to treat 'module.exports = exports' as an 'export='. + var assignedExpression = ts.getRightMostAssignedExpression(node.right); + if (ts.isEmptyObjectLiteral(assignedExpression) || isExportsOrModuleExportsOrAlias(assignedExpression)) { + // Mark it as a module in case there are no other exports in the file + setCommonJsModuleIndicator(node); + return; + } // 'module.exports = expr' assignment setCommonJsModuleIndicator(node); declareSymbol(file.symbol.exports, file.symbol, node, 4 /* Property */ | 7340032 /* Export */ | 512 /* ValueModule */, 0 /* None */); } function bindThisPropertyAssignment(node) { ts.Debug.assert(ts.isInJavaScriptFile(node)); - // Declare a 'member' if the container is an ES5 class or ES6 constructor - if (container.kind === 225 /* FunctionDeclaration */ || container.kind === 184 /* FunctionExpression */) { - container.symbol.members = container.symbol.members || ts.createMap(); - // 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 */); - } - else if (container.kind === 150 /* Constructor */) { - // this.foo assignment in a JavaScript class - // Bind this property to the containing class - var saveContainer = container; - container = container.parent; - var symbol = bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* None */); - if (symbol) { - // constructor-declared symbols can be overwritten by subsequent method declarations - symbol.isReplaceableByMethod = true; - } - container = saveContainer; + var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); + switch (container.kind) { + case 228 /* FunctionDeclaration */: + case 186 /* FunctionExpression */: + // Declare a 'member' if the container is an ES5 class or ES6 constructor + container.symbol.members = container.symbol.members || ts.createMap(); + // 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 152 /* Constructor */: + case 149 /* PropertyDeclaration */: + case 151 /* MethodDeclaration */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + // this.foo assignment in a JavaScript class + // Bind this property to the containing class + var containingClass = container.parent; + var symbol = declareSymbol(ts.hasModifier(container, 32 /* Static */) ? containingClass.symbol.exports : containingClass.symbol.members, containingClass.symbol, node, 4 /* Property */, 0 /* None */); + if (symbol) { + // symbols declared through 'this' property assignements can be overwritten by subsequent method declarations + symbol.isReplaceableByMethod = true; + } + break; } } function bindPrototypePropertyAssignment(node) { @@ -22390,16 +23508,44 @@ var ts; leftSideOfAssignment.parent = node; constructorFunction.parent = classPrototype; classPrototype.parent = leftSideOfAssignment; - var funcSymbol = container.locals[constructorFunction.text]; - if (!funcSymbol || !(funcSymbol.flags & 16 /* Function */ || ts.isDeclarationOfFunctionExpression(funcSymbol))) { + bindPropertyAssignment(constructorFunction.text, leftSideOfAssignment, /*isPrototypeProperty*/ true); + } + function bindStaticPropertyAssignment(node) { + // We saw a node of the form 'x.y = z'. Declare a 'member' y on x if x was a function. + // Look up the function in the local scope, since prototype assignments should + // follow the function declaration + var leftSideOfAssignment = node.left; + var target = leftSideOfAssignment.expression; + // Fix up parent pointers since we're going to use these nodes before we bind into them + leftSideOfAssignment.parent = node; + target.parent = leftSideOfAssignment; + if (isNameOfExportsOrModuleExportsAliasDeclaration(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.text, leftSideOfAssignment, /*isPrototypeProperty*/ false); + } + } + function lookupSymbolForName(name) { + return (container.symbol && container.symbol.exports && container.symbol.exports.get(name)) || (container.locals && container.locals.get(name)); + } + function bindPropertyAssignment(functionName, propertyAccessExpression, isPrototypeProperty) { + var targetSymbol = lookupSymbolForName(functionName); + if (targetSymbol && ts.isDeclarationOfFunctionOrClassExpression(targetSymbol)) { + targetSymbol = targetSymbol.valueDeclaration.initializer.symbol; + } + if (!targetSymbol || !(targetSymbol.flags & (16 /* Function */ | 32 /* Class */))) { return; } // Set up the members collection if it doesn't exist already - if (!funcSymbol.members) { - funcSymbol.members = ts.createMap(); - } + var symbolTable = isPrototypeProperty ? + (targetSymbol.members || (targetSymbol.members = ts.createMap())) : + (targetSymbol.exports || (targetSymbol.exports = ts.createMap())); // Declare the method/property - declareSymbol(funcSymbol.members, funcSymbol, leftSideOfAssignment, 4 /* Property */, 0 /* PropertyExcludes */); + declareSymbol(symbolTable, targetSymbol, propertyAccessExpression, 4 /* Property */, 0 /* PropertyExcludes */); } function bindCallExpression(node) { // We're only inspecting call expressions to detect CommonJS modules, so we can skip @@ -22409,7 +23555,7 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (node.kind === 226 /* ClassDeclaration */) { + if (node.kind === 229 /* ClassDeclaration */) { bindBlockScopedDeclaration(node, 32 /* Class */, 899519 /* ClassExcludes */); } else { @@ -22417,7 +23563,7 @@ var ts; bindAnonymousDeclaration(node, 32 /* Class */, bindingName); // Add name of class expression into the map for semantic classifier if (node.name) { - classifiableNames[node.name.text] = node.name.text; + classifiableNames.set(node.name.text, node.name.text); } } var symbol = node.symbol; @@ -22430,14 +23576,15 @@ var ts; // Note: we check for this here because this class may be merging into a module. The // module might have an exported variable called 'prototype'. We can't allow that as // that would clash with the built-in 'prototype' for the class. - var prototypeSymbol = createSymbol(4 /* Property */ | 134217728 /* Prototype */, "prototype"); - if (symbol.exports[prototypeSymbol.name]) { + var prototypeSymbol = createSymbol(4 /* Property */ | 16777216 /* Prototype */, "prototype"); + var symbolExport = symbol.exports.get(prototypeSymbol.name); + if (symbolExport) { if (node.name) { node.name.parent = node; } - file.bindDiagnostics.push(ts.createDiagnosticForNode(symbol.exports[prototypeSymbol.name].declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); + file.bindDiagnostics.push(ts.createDiagnosticForNode(symbolExport.declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); } - symbol.exports[prototypeSymbol.name] = prototypeSymbol; + symbol.exports.set(prototypeSymbol.name, prototypeSymbol); prototypeSymbol.parent = symbol; } function bindEnumDeclaration(node) { @@ -22486,12 +23633,12 @@ var ts; // containing class. if (ts.isParameterPropertyDeclaration(node)) { var classDeclaration = node.parent.parent; - declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4 /* Property */ | (node.questionToken ? 536870912 /* Optional */ : 0 /* None */), 0 /* PropertyExcludes */); + declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4 /* Property */ | (node.questionToken ? 67108864 /* Optional */ : 0 /* None */), 0 /* PropertyExcludes */); } } function bindFunctionDeclaration(node) { if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { - if (ts.isAsyncFunctionLike(node)) { + if (ts.isAsyncFunction(node)) { emitFlags |= 1024 /* HasAsyncFunctions */; } } @@ -22506,7 +23653,7 @@ var ts; } function bindFunctionExpression(node) { if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { - if (ts.isAsyncFunctionLike(node)) { + if (ts.isAsyncFunction(node)) { emitFlags |= 1024 /* HasAsyncFunctions */; } } @@ -22519,7 +23666,7 @@ var ts; } function bindPropertyOrMethodOrAccessor(node, symbolFlags, symbolExcludes) { if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { - if (ts.isAsyncFunctionLike(node)) { + if (ts.isAsyncFunction(node)) { emitFlags |= 1024 /* HasAsyncFunctions */; } } @@ -22545,13 +23692,13 @@ var ts; if (currentFlow === unreachableFlow) { var reportError = // report error on all statements except empty ones - (ts.isStatementButNotDeclaration(node) && node.kind !== 206 /* EmptyStatement */) || + (ts.isStatementButNotDeclaration(node) && node.kind !== 209 /* EmptyStatement */) || // report error on class declarations - node.kind === 226 /* ClassDeclaration */ || + node.kind === 229 /* ClassDeclaration */ || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set - (node.kind === 230 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)) || + (node.kind === 233 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)) || // report error on regular enums and const enums if preserveConstEnums is set - (node.kind === 229 /* EnumDeclaration */ && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); + (node.kind === 232 /* EnumDeclaration */ && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); if (reportError) { currentFlow = reportedUnreachableFlow; // unreachable code is reported if @@ -22565,7 +23712,7 @@ var ts; // On the other side we do want to report errors on non-initialized 'lets' because of TDZ var reportUnreachableCode = !options.allowUnreachableCode && !ts.isInAmbientContext(node) && - (node.kind !== 205 /* VariableStatement */ || + (node.kind !== 208 /* VariableStatement */ || ts.getCombinedNodeFlags(node.declarationList) & 3 /* BlockScoped */ || ts.forEach(node.declarationList.declarations, function (d) { return d.initializer; })); if (reportUnreachableCode) { @@ -22585,56 +23732,56 @@ var ts; function computeTransformFlagsForNode(node, subtreeFlags) { var kind = node.kind; switch (kind) { - case 179 /* CallExpression */: + case 181 /* CallExpression */: return computeCallExpression(node, subtreeFlags); - case 180 /* NewExpression */: + case 182 /* NewExpression */: return computeNewExpression(node, subtreeFlags); - case 230 /* ModuleDeclaration */: + case 233 /* ModuleDeclaration */: return computeModuleDeclaration(node, subtreeFlags); - case 183 /* ParenthesizedExpression */: + case 185 /* ParenthesizedExpression */: return computeParenthesizedExpression(node, subtreeFlags); - case 192 /* BinaryExpression */: + case 194 /* BinaryExpression */: return computeBinaryExpression(node, subtreeFlags); - case 207 /* ExpressionStatement */: + case 210 /* ExpressionStatement */: return computeExpressionStatement(node, subtreeFlags); - case 144 /* Parameter */: + case 146 /* Parameter */: return computeParameter(node, subtreeFlags); - case 185 /* ArrowFunction */: + case 187 /* ArrowFunction */: return computeArrowFunction(node, subtreeFlags); - case 184 /* FunctionExpression */: + case 186 /* FunctionExpression */: return computeFunctionExpression(node, subtreeFlags); - case 225 /* FunctionDeclaration */: + case 228 /* FunctionDeclaration */: return computeFunctionDeclaration(node, subtreeFlags); - case 223 /* VariableDeclaration */: + case 226 /* VariableDeclaration */: return computeVariableDeclaration(node, subtreeFlags); - case 224 /* VariableDeclarationList */: + case 227 /* VariableDeclarationList */: return computeVariableDeclarationList(node, subtreeFlags); - case 205 /* VariableStatement */: + case 208 /* VariableStatement */: return computeVariableStatement(node, subtreeFlags); - case 219 /* LabeledStatement */: + case 222 /* LabeledStatement */: return computeLabeledStatement(node, subtreeFlags); - case 226 /* ClassDeclaration */: + case 229 /* ClassDeclaration */: return computeClassDeclaration(node, subtreeFlags); - case 197 /* ClassExpression */: + case 199 /* ClassExpression */: return computeClassExpression(node, subtreeFlags); - case 255 /* HeritageClause */: + case 259 /* HeritageClause */: return computeHeritageClause(node, subtreeFlags); - case 256 /* CatchClause */: + case 260 /* CatchClause */: return computeCatchClause(node, subtreeFlags); - case 199 /* ExpressionWithTypeArguments */: + case 201 /* ExpressionWithTypeArguments */: return computeExpressionWithTypeArguments(node, subtreeFlags); - case 150 /* Constructor */: + case 152 /* Constructor */: return computeConstructor(node, subtreeFlags); - case 147 /* PropertyDeclaration */: + case 149 /* PropertyDeclaration */: return computePropertyDeclaration(node, subtreeFlags); - case 149 /* MethodDeclaration */: + case 151 /* MethodDeclaration */: return computeMethod(node, subtreeFlags); - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: return computeAccessor(node, subtreeFlags); - case 234 /* ImportEqualsDeclaration */: + case 237 /* ImportEqualsDeclaration */: return computeImportEquals(node, subtreeFlags); - case 177 /* PropertyAccessExpression */: + case 179 /* PropertyAccessExpression */: return computePropertyAccess(node, subtreeFlags); default: return computeOther(node, kind, subtreeFlags); @@ -22659,13 +23806,13 @@ var ts; } function isSuperOrSuperProperty(node, kind) { switch (kind) { - case 96 /* SuperKeyword */: + case 97 /* SuperKeyword */: return true; - case 177 /* PropertyAccessExpression */: - case 178 /* ElementAccessExpression */: + case 179 /* PropertyAccessExpression */: + case 180 /* ElementAccessExpression */: var expression = node.expression; var expressionKind = expression.kind; - return expressionKind === 96 /* SuperKeyword */; + return expressionKind === 97 /* SuperKeyword */; } return false; } @@ -22686,17 +23833,17 @@ var ts; var transformFlags = subtreeFlags; var operatorTokenKind = node.operatorToken.kind; var leftKind = node.left.kind; - if (operatorTokenKind === 57 /* EqualsToken */ && leftKind === 176 /* ObjectLiteralExpression */) { + if (operatorTokenKind === 58 /* EqualsToken */ && leftKind === 178 /* 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 === 57 /* EqualsToken */ && leftKind === 175 /* ArrayLiteralExpression */) { + else if (operatorTokenKind === 58 /* EqualsToken */ && leftKind === 177 /* ArrayLiteralExpression */) { // Destructuring assignments are ES2015 syntax. transformFlags |= 192 /* AssertES2015 */ | 3072 /* AssertDestructuringAssignment */; } - else if (operatorTokenKind === 39 /* AsteriskAsteriskToken */ - || operatorTokenKind === 61 /* AsteriskAsteriskEqualsToken */) { + else if (operatorTokenKind === 40 /* AsteriskAsteriskToken */ + || operatorTokenKind === 62 /* AsteriskAsteriskEqualsToken */) { // Exponentiation is ES2016 syntax. transformFlags |= 32 /* AssertES2016 */; } @@ -22741,8 +23888,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 === 200 /* AsExpression */ - || expressionKind === 182 /* TypeAssertionExpression */) { + if (expressionKind === 202 /* AsExpression */ + || expressionKind === 184 /* TypeAssertionExpression */) { transformFlags |= 3 /* AssertTypeScript */; } // If the expression of a ParenthesizedExpression is a destructuring assignment, @@ -22800,11 +23947,11 @@ var ts; function computeHeritageClause(node, subtreeFlags) { var transformFlags = subtreeFlags; switch (node.token) { - case 84 /* ExtendsKeyword */: + case 85 /* ExtendsKeyword */: // An `extends` HeritageClause is ES6 syntax. transformFlags |= 192 /* AssertES2015 */; break; - case 107 /* ImplementsKeyword */: + case 108 /* ImplementsKeyword */: // An `implements` HeritageClause is TypeScript syntax. transformFlags |= 3 /* AssertTypeScript */; break; @@ -22867,10 +24014,9 @@ var ts; } // An async method declaration is ES2017 syntax. if (ts.hasModifier(node, 256 /* Async */)) { - transformFlags |= 16 /* AssertES2017 */; + transformFlags |= node.asteriskToken ? 8 /* AssertESNext */ : 16 /* AssertES2017 */; } - // Currently, we only support generators that were originally async function bodies. - if (node.asteriskToken && ts.getEmitFlags(node) & 131072 /* AsyncFunctionBody */) { + if (node.asteriskToken) { transformFlags |= 768 /* AssertGenerator */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; @@ -22924,7 +24070,7 @@ var ts; } // An async function declaration is ES2017 syntax. if (modifierFlags & 256 /* Async */) { - transformFlags |= 16 /* AssertES2017 */; + transformFlags |= node.asteriskToken ? 8 /* AssertESNext */ : 16 /* AssertES2017 */; } // function declarations with object rest destructuring are ES Next syntax if (subtreeFlags & 1048576 /* ContainsObjectRest */) { @@ -22941,7 +24087,7 @@ var ts; // down-level generator. // Currently we do not support transforming any other generator fucntions // down level. - if (node.asteriskToken && ts.getEmitFlags(node) & 131072 /* AsyncFunctionBody */) { + if (node.asteriskToken) { transformFlags |= 768 /* AssertGenerator */; } } @@ -22959,7 +24105,7 @@ var ts; } // An async function expression is ES2017 syntax. if (ts.hasModifier(node, 256 /* Async */)) { - transformFlags |= 16 /* AssertES2017 */; + transformFlags |= node.asteriskToken ? 8 /* AssertESNext */ : 16 /* AssertES2017 */; } // function expressions with object rest destructuring are ES Next syntax if (subtreeFlags & 1048576 /* ContainsObjectRest */) { @@ -22974,9 +24120,7 @@ var ts; // If a FunctionExpression is generator function and is the body of a // transformed async function, then this node can be transformed to a // down-level generator. - // Currently we do not support transforming any other generator fucntions - // down level. - if (node.asteriskToken && ts.getEmitFlags(node) & 131072 /* AsyncFunctionBody */) { + if (node.asteriskToken) { transformFlags |= 768 /* AssertGenerator */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; @@ -23013,7 +24157,7 @@ var ts; var expressionKind = expression.kind; // If a PropertyAccessExpression starts with a super keyword, then it is // ES6 syntax, and requires a lexical `this` binding. - if (expressionKind === 96 /* SuperKeyword */) { + if (expressionKind === 97 /* SuperKeyword */) { transformFlags |= 16384 /* ContainsLexicalThis */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; @@ -23106,92 +24250,109 @@ var ts; var transformFlags = subtreeFlags; var excludeFlags = 536872257 /* NodeExcludes */; switch (kind) { - case 119 /* AsyncKeyword */: - case 189 /* AwaitExpression */: - // async/await is ES2017 syntax - transformFlags |= 16 /* AssertES2017 */; + case 120 /* AsyncKeyword */: + case 191 /* AwaitExpression */: + // async/await is ES2017 syntax, but may be ESNext syntax (for async generators) + transformFlags |= 8 /* AssertESNext */ | 16 /* AssertES2017 */; break; - case 113 /* PublicKeyword */: - case 111 /* PrivateKeyword */: - case 112 /* ProtectedKeyword */: - case 116 /* AbstractKeyword */: - case 123 /* DeclareKeyword */: - case 75 /* ConstKeyword */: - case 229 /* EnumDeclaration */: - case 260 /* EnumMember */: - case 182 /* TypeAssertionExpression */: - case 200 /* AsExpression */: - case 201 /* NonNullExpression */: - case 130 /* ReadonlyKeyword */: + case 114 /* PublicKeyword */: + case 112 /* PrivateKeyword */: + case 113 /* ProtectedKeyword */: + case 117 /* AbstractKeyword */: + case 124 /* DeclareKeyword */: + case 76 /* ConstKeyword */: + case 232 /* EnumDeclaration */: + case 264 /* EnumMember */: + case 184 /* TypeAssertionExpression */: + case 202 /* AsExpression */: + case 203 /* NonNullExpression */: + case 131 /* ReadonlyKeyword */: // These nodes are TypeScript syntax. transformFlags |= 3 /* AssertTypeScript */; break; - case 246 /* JsxElement */: - case 247 /* JsxSelfClosingElement */: - case 248 /* JsxOpeningElement */: + case 249 /* JsxElement */: + case 250 /* JsxSelfClosingElement */: + case 251 /* JsxOpeningElement */: case 10 /* JsxText */: - case 249 /* JsxClosingElement */: - case 250 /* JsxAttribute */: - case 251 /* JsxSpreadAttribute */: - case 252 /* JsxExpression */: + case 252 /* JsxClosingElement */: + case 253 /* JsxAttribute */: + case 254 /* JsxAttributes */: + case 255 /* JsxSpreadAttribute */: + case 256 /* JsxExpression */: // These nodes are Jsx syntax. transformFlags |= 4 /* AssertJsx */; break; - case 213 /* ForOfStatement */: - // for-of might be ESNext if it has a rest destructuring - transformFlags |= 8 /* AssertESNext */; - // FALLTHROUGH - case 12 /* NoSubstitutionTemplateLiteral */: - case 13 /* TemplateHead */: - case 14 /* TemplateMiddle */: - case 15 /* TemplateTail */: - case 194 /* TemplateExpression */: - case 181 /* TaggedTemplateExpression */: - case 258 /* ShorthandPropertyAssignment */: - case 114 /* StaticKeyword */: + case 13 /* NoSubstitutionTemplateLiteral */: + case 14 /* TemplateHead */: + case 15 /* TemplateMiddle */: + case 16 /* TemplateTail */: + case 196 /* TemplateExpression */: + case 183 /* TaggedTemplateExpression */: + case 262 /* ShorthandPropertyAssignment */: + case 115 /* StaticKeyword */: + case 204 /* MetaProperty */: // These nodes are ES6 syntax. transformFlags |= 192 /* AssertES2015 */; break; - case 195 /* YieldExpression */: - // This node is ES6 syntax. - transformFlags |= 192 /* AssertES2015 */ | 16777216 /* ContainsYield */; + case 9 /* StringLiteral */: + if (node.hasExtendedUnicodeEscape) { + transformFlags |= 192 /* AssertES2015 */; + } break; - case 118 /* AnyKeyword */: - case 132 /* NumberKeyword */: - case 129 /* NeverKeyword */: - case 134 /* StringKeyword */: - case 121 /* BooleanKeyword */: - case 135 /* SymbolKeyword */: - case 104 /* VoidKeyword */: - case 143 /* TypeParameter */: - case 146 /* PropertySignature */: - case 148 /* MethodSignature */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: - case 156 /* TypePredicate */: - case 157 /* TypeReference */: - case 158 /* FunctionType */: - case 159 /* ConstructorType */: - case 160 /* TypeQuery */: - case 161 /* TypeLiteral */: - case 162 /* ArrayType */: - case 163 /* TupleType */: - case 164 /* UnionType */: - case 165 /* IntersectionType */: - case 166 /* ParenthesizedType */: - case 227 /* InterfaceDeclaration */: - case 228 /* TypeAliasDeclaration */: - case 167 /* ThisType */: - case 168 /* TypeOperator */: - case 169 /* IndexedAccessType */: - case 170 /* MappedType */: - case 171 /* LiteralType */: + case 8 /* NumericLiteral */: + if (node.numericLiteralFlags & 48 /* BinaryOrOctalSpecifier */) { + transformFlags |= 192 /* AssertES2015 */; + } + break; + case 216 /* 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 197 /* 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 122 /* BooleanKeyword */: + case 137 /* SymbolKeyword */: + case 105 /* VoidKeyword */: + case 145 /* TypeParameter */: + case 148 /* PropertySignature */: + case 150 /* MethodSignature */: + case 155 /* CallSignature */: + case 156 /* ConstructSignature */: + case 157 /* IndexSignature */: + case 158 /* TypePredicate */: + case 159 /* TypeReference */: + case 160 /* FunctionType */: + case 161 /* ConstructorType */: + case 162 /* TypeQuery */: + case 163 /* TypeLiteral */: + case 164 /* ArrayType */: + case 165 /* TupleType */: + case 166 /* UnionType */: + case 167 /* IntersectionType */: + case 168 /* ParenthesizedType */: + case 230 /* InterfaceDeclaration */: + case 231 /* TypeAliasDeclaration */: + case 169 /* ThisType */: + case 170 /* TypeOperator */: + case 171 /* IndexedAccessType */: + case 172 /* MappedType */: + case 173 /* LiteralType */: // Types and signatures are TypeScript syntax, and exclude all other facts. transformFlags = 3 /* AssertTypeScript */; excludeFlags = -3 /* TypeExcludes */; break; - case 142 /* ComputedPropertyName */: + case 144 /* 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. @@ -23208,42 +24369,42 @@ var ts; transformFlags |= 65536 /* ContainsLexicalThisInComputedPropertyName */; } break; - case 196 /* SpreadElement */: + case 198 /* SpreadElement */: transformFlags |= 192 /* AssertES2015 */ | 524288 /* ContainsSpread */; break; - case 259 /* SpreadAssignment */: + case 263 /* SpreadAssignment */: transformFlags |= 8 /* AssertESNext */ | 1048576 /* ContainsObjectSpread */; break; - case 96 /* SuperKeyword */: + case 97 /* SuperKeyword */: // This node is ES6 syntax. transformFlags |= 192 /* AssertES2015 */; break; - case 98 /* ThisKeyword */: + case 99 /* ThisKeyword */: // Mark this node and its ancestors as containing a lexical `this` keyword. transformFlags |= 16384 /* ContainsLexicalThis */; break; - case 172 /* ObjectBindingPattern */: + case 174 /* ObjectBindingPattern */: transformFlags |= 192 /* AssertES2015 */ | 8388608 /* ContainsBindingPattern */; if (subtreeFlags & 524288 /* ContainsRest */) { transformFlags |= 8 /* AssertESNext */ | 1048576 /* ContainsObjectRest */; } excludeFlags = 537396545 /* BindingPatternExcludes */; break; - case 173 /* ArrayBindingPattern */: + case 175 /* ArrayBindingPattern */: transformFlags |= 192 /* AssertES2015 */ | 8388608 /* ContainsBindingPattern */; excludeFlags = 537396545 /* BindingPatternExcludes */; break; - case 174 /* BindingElement */: + case 176 /* BindingElement */: transformFlags |= 192 /* AssertES2015 */; if (node.dotDotDotToken) { transformFlags |= 524288 /* ContainsRest */; } break; - case 145 /* Decorator */: + case 147 /* Decorator */: // This node is TypeScript syntax, and marks its container as also being TypeScript syntax. transformFlags |= 3 /* AssertTypeScript */ | 4096 /* ContainsDecorators */; break; - case 176 /* ObjectLiteralExpression */: + case 178 /* ObjectLiteralExpression */: excludeFlags = 540087617 /* ObjectLiteralExcludes */; if (subtreeFlags & 2097152 /* ContainsComputedPropertyName */) { // If an ObjectLiteralExpression contains a ComputedPropertyName, then it @@ -23261,8 +24422,8 @@ var ts; transformFlags |= 8 /* AssertESNext */; } break; - case 175 /* ArrayLiteralExpression */: - case 180 /* NewExpression */: + case 177 /* ArrayLiteralExpression */: + case 182 /* NewExpression */: excludeFlags = 537396545 /* ArrayLiteralOrCallOrNewExcludes */; if (subtreeFlags & 524288 /* ContainsSpread */) { // If the this node contains a SpreadExpression, then it is an ES6 @@ -23270,23 +24431,23 @@ var ts; transformFlags |= 192 /* AssertES2015 */; } break; - case 209 /* DoStatement */: - case 210 /* WhileStatement */: - case 211 /* ForStatement */: - case 212 /* ForInStatement */: + case 212 /* DoStatement */: + case 213 /* WhileStatement */: + case 214 /* ForStatement */: + case 215 /* ForInStatement */: // A loop containing a block scoped binding *may* need to be transformed from ES6. if (subtreeFlags & 4194304 /* ContainsBlockScopedBinding */) { transformFlags |= 192 /* AssertES2015 */; } break; - case 261 /* SourceFile */: + case 265 /* SourceFile */: if (subtreeFlags & 32768 /* ContainsCapturedLexicalThis */) { transformFlags |= 192 /* AssertES2015 */; } break; - case 216 /* ReturnStatement */: - case 214 /* ContinueStatement */: - case 215 /* BreakStatement */: + case 219 /* ReturnStatement */: + case 217 /* ContinueStatement */: + case 218 /* BreakStatement */: transformFlags |= 33554432 /* ContainsHoistedDeclarationOrCompletion */; break; } @@ -23302,56 +24463,57 @@ var ts; */ /* @internal */ function getTransformFlagsSubtreeExclusions(kind) { - if (kind >= 156 /* FirstTypeNode */ && kind <= 171 /* LastTypeNode */) { + if (kind >= 158 /* FirstTypeNode */ && kind <= 173 /* LastTypeNode */) { return -3 /* TypeExcludes */; } switch (kind) { - case 179 /* CallExpression */: - case 180 /* NewExpression */: - case 175 /* ArrayLiteralExpression */: + case 181 /* CallExpression */: + case 182 /* NewExpression */: + case 177 /* ArrayLiteralExpression */: return 537396545 /* ArrayLiteralOrCallOrNewExcludes */; - case 230 /* ModuleDeclaration */: + case 233 /* ModuleDeclaration */: return 574674241 /* ModuleExcludes */; - case 144 /* Parameter */: + case 146 /* Parameter */: return 536872257 /* ParameterExcludes */; - case 185 /* ArrowFunction */: + case 187 /* ArrowFunction */: return 601249089 /* ArrowFunctionExcludes */; - case 184 /* FunctionExpression */: - case 225 /* FunctionDeclaration */: + case 186 /* FunctionExpression */: + case 228 /* FunctionDeclaration */: return 601281857 /* FunctionExcludes */; - case 224 /* VariableDeclarationList */: + case 227 /* VariableDeclarationList */: return 546309441 /* VariableDeclarationListExcludes */; - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: + case 229 /* ClassDeclaration */: + case 199 /* ClassExpression */: return 539358529 /* ClassExcludes */; - case 150 /* Constructor */: + case 152 /* Constructor */: return 601015617 /* ConstructorExcludes */; - case 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 151 /* MethodDeclaration */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: return 601015617 /* MethodOrAccessorExcludes */; - case 118 /* AnyKeyword */: - case 132 /* NumberKeyword */: - case 129 /* NeverKeyword */: - case 134 /* StringKeyword */: - case 121 /* BooleanKeyword */: - case 135 /* SymbolKeyword */: - case 104 /* VoidKeyword */: - case 143 /* TypeParameter */: - case 146 /* PropertySignature */: - case 148 /* MethodSignature */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: - case 227 /* InterfaceDeclaration */: - case 228 /* TypeAliasDeclaration */: + case 119 /* AnyKeyword */: + case 133 /* NumberKeyword */: + case 130 /* NeverKeyword */: + case 136 /* StringKeyword */: + case 134 /* ObjectKeyword */: + case 122 /* BooleanKeyword */: + case 137 /* SymbolKeyword */: + case 105 /* VoidKeyword */: + case 145 /* TypeParameter */: + case 148 /* PropertySignature */: + case 150 /* MethodSignature */: + case 155 /* CallSignature */: + case 156 /* ConstructSignature */: + case 157 /* IndexSignature */: + case 230 /* InterfaceDeclaration */: + case 231 /* TypeAliasDeclaration */: return -3 /* TypeExcludes */; - case 176 /* ObjectLiteralExpression */: + case 178 /* ObjectLiteralExpression */: return 540087617 /* ObjectLiteralExcludes */; - case 256 /* CatchClause */: + case 260 /* CatchClause */: return 537920833 /* CatchClauseExcludes */; - case 172 /* ObjectBindingPattern */: - case 173 /* ArrayBindingPattern */: + case 174 /* ObjectBindingPattern */: + case 175 /* ArrayBindingPattern */: return 537396545 /* BindingPatternExcludes */; default: return 536872257 /* NodeExcludes */; @@ -23403,31 +24565,28 @@ var ts; } ts.moduleHasNonRelativeName = moduleHasNonRelativeName; /** Reads from "main" or "types"/"typings" depending on `extensions`. */ - function tryReadPackageJsonMainOrTypes(extensions, packageJsonPath, baseDirectory, state) { + function tryReadPackageJsonFields(readTypes, packageJsonPath, baseDirectory, state) { var jsonContent = readJson(packageJsonPath, state.host); - switch (extensions) { - case 2 /* DtsOnly */: - case 0 /* TypeScript */: - return tryReadFromField("typings") || tryReadFromField("types"); - case 1 /* JavaScript */: - return tryReadFromField("main"); - } + return readTypes ? tryReadFromField("typings") || tryReadFromField("types") : tryReadFromField("main"); function tryReadFromField(fieldName) { - if (ts.hasProperty(jsonContent, fieldName)) { - var typesFile = jsonContent[fieldName]; - if (typeof typesFile === "string") { - var typesFilePath = ts.normalizePath(ts.combinePaths(baseDirectory, typesFile)); - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.package_json_has_0_field_1_that_references_2, fieldName, typesFile, typesFilePath); - } - return typesFilePath; - } - else { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_string_got_1, fieldName, typeof typesFile); - } + if (!ts.hasProperty(jsonContent, fieldName)) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.package_json_does_not_have_a_0_field, fieldName); } + return; } + var fileName = jsonContent[fieldName]; + if (typeof fileName !== "string") { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_string_got_1, fieldName, typeof fileName); + } + return; + } + var path = ts.normalizePath(ts.combinePaths(baseDirectory, fileName)); + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.package_json_has_0_field_1_that_references_2, fieldName, fileName, path); + } + return path; } } function readJson(path, host) { @@ -23463,9 +24622,10 @@ var ts; function getDefaultTypeRoots(currentDirectory, host) { if (!host.directoryExists) { return [ts.combinePaths(currentDirectory, nodeModulesAtTypes)]; + // And if it doesn't exist, tough. } var typeRoots; - forEachAncestorDirectory(currentDirectory, function (directory) { + forEachAncestorDirectory(ts.normalizePath(currentDirectory), function (directory) { var atTypes = ts.combinePaths(directory, nodeModulesAtTypes); if (host.directoryExists(atTypes)) { (typeRoots || (typeRoots = [])).push(atTypes); @@ -23531,7 +24691,11 @@ var ts; return ts.forEach(typeRoots, function (typeRoot) { var candidate = ts.combinePaths(typeRoot, typeReferenceDirectiveName); var candidateDirectory = ts.getDirectoryPath(candidate); - return resolvedTypeScriptOnly(loadNodeModuleFromDirectory(2 /* DtsOnly */, candidate, failedLookupLocations, !directoryProbablyExists(candidateDirectory, host), moduleResolutionState)); + var directoryExists = directoryProbablyExists(candidateDirectory, host); + if (!directoryExists && traceEnabled) { + trace(host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, candidateDirectory); + } + return resolvedTypeScriptOnly(loadNodeModuleFromDirectory(Extensions.DtsOnly, candidate, failedLookupLocations, !directoryExists, moduleResolutionState)); }); } else { @@ -23548,7 +24712,7 @@ var ts; if (traceEnabled) { trace(host, ts.Diagnostics.Looking_up_in_node_modules_folder_initial_location_0, initialLocationForSecondaryLookup); } - var result = loadModuleFromNodeModules(2 /* DtsOnly */, typeReferenceDirectiveName, initialLocationForSecondaryLookup, failedLookupLocations, moduleResolutionState, /*cache*/ undefined); + var result = loadModuleFromNodeModules(Extensions.DtsOnly, typeReferenceDirectiveName, initialLocationForSecondaryLookup, failedLookupLocations, moduleResolutionState, /*cache*/ undefined); resolvedFile = resolvedTypeScriptOnly(result && result.value); if (!resolvedFile && traceEnabled) { trace(host, ts.Diagnostics.Type_reference_directive_0_was_not_resolved, typeReferenceDirectiveName); @@ -23564,13 +24728,13 @@ var ts; } ts.resolveTypeReferenceDirective = resolveTypeReferenceDirective; /** - * Given a set of options, returns the set of type directive names - * that should be included for this program automatically. - * This list could either come from the config file, - * or from enumerating the types root + initial secondary types lookup location. - * More type directives might appear in the program later as a result of loading actual source files; - * this list is only the set of defaults that are implicitly included. - */ + * Given a set of options, returns the set of type directive names + * that should be included for this program automatically. + * This list could either come from the config file, + * or from enumerating the types root + initial secondary types lookup location. + * More type directives might appear in the program later as a result of loading actual source files; + * this list is only the set of defaults that are implicitly included. + */ function getAutomaticTypeDirectiveNames(options, host) { // Use explicit type list from tsconfig.json if (options.types) { @@ -23619,9 +24783,10 @@ var ts; if (!moduleHasNonRelativeName(nonRelativeModuleName)) { return undefined; } - var perModuleNameCache = moduleNameToDirectoryMap[nonRelativeModuleName]; + var perModuleNameCache = moduleNameToDirectoryMap.get(nonRelativeModuleName); if (!perModuleNameCache) { - moduleNameToDirectoryMap[nonRelativeModuleName] = perModuleNameCache = createPerModuleNameCache(); + perModuleNameCache = createPerModuleNameCache(); + moduleNameToDirectoryMap.set(nonRelativeModuleName, perModuleNameCache); } return perModuleNameCache; } @@ -23657,13 +24822,13 @@ var ts; var commonPrefix = getCommonPrefix(path, resolvedFileName); var current = path; while (true) { - var parent_5 = ts.getDirectoryPath(current); - if (parent_5 === current || directoryPathMap.contains(parent_5)) { + var parent = ts.getDirectoryPath(current); + if (parent === current || directoryPathMap.contains(parent)) { break; } - directoryPathMap.set(parent_5, result); - current = parent_5; - if (current == commonPrefix) { + directoryPathMap.set(parent, result); + current = parent; + if (current === commonPrefix) { break; } } @@ -23695,7 +24860,7 @@ var ts; } var containingDirectory = ts.getDirectoryPath(containingFile); var perFolderCache = cache && cache.getOrCreateCacheForDirectory(containingDirectory); - var result = perFolderCache && perFolderCache[moduleName]; + var result = perFolderCache && perFolderCache.get(moduleName); if (result) { if (traceEnabled) { trace(host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache, moduleName); @@ -23723,7 +24888,7 @@ var ts; break; } if (perFolderCache) { - perFolderCache[moduleName] = result; + perFolderCache.set(moduleName, result); // put result in per-module name cache var perModuleNameCache = cache.getOrCreateCacheForModuleName(moduleName); if (perModuleNameCache) { @@ -23923,24 +25088,31 @@ var ts; } } function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache) { + return nodeModuleNameResolverWorker(moduleName, containingFile, compilerOptions, host, cache, /*jsOnly*/ false); + } + ts.nodeModuleNameResolver = nodeModuleNameResolver; + /* @internal */ + function nodeModuleNameResolverWorker(moduleName, containingFile, compilerOptions, host, cache, jsOnly) { + if (jsOnly === void 0) { jsOnly = false; } var containingDirectory = ts.getDirectoryPath(containingFile); var traceEnabled = isTraceEnabled(compilerOptions, host); var failedLookupLocations = []; var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled }; - var result = tryResolve(0 /* TypeScript */) || tryResolve(1 /* JavaScript */); + var result = jsOnly ? tryResolve(Extensions.JavaScript) : (tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript)); if (result && result.value) { var _a = result.value, resolved = _a.resolved, isExternalLibraryImport = _a.isExternalLibraryImport; return createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations); } return { resolvedModule: undefined, failedLookupLocations: failedLookupLocations }; function tryResolve(extensions) { - var resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, nodeLoadModuleByRelativeName, failedLookupLocations, state); + var loader = function (extensions, candidate, failedLookupLocations, onlyRecordFailures, state) { return nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, /*considerPackageJson*/ true); }; + var resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loader, failedLookupLocations, state); if (resolved) { return toSearchResult({ resolved: resolved, isExternalLibraryImport: false }); } if (moduleHasNonRelativeName(moduleName)) { if (traceEnabled) { - trace(host, ts.Diagnostics.Loading_module_0_from_node_modules_folder, moduleName); + trace(host, ts.Diagnostics.Loading_module_0_from_node_modules_folder_target_file_type_1, moduleName, Extensions[extensions]); } var resolved_1 = loadModuleFromNodeModules(extensions, moduleName, containingDirectory, failedLookupLocations, state, cache); // For node_modules lookups, get the real path so that multiple accesses to an `npm link`-ed module do not create duplicate files. @@ -23948,12 +25120,12 @@ var ts; } else { var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); - var resolved_2 = nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, /*onlyRecordFailures*/ false, state); + var resolved_2 = nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, /*onlyRecordFailures*/ false, state, /*considerPackageJson*/ true); return resolved_2 && toSearchResult({ resolved: resolved_2, isExternalLibraryImport: false }); } } } - ts.nodeModuleNameResolver = nodeModuleNameResolver; + ts.nodeModuleNameResolverWorker = nodeModuleNameResolverWorker; function realpath(path, host, traceEnabled) { if (!host.realpath) { return path; @@ -23964,12 +25136,35 @@ var ts; } return real; } - function nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, onlyRecordFailures, state) { + function nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, considerPackageJson) { if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.Loading_module_as_file_Slash_folder_candidate_module_location_0, candidate); + trace(state.host, ts.Diagnostics.Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1, candidate, Extensions[extensions]); } - var resolvedFromFile = !ts.pathEndsWithDirectorySeparator(candidate) && loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state); - return resolvedFromFile || loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state); + if (!ts.pathEndsWithDirectorySeparator(candidate)) { + if (!onlyRecordFailures) { + var parentOfCandidate = ts.getDirectoryPath(candidate); + if (!directoryProbablyExists(parentOfCandidate, state.host)) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, parentOfCandidate); + } + onlyRecordFailures = true; + } + } + var resolvedFromFile = loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state); + if (resolvedFromFile) { + return resolvedFromFile; + } + } + if (!onlyRecordFailures) { + var candidateExists = directoryProbablyExists(candidate, state.host); + if (!candidateExists) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, candidate); + } + onlyRecordFailures = true; + } + } + return loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, considerPackageJson); } /* @internal */ function directoryProbablyExists(directoryName, host) { @@ -24008,11 +25203,11 @@ var ts; } } switch (extensions) { - case 2 /* DtsOnly */: + case Extensions.DtsOnly: return tryExtension(".d.ts", ts.Extension.Dts); - case 0 /* TypeScript */: + case Extensions.TypeScript: return tryExtension(".ts", ts.Extension.Ts) || tryExtension(".tsx", ts.Extension.Tsx) || tryExtension(".d.ts", ts.Extension.Dts); - case 1 /* JavaScript */: + case Extensions.JavaScript: return tryExtension(".js", ts.Extension.Js) || tryExtension(".jsx", ts.Extension.Jsx); } function tryExtension(ext, extension) { @@ -24022,70 +25217,67 @@ var ts; } /** Return the file if it exists. */ function tryFile(fileName, failedLookupLocations, onlyRecordFailures, state) { - if (!onlyRecordFailures && state.host.fileExists(fileName)) { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.File_0_exist_use_it_as_a_name_resolution_result, fileName); - } - return fileName; - } - else { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.File_0_does_not_exist, fileName); - } - failedLookupLocations.push(fileName); - return undefined; - } - } - function loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state) { - var packageJsonPath = pathToPackageJson(candidate); - var directoryExists = !onlyRecordFailures && directoryProbablyExists(candidate, state.host); - if (directoryExists && state.host.fileExists(packageJsonPath)) { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); - } - var mainOrTypesFile = tryReadPackageJsonMainOrTypes(extensions, packageJsonPath, candidate, state); - if (mainOrTypesFile) { - var onlyRecordFailures_1 = !directoryProbablyExists(ts.getDirectoryPath(mainOrTypesFile), state.host); - // A package.json "typings" may specify an exact filename, or may choose to omit an extension. - var fromExactFile = tryFile(mainOrTypesFile, failedLookupLocations, onlyRecordFailures_1, state); - if (fromExactFile) { - var resolved_3 = fromExactFile && resolvedIfExtensionMatches(extensions, fromExactFile); - if (resolved_3) { - return resolved_3; - } - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it, fromExactFile); - } - } - var resolved = tryAddingExtensions(mainOrTypesFile, 0 /* TypeScript */, failedLookupLocations, onlyRecordFailures_1, state); - if (resolved) { - return resolved; - } - if (extensions === 1 /* JavaScript */) { - // A package.json "main" may specify an exact filename, or may choose to omit an extension. - // We tried the ts extensions erlier, now try the js extensions. - // tryReadPackageJsonMainOrTypes returns main iff extensions is Extensions.JavaScript. - var resolved_4 = tryAddingExtensions(mainOrTypesFile, 1 /* JavaScript */, failedLookupLocations, onlyRecordFailures_1, state); - if (resolved_4) { - return resolved_4; - } + if (!onlyRecordFailures) { + if (state.host.fileExists(fileName)) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.File_0_exist_use_it_as_a_name_resolution_result, fileName); } + return fileName; } else { if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.package_json_does_not_have_a_types_or_main_field); + trace(state.host, ts.Diagnostics.File_0_does_not_exist, fileName); } } } - else { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.File_0_does_not_exist, packageJsonPath); + failedLookupLocations.push(fileName); + return undefined; + } + function loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, considerPackageJson) { + if (considerPackageJson === void 0) { considerPackageJson = true; } + var directoryExists = !onlyRecordFailures && directoryProbablyExists(candidate, state.host); + if (considerPackageJson) { + var packageJsonPath = pathToPackageJson(candidate); + if (directoryExists && state.host.fileExists(packageJsonPath)) { + var fromPackageJson = loadModuleFromPackageJson(packageJsonPath, extensions, candidate, failedLookupLocations, state); + if (fromPackageJson) { + return fromPackageJson; + } + } + else { + if (directoryExists && state.traceEnabled) { + trace(state.host, ts.Diagnostics.File_0_does_not_exist, packageJsonPath); + } + // record package json as one of failed lookup locations - in the future if this file will appear it will invalidate resolution results + failedLookupLocations.push(packageJsonPath); } - // record package json as one of failed lookup locations - in the future if this file will appear it will invalidate resolution results - failedLookupLocations.push(packageJsonPath); } return loadModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocations, !directoryExists, state); } + function loadModuleFromPackageJson(packageJsonPath, extensions, candidate, failedLookupLocations, state) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); + } + var file = tryReadPackageJsonFields(extensions !== Extensions.JavaScript, packageJsonPath, candidate, state); + if (!file) { + return undefined; + } + var onlyRecordFailures = !directoryProbablyExists(ts.getDirectoryPath(file), state.host); + var fromFile = tryFile(file, failedLookupLocations, onlyRecordFailures, state); + if (fromFile) { + var resolved = fromFile && resolvedIfExtensionMatches(extensions, fromFile); + if (resolved) { + return resolved; + } + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it, fromFile); + } + } + // Even if extensions is DtsOnly, we can still look up a .ts file as a result of package.json "types" + var nextExtensions = extensions === Extensions.DtsOnly ? Extensions.TypeScript : extensions; + // Don't do package.json lookup recursively, because Node.js' package lookup doesn't. + return nodeLoadModuleByRelativeName(nextExtensions, file, failedLookupLocations, onlyRecordFailures, state, /*considerPackageJson*/ false); + } /** Resolve from an arbitrarily specified file. Return `undefined` if it has an unsupported extension. */ function resolvedIfExtensionMatches(extensions, path) { var extension = ts.tryGetExtensionFromPath(path); @@ -24094,20 +25286,18 @@ var ts; /** True if `extension` is one of the supported `extensions`. */ function extensionIsOk(extensions, extension) { switch (extensions) { - case 1 /* JavaScript */: + case Extensions.JavaScript: return extension === ts.Extension.Js || extension === ts.Extension.Jsx; - case 0 /* TypeScript */: + case Extensions.TypeScript: return extension === ts.Extension.Ts || extension === ts.Extension.Tsx || extension === ts.Extension.Dts; - case 2 /* DtsOnly */: + case Extensions.DtsOnly: return extension === ts.Extension.Dts; } } function pathToPackageJson(directory) { return ts.combinePaths(directory, "package.json"); } - function loadModuleFromNodeModulesFolder(extensions, moduleName, directory, failedLookupLocations, state) { - var nodeModulesFolder = ts.combinePaths(directory, "node_modules"); - var nodeModulesFolderExists = directoryProbablyExists(nodeModulesFolder, state.host); + function loadModuleFromNodeModulesFolder(extensions, moduleName, nodeModulesFolder, nodeModulesFolderExists, failedLookupLocations, state) { var candidate = ts.normalizePath(ts.combinePaths(nodeModulesFolder, moduleName)); return loadModuleFromFile(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state) || loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state); @@ -24117,7 +25307,7 @@ var ts; } function loadModuleFromNodeModulesAtTypes(moduleName, directory, failedLookupLocations, state) { // Extensions parameter here doesn't actually matter, because typesOnly ensures we're just doing @types lookup, which is always DtsOnly. - return loadModuleFromNodeModulesWorker(2 /* DtsOnly */, moduleName, directory, failedLookupLocations, state, /*typesOnly*/ true, /*cache*/ undefined); + return loadModuleFromNodeModulesWorker(Extensions.DtsOnly, moduleName, directory, failedLookupLocations, state, /*typesOnly*/ true, /*cache*/ undefined); } function loadModuleFromNodeModulesWorker(extensions, moduleName, directory, failedLookupLocations, state, typesOnly, cache) { var perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName); @@ -24134,14 +25324,41 @@ var ts; /** Load a module from a single node_modules directory, but not from any ancestors' node_modules directories. */ function loadModuleFromNodeModulesOneLevel(extensions, moduleName, directory, failedLookupLocations, state, typesOnly) { if (typesOnly === void 0) { typesOnly = false; } - var packageResult = typesOnly ? undefined : loadModuleFromNodeModulesFolder(extensions, moduleName, directory, failedLookupLocations, state); + var nodeModulesFolder = ts.combinePaths(directory, "node_modules"); + var nodeModulesFolderExists = directoryProbablyExists(nodeModulesFolder, state.host); + if (!nodeModulesFolderExists && state.traceEnabled) { + trace(state.host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, nodeModulesFolder); + } + var packageResult = typesOnly ? undefined : loadModuleFromNodeModulesFolder(extensions, moduleName, nodeModulesFolder, nodeModulesFolderExists, failedLookupLocations, state); if (packageResult) { return packageResult; } - if (extensions !== 1 /* JavaScript */) { - return loadModuleFromNodeModulesFolder(2 /* DtsOnly */, ts.combinePaths("@types", moduleName), directory, failedLookupLocations, state); + if (extensions !== Extensions.JavaScript) { + var nodeModulesAtTypes_1 = ts.combinePaths(nodeModulesFolder, "@types"); + var nodeModulesAtTypesExists = nodeModulesFolderExists; + if (nodeModulesFolderExists && !directoryProbablyExists(nodeModulesAtTypes_1, state.host)) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, nodeModulesAtTypes_1); + } + nodeModulesAtTypesExists = false; + } + return loadModuleFromNodeModulesFolder(Extensions.DtsOnly, mangleScopedPackage(moduleName, state), nodeModulesAtTypes_1, nodeModulesAtTypesExists, failedLookupLocations, state); } } + /** For a scoped package, we must look in `@types/foo__bar` instead of `@types/@foo/bar`. */ + function mangleScopedPackage(moduleName, state) { + if (ts.startsWith(moduleName, "@")) { + var replaceSlash = moduleName.replace(ts.directorySeparator, "__"); + if (replaceSlash !== moduleName) { + var mangled = replaceSlash.slice(1); // Take off the "@" + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Scoped_package_detected_looking_in_0, mangled); + } + return mangled; + } + } + return moduleName; + } function tryFindNonRelativeModuleNameInCache(cache, moduleName, containingDirectory, traceEnabled, host) { var result = cache && cache.get(containingDirectory); if (result) { @@ -24156,7 +25373,7 @@ var ts; var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled }; var failedLookupLocations = []; var containingDirectory = ts.getDirectoryPath(containingFile); - var resolved = tryResolve(0 /* TypeScript */) || tryResolve(1 /* JavaScript */); + var resolved = tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript); return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, /*isExternalLibraryImport*/ false, failedLookupLocations); function tryResolve(extensions) { var resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFile, failedLookupLocations, state); @@ -24166,7 +25383,7 @@ var ts; var perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName); if (moduleHasNonRelativeName(moduleName)) { // Climb up parent directories looking for a module. - var resolved_5 = forEachAncestorDirectory(containingDirectory, function (directory) { + var resolved_3 = forEachAncestorDirectory(containingDirectory, function (directory) { var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, directory, traceEnabled, host); if (resolutionFromCache) { return resolutionFromCache; @@ -24174,10 +25391,10 @@ var ts; var searchName = ts.normalizePath(ts.combinePaths(directory, moduleName)); return toSearchResult(loadModuleFromFile(extensions, searchName, failedLookupLocations, /*onlyRecordFailures*/ false, state)); }); - if (resolved_5) { - return resolved_5; + if (resolved_3) { + return resolved_3; } - if (extensions === 0 /* TypeScript */) { + if (extensions === Extensions.TypeScript) { // If we didn't find the file normally, look it up in @types. return loadModuleFromNodeModulesAtTypes(moduleName, containingDirectory, failedLookupLocations, state); } @@ -24201,7 +25418,7 @@ var ts; } var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled }; var failedLookupLocations = []; - var resolved = loadModuleFromNodeModulesOneLevel(2 /* DtsOnly */, moduleName, globalCache, failedLookupLocations, state); + var resolved = loadModuleFromNodeModulesOneLevel(Extensions.DtsOnly, moduleName, globalCache, failedLookupLocations, state); return createResolvedModuleWithFailedLookupLocations(resolved, /*isExternalLibraryImport*/ true, failedLookupLocations); } ts.loadModuleFromGlobalCache = loadModuleFromGlobalCache; @@ -24271,18 +25488,27 @@ var ts; var Signature = ts.objectAllocator.getSignatureConstructor(); var typeCount = 0; var symbolCount = 0; + var symbolInstantiationDepth = 0; var emptyArray = []; var emptySymbols = ts.createMap(); var compilerOptions = host.getCompilerOptions(); - var languageVersion = compilerOptions.target || 0 /* ES3 */; + var languageVersion = ts.getEmitScriptTarget(compilerOptions); var modulekind = ts.getEmitModuleKind(compilerOptions); var noUnusedIdentifiers = !!compilerOptions.noUnusedLocals || !!compilerOptions.noUnusedParameters; var allowSyntheticDefaultImports = typeof compilerOptions.allowSyntheticDefaultImports !== "undefined" ? compilerOptions.allowSyntheticDefaultImports : modulekind === ts.ModuleKind.System; - var strictNullChecks = compilerOptions.strictNullChecks; + var strictNullChecks = compilerOptions.strictNullChecks === undefined ? compilerOptions.strict : compilerOptions.strictNullChecks; + var noImplicitAny = compilerOptions.noImplicitAny === undefined ? compilerOptions.strict : compilerOptions.noImplicitAny; + var noImplicitThis = compilerOptions.noImplicitThis === undefined ? compilerOptions.strict : compilerOptions.noImplicitThis; var emitResolver = createResolver(); - var undefinedSymbol = createSymbol(4 /* Property */ | 67108864 /* Transient */, "undefined"); + var nodeBuilder = createNodeBuilder(); + var undefinedSymbol = createSymbol(4 /* Property */, "undefined"); undefinedSymbol.declarations = []; - var argumentsSymbol = createSymbol(4 /* Property */ | 67108864 /* Transient */, "arguments"); + var argumentsSymbol = createSymbol(4 /* Property */, "arguments"); + // for public members that accept a Node or one of its subtypes, we must guard against + // synthetic nodes created during transformations by calling `getParseTreeNode`. + // for most of these, we perform the guard only on `checker` to avoid any possible + // extra cost of calling `getParseTreeNode` when calling these functions from inside the + // checker. var checker = { getNodeCount: function () { return ts.sum(host.getSourceFiles(), "nodeCount"); }, getIdentifierCount: function () { return ts.sum(host.getSourceFiles(), "identifierCount"); }, @@ -24291,49 +25517,129 @@ var ts; isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; }, isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; }, isUnknownSymbol: function (symbol) { return symbol === unknownSymbol; }, + getMergedSymbol: getMergedSymbol, getDiagnostics: getDiagnostics, getGlobalDiagnostics: getGlobalDiagnostics, - getTypeOfSymbolAtLocation: getTypeOfSymbolAtLocation, - getSymbolsOfParameterPropertyDeclaration: getSymbolsOfParameterPropertyDeclaration, + getTypeOfSymbolAtLocation: function (symbol, location) { + location = ts.getParseTreeNode(location); + return location ? getTypeOfSymbolAtLocation(symbol, location) : unknownType; + }, + getSymbolsOfParameterPropertyDeclaration: function (parameter, parameterName) { + parameter = ts.getParseTreeNode(parameter, ts.isParameter); + ts.Debug.assert(parameter !== undefined, "Cannot get symbols of a synthetic parameter that cannot be resolved to a parse-tree node."); + return getSymbolsOfParameterPropertyDeclaration(parameter, parameterName); + }, getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol, getPropertiesOfType: getPropertiesOfType, getPropertyOfType: getPropertyOfType, + getIndexInfoOfType: getIndexInfoOfType, getSignaturesOfType: getSignaturesOfType, getIndexTypeOfType: getIndexTypeOfType, getBaseTypes: getBaseTypes, + getBaseTypeOfLiteralType: getBaseTypeOfLiteralType, + getWidenedType: getWidenedType, + getTypeFromTypeNode: function (node) { + node = ts.getParseTreeNode(node, ts.isTypeNode); + return node ? getTypeFromTypeNode(node) : unknownType; + }, + getParameterType: getTypeAtPosition, getReturnTypeOfSignature: getReturnTypeOfSignature, getNonNullableType: getNonNullableType, - getSymbolsInScope: getSymbolsInScope, - getSymbolAtLocation: getSymbolAtLocation, - getShorthandAssignmentValueSymbol: getShorthandAssignmentValueSymbol, - getExportSpecifierLocalTargetSymbol: getExportSpecifierLocalTargetSymbol, - getTypeAtLocation: getTypeOfNode, - getPropertySymbolOfDestructuringAssignment: getPropertySymbolOfDestructuringAssignment, - typeToString: typeToString, + typeToTypeNode: nodeBuilder.typeToTypeNode, + indexInfoToIndexSignatureDeclaration: nodeBuilder.indexInfoToIndexSignatureDeclaration, + signatureToSignatureDeclaration: nodeBuilder.signatureToSignatureDeclaration, + getSymbolsInScope: function (location, meaning) { + location = ts.getParseTreeNode(location); + return location ? getSymbolsInScope(location, meaning) : []; + }, + getSymbolAtLocation: function (node) { + node = ts.getParseTreeNode(node); + return node ? getSymbolAtLocation(node) : undefined; + }, + getShorthandAssignmentValueSymbol: function (node) { + node = ts.getParseTreeNode(node); + return node ? getShorthandAssignmentValueSymbol(node) : undefined; + }, + getExportSpecifierLocalTargetSymbol: function (node) { + node = ts.getParseTreeNode(node, ts.isExportSpecifier); + return node ? getExportSpecifierLocalTargetSymbol(node) : undefined; + }, + getTypeAtLocation: function (node) { + node = ts.getParseTreeNode(node); + return node ? getTypeOfNode(node) : unknownType; + }, + getPropertySymbolOfDestructuringAssignment: function (location) { + location = ts.getParseTreeNode(location, ts.isIdentifier); + return location ? getPropertySymbolOfDestructuringAssignment(location) : undefined; + }, + signatureToString: function (signature, enclosingDeclaration, flags, kind) { + return signatureToString(signature, ts.getParseTreeNode(enclosingDeclaration), flags, kind); + }, + typeToString: function (type, enclosingDeclaration, flags) { + return typeToString(type, ts.getParseTreeNode(enclosingDeclaration), flags); + }, getSymbolDisplayBuilder: getSymbolDisplayBuilder, - symbolToString: symbolToString, + symbolToString: function (symbol, enclosingDeclaration, meaning) { + return symbolToString(symbol, ts.getParseTreeNode(enclosingDeclaration), meaning); + }, getAugmentedPropertiesOfType: getAugmentedPropertiesOfType, getRootSymbols: getRootSymbols, - getContextualType: getContextualType, + getContextualType: function (node) { + node = ts.getParseTreeNode(node, ts.isExpression); + return node ? getContextualType(node) : undefined; + }, getFullyQualifiedName: getFullyQualifiedName, - getResolvedSignature: getResolvedSignature, - getConstantValue: getConstantValue, - isValidPropertyAccess: isValidPropertyAccess, - getSignatureFromDeclaration: getSignatureFromDeclaration, - isImplementationOfOverload: isImplementationOfOverload, + getResolvedSignature: function (node, candidatesOutArray) { + node = ts.getParseTreeNode(node, ts.isCallLikeExpression); + return node ? getResolvedSignature(node, candidatesOutArray) : undefined; + }, + getConstantValue: function (node) { + node = ts.getParseTreeNode(node, canHaveConstantValue); + return node ? getConstantValue(node) : undefined; + }, + isValidPropertyAccess: function (node, propertyName) { + node = ts.getParseTreeNode(node, ts.isPropertyAccessOrQualifiedName); + return node ? isValidPropertyAccess(node, propertyName) : false; + }, + getSignatureFromDeclaration: function (declaration) { + declaration = ts.getParseTreeNode(declaration, ts.isFunctionLike); + return declaration ? getSignatureFromDeclaration(declaration) : undefined; + }, + isImplementationOfOverload: function (node) { + node = ts.getParseTreeNode(node, ts.isFunctionLike); + return node ? isImplementationOfOverload(node) : undefined; + }, + getImmediateAliasedSymbol: function (symbol) { + ts.Debug.assert((symbol.flags & 8388608 /* Alias */) !== 0, "Should only get Alias here."); + var links = getSymbolLinks(symbol); + if (!links.immediateTarget) { + var node = getDeclarationOfAliasSymbol(symbol); + ts.Debug.assert(!!node); + links.immediateTarget = getTargetOfAliasDeclaration(node, /*dontRecursivelyResolve*/ true); + } + return links.immediateTarget; + }, getAliasedSymbol: resolveAlias, getEmitResolver: getEmitResolver, getExportsOfModule: getExportsOfModuleAsArray, + getExportsAndPropertiesOfModule: getExportsAndPropertiesOfModule, getAmbientModules: getAmbientModules, - getJsxElementAttributesType: getJsxElementAttributesType, + getAllAttributesTypeFromJsxOpeningLikeElement: function (node) { + node = ts.getParseTreeNode(node, ts.isJsxOpeningLikeElement); + return node ? getAllAttributesTypeFromJsxOpeningLikeElement(node) : undefined; + }, getJsxIntrinsicTagNames: getJsxIntrinsicTagNames, - isOptionalParameter: isOptionalParameter, + isOptionalParameter: function (node) { + node = ts.getParseTreeNode(node, ts.isParameter); + return node ? isOptionalParameter(node) : false; + }, tryGetMemberInModuleExports: tryGetMemberInModuleExports, tryFindAmbientModuleWithoutAugmentations: function (moduleName) { // we deliberately exclude augmentations // since we are only interested in declarations of the module itself return tryFindAmbientModule(moduleName, /*withAugmentations*/ false); - } + }, + getApparentType: getApparentType }; var tupleTypes = []; var unionTypes = ts.createMap(); @@ -24342,8 +25648,8 @@ var ts; var numericLiteralTypes = ts.createMap(); var indexedAccessTypes = ts.createMap(); var evolvingArrayTypes = []; - var unknownSymbol = createSymbol(4 /* Property */ | 67108864 /* Transient */, "unknown"); - var resolvingSymbol = createSymbol(67108864 /* Transient */, "__resolving__"); + var unknownSymbol = createSymbol(4 /* Property */, "unknown"); + var resolvingSymbol = createSymbol(0, "__resolving__"); var anyType = createIntrinsicType(1 /* Any */, "any"); var autoType = createIntrinsicType(1 /* Any */, "any"); var unknownType = createIntrinsicType(1 /* Any */, "unknown"); @@ -24360,8 +25666,9 @@ var ts; var voidType = createIntrinsicType(1024 /* Void */, "void"); var neverType = createIntrinsicType(8192 /* Never */, "never"); var silentNeverType = createIntrinsicType(8192 /* Never */, "never"); + var nonPrimitiveType = createIntrinsicType(16777216 /* NonPrimitive */, "object"); var emptyObjectType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); - var emptyTypeLiteralSymbol = createSymbol(2048 /* TypeLiteral */ | 67108864 /* Transient */, "__type"); + var emptyTypeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type"); emptyTypeLiteralSymbol.members = ts.createMap(); var emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, emptyArray, emptyArray, undefined, undefined); var emptyGenericType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); @@ -24371,21 +25678,20 @@ var ts; // in getPropagatingFlagsOfTypes, and it is checked in inferFromTypes. anyFunctionType.flags |= 8388608 /* ContainsAnyFunctionType */; var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); + var circularConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var anySignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); var unknownSignature = createSignature(undefined, undefined, undefined, emptyArray, unknownType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); var resolvingSignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); var silentNeverSignature = createSignature(undefined, undefined, undefined, emptyArray, silentNeverType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); var enumNumberIndexInfo = createIndexInfo(stringType, /*isReadonly*/ true); + var jsObjectLiteralIndexInfo = createIndexInfo(anyType, /*isReadonly*/ false); var globals = ts.createMap(); /** * List of every ambient module with a "*" wildcard. * Unlike other ambient modules, these can't be stored in `globals` because symbol tables only deal with exact matches. * This is only used if there is no exact match. - */ + */ var patternAmbientModules; - var getGlobalESSymbolConstructorSymbol; - var getGlobalPromiseConstructorSymbol; - var tryGetGlobalPromiseConstructorSymbol; var globalObjectType; var globalFunctionType; var globalArrayType; @@ -24394,29 +25700,29 @@ var ts; var globalNumberType; var globalBooleanType; var globalRegExpType; + var globalThisType; var anyArrayType; var autoArrayType; var anyReadonlyArrayType; // 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 - var getGlobalTemplateStringsArrayType; - var getGlobalESSymbolType; - var getGlobalIterableType; - var getGlobalIteratorType; - var getGlobalIterableIteratorType; - var getGlobalClassDecoratorType; - var getGlobalParameterDecoratorType; - var getGlobalPropertyDecoratorType; - var getGlobalMethodDecoratorType; - var getGlobalTypedPropertyDescriptorType; - var getGlobalPromiseType; - var tryGetGlobalPromiseType; - var getGlobalPromiseLikeType; - var getInstantiatedGlobalPromiseLikeType; - var getGlobalPromiseConstructorLikeType; - var getGlobalThenableType; - var jsxElementClassType; + var deferredGlobalESSymbolConstructorSymbol; + var deferredGlobalESSymbolType; + var deferredGlobalTypedPropertyDescriptorType; + var deferredGlobalPromiseType; + var deferredGlobalPromiseConstructorSymbol; + var deferredGlobalPromiseConstructorLikeType; + var deferredGlobalIterableType; + var deferredGlobalIteratorType; + var deferredGlobalIterableIteratorType; + var deferredGlobalAsyncIterableType; + var deferredGlobalAsyncIteratorType; + var deferredGlobalAsyncIterableIteratorType; + var deferredGlobalTemplateStringsArrayType; + var deferredJsxElementClassType; + var deferredJsxElementType; + var deferredJsxStatelessElementType; var deferredNodes; var deferredUnusedIdentifierNodes; var flowLoopStart = 0; @@ -24437,6 +25743,7 @@ var ts; var visitedFlowNodes = []; var visitedFlowTypes = []; var potentialThisCollisions = []; + var potentialNewTargetCollisions = []; var awaitedTypeStack = []; var diagnostics = ts.createDiagnosticCollection(); var TypeFacts; @@ -24502,7 +25809,7 @@ var ts; TypeFacts[TypeFacts["UndefinedFacts"] = 2457472] = "UndefinedFacts"; TypeFacts[TypeFacts["NullFacts"] = 2340752] = "NullFacts"; })(TypeFacts || (TypeFacts = {})); - var typeofEQFacts = ts.createMap({ + var typeofEQFacts = ts.createMapFromTemplate({ "string": 1 /* TypeofEQString */, "number": 2 /* TypeofEQNumber */, "boolean": 4 /* TypeofEQBoolean */, @@ -24511,7 +25818,7 @@ var ts; "object": 16 /* TypeofEQObject */, "function": 32 /* TypeofEQFunction */ }); - var typeofNEFacts = ts.createMap({ + var typeofNEFacts = ts.createMapFromTemplate({ "string": 128 /* TypeofNEString */, "number": 256 /* TypeofNENumber */, "boolean": 512 /* TypeofNEBoolean */, @@ -24520,16 +25827,20 @@ var ts; "object": 2048 /* TypeofNEObject */, "function": 4096 /* TypeofNEFunction */ }); - var typeofTypesByName = ts.createMap({ + var typeofTypesByName = ts.createMapFromTemplate({ "string": stringType, "number": numberType, "boolean": booleanType, "symbol": esSymbolType, "undefined": undefinedType }); - var jsxElementType; + 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.createMap(); var JsxNames = { @@ -24537,6 +25848,7 @@ var ts; IntrinsicElements: "IntrinsicElements", ElementClass: "ElementClass", ElementAttributesPropertyNameContainer: "ElementAttributesProperty", + ElementChildrenAttributeNameContainer: "ElementChildrenAttribute", Element: "Element", IntrinsicAttributes: "IntrinsicAttributes", IntrinsicClassAttributes: "IntrinsicClassAttributes" @@ -24555,12 +25867,18 @@ var ts; TypeSystemPropertyName[TypeSystemPropertyName["DeclaredType"] = 2] = "DeclaredType"; TypeSystemPropertyName[TypeSystemPropertyName["ResolvedReturnType"] = 3] = "ResolvedReturnType"; })(TypeSystemPropertyName || (TypeSystemPropertyName = {})); + var CheckMode; + (function (CheckMode) { + CheckMode[CheckMode["Normal"] = 0] = "Normal"; + CheckMode[CheckMode["SkipContextSensitive"] = 1] = "SkipContextSensitive"; + CheckMode[CheckMode["Inferential"] = 2] = "Inferential"; + })(CheckMode || (CheckMode = {})); var builtinGlobals = ts.createMap(); - builtinGlobals[undefinedSymbol.name] = undefinedSymbol; + builtinGlobals.set(undefinedSymbol.name, undefinedSymbol); initializeTypeChecker(); return checker; function getJsxNamespace() { - if (_jsxNamespace === undefined) { + if (!_jsxNamespace) { _jsxNamespace = "React"; if (compilerOptions.jsxFactory) { _jsxFactoryEntity = ts.parseIsolatedEntityName(compilerOptions.jsxFactory, languageVersion); @@ -24588,7 +25906,12 @@ var ts; } function createSymbol(flags, name) { symbolCount++; - return new Symbol(flags, name); + var symbol = (new Symbol(flags | 134217728 /* Transient */, name)); + symbol.checkFlags = 0; + return symbol; + } + function isTransientSymbol(symbol) { + return (symbol.flags & 134217728 /* Transient */) !== 0; } function getExcludedSymbolFlags(flags) { var result = 0; @@ -24634,7 +25957,7 @@ var ts; mergedSymbols[source.mergeId] = target; } function cloneSymbol(symbol) { - var result = createSymbol(symbol.flags | 33554432 /* Merged */, symbol.name); + var result = createSymbol(symbol.flags, symbol.name); result.declarations = symbol.declarations.slice(0); result.parent = symbol.parent; if (symbol.valueDeclaration) @@ -24657,7 +25980,7 @@ var ts; target.flags |= source.flags; if (source.valueDeclaration && (!target.valueDeclaration || - (target.valueDeclaration.kind === 230 /* ModuleDeclaration */ && source.valueDeclaration.kind !== 230 /* ModuleDeclaration */))) { + (target.valueDeclaration.kind === 233 /* ModuleDeclaration */ && source.valueDeclaration.kind !== 233 /* ModuleDeclaration */))) { // other kinds of value declarations take precedence over modules target.valueDeclaration = source.valueDeclaration; } @@ -24674,30 +25997,34 @@ var ts; } 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; ts.forEach(source.declarations, function (node) { - error(node.name ? node.name : node, message_2, symbolToString(source)); + error(ts.getNameOfDeclaration(node) || node, message_2, symbolToString(source)); }); ts.forEach(target.declarations, function (node) { - error(node.name ? node.name : node, message_2, symbolToString(source)); + error(ts.getNameOfDeclaration(node) || node, message_2, symbolToString(source)); }); } } function mergeSymbolTable(target, source) { - for (var id in source) { - var targetSymbol = target[id]; + source.forEach(function (sourceSymbol, id) { + var targetSymbol = target.get(id); if (!targetSymbol) { - target[id] = source[id]; + target.set(id, sourceSymbol); } else { - if (!(targetSymbol.flags & 33554432 /* Merged */)) { - target[id] = targetSymbol = cloneSymbol(targetSymbol); + if (!(targetSymbol.flags & 134217728 /* Transient */)) { + targetSymbol = cloneSymbol(targetSymbol); + target.set(id, targetSymbol); } - mergeSymbol(targetSymbol, source[id]); + mergeSymbol(targetSymbol, sourceSymbol); } - } + }); } function mergeModuleAugmentation(moduleName) { var moduleAugmentation = moduleName.parent; @@ -24726,7 +26053,7 @@ var ts; if (mainModule.flags & 1920 /* Namespace */) { // if module symbol has already been merged - it is safe to use it. // otherwise clone it - mainModule = mainModule.flags & 33554432 /* Merged */ ? mainModule : cloneSymbol(mainModule); + mainModule = mainModule.flags & 134217728 /* Transient */ ? mainModule : cloneSymbol(mainModule); mergeSymbol(mainModule, moduleAugmentation.symbol); } else { @@ -24735,21 +26062,22 @@ var ts; } } function addToSymbolTable(target, source, message) { - for (var id in source) { - if (target[id]) { + source.forEach(function (sourceSymbol, id) { + var targetSymbol = target.get(id); + if (targetSymbol) { // Error on redeclarations - ts.forEach(target[id].declarations, addDeclarationDiagnostic(id, message)); + ts.forEach(targetSymbol.declarations, addDeclarationDiagnostic(id, message)); } else { - target[id] = source[id]; + target.set(id, sourceSymbol); } - } + }); function addDeclarationDiagnostic(id, message) { return function (declaration) { return diagnostics.add(ts.createDiagnosticForNode(declaration, message, id)); }; } } function getSymbolLinks(symbol) { - if (symbol.flags & 67108864 /* Transient */) + if (symbol.flags & 134217728 /* Transient */) return symbol; var id = getSymbolId(symbol); return symbolLinks[id] || (symbolLinks[id] = {}); @@ -24761,14 +26089,17 @@ var ts; function getObjectFlags(type) { return type.flags & 32768 /* Object */ ? type.objectFlags : 0; } + function getCheckFlags(symbol) { + return symbol.flags & 134217728 /* Transient */ ? symbol.checkFlags : 0; + } function isGlobalSourceFile(node) { - return node.kind === 261 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); + return node.kind === 265 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning) { - var symbol = symbols[name]; + var symbol = symbols.get(name); if (symbol) { - ts.Debug.assert((symbol.flags & 16777216 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); + ts.Debug.assert((getCheckFlags(symbol) & 1 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); if (symbol.flags & meaning) { return symbol; } @@ -24804,13 +26135,14 @@ var ts; var useFile = ts.getSourceFileOfNode(usage); if (declarationFile !== useFile) { if ((modulekind && (declarationFile.externalModuleIndicator || useFile.externalModuleIndicator)) || - (!compilerOptions.outFile && !compilerOptions.out)) { - // nodes are in different files and order cannot be determines + (!compilerOptions.outFile && !compilerOptions.out) || + ts.isInAmbientContext(declaration)) { + // nodes are in different files and order cannot be determined return true; } // declaration is after usage // can be legal if usage is deferred (i.e. inside function or in initializer of instance property) - if (isUsedInFunctionOrNonStaticProperty(usage)) { + if (isUsedInFunctionOrInstanceProperty(usage, declaration)) { return true; } var sourceFiles = host.getSourceFiles(); @@ -24818,32 +26150,41 @@ var ts; } if (declaration.pos <= usage.pos) { // declaration is before usage - if (declaration.kind === 174 /* BindingElement */) { + if (declaration.kind === 176 /* 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, 174 /* BindingElement */); + var errorBindingElement = ts.getAncestor(usage, 176 /* BindingElement */); if (errorBindingElement) { - return getAncestorBindingPattern(errorBindingElement) !== getAncestorBindingPattern(declaration) || + 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, 223 /* VariableDeclaration */), usage); + return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 226 /* VariableDeclaration */), usage); } - else if (declaration.kind === 223 /* VariableDeclaration */) { + else if (declaration.kind === 226 /* VariableDeclaration */) { // still might be illegal if usage is in the initializer of the variable declaration (eg var a = a) return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } return true; } - // declaration is after usage - // can be legal if usage is deferred (i.e. inside function or in initializer of instance property) + // declaration is after usage, but it can still be legal if usage is deferred: + // 1. inside an export specifier + // 2. inside a function + // 3. inside an instance property initializer, a reference to a non-instance property + // 4. inside a static property initializer, a reference to a static method in the same class + // or if usage is in a type context: + // 1. inside a type query (typeof in type position) + if (usage.parent.kind === 246 /* ExportSpecifier */) { + // export specifiers do not use the variable, they only make it available for use + return true; + } var container = ts.getEnclosingBlockScopeContainer(declaration); - return isUsedInFunctionOrNonStaticProperty(usage, container); + return isInTypeQuery(usage) || isUsedInFunctionOrInstanceProperty(usage, declaration, container); function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { var container = ts.getEnclosingBlockScopeContainer(declaration); switch (declaration.parent.parent.kind) { - case 205 /* VariableStatement */: - case 211 /* ForStatement */: - case 213 /* ForOfStatement */: + case 208 /* VariableStatement */: + case 214 /* ForStatement */: + case 216 /* 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)) { @@ -24852,8 +26193,8 @@ var ts; break; } switch (declaration.parent.parent.kind) { - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: + case 215 /* ForInStatement */: + case 216 /* ForOfStatement */: // ForIn/ForOf case - use site should not be used in expression part if (isSameScopeDescendentOf(usage, declaration.parent.parent.expression, container)) { return true; @@ -24861,34 +26202,31 @@ var ts; } return false; } - function isUsedInFunctionOrNonStaticProperty(usage, container) { - var current = usage; - while (current) { + function isUsedInFunctionOrInstanceProperty(usage, declaration, container) { + return !!ts.findAncestor(usage, function (current) { if (current === container) { - return false; + return "quit"; } if (ts.isFunctionLike(current)) { return true; } - var initializerOfNonStaticProperty = current.parent && - current.parent.kind === 147 /* PropertyDeclaration */ && - (ts.getModifierFlags(current.parent) & 32 /* Static */) === 0 && + var initializerOfProperty = current.parent && + current.parent.kind === 149 /* PropertyDeclaration */ && current.parent.initializer === current; - if (initializerOfNonStaticProperty) { - return true; + if (initializerOfProperty) { + if (ts.getModifierFlags(current.parent) & 32 /* Static */) { + if (declaration.kind === 151 /* MethodDeclaration */) { + return true; + } + } + else { + var isDeclarationInstanceProperty = declaration.kind === 149 /* PropertyDeclaration */ && !(ts.getModifierFlags(declaration) & 32 /* Static */); + if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { + return true; + } + } } - current = current.parent; - } - return false; - } - function getAncestorBindingPattern(node) { - while (node) { - if (ts.isBindingPattern(node)) { - return node; - } - node = node.parent; - } - return undefined; + }); } } // Resolve a given name for a given meaning at a given location. An error is reported if the name was not found and @@ -24913,11 +26251,11 @@ 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 !== 278 /* JSDocComment */) { + if (meaning & result.flags & 793064 /* Type */ && lastLocation.kind !== 283 /* JSDocComment */) { useResult = result.flags & 262144 /* TypeParameter */ ? lastLocation === location.type || - lastLocation.kind === 144 /* Parameter */ || - lastLocation.kind === 143 /* TypeParameter */ + lastLocation.kind === 146 /* Parameter */ || + lastLocation.kind === 145 /* TypeParameter */ : false; } if (meaning & 107455 /* Value */ && result.flags & 1 /* FunctionScopedVariable */) { @@ -24926,9 +26264,9 @@ var ts; // however it is detected separately when checking initializers of parameters // to make sure that they reference no variables declared after them. useResult = - lastLocation.kind === 144 /* Parameter */ || + lastLocation.kind === 146 /* Parameter */ || (lastLocation === location.type && - result.valueDeclaration.kind === 144 /* Parameter */); + result.valueDeclaration.kind === 146 /* Parameter */); } } if (useResult) { @@ -24940,16 +26278,17 @@ var ts; } } switch (location.kind) { - case 261 /* SourceFile */: + case 265 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; isInExternalModule = true; - case 230 /* ModuleDeclaration */: + // falls through + case 233 /* ModuleDeclaration */: var moduleExports = getSymbolOfNode(location).exports; - if (location.kind === 261 /* SourceFile */ || ts.isAmbientModule(location)) { + if (location.kind === 265 /* 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["default"]) { + if (result = moduleExports.get("default")) { var localSymbol = ts.getLocalSymbolForExportDefault(result); if (localSymbol && (result.flags & meaning) && localSymbol.name === name) { break loop; @@ -24967,9 +26306,10 @@ var ts; // 2. We check === SymbolFlags.Alias in order to check that the symbol is *purely* // an alias. If we used &, we'd be throwing out symbols that have non alias aspects, // which is not the desired behavior. - if (moduleExports[name] && - moduleExports[name].flags === 8388608 /* Alias */ && - ts.getDeclarationOfKind(moduleExports[name], 243 /* ExportSpecifier */)) { + var moduleExport = moduleExports.get(name); + if (moduleExport && + moduleExport.flags === 8388608 /* Alias */ && + ts.getDeclarationOfKind(moduleExport, 246 /* ExportSpecifier */)) { break; } } @@ -24977,13 +26317,13 @@ var ts; break loop; } break; - case 229 /* EnumDeclaration */: + case 232 /* EnumDeclaration */: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { break loop; } break; - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: + case 149 /* PropertyDeclaration */: + case 148 /* 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 @@ -25000,10 +26340,15 @@ var ts; } } break; - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: - case 227 /* InterfaceDeclaration */: + case 229 /* ClassDeclaration */: + case 199 /* ClassExpression */: + case 230 /* InterfaceDeclaration */: if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & 793064 /* Type */)) { + if (!isTypeParameterSymbolDeclaredInContainer(result, location)) { + // ignore type parameters not declared in this container + result = undefined; + break; + } if (lastLocation && ts.getModifierFlags(lastLocation) & 32 /* Static */) { // TypeScript 1.0 spec (April 2014): 3.4.1 // The scope of a type parameter extends over the entire declaration with which the type @@ -25013,7 +26358,7 @@ var ts; } break loop; } - if (location.kind === 197 /* ClassExpression */ && meaning & 32 /* Class */) { + if (location.kind === 199 /* ClassExpression */ && meaning & 32 /* Class */) { var className = location.name; if (className && name === className.text) { result = location.symbol; @@ -25029,9 +26374,9 @@ var ts; // [foo()]() { } // <-- Reference to T from class's own computed property // } // - case 142 /* ComputedPropertyName */: + case 144 /* ComputedPropertyName */: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 227 /* InterfaceDeclaration */) { + if (ts.isClassLike(grandparent) || grandparent.kind === 230 /* InterfaceDeclaration */) { // A reference to this grandparent's type parameters would be an error if (result = getSymbol(getSymbolOfNode(grandparent).members, name, meaning & 793064 /* Type */)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); @@ -25039,19 +26384,19 @@ var ts; } } break; - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 225 /* FunctionDeclaration */: - case 185 /* ArrowFunction */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: + case 152 /* Constructor */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + case 228 /* FunctionDeclaration */: + case 187 /* ArrowFunction */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 184 /* FunctionExpression */: + case 186 /* FunctionExpression */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; @@ -25064,7 +26409,7 @@ var ts; } } break; - case 145 /* Decorator */: + case 147 /* Decorator */: // Decorators are resolved at the class declaration. Resolving at the parameter // or member would result in looking up locals in the method. // @@ -25073,7 +26418,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 === 144 /* Parameter */) { + if (location.parent && location.parent.kind === 146 /* Parameter */) { location = location.parent; } // @@ -25102,7 +26447,8 @@ var ts; !checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) && !checkAndReportErrorForExtendingInterface(errorLocation) && !checkAndReportErrorForUsingTypeAsNamespace(errorLocation, name, meaning) && - !checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning)) { + !checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) && + !checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning)) { error(errorLocation, nameNotFoundMessage, typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); } } @@ -25124,31 +26470,41 @@ var ts; // interface bar {} // } // const foo/*1*/: foo/*2*/.bar; - // The foo at /*1*/ and /*2*/ will share same symbol with two meaning - // block - scope variable and namespace module. However, only when we + // The foo at /*1*/ and /*2*/ will share same symbol with two meanings: + // block-scoped variable and namespace module. However, only when we // try to resolve name in /*1*/ which is used in variable position, - // we want to check for block- scoped - if (meaning & 2 /* BlockScopedVariable */) { + // we want to check for block-scoped + if (meaning & 2 /* BlockScopedVariable */ || + ((meaning & 32 /* Class */ || meaning & 384 /* Enum */) && (meaning & 107455 /* Value */) === 107455 /* Value */)) { var exportOrLocalSymbol = getExportSymbolOfValueSymbolIfExported(result); - if (exportOrLocalSymbol.flags & 2 /* BlockScopedVariable */) { + 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 */) { var decls = result.declarations; - if (decls && decls.length === 1 && decls[0].kind === 233 /* NamespaceExportDeclaration */) { + if (decls && decls.length === 1 && decls[0].kind === 236 /* NamespaceExportDeclaration */) { error(errorLocation, ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead, name); } } } return result; } + function isTypeParameterSymbolDeclaredInContainer(symbol, container) { + for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { + var decl = _a[_i]; + if (decl.kind === 145 /* TypeParameter */ && decl.parent === container) { + return true; + } + } + return false; + } function checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) { - if ((errorLocation.kind === 70 /* Identifier */ && (isTypeReferenceIdentifier(errorLocation)) || isInTypeQuery(errorLocation))) { + if ((errorLocation.kind === 71 /* Identifier */ && (isTypeReferenceIdentifier(errorLocation)) || isInTypeQuery(errorLocation))) { return false; } - var container = ts.getThisContainer(errorLocation, /* includeArrowFunctions */ true); + var container = ts.getThisContainer(errorLocation, /*includeArrowFunctions*/ true); var location = container; while (location) { if (ts.isClassLike(location.parent)) { @@ -25190,10 +26546,10 @@ var ts; */ function getEntityNameForExtendingInterface(node) { switch (node.kind) { - case 70 /* Identifier */: - case 177 /* PropertyAccessExpression */: + case 71 /* Identifier */: + case 179 /* PropertyAccessExpression */: return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined; - case 199 /* ExpressionWithTypeArguments */: + case 201 /* ExpressionWithTypeArguments */: ts.Debug.assert(ts.isEntityNameExpression(node.expression)); return node.expression; default: @@ -25220,13 +26576,38 @@ 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)); + if (symbol) { + error(errorLocation, ts.Diagnostics.Cannot_use_namespace_0_as_a_value, name); + return true; + } + } + else if (meaning & (793064 /* Type */ & ~1024 /* NamespaceModule */ & ~107455 /* Value */)) { + var symbol = resolveSymbol(resolveName(errorLocation, name, 1024 /* NamespaceModule */ & ~793064 /* Type */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined)); + if (symbol) { + error(errorLocation, ts.Diagnostics.Cannot_use_namespace_0_as_a_type, name); + return true; + } + } + return false; + } function checkResolvedBlockScopedVariable(result, errorLocation) { - ts.Debug.assert((result.flags & 2 /* BlockScopedVariable */) !== 0); + 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) ? d : undefined; }); - ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); + var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 232 /* EnumDeclaration */) ? d : undefined; }); + ts.Debug.assert(declaration !== undefined, "Declaration to checkResolvedBlockScopedVariable is undefined"); if (!ts.isInAmbientContext(declaration) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { - error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); + if (result.flags & 2 /* BlockScopedVariable */) { + error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(ts.getNameOfDeclaration(declaration))); + } + else if (result.flags & 32 /* Class */) { + error(errorLocation, ts.Diagnostics.Class_0_used_before_its_declaration, ts.declarationNameToString(ts.getNameOfDeclaration(declaration))); + } + else if (result.flags & 384 /* Enum */) { + error(errorLocation, ts.Diagnostics.Enum_0_used_before_its_declaration, ts.declarationNameToString(ts.getNameOfDeclaration(declaration))); + } } } /* Starting from 'initial' node walk up the parent chain until 'stopAt' node is reached. @@ -25234,56 +26615,50 @@ var ts; * Return false if 'stopAt' node is reached or isFunctionLike(current) === true. */ function isSameScopeDescendentOf(initial, parent, stopAt) { - if (!parent) { - return false; - } - for (var current = initial; current && current !== stopAt && !ts.isFunctionLike(current); current = current.parent) { - if (current === parent) { - return true; - } - } - return false; + return parent && !!ts.findAncestor(initial, function (n) { return n === stopAt || ts.isFunctionLike(n) ? "quit" : n === parent; }); } function getAnyImportSyntax(node) { if (ts.isAliasSymbolDeclaration(node)) { - if (node.kind === 234 /* ImportEqualsDeclaration */) { + if (node.kind === 237 /* ImportEqualsDeclaration */) { return node; } - while (node && node.kind !== 235 /* ImportDeclaration */) { - node = node.parent; - } - return node; + return ts.findAncestor(node, function (n) { return n.kind === 238 /* ImportDeclaration */; }); } } function getDeclarationOfAliasSymbol(symbol) { return ts.find(symbol.declarations, ts.isAliasSymbolDeclaration); } - function getTargetOfImportEqualsDeclaration(node) { - if (node.moduleReference.kind === 245 /* ExternalModuleReference */) { + function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) { + if (node.moduleReference.kind === 248 /* ExternalModuleReference */) { return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node))); } - return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference); + return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, dontResolveAlias); } - function getTargetOfImportClause(node) { + function getTargetOfImportClause(node, dontResolveAlias) { var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier); if (moduleSymbol) { - var exportDefaultSymbol = ts.isShorthandAmbientModuleSymbol(moduleSymbol) ? - moduleSymbol : - moduleSymbol.exports["export="] ? - getPropertyOfType(getTypeOfSymbol(moduleSymbol.exports["export="]), "default") : - resolveSymbol(moduleSymbol.exports["default"]); + var exportDefaultSymbol = void 0; + if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) { + exportDefaultSymbol = moduleSymbol; + } + else { + var exportValue = moduleSymbol.exports.get("export="); + exportDefaultSymbol = exportValue + ? getPropertyOfType(getTypeOfSymbol(exportValue), "default") + : resolveSymbol(moduleSymbol.exports.get("default"), dontResolveAlias); + } if (!exportDefaultSymbol && !allowSyntheticDefaultImports) { error(node.name, ts.Diagnostics.Module_0_has_no_default_export, symbolToString(moduleSymbol)); } else if (!exportDefaultSymbol && allowSyntheticDefaultImports) { - return resolveExternalModuleSymbol(moduleSymbol) || resolveSymbol(moduleSymbol); + return resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias); } return exportDefaultSymbol; } } - function getTargetOfNamespaceImport(node) { + function getTargetOfNamespaceImport(node, dontResolveAlias) { var moduleSpecifier = node.parent.parent.moduleSpecifier; - return resolveESModuleSymbol(resolveExternalModuleName(node, moduleSpecifier), moduleSpecifier); + return resolveESModuleSymbol(resolveExternalModuleName(node, moduleSpecifier), moduleSpecifier, dontResolveAlias); } // This function creates a synthetic symbol that combines the value side of one symbol with the // type/namespace side of another symbol. Consider this example: @@ -25318,12 +26693,9 @@ var ts; result.exports = valueSymbol.exports; return result; } - function getExportOfModule(symbol, name) { + function getExportOfModule(symbol, name, dontResolveAlias) { if (symbol.flags & 1536 /* Module */) { - var exportedSymbol = getExportsOfSymbol(symbol)[name]; - if (exportedSymbol) { - return resolveSymbol(exportedSymbol); - } + return resolveSymbol(getExportsOfSymbol(symbol).get(name), dontResolveAlias); } } function getPropertyOfVariable(symbol, name) { @@ -25334,74 +26706,75 @@ var ts; } } } - function getExternalModuleMember(node, specifier) { + function getExternalModuleMember(node, specifier, dontResolveAlias) { var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier); - var targetSymbol = resolveESModuleSymbol(moduleSymbol, node.moduleSpecifier); + var targetSymbol = resolveESModuleSymbol(moduleSymbol, node.moduleSpecifier, dontResolveAlias); if (targetSymbol) { - var name_16 = specifier.propertyName || specifier.name; - if (name_16.text) { + var name = specifier.propertyName || specifier.name; + if (name.text) { if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) { return moduleSymbol; } var symbolFromVariable = void 0; // First check if module was specified with "export=". If so, get the member from the resolved type - if (moduleSymbol && moduleSymbol.exports && moduleSymbol.exports["export="]) { - symbolFromVariable = getPropertyOfType(getTypeOfSymbol(targetSymbol), name_16.text); + if (moduleSymbol && moduleSymbol.exports && moduleSymbol.exports.get("export=")) { + symbolFromVariable = getPropertyOfType(getTypeOfSymbol(targetSymbol), name.text); } else { - symbolFromVariable = getPropertyOfVariable(targetSymbol, name_16.text); + symbolFromVariable = getPropertyOfVariable(targetSymbol, name.text); } // if symbolFromVariable is export - get its final target - symbolFromVariable = resolveSymbol(symbolFromVariable); - var symbolFromModule = getExportOfModule(targetSymbol, name_16.text); + symbolFromVariable = resolveSymbol(symbolFromVariable, dontResolveAlias); + var symbolFromModule = getExportOfModule(targetSymbol, name.text, dontResolveAlias); // If the export member we're looking for is default, and there is no real default but allowSyntheticDefaultImports is on, return the entire module as the default - if (!symbolFromModule && allowSyntheticDefaultImports && name_16.text === "default") { - symbolFromModule = resolveExternalModuleSymbol(moduleSymbol) || resolveSymbol(moduleSymbol); + if (!symbolFromModule && allowSyntheticDefaultImports && name.text === "default") { + symbolFromModule = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias); } var symbol = symbolFromModule && symbolFromVariable ? combineValueAndTypeSymbols(symbolFromVariable, symbolFromModule) : symbolFromModule || symbolFromVariable; if (!symbol) { - error(name_16, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(name_16)); + error(name, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(name)); } return symbol; } } } - function getTargetOfImportSpecifier(node) { - return getExternalModuleMember(node.parent.parent.parent, node); + function getTargetOfImportSpecifier(node, dontResolveAlias) { + return getExternalModuleMember(node.parent.parent.parent, node, dontResolveAlias); } - function getTargetOfNamespaceExportDeclaration(node) { - return resolveExternalModuleSymbol(node.parent.symbol); + function getTargetOfNamespaceExportDeclaration(node, dontResolveAlias) { + return resolveExternalModuleSymbol(node.parent.symbol, dontResolveAlias); } - function getTargetOfExportSpecifier(node) { + function getTargetOfExportSpecifier(node, dontResolveAlias) { return node.parent.parent.moduleSpecifier ? - getExternalModuleMember(node.parent.parent, node) : - resolveEntityName(node.propertyName || node.name, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */); + getExternalModuleMember(node.parent.parent, node, dontResolveAlias) : + resolveEntityName(node.propertyName || node.name, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } - function getTargetOfExportAssignment(node) { - return resolveEntityName(node.expression, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */); + function getTargetOfExportAssignment(node, dontResolveAlias) { + return resolveEntityName(node.expression, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } - function getTargetOfAliasDeclaration(node) { + function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) { switch (node.kind) { - case 234 /* ImportEqualsDeclaration */: - return getTargetOfImportEqualsDeclaration(node); - case 236 /* ImportClause */: - return getTargetOfImportClause(node); - case 237 /* NamespaceImport */: - return getTargetOfNamespaceImport(node); - case 239 /* ImportSpecifier */: - return getTargetOfImportSpecifier(node); - case 243 /* ExportSpecifier */: - return getTargetOfExportSpecifier(node); - case 240 /* ExportAssignment */: - return getTargetOfExportAssignment(node); - case 233 /* NamespaceExportDeclaration */: - return getTargetOfNamespaceExportDeclaration(node); + case 237 /* ImportEqualsDeclaration */: + return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); + case 239 /* ImportClause */: + return getTargetOfImportClause(node, dontRecursivelyResolve); + case 240 /* NamespaceImport */: + return getTargetOfNamespaceImport(node, dontRecursivelyResolve); + case 242 /* ImportSpecifier */: + return getTargetOfImportSpecifier(node, dontRecursivelyResolve); + case 246 /* ExportSpecifier */: + return getTargetOfExportSpecifier(node, dontRecursivelyResolve); + case 243 /* ExportAssignment */: + return getTargetOfExportAssignment(node, dontRecursivelyResolve); + case 236 /* NamespaceExportDeclaration */: + return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); } } - function resolveSymbol(symbol) { - return symbol && symbol.flags & 8388608 /* Alias */ && !(symbol.flags & (107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */)) ? resolveAlias(symbol) : symbol; + function resolveSymbol(symbol, dontResolveAlias) { + var shouldResolve = !dontResolveAlias && symbol && symbol.flags & 8388608 /* Alias */ && !(symbol.flags & (107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */)); + return shouldResolve ? resolveAlias(symbol) : symbol; } function resolveAlias(symbol) { ts.Debug.assert((symbol.flags & 8388608 /* Alias */) !== 0, "Should only get Alias here."); @@ -25443,11 +26816,11 @@ var ts; links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); ts.Debug.assert(!!node); - if (node.kind === 240 /* ExportAssignment */) { + if (node.kind === 243 /* ExportAssignment */) { // export default checkExpressionCached(node.expression); } - else if (node.kind === 243 /* ExportSpecifier */) { + else if (node.kind === 246 /* ExportSpecifier */) { // export { } or export { as foo } checkExpressionCached(node.propertyName || node.name); } @@ -25465,39 +26838,55 @@ var ts; // import a = |b|; // Namespace // import a = |b.c|; // Value, type, namespace // import a = |b.c|.d; // Namespace - if (entityName.kind === 70 /* Identifier */ && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { + if (entityName.kind === 71 /* Identifier */ && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } // Check for case 1 and 3 in the above example - if (entityName.kind === 70 /* Identifier */ || entityName.parent.kind === 141 /* QualifiedName */) { + if (entityName.kind === 71 /* Identifier */ || entityName.parent.kind === 143 /* 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 === 234 /* ImportEqualsDeclaration */); + ts.Debug.assert(entityName.parent.kind === 237 /* ImportEqualsDeclaration */); return resolveEntityName(entityName, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } } function getFullyQualifiedName(symbol) { return symbol.parent ? getFullyQualifiedName(symbol.parent) + "." + symbolToString(symbol) : symbolToString(symbol); } - // Resolves a qualified name and any involved aliases + /** + * Resolves a qualified name and any involved aliases. + */ function resolveEntityName(name, meaning, ignoreErrors, dontResolveAlias, location) { if (ts.nodeIsMissing(name)) { return undefined; } var symbol; - if (name.kind === 70 /* Identifier */) { + if (name.kind === 71 /* Identifier */) { var message = meaning === 1920 /* Namespace */ ? ts.Diagnostics.Cannot_find_namespace_0 : ts.Diagnostics.Cannot_find_name_0; symbol = resolveName(location || name, name.text, meaning, ignoreErrors ? undefined : message, name); if (!symbol) { return undefined; } } - else if (name.kind === 141 /* QualifiedName */ || name.kind === 177 /* PropertyAccessExpression */) { - var left = name.kind === 141 /* QualifiedName */ ? name.left : name.expression; - var right = name.kind === 141 /* QualifiedName */ ? name.right : name.name; + else if (name.kind === 143 /* QualifiedName */ || name.kind === 179 /* PropertyAccessExpression */) { + var left = void 0; + if (name.kind === 143 /* QualifiedName */) { + left = name.left; + } + else if (name.kind === 179 /* PropertyAccessExpression */ && + (name.expression.kind === 185 /* 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 === 143 /* QualifiedName */ ? name.right : name.name; var namespace = resolveEntityName(left, 1920 /* Namespace */, ignoreErrors, /*dontResolveAlias*/ false, location); if (!namespace || ts.nodeIsMissing(right)) { return undefined; @@ -25513,10 +26902,19 @@ var ts; return undefined; } } + else if (name.kind === 185 /* 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.fail("Unknown entity name kind."); } - ts.Debug.assert((symbol.flags & 16777216 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); + ts.Debug.assert((getCheckFlags(symbol) & 1 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); return (symbol.flags & meaning) || dontResolveAlias ? symbol : resolveAlias(symbol); } function resolveExternalModuleName(location, moduleReferenceExpression) { @@ -25524,7 +26922,7 @@ var ts; } function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, isForAugmentation) { if (isForAugmentation === void 0) { isForAugmentation = false; } - if (moduleReferenceExpression.kind !== 9 /* StringLiteral */) { + if (moduleReferenceExpression.kind !== 9 /* StringLiteral */ && moduleReferenceExpression.kind !== 13 /* NoSubstitutionTemplateLiteral */) { return; } var moduleReferenceLiteral = moduleReferenceExpression; @@ -25569,7 +26967,7 @@ 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 (compilerOptions.noImplicitAny && moduleNotFoundError) { + else if (noImplicitAny && moduleNotFoundError) { error(errorNode, ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type, moduleReference, resolvedModule.resolvedFileName); } // Failed imports and untyped modules are both treated in an untyped manner; only difference is whether we give a diagnostic first. @@ -25595,30 +26993,38 @@ var ts; } // 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) { - return moduleSymbol && getMergedSymbol(resolveSymbol(moduleSymbol.exports["export="])) || moduleSymbol; + function resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) { + return moduleSymbol && getMergedSymbol(resolveSymbol(moduleSymbol.exports.get("export="), dontResolveAlias)) || moduleSymbol; } // An external module with an 'export =' declaration may be referenced as an ES6 module provided the 'export =' // references a symbol that is at least declared as a module or a variable. The target of the 'export =' may // combine other declarations with the module or variable (e.g. a class/module, function/module, interface/variable). - function resolveESModuleSymbol(moduleSymbol, moduleReferenceExpression) { - var symbol = resolveExternalModuleSymbol(moduleSymbol); - if (symbol && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */))) { + function resolveESModuleSymbol(moduleSymbol, moduleReferenceExpression, dontResolveAlias) { + var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); + if (!dontResolveAlias && symbol && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */))) { error(moduleReferenceExpression, ts.Diagnostics.Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol)); symbol = undefined; } return symbol; } function hasExportAssignmentSymbol(moduleSymbol) { - return moduleSymbol.exports["export="] !== undefined; + return moduleSymbol.exports.get("export=") !== undefined; } function getExportsOfModuleAsArray(moduleSymbol) { return symbolsToArray(getExportsOfModule(moduleSymbol)); } + function getExportsAndPropertiesOfModule(moduleSymbol) { + var exports = getExportsOfModuleAsArray(moduleSymbol); + var exportEquals = resolveExternalModuleSymbol(moduleSymbol); + if (exportEquals !== moduleSymbol) { + ts.addRange(exports, getPropertiesOfType(getTypeOfSymbol(exportEquals))); + } + return exports; + } function tryGetMemberInModuleExports(memberName, moduleSymbol) { var symbolTable = getExportsOfModule(moduleSymbol); if (symbolTable) { - return symbolTable[memberName]; + return symbolTable.get(memberName); } } function getExportsOfSymbol(symbol) { @@ -25633,24 +27039,28 @@ var ts; * Not passing `lookupTable` and `exportNode` disables this collection, and just extends the tables */ function extendExportSymbols(target, source, lookupTable, exportNode) { - for (var id in source) { - if (id !== "default" && !target[id]) { - target[id] = source[id]; + source && source.forEach(function (sourceSymbol, id) { + if (id === "default") + return; + var targetSymbol = target.get(id); + if (!targetSymbol) { + target.set(id, sourceSymbol); if (lookupTable && exportNode) { - lookupTable[id] = { + lookupTable.set(id, { specifierText: ts.getTextOfNode(exportNode.moduleSpecifier) - }; + }); } } - else if (lookupTable && exportNode && id !== "default" && target[id] && resolveSymbol(target[id]) !== resolveSymbol(source[id])) { - if (!lookupTable[id].exportsWithDuplicate) { - lookupTable[id].exportsWithDuplicate = [exportNode]; + else if (lookupTable && exportNode && targetSymbol && resolveSymbol(targetSymbol) !== resolveSymbol(sourceSymbol)) { + var collisionTracker = lookupTable.get(id); + if (!collisionTracker.exportsWithDuplicate) { + collisionTracker.exportsWithDuplicate = [exportNode]; } else { - lookupTable[id].exportsWithDuplicate.push(exportNode); + collisionTracker.exportsWithDuplicate.push(exportNode); } } - } + }); } function getExportsForModule(moduleSymbol) { var visitedSymbols = []; @@ -25666,27 +27076,27 @@ var ts; visitedSymbols.push(symbol); var symbols = ts.cloneMap(symbol.exports); // All export * declarations are collected in an __export symbol by the binder - var exportStars = symbol.exports["__export"]; + var exportStars = symbol.exports.get("__export"); if (exportStars) { var nestedSymbols = ts.createMap(); - var lookupTable = ts.createMap(); + var lookupTable_1 = ts.createMap(); for (var _i = 0, _a = exportStars.declarations; _i < _a.length; _i++) { var node = _a[_i]; var resolvedModule = resolveExternalModuleName(node, node.moduleSpecifier); var exportedSymbols = visit(resolvedModule); - extendExportSymbols(nestedSymbols, exportedSymbols, lookupTable, node); + extendExportSymbols(nestedSymbols, exportedSymbols, lookupTable_1, node); } - for (var id in lookupTable) { - var exportsWithDuplicate = lookupTable[id].exportsWithDuplicate; + lookupTable_1.forEach(function (_a, id) { + var exportsWithDuplicate = _a.exportsWithDuplicate; // It's not an error if the file with multiple `export *`s with duplicate names exports a member with that name itself - if (id === "export=" || !(exportsWithDuplicate && exportsWithDuplicate.length) || symbols[id]) { - continue; + if (id === "export=" || !(exportsWithDuplicate && exportsWithDuplicate.length) || symbols.has(id)) { + return; } - for (var _b = 0, exportsWithDuplicate_1 = exportsWithDuplicate; _b < exportsWithDuplicate_1.length; _b++) { - var node = exportsWithDuplicate_1[_b]; - diagnostics.add(ts.createDiagnosticForNode(node, ts.Diagnostics.Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity, lookupTable[id].specifierText, id)); + for (var _i = 0, exportsWithDuplicate_1 = exportsWithDuplicate; _i < exportsWithDuplicate_1.length; _i++) { + var node = exportsWithDuplicate_1[_i]; + diagnostics.add(ts.createDiagnosticForNode(node, ts.Diagnostics.Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity, lookupTable_1.get(id).specifierText, id)); } - } + }); extendExportSymbols(symbols, nestedSymbols); } return symbols; @@ -25708,26 +27118,13 @@ var ts; : symbol; } function symbolIsValue(symbol) { - // If it is an instantiated symbol, then it is a value if the symbol it is an - // instantiation of is a value. - if (symbol.flags & 16777216 /* Instantiated */) { - return symbolIsValue(getSymbolLinks(symbol).target); - } - // If the symbol has the value flag, it is trivially a value. - if (symbol.flags & 107455 /* Value */) { - return true; - } - // If it is an alias, then it is a value if the symbol it resolves to is a value. - if (symbol.flags & 8388608 /* Alias */) { - return (resolveAlias(symbol).flags & 107455 /* Value */) !== 0; - } - return false; + return !!(symbol.flags & 107455 /* Value */ || symbol.flags & 8388608 /* Alias */ && resolveAlias(symbol).flags & 107455 /* Value */); } function findConstructorDeclaration(node) { var members = node.members; for (var _i = 0, members_1 = members; _i < members_1.length; _i++) { var member = members_1[_i]; - if (member.kind === 150 /* Constructor */ && ts.nodeIsPresent(member.body)) { + if (member.kind === 152 /* Constructor */ && ts.nodeIsPresent(member.body)) { return member; } } @@ -25755,6 +27152,9 @@ var ts; type.symbol = symbol; return type; } + function createTypeofType() { + return getUnionType(ts.convertToArray(typeofEQFacts.keys(), function (s) { return getLiteralTypeForText(32 /* StringLiteral */, s); })); + } // A reserved member name starts with two underscores, but the third character cannot be an underscore // or the @ symbol. A third underscore indicates an escaped form of an identifer that started // with at least two underscores. The @ character indicates that the name is denoted by a well known ES @@ -25767,16 +27167,15 @@ var ts; } function getNamedMembers(members) { var result; - for (var id in members) { + members.forEach(function (symbol, id) { if (!isReservedMemberName(id)) { if (!result) result = []; - var symbol = members[id]; if (symbolIsValue(symbol)) { result.push(symbol); } } - } + }); return result || emptyArray; } function setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo) { @@ -25795,20 +27194,21 @@ var ts; } function forEachSymbolTableInScope(enclosingDeclaration, callback) { var result; - for (var location_1 = enclosingDeclaration; location_1; location_1 = location_1.parent) { + for (var location = enclosingDeclaration; location; location = location.parent) { // Locals of a source file are not in scope (because they get merged into the global symbol table) - if (location_1.locals && !isGlobalSourceFile(location_1)) { - if (result = callback(location_1.locals)) { + if (location.locals && !isGlobalSourceFile(location)) { + if (result = callback(location.locals)) { return result; } } - switch (location_1.kind) { - case 261 /* SourceFile */: - if (!ts.isExternalOrCommonJsModule(location_1)) { + switch (location.kind) { + case 265 /* SourceFile */: + if (!ts.isExternalOrCommonJsModule(location)) { break; } - case 230 /* ModuleDeclaration */: - if (result = callback(getSymbolOfNode(location_1).exports)) { + // falls through + case 233 /* ModuleDeclaration */: + if (result = callback(getSymbolOfNode(location).exports)) { return result; } break; @@ -25852,14 +27252,14 @@ var ts; } function trySymbolTable(symbols) { // If symbol is directly available by its name in the symbol table - if (isAccessible(symbols[symbol.name])) { + if (isAccessible(symbols.get(symbol.name))) { return [symbol]; } // Check if symbol is any of the alias - return ts.forEachProperty(symbols, function (symbolFromSymbolTable) { + return ts.forEachEntry(symbols, function (symbolFromSymbolTable) { if (symbolFromSymbolTable.flags & 8388608 /* Alias */ && symbolFromSymbolTable.name !== "export=" - && !ts.getDeclarationOfKind(symbolFromSymbolTable, 243 /* ExportSpecifier */)) { + && !ts.getDeclarationOfKind(symbolFromSymbolTable, 246 /* ExportSpecifier */)) { if (!useOnlyExternalAliasing || // Is this external alias, then use it to name ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) { @@ -25888,7 +27288,7 @@ var ts; var qualify = false; forEachSymbolTableInScope(enclosingDeclaration, function (symbolTable) { // If symbol of this name is not available in the symbol table we are ok - var symbolFromSymbolTable = symbolTable[symbol.name]; + var symbolFromSymbolTable = symbolTable.get(symbol.name); if (!symbolFromSymbolTable) { // Continue to the next symbol table return false; @@ -25899,7 +27299,7 @@ var ts; return true; } // Qualify if the symbol from symbol table has same meaning as expected - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 243 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 246 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -25914,10 +27314,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; switch (declaration.kind) { - case 147 /* PropertyDeclaration */: - case 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 149 /* PropertyDeclaration */: + case 151 /* MethodDeclaration */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: continue; default: return false; @@ -25990,15 +27390,12 @@ var ts; } return { accessibility: 0 /* Accessible */ }; function getExternalModuleContainer(declaration) { - for (; declaration; declaration = declaration.parent) { - if (hasExternalModuleSymbol(declaration)) { - return getSymbolOfNode(declaration); - } - } + var node = ts.findAncestor(declaration, hasExternalModuleSymbol); + return node && getSymbolOfNode(node); } } function hasExternalModuleSymbol(declaration) { - return ts.isAmbientModule(declaration) || (declaration.kind === 261 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isAmbientModule(declaration) || (declaration.kind === 265 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { var aliasesToMakeVisible; @@ -26039,12 +27436,12 @@ var ts; function isEntityNameVisible(entityName, enclosingDeclaration) { // get symbol of the first identifier of the entityName var meaning; - if (entityName.parent.kind === 160 /* TypeQuery */ || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) { + if (entityName.parent.kind === 162 /* TypeQuery */ || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) { // Typeof value meaning = 107455 /* Value */ | 1048576 /* ExportValue */; } - else if (entityName.kind === 141 /* QualifiedName */ || entityName.kind === 177 /* PropertyAccessExpression */ || - entityName.parent.kind === 234 /* ImportEqualsDeclaration */) { + else if (entityName.kind === 143 /* QualifiedName */ || entityName.kind === 179 /* PropertyAccessExpression */ || + entityName.parent.kind === 237 /* ImportEqualsDeclaration */) { // Left identifier from type reference or TypeAlias // Entity name of the import declaration meaning = 1920 /* Namespace */; @@ -26096,6 +27493,517 @@ var ts; } return result; } + function createNodeBuilder() { + var context; + return { + typeToTypeNode: function (type, enclosingDeclaration, flags) { + context = createNodeBuilderContext(enclosingDeclaration, flags); + var resultingNode = typeToTypeNodeHelper(type); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, + indexInfoToIndexSignatureDeclaration: function (indexInfo, kind, enclosingDeclaration, flags) { + context = createNodeBuilderContext(enclosingDeclaration, flags); + var resultingNode = indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, + signatureToSignatureDeclaration: function (signature, kind, enclosingDeclaration, flags) { + context = createNodeBuilderContext(enclosingDeclaration, flags); + var resultingNode = signatureToSignatureDeclarationHelper(signature, kind); + var result = context.encounteredError ? undefined : resultingNode; + return result; + } + }; + function createNodeBuilderContext(enclosingDeclaration, flags) { + return { + enclosingDeclaration: enclosingDeclaration, + flags: flags, + encounteredError: false, + inObjectTypeLiteral: false, + checkAlias: true, + symbolStack: undefined + }; + } + function typeToTypeNodeHelper(type) { + if (!type) { + context.encounteredError = true; + // TODO(aozgaa): should we return implict any (undefined) or explicit any (keywordtypenode)? + return undefined; + } + if (type.flags & 1 /* Any */) { + return ts.createKeywordTypeNode(119 /* AnyKeyword */); + } + if (type.flags & 2 /* String */) { + return ts.createKeywordTypeNode(136 /* StringKeyword */); + } + if (type.flags & 4 /* Number */) { + return ts.createKeywordTypeNode(133 /* NumberKeyword */); + } + if (type.flags & 8 /* Boolean */) { + return ts.createKeywordTypeNode(122 /* BooleanKeyword */); + } + if (type.flags & 16 /* Enum */) { + var name = symbolToName(type.symbol, /*expectsIdentifier*/ false); + return ts.createTypeReferenceNode(name, /*typeArguments*/ undefined); + } + if (type.flags & (32 /* StringLiteral */)) { + return ts.createLiteralTypeNode((ts.createLiteral(type.text))); + } + if (type.flags & (64 /* NumberLiteral */)) { + return ts.createLiteralTypeNode((ts.createNumericLiteral(type.text))); + } + if (type.flags & 128 /* BooleanLiteral */) { + return type.intrinsicName === "true" ? ts.createTrue() : ts.createFalse(); + } + if (type.flags & 256 /* EnumLiteral */) { + var name = symbolToName(type.symbol, /*expectsIdentifier*/ false); + return ts.createTypeReferenceNode(name, /*typeArguments*/ undefined); + } + if (type.flags & 1024 /* Void */) { + return ts.createKeywordTypeNode(105 /* VoidKeyword */); + } + if (type.flags & 2048 /* Undefined */) { + return ts.createKeywordTypeNode(139 /* UndefinedKeyword */); + } + if (type.flags & 4096 /* Null */) { + return ts.createKeywordTypeNode(95 /* NullKeyword */); + } + if (type.flags & 8192 /* Never */) { + return ts.createKeywordTypeNode(130 /* NeverKeyword */); + } + if (type.flags & 512 /* ESSymbol */) { + return ts.createKeywordTypeNode(137 /* SymbolKeyword */); + } + if (type.flags & 16777216 /* NonPrimitive */) { + return ts.createKeywordTypeNode(134 /* ObjectKeyword */); + } + if (type.flags & 16384 /* TypeParameter */ && type.isThisType) { + if (context.inObjectTypeLiteral) { + if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.allowThisInObjectLiteral)) { + context.encounteredError = true; + } + } + return ts.createThis(); + } + var objectFlags = getObjectFlags(type); + if (objectFlags & 4 /* Reference */) { + ts.Debug.assert(!!(type.flags & 32768 /* Object */)); + return typeReferenceToTypeNode(type); + } + if (objectFlags & 3 /* ClassOrInterface */) { + ts.Debug.assert(!!(type.flags & 32768 /* Object */)); + var name = symbolToName(type.symbol, /*expectsIdentifier*/ false); + // TODO(aozgaa): handle type arguments. + return ts.createTypeReferenceNode(name, /*typeArguments*/ undefined); + } + if (type.flags & 16384 /* TypeParameter */) { + var name = symbolToName(type.symbol, /*expectsIdentifier*/ false); + // Ignore constraint/default when creating a usage (as opposed to declaration) of a type parameter. + return ts.createTypeReferenceNode(name, /*typeArguments*/ undefined); + } + if (context.checkAlias && type.aliasSymbol) { + var name = symbolToName(type.aliasSymbol, /*expectsIdentifier*/ false); + var typeArgumentNodes = type.aliasTypeArguments && mapToTypeNodeArray(type.aliasTypeArguments); + return ts.createTypeReferenceNode(name, typeArgumentNodes); + } + context.checkAlias = false; + if (type.flags & 65536 /* Union */) { + var formattedUnionTypes = formatUnionTypes(type.types); + var unionTypeNodes = formattedUnionTypes && mapToTypeNodeArray(formattedUnionTypes); + if (unionTypeNodes && unionTypeNodes.length > 0) { + return ts.createUnionOrIntersectionTypeNode(166 /* UnionType */, unionTypeNodes); + } + else { + if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.allowEmptyUnionOrIntersection)) { + context.encounteredError = true; + } + return undefined; + } + } + if (type.flags & 131072 /* Intersection */) { + return ts.createUnionOrIntersectionTypeNode(167 /* IntersectionType */, mapToTypeNodeArray(type.types)); + } + if (objectFlags & (16 /* Anonymous */ | 32 /* Mapped */)) { + ts.Debug.assert(!!(type.flags & 32768 /* Object */)); + // The type is an object literal type. + return createAnonymousTypeNode(type); + } + if (type.flags & 262144 /* Index */) { + var indexedType = type.type; + var indexTypeNode = typeToTypeNodeHelper(indexedType); + return ts.createTypeOperatorNode(indexTypeNode); + } + if (type.flags & 524288 /* IndexedAccess */) { + var objectTypeNode = typeToTypeNodeHelper(type.objectType); + var indexTypeNode = typeToTypeNodeHelper(type.indexType); + return ts.createIndexedAccessTypeNode(objectTypeNode, indexTypeNode); + } + ts.Debug.fail("Should be unreachable."); + function mapToTypeNodeArray(types) { + var result = []; + for (var _i = 0, types_1 = types; _i < types_1.length; _i++) { + var type_1 = types_1[_i]; + var typeNode = typeToTypeNodeHelper(type_1); + if (typeNode) { + result.push(typeNode); + } + } + return result; + } + function createMappedTypeNodeFromType(type) { + ts.Debug.assert(!!(type.flags & 32768 /* Object */)); + var typeParameter = getTypeParameterFromMappedType(type); + var typeParameterNode = typeParameterToDeclaration(typeParameter); + var templateType = getTemplateTypeFromMappedType(type); + var templateTypeNode = typeToTypeNodeHelper(templateType); + var readonlyToken = type.declaration && type.declaration.readonlyToken ? ts.createToken(131 /* ReadonlyKeyword */) : undefined; + var questionToken = type.declaration && type.declaration.questionToken ? ts.createToken(55 /* QuestionToken */) : undefined; + return ts.createMappedTypeNode(readonlyToken, typeParameterNode, questionToken, templateTypeNode); + } + function createAnonymousTypeNode(type) { + 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.flags & (384 /* Enum */ | 512 /* ValueModule */) || + shouldWriteTypeOfFunctionSymbol()) { + return createTypeQueryNodeFromSymbol(symbol); + } + 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, /*expectsIdentifier*/ false); + return ts.createTypeReferenceNode(entityName, /*typeArguments*/ undefined); + } + else { + return ts.createKeywordTypeNode(119 /* AnyKeyword */); + } + } + else { + // Since instantiations of the same anonymous type have the same symbol, tracking symbols instead + // of types allows us to catch circular references to instantiations of the same anonymous type + if (!context.symbolStack) { + context.symbolStack = []; + } + context.symbolStack.push(symbol); + var result = createTypeNodeFromObjectType(type); + context.symbolStack.pop(); + return result; + } + } + else { + // Anonymous types without a symbol are never circular. + return createTypeNodeFromObjectType(type); + } + function shouldWriteTypeOfFunctionSymbol() { + var isStaticMethodSymbol = !!(symbol.flags & 8192 /* Method */ && + ts.forEach(symbol.declarations, function (declaration) { return ts.getModifierFlags(declaration) & 32 /* Static */; })); + var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && + (symbol.parent || + ts.forEach(symbol.declarations, function (declaration) { + return declaration.parent.kind === 265 /* SourceFile */ || declaration.parent.kind === 234 /* ModuleBlock */; + })); + if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { + // typeof is allowed only for static/non local functions + return ts.contains(context.symbolStack, symbol); // it is type of the symbol uses itself recursively + } + } + } + function createTypeNodeFromObjectType(type) { + if (type.objectFlags & 32 /* Mapped */) { + if (getConstraintTypeFromMappedType(type).flags & (16384 /* TypeParameter */ | 262144 /* Index */)) { + return createMappedTypeNodeFromType(type); + } + } + var resolved = resolveStructuredTypeMembers(type); + if (!resolved.properties.length && !resolved.stringIndexInfo && !resolved.numberIndexInfo) { + if (!resolved.callSignatures.length && !resolved.constructSignatures.length) { + return ts.createTypeLiteralNode(/*members*/ undefined); + } + if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { + var signature = resolved.callSignatures[0]; + return signatureToSignatureDeclarationHelper(signature, 160 /* FunctionType */); + } + if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { + var signature = resolved.constructSignatures[0]; + return signatureToSignatureDeclarationHelper(signature, 161 /* ConstructorType */); + } + } + var saveInObjectTypeLiteral = context.inObjectTypeLiteral; + context.inObjectTypeLiteral = true; + var members = createTypeNodesFromResolvedType(resolved); + context.inObjectTypeLiteral = saveInObjectTypeLiteral; + return ts.createTypeLiteralNode(members); + } + function createTypeQueryNodeFromSymbol(symbol) { + var entityName = symbolToName(symbol, /*expectsIdentifier*/ false); + return ts.createTypeQueryNode(entityName); + } + function typeReferenceToTypeNode(type) { + var typeArguments = type.typeArguments || emptyArray; + if (type.target === globalArrayType) { + var elementType = typeToTypeNodeHelper(typeArguments[0]); + return ts.createArrayTypeNode(elementType); + } + else if (type.target.objectFlags & 8 /* Tuple */) { + if (typeArguments.length > 0) { + var tupleConstituentNodes = mapToTypeNodeArray(typeArguments.slice(0, getTypeReferenceArity(type))); + if (tupleConstituentNodes && tupleConstituentNodes.length > 0) { + return ts.createTupleTypeNode(tupleConstituentNodes); + } + } + if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.allowEmptyTuple)) { + context.encounteredError = true; + } + return undefined; + } + else { + var outerTypeParameters = type.target.outerTypeParameters; + var i = 0; + var qualifiedName = undefined; + if (outerTypeParameters) { + var length_1 = outerTypeParameters.length; + while (i < length_1) { + // Find group of type arguments for type parameters with the same declaring container. + var start = i; + var parent = getParentSymbolOfTypeParameter(outerTypeParameters[i]); + do { + i++; + } while (i < length_1 && getParentSymbolOfTypeParameter(outerTypeParameters[i]) === parent); + // When type parameters are their own type arguments for the whole group (i.e. we have + // the default outer type arguments), we don't show the group. + if (!ts.rangeEquals(outerTypeParameters, typeArguments, start, i)) { + var qualifiedNamePart = symbolToName(parent, /*expectsIdentifier*/ true); + if (!qualifiedName) { + qualifiedName = ts.createQualifiedName(qualifiedNamePart, /*right*/ undefined); + } + else { + ts.Debug.assert(!qualifiedName.right); + qualifiedName.right = qualifiedNamePart; + qualifiedName = ts.createQualifiedName(qualifiedName, /*right*/ undefined); + } + } + } + } + var entityName = undefined; + var nameIdentifier = symbolToName(type.symbol, /*expectsIdentifier*/ true); + if (qualifiedName) { + ts.Debug.assert(!qualifiedName.right); + qualifiedName.right = nameIdentifier; + entityName = qualifiedName; + } + else { + entityName = nameIdentifier; + } + var typeParameterCount = (type.target.typeParameters || emptyArray).length; + var typeArgumentNodes = ts.some(typeArguments) ? mapToTypeNodeArray(typeArguments.slice(i, typeParameterCount - i)) : undefined; + return ts.createTypeReferenceNode(entityName, typeArgumentNodes); + } + } + function createTypeNodesFromResolvedType(resolvedType) { + var typeElements = []; + for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) { + var signature = _a[_i]; + typeElements.push(signatureToSignatureDeclarationHelper(signature, 155 /* CallSignature */)); + } + for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) { + var signature = _c[_b]; + typeElements.push(signatureToSignatureDeclarationHelper(signature, 156 /* ConstructSignature */)); + } + if (resolvedType.stringIndexInfo) { + typeElements.push(indexInfoToIndexSignatureDeclarationHelper(resolvedType.stringIndexInfo, 0 /* String */)); + } + if (resolvedType.numberIndexInfo) { + typeElements.push(indexInfoToIndexSignatureDeclarationHelper(resolvedType.numberIndexInfo, 1 /* Number */)); + } + var properties = resolvedType.properties; + if (!properties) { + return typeElements; + } + for (var _d = 0, properties_2 = properties; _d < properties_2.length; _d++) { + var propertySymbol = properties_2[_d]; + var propertyType = getTypeOfSymbol(propertySymbol); + var oldDeclaration = propertySymbol.declarations && propertySymbol.declarations[0]; + if (!oldDeclaration) { + return; + } + var propertyName = oldDeclaration.name; + var optionalToken = propertySymbol.flags & 67108864 /* 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, 150 /* MethodSignature */); + methodDeclaration.name = propertyName; + methodDeclaration.questionToken = optionalToken; + typeElements.push(methodDeclaration); + } + } + else { + // TODO(aozgaa): should we create a node with explicit or implict any? + var propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType) : ts.createKeywordTypeNode(119 /* AnyKeyword */); + typeElements.push(ts.createPropertySignature(propertyName, optionalToken, propertyTypeNode, + /*initializer*/ undefined)); + } + } + return typeElements.length ? typeElements : undefined; + } + } + function indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind) { + var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 /* String */ ? 136 /* StringKeyword */ : 133 /* NumberKeyword */); + var name = ts.getNameFromIndexInfo(indexInfo); + var indexingParameter = ts.createParameter( + /*decorators*/ undefined, + /*modifiers*/ undefined, + /*dotDotDotToken*/ undefined, name, + /*questionToken*/ undefined, indexerTypeNode, + /*initializer*/ undefined); + var typeNode = typeToTypeNodeHelper(indexInfo.type); + return ts.createIndexSignatureDeclaration( + /*decorators*/ undefined, indexInfo.isReadonly ? [ts.createToken(131 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); + } + function signatureToSignatureDeclarationHelper(signature, kind) { + var typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter); }); + var parameters = signature.parameters.map(function (parameter) { return symbolToParameterDeclaration(parameter); }); + var returnTypeNode; + if (signature.typePredicate) { + var typePredicate = signature.typePredicate; + var parameterName = typePredicate.kind === 1 /* Identifier */ ? ts.createIdentifier(typePredicate.parameterName) : ts.createThisTypeNode(); + var typeNode = typeToTypeNodeHelper(typePredicate.type); + returnTypeNode = ts.createTypePredicateNode(parameterName, typeNode); + } + else { + var returnType = getReturnTypeOfSignature(signature); + returnTypeNode = returnType && typeToTypeNodeHelper(returnType); + } + var returnTypeNodeExceptAny = returnTypeNode && returnTypeNode.kind !== 119 /* AnyKeyword */ ? returnTypeNode : undefined; + return ts.createSignatureDeclaration(kind, typeParameters, parameters, returnTypeNodeExceptAny); + } + function typeParameterToDeclaration(type) { + var constraint = getConstraintFromTypeParameter(type); + var constraintNode = constraint && typeToTypeNodeHelper(constraint); + var defaultParameter = getDefaultFromTypeParameter(type); + var defaultParameterNode = defaultParameter && typeToTypeNodeHelper(defaultParameter); + var name = symbolToName(type.symbol, /*expectsIdentifier*/ true); + return ts.createTypeParameterDeclaration(name, constraintNode, defaultParameterNode); + } + function symbolToParameterDeclaration(parameterSymbol) { + var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 146 /* Parameter */); + var parameterType = getTypeOfSymbol(parameterSymbol); + var parameterTypeNode = typeToTypeNodeHelper(parameterType); + // TODO(aozgaa): In the future, check initializer accessibility. + var parameterNode = ts.createParameter(parameterDeclaration.decorators, parameterDeclaration.modifiers, parameterDeclaration.dotDotDotToken && ts.createToken(24 /* DotDotDotToken */), + // Clone name to remove trivia. + ts.getSynthesizedClone(parameterDeclaration.name), parameterDeclaration.questionToken && ts.createToken(55 /* QuestionToken */), parameterTypeNode, parameterDeclaration.initializer); + return parameterNode; + } + function symbolToName(symbol, expectsIdentifier) { + // Try to get qualified name if the symbol is not a type parameter and there is an enclosing declaration. + var chain; + var isTypeParameter = symbol.flags & 262144 /* TypeParameter */; + if (!isTypeParameter && context.enclosingDeclaration) { + chain = getSymbolChain(symbol, 0 /* None */, /*endOfChain*/ true); + ts.Debug.assert(chain && chain.length > 0); + } + else { + chain = [symbol]; + } + if (expectsIdentifier && chain.length !== 1 + && !context.encounteredError + && !(context.flags & ts.NodeBuilderFlags.allowQualifedNameInPlaceOfIdentifier)) { + context.encounteredError = true; + } + return createEntityNameFromSymbolChain(chain, chain.length - 1); + function createEntityNameFromSymbolChain(chain, index) { + ts.Debug.assert(chain && 0 <= index && index < chain.length); + // const parentIndex = index - 1; + var symbol = chain[index]; + var typeParameterString = ""; + if (index > 0) { + var parentSymbol = chain[index - 1]; + var typeParameters = void 0; + if (getCheckFlags(symbol) & 1 /* Instantiated */) { + typeParameters = getTypeParametersOfClassOrInterface(parentSymbol); + } + else { + var targetSymbol = getTargetSymbol(parentSymbol); + if (targetSymbol.flags & (32 /* Class */ | 64 /* Interface */ | 524288 /* TypeAlias */)) { + typeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); + } + } + if (typeParameters && typeParameters.length > 0) { + if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.allowTypeParameterInQualifiedName)) { + context.encounteredError = true; + } + var writer = ts.getSingleLineStringWriter(); + var displayBuilder = getSymbolDisplayBuilder(); + displayBuilder.buildDisplayForTypeParametersAndDelimiters(typeParameters, writer, context.enclosingDeclaration, 0); + typeParameterString = writer.string(); + ts.releaseStringWriter(writer); + } + } + var symbolName = getNameOfSymbol(symbol); + var symbolNameWithTypeParameters = typeParameterString.length > 0 ? symbolName + "<" + typeParameterString + ">" : symbolName; + var identifier = ts.createIdentifier(symbolNameWithTypeParameters); + return index > 0 ? ts.createQualifiedName(createEntityNameFromSymbolChain(chain, index - 1), identifier) : identifier; + } + /** @param endOfChain Set to false for recursive calls; non-recursive calls should always output something. */ + function getSymbolChain(symbol, meaning, endOfChain) { + var accessibleSymbolChain = getAccessibleSymbolChain(symbol, context.enclosingDeclaration, meaning, /*useOnlyExternalAliasing*/ false); + var parentSymbol; + if (!accessibleSymbolChain || + needsQualification(accessibleSymbolChain[0], context.enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { + // Go up and add our parent. + var parent = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol); + if (parent) { + var parentChain = getSymbolChain(parent, getQualifiedLeftMeaning(meaning), /*endOfChain*/ false); + if (parentChain) { + parentSymbol = parent; + accessibleSymbolChain = parentChain.concat(accessibleSymbolChain || [symbol]); + } + } + } + if (accessibleSymbolChain) { + return accessibleSymbolChain; + } + if ( + // If this is the last part of outputting the symbol, always output. The cases apply only to parent symbols. + endOfChain || + // If a parent symbol is an external module, don't write it. (We prefer just `x` vs `"foo/bar".x`.) + !(!parentSymbol && ts.forEach(symbol.declarations, hasExternalModuleSymbol)) && + // If a parent symbol is an anonymous type, don't write it. + !(symbol.flags & (2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */))) { + return [symbol]; + } + } + function getNameOfSymbol(symbol) { + var declaration = ts.firstOrUndefined(symbol.declarations); + if (declaration) { + var name = ts.getNameOfDeclaration(declaration); + if (name) { + return ts.declarationNameToString(name); + } + if (declaration.parent && declaration.parent.kind === 226 /* VariableDeclaration */) { + return ts.declarationNameToString(declaration.parent.name); + } + if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.allowAnonymousIdentifier)) { + context.encounteredError = true; + } + switch (declaration.kind) { + case 199 /* ClassExpression */: + return "(Anonymous class)"; + case 186 /* FunctionExpression */: + case 187 /* ArrowFunction */: + return "(Anonymous function)"; + } + } + return symbol.name; + } + } + } function typePredicateToString(typePredicate, enclosingDeclaration, flags) { var writer = ts.getSingleLineStringWriter(); getSymbolDisplayBuilder().buildTypePredicateDisplay(typePredicate, writer, enclosingDeclaration, flags); @@ -26139,11 +28047,8 @@ var ts; } function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { - var node = type.symbol.declarations[0].parent; - while (node.kind === 166 /* ParenthesizedType */) { - node = node.parent; - } - if (node.kind === 228 /* TypeAliasDeclaration */) { + var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 168 /* ParenthesizedType */; }); + if (node.kind === 231 /* TypeAliasDeclaration */) { return getSymbolOfNode(node); } } @@ -26151,29 +28056,33 @@ var ts; } function isTopLevelInExternalModuleAugmentation(node) { return node && node.parent && - node.parent.kind === 231 /* ModuleBlock */ && + node.parent.kind === 234 /* ModuleBlock */ && ts.isExternalModuleAugmentation(node.parent.parent); } function literalTypeToString(type) { return type.flags & 32 /* StringLiteral */ ? "\"" + ts.escapeString(type.text) + "\"" : type.text; } - function getSymbolDisplayBuilder() { - function getNameOfSymbol(symbol) { - if (symbol.declarations && symbol.declarations.length) { - var declaration = symbol.declarations[0]; - if (declaration.name) { - return ts.declarationNameToString(declaration.name); - } - switch (declaration.kind) { - case 197 /* ClassExpression */: - return "(Anonymous class)"; - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - return "(Anonymous function)"; - } + function getNameOfSymbol(symbol) { + if (symbol.declarations && symbol.declarations.length) { + var declaration = symbol.declarations[0]; + var name = ts.getNameOfDeclaration(declaration); + if (name) { + return ts.declarationNameToString(name); + } + if (declaration.parent && declaration.parent.kind === 226 /* VariableDeclaration */) { + return ts.declarationNameToString(declaration.parent.name); + } + switch (declaration.kind) { + case 199 /* ClassExpression */: + return "(Anonymous class)"; + case 186 /* FunctionExpression */: + case 187 /* ArrowFunction */: + return "(Anonymous function)"; } - return symbol.name; } + return symbol.name; + } + function getSymbolDisplayBuilder() { /** * Writes only the name of the symbol out to the writer. Uses the original source text * for the name of the symbol if it is available to match how the user wrote the name. @@ -26191,17 +28100,17 @@ var ts; var firstChar = symbolName.charCodeAt(0); var needsElementAccess = !ts.isIdentifierStart(firstChar, languageVersion); if (needsElementAccess) { - writePunctuation(writer, 20 /* OpenBracketToken */); + writePunctuation(writer, 21 /* OpenBracketToken */); if (ts.isSingleOrDoubleQuote(firstChar)) { writer.writeStringLiteral(symbolName); } else { writer.writeSymbol(symbolName, symbol); } - writePunctuation(writer, 21 /* CloseBracketToken */); + writePunctuation(writer, 22 /* CloseBracketToken */); } else { - writePunctuation(writer, 22 /* DotToken */); + writePunctuation(writer, 23 /* DotToken */); writer.writeSymbol(symbolName, symbol); } } @@ -26215,7 +28124,7 @@ var ts; if (parentSymbol) { // Write type arguments of instantiated class/interface here if (flags & 1 /* WriteTypeParametersOrArguments */) { - if (symbol.flags & 16777216 /* Instantiated */) { + if (getCheckFlags(symbol) & 1 /* Instantiated */) { buildDisplayForTypeArgumentsAndDelimiters(getTypeParametersOfClassOrInterface(parentSymbol), symbol.mapper, writer, enclosingDeclaration); } else { @@ -26243,9 +28152,9 @@ var ts; if (!accessibleSymbolChain || needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { // Go up and add our parent. - var parent_6 = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol); - if (parent_6) { - walkSymbol(parent_6, getQualifiedLeftMeaning(meaning), /*endOfChain*/ false); + var parent = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol); + if (parent) { + walkSymbol(parent, getQualifiedLeftMeaning(meaning), /*endOfChain*/ false); } } if (accessibleSymbolChain) { @@ -26283,7 +28192,7 @@ var ts; function writeType(type, flags) { var nextFlags = flags & ~512 /* InTypeAlias */; // Write undefined/null type as any - if (type.flags & 16015 /* Intrinsic */) { + if (type.flags & 16793231 /* Intrinsic */) { // Special handling for unknown / resolving types, they should show up as any and not unknown or __resolving writer.writeKeyword(!(globalFlags & 16 /* WriteOwnNameForAnyLike */) && isTypeAny(type) ? "any" @@ -26300,7 +28209,7 @@ var ts; } else if (type.flags & 256 /* EnumLiteral */) { buildSymbolDisplay(getParentOfSymbol(type.symbol), writer, enclosingDeclaration, 793064 /* Type */, 0 /* None */, nextFlags); - writePunctuation(writer, 22 /* DotToken */); + writePunctuation(writer, 23 /* DotToken */); appendSymbolNameOnly(type.symbol, writer); } else if (getObjectFlags(type) & 3 /* ClassOrInterface */ || type.flags & (16 /* Enum */ | 16384 /* TypeParameter */)) { @@ -26310,7 +28219,7 @@ var ts; else if (!(flags & 512 /* InTypeAlias */) && type.aliasSymbol && isSymbolAccessible(type.aliasSymbol, enclosingDeclaration, 793064 /* Type */, /*shouldComputeAliasesToMakeVisible*/ false).accessibility === 0 /* Accessible */) { var typeArguments = type.aliasTypeArguments; - writeSymbolTypeReference(type.aliasSymbol, typeArguments, 0, typeArguments ? typeArguments.length : 0, nextFlags); + writeSymbolTypeReference(type.aliasSymbol, typeArguments, 0, ts.length(typeArguments), nextFlags); } else if (type.flags & 196608 /* UnionOrIntersection */) { writeUnionOrIntersectionType(type, nextFlags); @@ -26328,30 +28237,30 @@ var ts; } else if (type.flags & 524288 /* IndexedAccess */) { writeType(type.objectType, 64 /* InElementType */); - writePunctuation(writer, 20 /* OpenBracketToken */); + writePunctuation(writer, 21 /* OpenBracketToken */); writeType(type.indexType, 0 /* None */); - writePunctuation(writer, 21 /* CloseBracketToken */); + writePunctuation(writer, 22 /* CloseBracketToken */); } else { // Should never get here // { ... } - writePunctuation(writer, 16 /* OpenBraceToken */); + writePunctuation(writer, 17 /* OpenBraceToken */); writeSpace(writer); - writePunctuation(writer, 23 /* DotDotDotToken */); + writePunctuation(writer, 24 /* DotDotDotToken */); writeSpace(writer); - writePunctuation(writer, 17 /* CloseBraceToken */); + writePunctuation(writer, 18 /* CloseBraceToken */); } } function writeTypeList(types, delimiter) { for (var i = 0; i < types.length; i++) { if (i > 0) { - if (delimiter !== 25 /* CommaToken */) { + if (delimiter !== 26 /* CommaToken */) { writeSpace(writer); } writePunctuation(writer, delimiter); writeSpace(writer); } - writeType(types[i], delimiter === 25 /* CommaToken */ ? 0 /* None */ : 64 /* InElementType */); + writeType(types[i], delimiter === 26 /* CommaToken */ ? 0 /* None */ : 64 /* InElementType */); } } function writeSymbolTypeReference(symbol, typeArguments, pos, end, flags) { @@ -26360,29 +28269,29 @@ var ts; buildSymbolDisplay(symbol, writer, enclosingDeclaration, 793064 /* Type */, 0 /* None */, flags); } if (pos < end) { - writePunctuation(writer, 26 /* LessThanToken */); + writePunctuation(writer, 27 /* LessThanToken */); writeType(typeArguments[pos], 256 /* InFirstTypeArgument */); pos++; while (pos < end) { - writePunctuation(writer, 25 /* CommaToken */); + writePunctuation(writer, 26 /* CommaToken */); writeSpace(writer); writeType(typeArguments[pos], 0 /* None */); pos++; } - writePunctuation(writer, 28 /* GreaterThanToken */); + writePunctuation(writer, 29 /* GreaterThanToken */); } } function writeTypeReference(type, flags) { var typeArguments = type.typeArguments || emptyArray; if (type.target === globalArrayType && !(flags & 1 /* WriteArrayAsGenericType */)) { writeType(typeArguments[0], 64 /* InElementType */); - writePunctuation(writer, 20 /* OpenBracketToken */); - writePunctuation(writer, 21 /* CloseBracketToken */); + writePunctuation(writer, 21 /* OpenBracketToken */); + writePunctuation(writer, 22 /* CloseBracketToken */); } else if (type.target.objectFlags & 8 /* Tuple */) { - writePunctuation(writer, 20 /* OpenBracketToken */); - writeTypeList(type.typeArguments.slice(0, getTypeReferenceArity(type)), 25 /* CommaToken */); - writePunctuation(writer, 21 /* CloseBracketToken */); + writePunctuation(writer, 21 /* OpenBracketToken */); + writeTypeList(type.typeArguments.slice(0, getTypeReferenceArity(type)), 26 /* CommaToken */); + writePunctuation(writer, 22 /* CloseBracketToken */); } else { // Write the type reference in the format f.g.C where A and B are type arguments @@ -26391,19 +28300,19 @@ var ts; var outerTypeParameters = type.target.outerTypeParameters; var i = 0; if (outerTypeParameters) { - var length_1 = outerTypeParameters.length; - while (i < length_1) { + var length_2 = outerTypeParameters.length; + while (i < length_2) { // Find group of type arguments for type parameters with the same declaring container. var start = i; - var parent_7 = getParentSymbolOfTypeParameter(outerTypeParameters[i]); + var parent = getParentSymbolOfTypeParameter(outerTypeParameters[i]); do { i++; - } while (i < length_1 && getParentSymbolOfTypeParameter(outerTypeParameters[i]) === parent_7); + } while (i < length_2 && getParentSymbolOfTypeParameter(outerTypeParameters[i]) === parent); // When type parameters are their own type arguments for the whole group (i.e. we have // the default outer type arguments), we don't show the group. if (!ts.rangeEquals(outerTypeParameters, typeArguments, start, i)) { - writeSymbolTypeReference(parent_7, typeArguments, start, i, flags); - writePunctuation(writer, 22 /* DotToken */); + writeSymbolTypeReference(parent, typeArguments, start, i, flags); + writePunctuation(writer, 23 /* DotToken */); } } } @@ -26413,23 +28322,24 @@ var ts; } function writeUnionOrIntersectionType(type, flags) { if (flags & 64 /* InElementType */) { - writePunctuation(writer, 18 /* OpenParenToken */); + writePunctuation(writer, 19 /* OpenParenToken */); } if (type.flags & 65536 /* Union */) { - writeTypeList(formatUnionTypes(type.types), 48 /* BarToken */); + writeTypeList(formatUnionTypes(type.types), 49 /* BarToken */); } else { - writeTypeList(type.types, 47 /* AmpersandToken */); + writeTypeList(type.types, 48 /* AmpersandToken */); } if (flags & 64 /* InElementType */) { - writePunctuation(writer, 19 /* CloseParenToken */); + writePunctuation(writer, 20 /* CloseParenToken */); } } function writeAnonymousType(type, flags) { var symbol = type.symbol; if (symbol) { // Always use 'typeof T' for type of class, enum, and module objects - if (symbol.flags & (32 /* Class */ | 384 /* Enum */ | 512 /* ValueModule */)) { + if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) || + symbol.flags & (384 /* Enum */ | 512 /* ValueModule */)) { writeTypeOfSymbol(type, flags); } else if (shouldWriteTypeOfFunctionSymbol()) { @@ -26444,7 +28354,7 @@ var ts; } else { // Recursive usage, use any - writeKeyword(writer, 118 /* AnyKeyword */); + writeKeyword(writer, 119 /* AnyKeyword */); } } else { @@ -26468,7 +28378,7 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 261 /* SourceFile */ || declaration.parent.kind === 231 /* ModuleBlock */; + return declaration.parent.kind === 265 /* SourceFile */ || declaration.parent.kind === 234 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { // typeof is allowed only for static/non local functions @@ -26478,37 +28388,18 @@ var ts; } } function writeTypeOfSymbol(type, typeFormatFlags) { - writeKeyword(writer, 102 /* TypeOfKeyword */); + writeKeyword(writer, 103 /* TypeOfKeyword */); writeSpace(writer); buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 107455 /* Value */, 0 /* None */, typeFormatFlags); } - function writeIndexSignature(info, keyword) { - if (info) { - if (info.isReadonly) { - writeKeyword(writer, 130 /* ReadonlyKeyword */); - writeSpace(writer); - } - writePunctuation(writer, 20 /* OpenBracketToken */); - writer.writeParameter(info.declaration ? ts.declarationNameToString(info.declaration.parameters[0].name) : "x"); - writePunctuation(writer, 55 /* ColonToken */); - writeSpace(writer); - writeKeyword(writer, keyword); - writePunctuation(writer, 21 /* CloseBracketToken */); - writePunctuation(writer, 55 /* ColonToken */); - writeSpace(writer); - writeType(info.type, 0 /* None */); - writePunctuation(writer, 24 /* SemicolonToken */); - writer.writeLine(); - } - } function writePropertyWithModifiers(prop) { if (isReadonlySymbol(prop)) { - writeKeyword(writer, 130 /* ReadonlyKeyword */); + writeKeyword(writer, 131 /* ReadonlyKeyword */); writeSpace(writer); } buildSymbolDisplay(prop, writer); - if (prop.flags & 536870912 /* Optional */) { - writePunctuation(writer, 54 /* QuestionToken */); + if (prop.flags & 67108864 /* Optional */) { + writePunctuation(writer, 55 /* QuestionToken */); } } function shouldAddParenthesisAroundFunctionType(callSignature, flags) { @@ -26533,107 +28424,107 @@ var ts; var resolved = resolveStructuredTypeMembers(type); if (!resolved.properties.length && !resolved.stringIndexInfo && !resolved.numberIndexInfo) { if (!resolved.callSignatures.length && !resolved.constructSignatures.length) { - writePunctuation(writer, 16 /* OpenBraceToken */); - writePunctuation(writer, 17 /* CloseBraceToken */); + writePunctuation(writer, 17 /* OpenBraceToken */); + writePunctuation(writer, 18 /* CloseBraceToken */); return; } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { var parenthesizeSignature = shouldAddParenthesisAroundFunctionType(resolved.callSignatures[0], flags); if (parenthesizeSignature) { - writePunctuation(writer, 18 /* OpenParenToken */); + writePunctuation(writer, 19 /* OpenParenToken */); } buildSignatureDisplay(resolved.callSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8 /* WriteArrowStyleSignature */, /*kind*/ undefined, symbolStack); if (parenthesizeSignature) { - writePunctuation(writer, 19 /* CloseParenToken */); + writePunctuation(writer, 20 /* CloseParenToken */); } return; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { if (flags & 64 /* InElementType */) { - writePunctuation(writer, 18 /* OpenParenToken */); + writePunctuation(writer, 19 /* OpenParenToken */); } - writeKeyword(writer, 93 /* NewKeyword */); + writeKeyword(writer, 94 /* NewKeyword */); writeSpace(writer); buildSignatureDisplay(resolved.constructSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8 /* WriteArrowStyleSignature */, /*kind*/ undefined, symbolStack); if (flags & 64 /* InElementType */) { - writePunctuation(writer, 19 /* CloseParenToken */); + writePunctuation(writer, 20 /* CloseParenToken */); } return; } } var saveInObjectTypeLiteral = inObjectTypeLiteral; inObjectTypeLiteral = true; - writePunctuation(writer, 16 /* OpenBraceToken */); + writePunctuation(writer, 17 /* OpenBraceToken */); writer.writeLine(); writer.increaseIndent(); writeObjectLiteralType(resolved); writer.decreaseIndent(); - writePunctuation(writer, 17 /* CloseBraceToken */); + writePunctuation(writer, 18 /* CloseBraceToken */); inObjectTypeLiteral = saveInObjectTypeLiteral; } function writeObjectLiteralType(resolved) { for (var _i = 0, _a = resolved.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, /*kind*/ undefined, symbolStack); - writePunctuation(writer, 24 /* SemicolonToken */); + writePunctuation(writer, 25 /* SemicolonToken */); writer.writeLine(); } for (var _b = 0, _c = resolved.constructSignatures; _b < _c.length; _b++) { var signature = _c[_b]; buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, 1 /* Construct */, symbolStack); - writePunctuation(writer, 24 /* SemicolonToken */); + writePunctuation(writer, 25 /* SemicolonToken */); writer.writeLine(); } - writeIndexSignature(resolved.stringIndexInfo, 134 /* StringKeyword */); - writeIndexSignature(resolved.numberIndexInfo, 132 /* NumberKeyword */); + buildIndexSignatureDisplay(resolved.stringIndexInfo, writer, 0 /* String */, enclosingDeclaration, globalFlags, symbolStack); + buildIndexSignatureDisplay(resolved.numberIndexInfo, writer, 1 /* Number */, enclosingDeclaration, globalFlags, symbolStack); for (var _d = 0, _e = resolved.properties; _d < _e.length; _d++) { var p = _e[_d]; var t = getTypeOfSymbol(p); if (p.flags & (16 /* Function */ | 8192 /* Method */) && !getPropertiesOfObjectType(t).length) { var signatures = getSignaturesOfType(t, 0 /* Call */); - for (var _f = 0, signatures_1 = signatures; _f < signatures_1.length; _f++) { - var signature = signatures_1[_f]; + for (var _f = 0, signatures_2 = signatures; _f < signatures_2.length; _f++) { + var signature = signatures_2[_f]; writePropertyWithModifiers(p); buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, /*kind*/ undefined, symbolStack); - writePunctuation(writer, 24 /* SemicolonToken */); + writePunctuation(writer, 25 /* SemicolonToken */); writer.writeLine(); } } else { writePropertyWithModifiers(p); - writePunctuation(writer, 55 /* ColonToken */); + writePunctuation(writer, 56 /* ColonToken */); writeSpace(writer); writeType(t, 0 /* None */); - writePunctuation(writer, 24 /* SemicolonToken */); + writePunctuation(writer, 25 /* SemicolonToken */); writer.writeLine(); } } } function writeMappedType(type) { - writePunctuation(writer, 16 /* OpenBraceToken */); + writePunctuation(writer, 17 /* OpenBraceToken */); writer.writeLine(); writer.increaseIndent(); if (type.declaration.readonlyToken) { - writeKeyword(writer, 130 /* ReadonlyKeyword */); + writeKeyword(writer, 131 /* ReadonlyKeyword */); writeSpace(writer); } - writePunctuation(writer, 20 /* OpenBracketToken */); + writePunctuation(writer, 21 /* OpenBracketToken */); appendSymbolNameOnly(getTypeParameterFromMappedType(type).symbol, writer); writeSpace(writer); - writeKeyword(writer, 91 /* InKeyword */); + writeKeyword(writer, 92 /* InKeyword */); writeSpace(writer); writeType(getConstraintTypeFromMappedType(type), 0 /* None */); - writePunctuation(writer, 21 /* CloseBracketToken */); + writePunctuation(writer, 22 /* CloseBracketToken */); if (type.declaration.questionToken) { - writePunctuation(writer, 54 /* QuestionToken */); + writePunctuation(writer, 55 /* QuestionToken */); } - writePunctuation(writer, 55 /* ColonToken */); + writePunctuation(writer, 56 /* ColonToken */); writeSpace(writer); writeType(getTemplateTypeFromMappedType(type), 0 /* None */); - writePunctuation(writer, 24 /* SemicolonToken */); + writePunctuation(writer, 25 /* SemicolonToken */); writer.writeLine(); writer.decreaseIndent(); - writePunctuation(writer, 17 /* CloseBraceToken */); + writePunctuation(writer, 18 /* CloseBraceToken */); } } function buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration, flags) { @@ -26647,54 +28538,65 @@ var ts; var constraint = getConstraintOfTypeParameter(tp); if (constraint) { writeSpace(writer); - writeKeyword(writer, 84 /* ExtendsKeyword */); + writeKeyword(writer, 85 /* ExtendsKeyword */); writeSpace(writer); buildTypeDisplay(constraint, writer, enclosingDeclaration, flags, symbolStack); } + var defaultType = getDefaultFromTypeParameter(tp); + if (defaultType) { + writeSpace(writer); + writePunctuation(writer, 58 /* EqualsToken */); + writeSpace(writer); + buildTypeDisplay(defaultType, writer, enclosingDeclaration, flags, symbolStack); + } } function buildParameterDisplay(p, writer, enclosingDeclaration, flags, symbolStack) { var parameterNode = p.valueDeclaration; - if (ts.isRestParameter(parameterNode)) { - writePunctuation(writer, 23 /* DotDotDotToken */); + if (parameterNode ? ts.isRestParameter(parameterNode) : isTransientSymbol(p) && p.isRestParameter) { + writePunctuation(writer, 24 /* DotDotDotToken */); } - if (ts.isBindingPattern(parameterNode.name)) { + if (parameterNode && ts.isBindingPattern(parameterNode.name)) { buildBindingPatternDisplay(parameterNode.name, writer, enclosingDeclaration, flags, symbolStack); } else { appendSymbolNameOnly(p, writer); } - if (isOptionalParameter(parameterNode)) { - writePunctuation(writer, 54 /* QuestionToken */); + if (parameterNode && isOptionalParameter(parameterNode)) { + writePunctuation(writer, 55 /* QuestionToken */); } - writePunctuation(writer, 55 /* ColonToken */); + writePunctuation(writer, 56 /* ColonToken */); writeSpace(writer); - buildTypeDisplay(getTypeOfSymbol(p), writer, enclosingDeclaration, flags, symbolStack); + var type = getTypeOfSymbol(p); + if (parameterNode && isRequiredInitializedParameter(parameterNode)) { + type = includeFalsyTypes(type, 2048 /* Undefined */); + } + buildTypeDisplay(type, writer, enclosingDeclaration, flags, symbolStack); } function buildBindingPatternDisplay(bindingPattern, writer, enclosingDeclaration, flags, symbolStack) { // We have to explicitly emit square bracket and bracket because these tokens are not stored inside the node. - if (bindingPattern.kind === 172 /* ObjectBindingPattern */) { - writePunctuation(writer, 16 /* OpenBraceToken */); + if (bindingPattern.kind === 174 /* ObjectBindingPattern */) { + writePunctuation(writer, 17 /* OpenBraceToken */); buildDisplayForCommaSeparatedList(bindingPattern.elements, writer, function (e) { return buildBindingElementDisplay(e, writer, enclosingDeclaration, flags, symbolStack); }); - writePunctuation(writer, 17 /* CloseBraceToken */); + writePunctuation(writer, 18 /* CloseBraceToken */); } - else if (bindingPattern.kind === 173 /* ArrayBindingPattern */) { - writePunctuation(writer, 20 /* OpenBracketToken */); + else if (bindingPattern.kind === 175 /* ArrayBindingPattern */) { + writePunctuation(writer, 21 /* OpenBracketToken */); var elements = bindingPattern.elements; buildDisplayForCommaSeparatedList(elements, writer, function (e) { return buildBindingElementDisplay(e, writer, enclosingDeclaration, flags, symbolStack); }); if (elements && elements.hasTrailingComma) { - writePunctuation(writer, 25 /* CommaToken */); + writePunctuation(writer, 26 /* CommaToken */); } - writePunctuation(writer, 21 /* CloseBracketToken */); + writePunctuation(writer, 22 /* CloseBracketToken */); } } function buildBindingElementDisplay(bindingElement, writer, enclosingDeclaration, flags, symbolStack) { if (ts.isOmittedExpression(bindingElement)) { return; } - ts.Debug.assert(bindingElement.kind === 174 /* BindingElement */); + ts.Debug.assert(bindingElement.kind === 176 /* BindingElement */); if (bindingElement.propertyName) { writer.writeProperty(ts.getTextOfNode(bindingElement.propertyName)); - writePunctuation(writer, 55 /* ColonToken */); + writePunctuation(writer, 56 /* ColonToken */); writeSpace(writer); } if (ts.isBindingPattern(bindingElement.name)) { @@ -26702,22 +28604,22 @@ var ts; } else { if (bindingElement.dotDotDotToken) { - writePunctuation(writer, 23 /* DotDotDotToken */); + writePunctuation(writer, 24 /* DotDotDotToken */); } appendSymbolNameOnly(bindingElement.symbol, writer); } } function buildDisplayForTypeParametersAndDelimiters(typeParameters, writer, enclosingDeclaration, flags, symbolStack) { if (typeParameters && typeParameters.length) { - writePunctuation(writer, 26 /* LessThanToken */); + writePunctuation(writer, 27 /* LessThanToken */); buildDisplayForCommaSeparatedList(typeParameters, writer, function (p) { return buildTypeParameterDisplay(p, writer, enclosingDeclaration, flags, symbolStack); }); - writePunctuation(writer, 28 /* GreaterThanToken */); + writePunctuation(writer, 29 /* GreaterThanToken */); } } function buildDisplayForCommaSeparatedList(list, writer, action) { for (var i = 0; i < list.length; i++) { if (i > 0) { - writePunctuation(writer, 25 /* CommaToken */); + writePunctuation(writer, 26 /* CommaToken */); writeSpace(writer); } action(list[i]); @@ -26725,65 +28627,68 @@ var ts; } function buildDisplayForTypeArgumentsAndDelimiters(typeParameters, mapper, writer, enclosingDeclaration) { if (typeParameters && typeParameters.length) { - writePunctuation(writer, 26 /* LessThanToken */); + writePunctuation(writer, 27 /* LessThanToken */); var flags = 256 /* InFirstTypeArgument */; for (var i = 0; i < typeParameters.length; i++) { if (i > 0) { - writePunctuation(writer, 25 /* CommaToken */); + writePunctuation(writer, 26 /* CommaToken */); writeSpace(writer); flags = 0 /* None */; } buildTypeDisplay(mapper(typeParameters[i]), writer, enclosingDeclaration, flags); } - writePunctuation(writer, 28 /* GreaterThanToken */); + writePunctuation(writer, 29 /* GreaterThanToken */); } } function buildDisplayForParametersAndDelimiters(thisParameter, parameters, writer, enclosingDeclaration, flags, symbolStack) { - writePunctuation(writer, 18 /* OpenParenToken */); + writePunctuation(writer, 19 /* OpenParenToken */); if (thisParameter) { buildParameterDisplay(thisParameter, writer, enclosingDeclaration, flags, symbolStack); } for (var i = 0; i < parameters.length; i++) { if (i > 0 || thisParameter) { - writePunctuation(writer, 25 /* CommaToken */); + writePunctuation(writer, 26 /* CommaToken */); writeSpace(writer); } buildParameterDisplay(parameters[i], writer, enclosingDeclaration, flags, symbolStack); } - writePunctuation(writer, 19 /* CloseParenToken */); + writePunctuation(writer, 20 /* CloseParenToken */); } function buildTypePredicateDisplay(predicate, writer, enclosingDeclaration, flags, symbolStack) { if (ts.isIdentifierTypePredicate(predicate)) { writer.writeParameter(predicate.parameterName); } else { - writeKeyword(writer, 98 /* ThisKeyword */); + writeKeyword(writer, 99 /* ThisKeyword */); } writeSpace(writer); - writeKeyword(writer, 125 /* IsKeyword */); + writeKeyword(writer, 126 /* IsKeyword */); writeSpace(writer); buildTypeDisplay(predicate.type, writer, enclosingDeclaration, flags, symbolStack); } function buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, symbolStack) { + var returnType = getReturnTypeOfSignature(signature); + if (flags & 2048 /* SuppressAnyReturnType */ && isTypeAny(returnType)) { + return; + } if (flags & 8 /* WriteArrowStyleSignature */) { writeSpace(writer); - writePunctuation(writer, 35 /* EqualsGreaterThanToken */); + writePunctuation(writer, 36 /* EqualsGreaterThanToken */); } else { - writePunctuation(writer, 55 /* ColonToken */); + writePunctuation(writer, 56 /* ColonToken */); } writeSpace(writer); if (signature.typePredicate) { buildTypePredicateDisplay(signature.typePredicate, writer, enclosingDeclaration, flags, symbolStack); } else { - var returnType = getReturnTypeOfSignature(signature); buildTypeDisplay(returnType, writer, enclosingDeclaration, flags, symbolStack); } } function buildSignatureDisplay(signature, writer, enclosingDeclaration, flags, kind, symbolStack) { if (kind === 1 /* Construct */) { - writeKeyword(writer, 93 /* NewKeyword */); + writeKeyword(writer, 94 /* NewKeyword */); writeSpace(writer); } if (signature.target && (flags & 32 /* WriteTypeArgumentsOfSignature */)) { @@ -26797,6 +28702,32 @@ var ts; buildDisplayForParametersAndDelimiters(signature.thisParameter, signature.parameters, writer, enclosingDeclaration, flags, symbolStack); buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, symbolStack); } + function buildIndexSignatureDisplay(info, writer, kind, enclosingDeclaration, globalFlags, symbolStack) { + if (info) { + if (info.isReadonly) { + writeKeyword(writer, 131 /* ReadonlyKeyword */); + writeSpace(writer); + } + writePunctuation(writer, 21 /* OpenBracketToken */); + writer.writeParameter(info.declaration ? ts.declarationNameToString(info.declaration.parameters[0].name) : "x"); + writePunctuation(writer, 56 /* ColonToken */); + writeSpace(writer); + switch (kind) { + case 1 /* Number */: + writeKeyword(writer, 133 /* NumberKeyword */); + break; + case 0 /* String */: + writeKeyword(writer, 136 /* StringKeyword */); + break; + } + writePunctuation(writer, 22 /* CloseBracketToken */); + writePunctuation(writer, 56 /* ColonToken */); + writeSpace(writer); + buildTypeDisplay(info.type, writer, enclosingDeclaration, globalFlags, symbolStack); + writePunctuation(writer, 25 /* SemicolonToken */); + writer.writeLine(); + } + } return _displayBuilder || (_displayBuilder = { buildSymbolDisplay: buildSymbolDisplay, buildTypeDisplay: buildTypeDisplay, @@ -26807,6 +28738,7 @@ var ts; buildDisplayForTypeParametersAndDelimiters: buildDisplayForTypeParametersAndDelimiters, buildTypeParameterDisplayFromSymbol: buildTypeParameterDisplayFromSymbol, buildSignatureDisplay: buildSignatureDisplay, + buildIndexSignatureDisplay: buildIndexSignatureDisplay, buildReturnTypeDisplay: buildReturnTypeDisplay }); } @@ -26821,75 +28753,76 @@ var ts; return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 174 /* BindingElement */: + case 176 /* BindingElement */: return isDeclarationVisible(node.parent.parent); - case 223 /* VariableDeclaration */: + case 226 /* VariableDeclaration */: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { // If the binding pattern is empty, this variable declaration is not visible return false; } - // Otherwise fall through - case 230 /* ModuleDeclaration */: - case 226 /* ClassDeclaration */: - case 227 /* InterfaceDeclaration */: - case 228 /* TypeAliasDeclaration */: - case 225 /* FunctionDeclaration */: - case 229 /* EnumDeclaration */: - case 234 /* ImportEqualsDeclaration */: + // falls through + case 233 /* ModuleDeclaration */: + case 229 /* ClassDeclaration */: + case 230 /* InterfaceDeclaration */: + case 231 /* TypeAliasDeclaration */: + case 228 /* FunctionDeclaration */: + case 232 /* EnumDeclaration */: + case 237 /* ImportEqualsDeclaration */: // external module augmentation is always visible if (ts.isExternalModuleAugmentation(node)) { return true; } - var parent_8 = getDeclarationContainer(node); + 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 !== 234 /* ImportEqualsDeclaration */ && parent_8.kind !== 261 /* SourceFile */ && ts.isInAmbientContext(parent_8))) { - return isGlobalSourceFile(parent_8); + !(node.kind !== 237 /* ImportEqualsDeclaration */ && parent.kind !== 265 /* SourceFile */ && ts.isInAmbientContext(parent))) { + return isGlobalSourceFile(parent); } // Exported members/ambient module elements (exception import declaration) are visible if parent is visible - return isDeclarationVisible(parent_8); - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + return isDeclarationVisible(parent); + case 149 /* PropertyDeclaration */: + case 148 /* PropertySignature */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: if (ts.getModifierFlags(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 const it fall into next case statement - case 150 /* Constructor */: - case 154 /* ConstructSignature */: - case 153 /* CallSignature */: - case 155 /* IndexSignature */: - case 144 /* Parameter */: - case 231 /* ModuleBlock */: - case 158 /* FunctionType */: - case 159 /* ConstructorType */: - case 161 /* TypeLiteral */: - case 157 /* TypeReference */: - case 162 /* ArrayType */: - case 163 /* TupleType */: - case 164 /* UnionType */: - case 165 /* IntersectionType */: - case 166 /* ParenthesizedType */: + // Public properties/methods are visible if its parents are visible, so: + // falls through + case 152 /* Constructor */: + case 156 /* ConstructSignature */: + case 155 /* CallSignature */: + case 157 /* IndexSignature */: + case 146 /* Parameter */: + case 234 /* ModuleBlock */: + case 160 /* FunctionType */: + case 161 /* ConstructorType */: + case 163 /* TypeLiteral */: + case 159 /* TypeReference */: + case 164 /* ArrayType */: + case 165 /* TupleType */: + case 166 /* UnionType */: + case 167 /* IntersectionType */: + case 168 /* 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 236 /* ImportClause */: - case 237 /* NamespaceImport */: - case 239 /* ImportSpecifier */: + case 239 /* ImportClause */: + case 240 /* NamespaceImport */: + case 242 /* ImportSpecifier */: return false; // Type parameters are always visible - case 143 /* TypeParameter */: + case 145 /* TypeParameter */: // Source file and namespace export are always visible - case 261 /* SourceFile */: - case 233 /* NamespaceExportDeclaration */: + case 265 /* SourceFile */: + case 236 /* NamespaceExportDeclaration */: return true; // Export assignments do not create name bindings outside the module - case 240 /* ExportAssignment */: + case 243 /* ExportAssignment */: return false; default: return false; @@ -26898,10 +28831,10 @@ var ts; } function collectLinkedAliases(node) { var exportSymbol; - if (node.parent && node.parent.kind === 240 /* ExportAssignment */) { + if (node.parent && node.parent.kind === 243 /* ExportAssignment */) { exportSymbol = resolveName(node.parent, node.text, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */ | 8388608 /* Alias */, ts.Diagnostics.Cannot_find_name_0, node); } - else if (node.parent.kind === 243 /* ExportSpecifier */) { + else if (node.parent.kind === 246 /* ExportSpecifier */) { var exportSpecifier = node.parent; exportSymbol = exportSpecifier.parent.parent.moduleSpecifier ? getExternalModuleMember(exportSpecifier.parent.parent, exportSpecifier) : @@ -26946,8 +28879,8 @@ var ts; var resolutionCycleStartIndex = findResolutionCycleStartIndex(target, propertyName); if (resolutionCycleStartIndex >= 0) { // A cycle was found - var length_2 = resolutionTargets.length; - for (var i = resolutionCycleStartIndex; i < length_2; i++) { + var length_3 = resolutionTargets.length; + for (var i = resolutionCycleStartIndex; i < length_3; i++) { resolutionResults[i] = false; } return false; @@ -26991,21 +28924,20 @@ var ts; return resolutionResults.pop(); } function getDeclarationContainer(node) { - node = ts.getRootDeclaration(node); - while (node) { + node = ts.findAncestor(ts.getRootDeclaration(node), function (node) { switch (node.kind) { - case 223 /* VariableDeclaration */: - case 224 /* VariableDeclarationList */: - case 239 /* ImportSpecifier */: - case 238 /* NamedImports */: - case 237 /* NamespaceImport */: - case 236 /* ImportClause */: - node = node.parent; - break; + case 226 /* VariableDeclaration */: + case 227 /* VariableDeclarationList */: + case 242 /* ImportSpecifier */: + case 241 /* NamedImports */: + case 240 /* NamespaceImport */: + case 239 /* ImportClause */: + return false; default: - return node.parent; + return true; } - } + }); + return node && node.parent; } function getTypeOfPrototypeProperty(prototype) { // TypeScript 1.0 spec (April 2014): 8.4 @@ -27023,9 +28955,6 @@ var ts; function isTypeAny(type) { return type && (type.flags & 1 /* Any */) !== 0; } - function isTypeNever(type) { - return type && (type.flags & 8192 /* Never */) !== 0; - } // Return the type of a binding element parent. We check SymbolLinks first to see if a type has been // assigned by contextual typing. function getTypeForBindingElementParent(node) { @@ -27033,7 +28962,7 @@ var ts; return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, /*includeOptionality*/ false); } function isComputedNonLiteralName(name) { - return name.kind === 142 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteral(name.expression); + return name.kind === 144 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteral(name.expression); } function getRestType(source, properties, symbol) { source = filterType(source, function (t) { return !(t.flags & 6144 /* Nullable */); }); @@ -27045,18 +28974,17 @@ var ts; } var members = ts.createMap(); var names = ts.createMap(); - for (var _i = 0, properties_2 = properties; _i < properties_2.length; _i++) { - var name_17 = properties_2[_i]; - names[ts.getTextOfPropertyName(name_17)] = true; + for (var _i = 0, properties_3 = properties; _i < properties_3.length; _i++) { + var name = properties_3[_i]; + names.set(ts.getTextOfPropertyName(name), true); } for (var _a = 0, _b = getPropertiesOfType(source); _a < _b.length; _a++) { var prop = _b[_a]; - var inNamesToRemove = prop.name in names; + var inNamesToRemove = names.has(prop.name); var isPrivate = getDeclarationModifierFlagsFromSymbol(prop) & (8 /* Private */ | 16 /* Protected */); - var isMethod = prop.flags & 8192 /* Method */; var isSetOnlyAccessor = prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */); - if (!inNamesToRemove && !isPrivate && !isMethod && !isSetOnlyAccessor) { - members[prop.name] = prop; + if (!inNamesToRemove && !isPrivate && !isClassMethod(prop) && !isSetOnlyAccessor) { + members.set(prop.name, prop); } } var stringIndexInfo = getIndexInfoOfType(source, 0 /* String */); @@ -27081,7 +29009,7 @@ var ts; return parentType; } var type; - if (pattern.kind === 172 /* ObjectBindingPattern */) { + if (pattern.kind === 174 /* ObjectBindingPattern */) { if (declaration.dotDotDotToken) { if (!isValidSpreadType(parentType)) { error(declaration, ts.Diagnostics.Rest_types_may_only_be_created_from_object_types); @@ -27098,8 +29026,8 @@ var ts; } else { // Use explicitly specified property name ({ p: xxx } form), or otherwise the implied name ({ p } form) - var name_18 = declaration.propertyName || declaration.name; - if (isComputedNonLiteralName(name_18)) { + var name = declaration.propertyName || declaration.name; + if (isComputedNonLiteralName(name)) { // computed properties with non-literal names are treated as 'any' return anyType; } @@ -27108,12 +29036,12 @@ var ts; } // Use type of the specified property, or otherwise, for a numeric name, the type of the numeric index signature, // or otherwise the type of the string index signature. - var text = ts.getTextOfPropertyName(name_18); + var text = ts.getTextOfPropertyName(name); type = getTypeOfPropertyOfType(parentType, text) || isNumericLiteralName(text) && getIndexTypeOfType(parentType, 1 /* Number */) || getIndexTypeOfType(parentType, 0 /* String */); if (!type) { - error(name_18, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name_18)); + error(name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name)); return unknownType; } } @@ -27122,7 +29050,7 @@ var ts; // This elementType will be used if the specific property corresponding to this index is not // present (aka the tuple element property). This call also checks that the parentType is in // fact an iterable or array (depending on target language). - var elementType = checkIteratedTypeOrElementType(parentType, pattern, /*allowStringInput*/ false); + var elementType = checkIteratedTypeOrElementType(parentType, pattern, /*allowStringInput*/ false, /*allowAsyncIterable*/ false); if (declaration.dotDotDotToken) { // Rest element has an array type with the same element type as the parent type type = createArrayType(elementType); @@ -27153,7 +29081,7 @@ var ts; getUnionType([type, checkExpressionCached(declaration.initializer)], /*subtypeReduction*/ true) : type; } - function getTypeForVariableLikeDeclarationFromJSDocComment(declaration) { + function getTypeForDeclarationFromJSDocComment(declaration) { var jsdocType = ts.getJSDocType(declaration); if (jsdocType) { return getTypeFromTypeNode(jsdocType); @@ -27162,11 +29090,11 @@ var ts; } function isNullOrUndefined(node) { var expr = ts.skipParentheses(node); - return expr.kind === 94 /* NullKeyword */ || expr.kind === 70 /* Identifier */ && getResolvedSymbol(expr) === undefinedSymbol; + return expr.kind === 95 /* NullKeyword */ || expr.kind === 71 /* Identifier */ && getResolvedSymbol(expr) === undefinedSymbol; } function isEmptyArrayLiteral(node) { var expr = ts.skipParentheses(node); - return expr.kind === 175 /* ArrayLiteralExpression */ && expr.elements.length === 0; + return expr.kind === 177 /* ArrayLiteralExpression */ && expr.elements.length === 0; } function addOptionality(type, optional) { return strictNullChecks && optional ? includeFalsyTypes(type, 2048 /* Undefined */) : type; @@ -27177,33 +29105,35 @@ var ts; // If this is a variable in a JavaScript file, then use the JSDoc type (if it has // one as its type), otherwise fallback to the below standard TS codepaths to // try to figure it out. - var type = getTypeForVariableLikeDeclarationFromJSDocComment(declaration); + var type = getTypeForDeclarationFromJSDocComment(declaration); if (type && type !== unknownType) { return type; } } // 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 (declaration.parent.parent.kind === 212 /* ForInStatement */) { + if (declaration.parent.parent.kind === 215 /* ForInStatement */) { var indexType = getIndexType(checkNonNullExpression(declaration.parent.parent.expression)); return indexType.flags & (16384 /* TypeParameter */ | 262144 /* Index */) ? indexType : stringType; } - if (declaration.parent.parent.kind === 213 /* ForOfStatement */) { + if (declaration.parent.parent.kind === 216 /* 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, // or it may have led to an error inside getElementTypeOfIterable. - return checkRightHandSideOfForOf(declaration.parent.parent.expression) || anyType; + var forOfStatement = declaration.parent.parent; + return checkRightHandSideOfForOf(forOfStatement.expression, forOfStatement.awaitModifier) || anyType; } if (ts.isBindingPattern(declaration.parent)) { return getTypeForBindingElement(declaration); } // Use type from type annotation if one is present if (declaration.type) { - return addOptionality(getTypeFromTypeNode(declaration.type), /*optional*/ declaration.questionToken && includeOptionality); + var declaredType = getTypeFromTypeNode(declaration.type); + return addOptionality(declaredType, /*optional*/ declaration.questionToken && includeOptionality); } - if ((compilerOptions.noImplicitAny || declaration.flags & 65536 /* JavaScriptFile */) && - declaration.kind === 223 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && + if ((noImplicitAny || declaration.flags & 65536 /* JavaScriptFile */) && + declaration.kind === 226 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && !(ts.getCombinedModifierFlags(declaration) & 1 /* Export */) && !ts.isInAmbientContext(declaration)) { // 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 @@ -27217,11 +29147,11 @@ var ts; return autoArrayType; } } - if (declaration.kind === 144 /* Parameter */) { + if (declaration.kind === 146 /* 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 === 152 /* SetAccessor */ && !ts.hasDynamicName(func)) { - var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 151 /* GetAccessor */); + if (func.kind === 154 /* SetAccessor */ && !ts.hasDynamicName(func)) { + var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 153 /* GetAccessor */); if (getter) { var getterSignature = getSignatureFromDeclaration(getter); var thisParameter = getAccessorThisParameter(func); @@ -27250,8 +29180,13 @@ var ts; var type = checkDeclarationInitializer(declaration); return addOptionality(type, /*optional*/ declaration.questionToken && includeOptionality); } + if (ts.isJsxAttribute(declaration)) { + // if JSX attribute doesn't have initializer, by default the attribute will have boolean value of true. + // I.e is sugar for + return trueType; + } // If it is a short-hand property assignment, use the type of the identifier - if (declaration.kind === 258 /* ShorthandPropertyAssignment */) { + if (declaration.kind === 262 /* ShorthandPropertyAssignment */) { return checkIdentifier(declaration.name); } // If the declaration specifies a binding pattern, use the type implied by the binding pattern @@ -27261,6 +29196,38 @@ var ts; // No type specified and nothing can be inferred return undefined; } + function getWidenedTypeFromJSSpecialPropertyDeclarations(symbol) { + var types = []; + var definedInConstructor = false; + var definedInMethod = false; + for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { + var declaration = _a[_i]; + var expression = declaration.kind === 194 /* BinaryExpression */ ? declaration : + declaration.kind === 179 /* PropertyAccessExpression */ ? ts.getAncestor(declaration, 194 /* BinaryExpression */) : + undefined; + if (!expression) { + return unknownType; + } + if (ts.isPropertyAccessExpression(expression.left) && expression.left.expression.kind === 99 /* ThisKeyword */) { + if (ts.getThisContainer(expression, /*includeArrowFunctions*/ false).kind === 152 /* Constructor */) { + definedInConstructor = true; + } + else { + definedInMethod = true; + } + } + if (expression.flags & 65536 /* JavaScriptFile */) { + // If there is a JSDoc type, use it + var type = getTypeForDeclarationFromJSDocComment(expression.parent); + if (type && type !== unknownType) { + types.push(getWidenedType(type)); + continue; + } + } + types.push(getWidenedLiteralType(checkExpressionCached(expression.right))); + } + return getWidenedType(addOptionality(getUnionType(types, /*subtypeReduction*/ true), definedInMethod && !definedInConstructor)); + } // Return the type implied by a binding pattern element. This is the type of the initializer of the element if // one is present. Otherwise, if the element is itself a binding pattern, it is the type implied by the binding // pattern. Otherwise, it is the type any. @@ -27271,7 +29238,7 @@ var ts; if (ts.isBindingPattern(element.name)) { return getTypeFromBindingPattern(element.name, includePatternInType, reportErrors); } - if (reportErrors && compilerOptions.noImplicitAny && !declarationBelongsToPrivateAmbientMember(element)) { + if (reportErrors && noImplicitAny && !declarationBelongsToPrivateAmbientMember(element)) { reportImplicitAnyError(element, anyType); } return anyType; @@ -27293,11 +29260,11 @@ var ts; return; } var text = ts.getTextOfPropertyName(name); - var flags = 4 /* Property */ | 67108864 /* Transient */ | (e.initializer ? 536870912 /* Optional */ : 0); + var flags = 4 /* Property */ | (e.initializer ? 67108864 /* Optional */ : 0); var symbol = createSymbol(flags, text); symbol.type = getTypeFromBindingElement(e, includePatternInType, reportErrors); symbol.bindingElement = e; - members[symbol.name] = symbol; + members.set(symbol.name, symbol); }); var result = createAnonymousType(undefined, members, emptyArray, emptyArray, stringIndexInfo, undefined); if (includePatternInType) { @@ -27332,7 +29299,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 === 172 /* ObjectBindingPattern */ + return pattern.kind === 174 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors); } @@ -27354,7 +29321,7 @@ var ts; // During a normal type check we'll never get to here with a property assignment (the check of the containing // object literal uses a different path). We exclude widening only so that language services and type verification // tools see the actual type. - if (declaration.kind === 257 /* PropertyAssignment */) { + if (declaration.kind === 261 /* PropertyAssignment */) { return type; } return getWidenedType(type); @@ -27362,7 +29329,7 @@ var ts; // Rest parameters default to type any[], other parameters default to type any type = declaration.dotDotDotToken ? anyArrayType : anyType; // Report implicit any errors unless this is a private property within an ambient declaration - if (reportErrors && compilerOptions.noImplicitAny) { + if (reportErrors && noImplicitAny) { if (!declarationBelongsToPrivateAmbientMember(declaration)) { reportImplicitAnyError(declaration, type); } @@ -27371,14 +29338,14 @@ var ts; } function declarationBelongsToPrivateAmbientMember(declaration) { var root = ts.getRootDeclaration(declaration); - var memberDeclaration = root.kind === 144 /* Parameter */ ? root.parent : root; + var memberDeclaration = root.kind === 146 /* Parameter */ ? root.parent : root; return isPrivateWithinAmbient(memberDeclaration); } function getTypeOfVariableOrParameterOrProperty(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { // Handle prototype property - if (symbol.flags & 134217728 /* Prototype */) { + if (symbol.flags & 16777216 /* Prototype */) { return links.type = getTypeOfPrototypeProperty(symbol); } // Handle catch clause variables @@ -27387,10 +29354,10 @@ var ts; return links.type = anyType; } // Handle export default expressions - if (declaration.kind === 240 /* ExportAssignment */) { + if (declaration.kind === 243 /* ExportAssignment */) { return links.type = checkExpression(declaration.expression); } - if (declaration.flags & 65536 /* JavaScriptFile */ && declaration.kind === 286 /* JSDocPropertyTag */ && declaration.typeExpression) { + if (declaration.flags & 65536 /* JavaScriptFile */ && declaration.kind === 291 /* JSDocPropertyTag */ && declaration.typeExpression) { return links.type = getTypeFromTypeNode(declaration.typeExpression.type); } // Handle variable, parameter or property @@ -27403,19 +29370,9 @@ var ts; // * exports.p = expr // * this.p = expr // * className.prototype.method = expr - if (declaration.kind === 192 /* BinaryExpression */ || - declaration.kind === 177 /* PropertyAccessExpression */ && declaration.parent.kind === 192 /* BinaryExpression */) { - // Use JS Doc type if present on parent expression statement - if (declaration.flags & 65536 /* JavaScriptFile */) { - var jsdocType = ts.getJSDocType(declaration.parent); - if (jsdocType) { - return links.type = getTypeFromTypeNode(jsdocType); - } - } - var declaredTypes = ts.map(symbol.declarations, function (decl) { return decl.kind === 192 /* BinaryExpression */ ? - checkExpressionCached(decl.right) : - checkExpressionCached(decl.parent.right); }); - type = getUnionType(declaredTypes, /*subtypeReduction*/ true); + if (declaration.kind === 194 /* BinaryExpression */ || + declaration.kind === 179 /* PropertyAccessExpression */ && declaration.parent.kind === 194 /* BinaryExpression */) { + type = getWidenedTypeFromJSSpecialPropertyDeclarations(symbol); } else { type = getWidenedTypeForVariableLikeDeclaration(declaration, /*reportErrors*/ true); @@ -27429,7 +29386,7 @@ var ts; } function getAnnotatedAccessorType(accessor) { if (accessor) { - if (accessor.kind === 151 /* GetAccessor */) { + if (accessor.kind === 153 /* GetAccessor */) { return accessor.type && getTypeFromTypeNode(accessor.type); } else { @@ -27449,10 +29406,10 @@ var ts; function getTypeOfAccessors(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - var getter = ts.getDeclarationOfKind(symbol, 151 /* GetAccessor */); - var setter = ts.getDeclarationOfKind(symbol, 152 /* SetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 153 /* GetAccessor */); + var setter = ts.getDeclarationOfKind(symbol, 154 /* SetAccessor */); if (getter && getter.flags & 65536 /* JavaScriptFile */) { - var jsDocType = getTypeForVariableLikeDeclarationFromJSDocComment(getter); + var jsDocType = getTypeForDeclarationFromJSDocComment(getter); if (jsDocType) { return links.type = jsDocType; } @@ -27478,7 +29435,7 @@ var ts; type = getReturnTypeFromBody(getter); } else { - if (compilerOptions.noImplicitAny) { + if (noImplicitAny) { if (setter) { error(setter, ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation, symbolToString(symbol)); } @@ -27493,8 +29450,8 @@ var ts; } if (!popTypeResolution()) { type = anyType; - if (compilerOptions.noImplicitAny) { - var getter_1 = ts.getDeclarationOfKind(symbol, 151 /* GetAccessor */); + if (noImplicitAny) { + var getter_1 = ts.getDeclarationOfKind(symbol, 153 /* 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)); } } @@ -27502,6 +29459,10 @@ var ts; } return links.type; } + function getBaseTypeVariableOfClass(symbol) { + var baseConstructorType = getBaseConstructorTypeOfClass(getDeclaredTypeOfClassOrInterface(symbol)); + return baseConstructorType.flags & 540672 /* TypeVariable */ ? baseConstructorType : undefined; + } function getTypeOfFuncClassEnumModule(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { @@ -27510,8 +29471,13 @@ var ts; } else { var type = createObjectType(16 /* Anonymous */, symbol); - links.type = strictNullChecks && symbol.flags & 536870912 /* Optional */ ? - includeFalsyTypes(type, 2048 /* Undefined */) : type; + if (symbol.flags & 32 /* Class */) { + var baseTypeVariable = getBaseTypeVariableOfClass(symbol); + links.type = baseTypeVariable ? getIntersectionType([type, baseTypeVariable]) : type; + } + else { + links.type = strictNullChecks && symbol.flags & 67108864 /* Optional */ ? includeFalsyTypes(type, 2048 /* Undefined */) : type; + } } } return links.type; @@ -27541,14 +29507,22 @@ var ts; function getTypeOfInstantiatedSymbol(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - if (!pushTypeResolution(symbol, 0 /* Type */)) { - return unknownType; + if (symbolInstantiationDepth === 100) { + error(symbol.valueDeclaration, ts.Diagnostics.Generic_type_instantiation_is_excessively_deep_and_possibly_infinite); + links.type = unknownType; } - var type = instantiateType(getTypeOfSymbol(links.target), links.mapper); - if (!popTypeResolution()) { - type = reportCircularityError(symbol); + else { + if (!pushTypeResolution(symbol, 0 /* Type */)) { + return unknownType; + } + symbolInstantiationDepth++; + var type = instantiateType(getTypeOfSymbol(links.target), links.mapper); + symbolInstantiationDepth--; + if (!popTypeResolution()) { + type = reportCircularityError(symbol); + } + links.type = type; } - links.type = type; } return links.type; } @@ -27559,13 +29533,13 @@ var ts; return unknownType; } // Otherwise variable has initializer that circularly references the variable itself - if (compilerOptions.noImplicitAny) { + if (noImplicitAny) { error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); } return anyType; } function getTypeOfSymbol(symbol) { - if (symbol.flags & 16777216 /* Instantiated */) { + if (getCheckFlags(symbol) & 1 /* Instantiated */) { return getTypeOfInstantiatedSymbol(symbol); } if (symbol.flags & (3 /* Variable */ | 4 /* Property */)) { @@ -27585,22 +29559,33 @@ var ts; } return unknownType; } + function isReferenceToType(type, target) { + return type !== undefined + && target !== undefined + && (getObjectFlags(type) & 4 /* Reference */) !== 0 + && type.target === target; + } function getTargetType(type) { return getObjectFlags(type) & 4 /* Reference */ ? type.target : type; } function hasBaseType(type, checkBase) { return check(type); function check(type) { - var target = getTargetType(type); - return target === checkBase || ts.forEach(getBaseTypes(target), check); + if (getObjectFlags(type) & (3 /* ClassOrInterface */ | 4 /* Reference */)) { + var target = getTargetType(type); + return target === checkBase || ts.forEach(getBaseTypes(target), check); + } + else if (type.flags & 131072 /* Intersection */) { + return ts.forEach(type.types, check); + } } } // Appends the type parameters given by a list of declarations to a set of type parameters and returns the resulting set. // The function allocates a new array if the input type parameter set is undefined, but otherwise it modifies the set // in-place and returns the same array. function appendTypeParameters(typeParameters, declarations) { - for (var _i = 0, declarations_2 = declarations; _i < declarations_2.length; _i++) { - var declaration = declarations_2[_i]; + for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { + var declaration = declarations_3[_i]; var tp = getDeclaredTypeOfTypeParameter(getSymbolOfNode(declaration)); if (!typeParameters) { typeParameters = [tp]; @@ -27620,9 +29605,9 @@ var ts; if (!node) { return typeParameters; } - if (node.kind === 226 /* ClassDeclaration */ || node.kind === 197 /* ClassExpression */ || - node.kind === 225 /* FunctionDeclaration */ || node.kind === 184 /* FunctionExpression */ || - node.kind === 149 /* MethodDeclaration */ || node.kind === 185 /* ArrowFunction */) { + if (node.kind === 229 /* ClassDeclaration */ || node.kind === 199 /* ClassExpression */ || + node.kind === 228 /* FunctionDeclaration */ || node.kind === 186 /* FunctionExpression */ || + node.kind === 151 /* MethodDeclaration */ || node.kind === 187 /* ArrowFunction */) { var declarations = node.typeParameters; if (declarations) { return appendTypeParameters(appendOuterTypeParameters(typeParameters, node), declarations); @@ -27632,8 +29617,8 @@ 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, 227 /* InterfaceDeclaration */); - return appendOuterTypeParameters(undefined, declaration); + var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 230 /* InterfaceDeclaration */); + return appendOuterTypeParameters(/*typeParameters*/ undefined, declaration); } // The local type parameters are the combined set of type parameters from all declarations of the class, // interface, or type alias. @@ -27641,8 +29626,8 @@ var ts; var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 227 /* InterfaceDeclaration */ || node.kind === 226 /* ClassDeclaration */ || - node.kind === 197 /* ClassExpression */ || node.kind === 228 /* TypeAliasDeclaration */) { + if (node.kind === 230 /* InterfaceDeclaration */ || node.kind === 229 /* ClassDeclaration */ || + node.kind === 199 /* ClassExpression */ || node.kind === 231 /* TypeAliasDeclaration */) { var declaration = node; if (declaration.typeParameters) { result = appendTypeParameters(result, declaration.typeParameters); @@ -27656,29 +29641,50 @@ var ts; function getTypeParametersOfClassOrInterface(symbol) { return ts.concatenate(getOuterTypeParametersOfClassOrInterface(symbol), getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol)); } + // A type is a mixin constructor if it has a single construct signature taking no type parameters and a single + // rest parameter of type any[]. + function isMixinConstructorType(type) { + var signatures = getSignaturesOfType(type, 1 /* Construct */); + if (signatures.length === 1) { + var s = signatures[0]; + return !s.typeParameters && s.parameters.length === 1 && s.hasRestParameter && getTypeOfParameter(s.parameters[0]) === anyArrayType; + } + return false; + } function isConstructorType(type) { - return type.flags & 32768 /* Object */ && getSignaturesOfType(type, 1 /* Construct */).length > 0; + if (isValidBaseType(type) && getSignaturesOfType(type, 1 /* Construct */).length > 0) { + return true; + } + if (type.flags & 540672 /* TypeVariable */) { + var constraint = getBaseConstraintOfType(type); + return constraint && isValidBaseType(constraint) && isMixinConstructorType(constraint); + } + return false; } function getBaseTypeNodeOfClass(type) { return ts.getClassExtendsHeritageClauseElement(type.symbol.valueDeclaration); } - function getConstructorsForTypeArguments(type, typeArgumentNodes) { - var typeArgCount = typeArgumentNodes ? typeArgumentNodes.length : 0; - return ts.filter(getSignaturesOfType(type, 1 /* Construct */), function (sig) { return (sig.typeParameters ? sig.typeParameters.length : 0) === typeArgCount; }); + function getConstructorsForTypeArguments(type, typeArgumentNodes, location) { + var typeArgCount = ts.length(typeArgumentNodes); + var isJavaScript = ts.isInJavaScriptFile(location); + return ts.filter(getSignaturesOfType(type, 1 /* Construct */), function (sig) { return (isJavaScript || typeArgCount >= getMinTypeArgumentCount(sig.typeParameters)) && typeArgCount <= ts.length(sig.typeParameters); }); } - function getInstantiatedConstructorsForTypeArguments(type, typeArgumentNodes) { - var signatures = getConstructorsForTypeArguments(type, typeArgumentNodes); + function getInstantiatedConstructorsForTypeArguments(type, typeArgumentNodes, location) { + var signatures = getConstructorsForTypeArguments(type, typeArgumentNodes, location); if (typeArgumentNodes) { var typeArguments_1 = ts.map(typeArgumentNodes, getTypeFromTypeNode); signatures = ts.map(signatures, function (sig) { return getSignatureInstantiation(sig, typeArguments_1); }); } return signatures; } - // The base constructor of a class can resolve to - // undefinedType if the class has no extends clause, - // unknownType if an error occurred during resolution of the extends expression, - // nullType if the extends expression is the null value, or - // an object type with at least one construct signature. + /** + * The base constructor of a class can resolve to + * * undefinedType if the class has no extends clause, + * * unknownType if an error occurred during resolution of the extends expression, + * * nullType if the extends expression is the null value, + * * anyType if the extends expression has type any, or + * * an object type with at least one construct signature. + */ function getBaseConstructorTypeOfClass(type) { if (!type.resolvedBaseConstructorType) { var baseTypeNode = getBaseTypeNodeOfClass(type); @@ -27689,7 +29695,7 @@ var ts; return unknownType; } var baseConstructorType = checkExpression(baseTypeNode.expression); - if (baseConstructorType.flags & 32768 /* Object */) { + if (baseConstructorType.flags & (32768 /* Object */ | 131072 /* Intersection */)) { // Resolving the members of a class requires us to resolve the base class of that class. // We force resolution here such that we catch circularities now. resolveStructuredTypeMembers(baseConstructorType); @@ -27698,7 +29704,7 @@ var ts; error(type.symbol.valueDeclaration, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_base_expression, symbolToString(type.symbol)); return type.resolvedBaseConstructorType = unknownType; } - if (baseConstructorType !== unknownType && baseConstructorType !== nullWideningType && !isConstructorType(baseConstructorType)) { + if (!(baseConstructorType.flags & 1 /* Any */) && baseConstructorType !== nullWideningType && !isConstructorType(baseConstructorType)) { error(baseTypeNode.expression, ts.Diagnostics.Type_0_is_not_a_constructor_function_type, typeToString(baseConstructorType)); return type.resolvedBaseConstructorType = unknownType; } @@ -27727,8 +29733,8 @@ var ts; } function resolveBaseTypesOfClass(type) { type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray; - var baseConstructorType = getBaseConstructorTypeOfClass(type); - if (!(baseConstructorType.flags & 32768 /* Object */)) { + var baseConstructorType = getApparentType(getBaseConstructorTypeOfClass(type)); + if (!(baseConstructorType.flags & (32768 /* Object */ | 131072 /* Intersection */ | 1 /* Any */))) { return; } var baseTypeNode = getBaseTypeNodeOfClass(type); @@ -27741,11 +29747,14 @@ var ts; // type arguments in the same manner as a type reference to get the same error reporting experience. baseType = getTypeFromClassOrInterfaceReference(baseTypeNode, baseConstructorType.symbol); } + else if (baseConstructorType.flags & 1 /* Any */) { + baseType = baseConstructorType; + } else { // The class derives from a "class-like" constructor function, check that we have at least one construct signature // with a matching number of type parameters and use the return type of the first instantiated signature. Elsewhere // we check that all instantiated signatures return the same type. - var constructors = getInstantiatedConstructorsForTypeArguments(baseConstructorType, baseTypeNode.typeArguments); + var constructors = getInstantiatedConstructorsForTypeArguments(baseConstructorType, baseTypeNode.typeArguments, baseTypeNode); if (!constructors.length) { error(baseTypeNode.expression, ts.Diagnostics.No_base_constructor_has_the_specified_number_of_type_arguments); return; @@ -27763,7 +29772,7 @@ var ts; if (baseType === unknownType) { return; } - if (!(getObjectFlags(getTargetType(baseType)) & 3 /* ClassOrInterface */)) { + if (!isValidBaseType(baseType)) { error(baseTypeNode.expression, ts.Diagnostics.Base_constructor_return_type_0_is_not_a_class_or_interface_type, typeToString(baseType)); return; } @@ -27789,16 +29798,22 @@ var ts; } return true; } + // A valid base type is `any`, any non-generic object type or intersection of non-generic + // object types. + function isValidBaseType(type) { + return type.flags & (32768 /* Object */ | 16777216 /* NonPrimitive */ | 1 /* Any */) && !isGenericMappedType(type) || + type.flags & 131072 /* Intersection */ && !ts.forEach(type.types, function (t) { return !isValidBaseType(t); }); + } function resolveBaseTypesOfInterface(type) { type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 227 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 230 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getTypeFromTypeNode(node); if (baseType !== unknownType) { - if (getObjectFlags(getTargetType(baseType)) & 3 /* ClassOrInterface */) { + if (isValidBaseType(baseType)) { if (type !== baseType && !hasBaseType(baseType, type)) { if (type.resolvedBaseTypes === emptyArray) { type.resolvedBaseTypes = [baseType]; @@ -27825,7 +29840,7 @@ var ts; function isIndependentInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 227 /* InterfaceDeclaration */) { + if (declaration.kind === 230 /* InterfaceDeclaration */) { if (declaration.flags & 64 /* ContainsThis */) { return false; } @@ -27863,7 +29878,7 @@ var ts; type.outerTypeParameters = outerTypeParameters; type.localTypeParameters = localTypeParameters; type.instantiations = ts.createMap(); - type.instantiations[getTypeListId(type.typeParameters)] = type; + type.instantiations.set(getTypeListId(type.typeParameters), type); type.target = type; type.typeArguments = type.typeParameters; type.thisType = createType(16384 /* TypeParameter */); @@ -27882,7 +29897,7 @@ var ts; if (!pushTypeResolution(symbol, 2 /* DeclaredType */)) { return unknownType; } - var declaration = ts.getDeclarationOfKind(symbol, 285 /* JSDocTypedefTag */); + var declaration = ts.getDeclarationOfKind(symbol, 290 /* JSDocTypedefTag */); var type = void 0; if (declaration) { if (declaration.jsDocTypeLiteral) { @@ -27893,7 +29908,7 @@ var ts; } } else { - declaration = ts.getDeclarationOfKind(symbol, 228 /* TypeAliasDeclaration */); + declaration = ts.getDeclarationOfKind(symbol, 231 /* TypeAliasDeclaration */); type = getTypeFromTypeNode(declaration.type); } if (popTypeResolution()) { @@ -27903,7 +29918,7 @@ var ts; // an instantiation of the type alias with the type parameters supplied as type arguments. links.typeParameters = typeParameters; links.instantiations = ts.createMap(); - links.instantiations[getTypeListId(typeParameters)] = type; + links.instantiations.set(getTypeListId(typeParameters), type); } } else { @@ -27920,14 +29935,14 @@ var ts; return !ts.isInAmbientContext(member); } return expr.kind === 8 /* NumericLiteral */ || - expr.kind === 190 /* PrefixUnaryExpression */ && expr.operator === 37 /* MinusToken */ && + expr.kind === 192 /* PrefixUnaryExpression */ && expr.operator === 38 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */ || - expr.kind === 70 /* Identifier */ && !!symbol.exports[expr.text]; + expr.kind === 71 /* Identifier */ && !!symbol.exports.get(expr.text); } function enumHasLiteralMembers(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 229 /* EnumDeclaration */) { + if (declaration.kind === 232 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; if (!isLiteralEnumMember(symbol, member)) { @@ -27952,10 +29967,10 @@ var ts; enumType.symbol = symbol; if (enumHasLiteralMembers(symbol)) { var memberTypeList = []; - var memberTypes = ts.createMap(); + var memberTypes = []; for (var _i = 0, _a = enumType.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 229 /* EnumDeclaration */) { + if (declaration.kind === 232 /* EnumDeclaration */) { computeEnumMemberValues(declaration); for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; @@ -27972,7 +29987,7 @@ var ts; if (memberTypeList.length > 1) { enumType.flags |= 65536 /* Union */; enumType.types = memberTypeList; - unionTypes[getTypeListId(memberTypeList)] = enumType; + unionTypes.set(getTypeListId(memberTypeList), enumType); } } } @@ -27993,9 +30008,6 @@ var ts; if (!links.declaredType) { var type = createType(16384 /* TypeParameter */); type.symbol = symbol; - if (!ts.getDeclarationOfKind(symbol, 143 /* TypeParameter */).constraint) { - type.constraint = noConstraintType; - } links.declaredType = type; } return links.declaredType; @@ -28008,7 +30020,6 @@ var ts; return links.declaredType; } function getDeclaredTypeOfSymbol(symbol) { - ts.Debug.assert((symbol.flags & 16777216 /* Instantiated */) === 0); if (symbol.flags & (32 /* Class */ | 64 /* Interface */)) { return getDeclaredTypeOfClassOrInterface(symbol); } @@ -28046,20 +30057,21 @@ var ts; // considered independent. function isIndependentType(node) { switch (node.kind) { - case 118 /* AnyKeyword */: - case 134 /* StringKeyword */: - case 132 /* NumberKeyword */: - case 121 /* BooleanKeyword */: - case 135 /* SymbolKeyword */: - case 104 /* VoidKeyword */: - case 137 /* UndefinedKeyword */: - case 94 /* NullKeyword */: - case 129 /* NeverKeyword */: - case 171 /* LiteralType */: + case 119 /* AnyKeyword */: + case 136 /* StringKeyword */: + case 133 /* NumberKeyword */: + case 122 /* BooleanKeyword */: + case 137 /* SymbolKeyword */: + case 134 /* ObjectKeyword */: + case 105 /* VoidKeyword */: + case 139 /* UndefinedKeyword */: + case 95 /* NullKeyword */: + case 130 /* NeverKeyword */: + case 173 /* LiteralType */: return true; - case 162 /* ArrayType */: + case 164 /* ArrayType */: return isIndependentType(node.elementType); - case 157 /* TypeReference */: + case 159 /* TypeReference */: return isIndependentTypeReference(node); } return false; @@ -28072,7 +30084,7 @@ var ts; // A function-like declaration is considered independent (free of this references) if it has a return type // annotation that is considered independent and if each parameter is considered independent. function isIndependentFunctionLikeDeclaration(node) { - if (node.kind !== 150 /* Constructor */ && (!node.type || !isIndependentType(node.type))) { + if (node.kind !== 152 /* Constructor */ && (!node.type || !isIndependentType(node.type))) { return false; } for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { @@ -28093,12 +30105,12 @@ var ts; var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: + case 149 /* PropertyDeclaration */: + case 148 /* PropertySignature */: return isIndependentVariableLikeDeclaration(declaration); - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: + case 152 /* Constructor */: return isIndependentFunctionLikeDeclaration(declaration); } } @@ -28109,7 +30121,7 @@ var ts; var result = ts.createMap(); for (var _i = 0, symbols_1 = symbols; _i < symbols_1.length; _i++) { var symbol = symbols_1[_i]; - result[symbol.name] = symbol; + result.set(symbol.name, symbol); } return result; } @@ -28119,15 +30131,15 @@ var ts; var result = ts.createMap(); for (var _i = 0, symbols_2 = symbols; _i < symbols_2.length; _i++) { var symbol = symbols_2[_i]; - result[symbol.name] = mappingThisOnly && isIndependentMember(symbol) ? symbol : instantiateSymbol(symbol, mapper); + result.set(symbol.name, mappingThisOnly && isIndependentMember(symbol) ? symbol : instantiateSymbol(symbol, mapper)); } return result; } function addInheritedMembers(symbols, baseSymbols) { for (var _i = 0, baseSymbols_1 = baseSymbols; _i < baseSymbols_1.length; _i++) { var s = baseSymbols_1[_i]; - if (!symbols[s.name]) { - symbols[s.name] = s; + if (!symbols.has(s.name)) { + symbols.set(s.name, s); } } } @@ -28135,8 +30147,8 @@ var ts; if (!type.declaredProperties) { var symbol = type.symbol; type.declaredProperties = getNamedMembers(symbol.members); - type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]); - type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]); + type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members.get("__call")); + type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members.get("__new")); type.declaredStringIndexInfo = getIndexInfoOfSymbol(symbol, 0 /* String */); type.declaredNumberIndexInfo = getIndexInfoOfSymbol(symbol, 1 /* Number */); } @@ -28144,7 +30156,14 @@ var ts; } function getTypeWithThisArgument(type, thisArgument) { if (getObjectFlags(type) & 4 /* Reference */) { - return createTypeReference(type.target, ts.concatenate(type.typeArguments, [thisArgument || type.target.thisType])); + var target = type.target; + var typeArguments = type.typeArguments; + if (ts.length(target.typeParameters) === ts.length(typeArguments)) { + return createTypeReference(target, ts.concatenate(typeArguments, [thisArgument || target.thisType])); + } + } + else if (type.flags & 131072 /* Intersection */) { + return getIntersectionType(ts.map(type.types, function (t) { return getTypeWithThisArgument(t, thisArgument); })); } return type; } @@ -28180,10 +30199,14 @@ var ts; for (var _i = 0, baseTypes_1 = baseTypes; _i < baseTypes_1.length; _i++) { var baseType = baseTypes_1[_i]; var instantiatedBaseType = thisArgument ? getTypeWithThisArgument(instantiateType(baseType, mapper), thisArgument) : baseType; - addInheritedMembers(members, getPropertiesOfObjectType(instantiatedBaseType)); + addInheritedMembers(members, getPropertiesOfType(instantiatedBaseType)); callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(instantiatedBaseType, 0 /* Call */)); constructSignatures = ts.concatenate(constructSignatures, getSignaturesOfType(instantiatedBaseType, 1 /* Construct */)); - stringIndexInfo = stringIndexInfo || getIndexInfoOfType(instantiatedBaseType, 0 /* String */); + if (!stringIndexInfo) { + stringIndexInfo = instantiatedBaseType === anyType ? + createIndexInfo(anyType, /*isReadonly*/ false) : + getIndexInfoOfType(instantiatedBaseType, 0 /* String */); + } numberIndexInfo = numberIndexInfo || getIndexInfoOfType(instantiatedBaseType, 1 /* Number */); } } @@ -28222,14 +30245,16 @@ var ts; return [createSignature(undefined, classType.localTypeParameters, undefined, emptyArray, classType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false)]; } var baseTypeNode = getBaseTypeNodeOfClass(classType); + var isJavaScript = ts.isInJavaScriptFile(baseTypeNode); var typeArguments = ts.map(baseTypeNode.typeArguments, getTypeFromTypeNode); - var typeArgCount = typeArguments ? typeArguments.length : 0; + var typeArgCount = ts.length(typeArguments); var result = []; for (var _i = 0, baseSignatures_1 = baseSignatures; _i < baseSignatures_1.length; _i++) { var baseSig = baseSignatures_1[_i]; - var typeParamCount = baseSig.typeParameters ? baseSig.typeParameters.length : 0; - if (typeParamCount === typeArgCount) { - var sig = typeParamCount ? createSignatureInstantiation(baseSig, typeArguments) : cloneSignature(baseSig); + var minTypeArgumentCount = getMinTypeArgumentCount(baseSig.typeParameters); + var typeParamCount = ts.length(baseSig.typeParameters); + if ((isJavaScript || typeArgCount >= minTypeArgumentCount) && typeArgCount <= typeParamCount) { + var sig = typeParamCount ? createSignatureInstantiation(baseSig, fillMissingTypeArguments(typeArguments, baseSig.typeParameters, minTypeArgumentCount, baseTypeNode)) : cloneSignature(baseSig); sig.typeParameters = classType.localTypeParameters; sig.resolvedReturnType = classType; result.push(sig); @@ -28292,7 +30317,7 @@ var ts; s = cloneSignature(signature); if (ts.forEach(unionSignatures, function (sig) { return sig.thisParameter; })) { var thisType = getUnionType(ts.map(unionSignatures, function (sig) { return getTypeOfSymbol(sig.thisParameter) || anyType; }), /*subtypeReduction*/ true); - s.thisParameter = createTransientSymbol(signature.thisParameter, thisType); + s.thisParameter = createSymbolWithType(signature.thisParameter, thisType); } // Clear resolved return type we possibly got from cloneSignature s.resolvedReturnType = undefined; @@ -28308,8 +30333,8 @@ var ts; function getUnionIndexInfo(types, kind) { var indexTypes = []; var isAnyReadonly = false; - for (var _i = 0, types_1 = types; _i < types_1.length; _i++) { - var type = types_1[_i]; + for (var _i = 0, types_2 = types; _i < types_2.length; _i++) { + var type = types_2[_i]; var indexInfo = getIndexInfoOfType(type, kind); if (!indexInfo) { return undefined; @@ -28337,22 +30362,57 @@ var ts; function unionSpreadIndexInfos(info1, info2) { return info1 && info2 && createIndexInfo(getUnionType([info1.type, info2.type]), info1.isReadonly || info2.isReadonly); } + function includeMixinType(type, types, index) { + var mixedTypes = []; + for (var i = 0; i < types.length; i++) { + if (i === index) { + mixedTypes.push(type); + } + else if (isMixinConstructorType(types[i])) { + mixedTypes.push(getReturnTypeOfSignature(getSignaturesOfType(types[i], 1 /* Construct */)[0])); + } + } + return getIntersectionType(mixedTypes); + } function resolveIntersectionTypeMembers(type) { // The members and properties collections are empty for intersection types. To get all properties of an // intersection type use getPropertiesOfType (only the language service uses this). var callSignatures = emptyArray; var constructSignatures = emptyArray; - var stringIndexInfo = undefined; - var numberIndexInfo = undefined; - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var t = _a[_i]; + var stringIndexInfo; + var numberIndexInfo; + var types = type.types; + var mixinCount = ts.countWhere(types, isMixinConstructorType); + var _loop_3 = function (i) { + var t = type.types[i]; + // When an intersection type contains mixin constructor types, the construct signatures from + // those types are discarded and their return types are mixed into the return types of all + // other construct signatures in the intersection type. For example, the intersection type + // '{ new(...args: any[]) => A } & { new(s: string) => B }' has a single construct signature + // 'new(s: string) => A & B'. + if (mixinCount === 0 || mixinCount === types.length && i === 0 || !isMixinConstructorType(t)) { + var signatures = getSignaturesOfType(t, 1 /* Construct */); + if (signatures.length && mixinCount > 0) { + signatures = ts.map(signatures, function (s) { + var clone = cloneSignature(s); + clone.resolvedReturnType = includeMixinType(getReturnTypeOfSignature(s), types, i); + return clone; + }); + } + constructSignatures = ts.concatenate(constructSignatures, signatures); + } callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(t, 0 /* Call */)); - constructSignatures = ts.concatenate(constructSignatures, getSignaturesOfType(t, 1 /* Construct */)); stringIndexInfo = intersectIndexInfos(stringIndexInfo, getIndexInfoOfType(t, 0 /* String */)); numberIndexInfo = intersectIndexInfos(numberIndexInfo, getIndexInfoOfType(t, 1 /* Number */)); + }; + for (var i = 0; i < types.length; i++) { + _loop_3(i); } setStructuredTypeMembers(type, emptySymbols, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo); } + /** + * Converts an AnonymousType to a ResolvedType. + */ function resolveAnonymousTypeMembers(type) { var symbol = type.symbol; if (type.target) { @@ -28365,8 +30425,8 @@ var ts; } else if (symbol.flags & 2048 /* TypeLiteral */) { var members = symbol.members; - var callSignatures = getSignaturesOfSymbol(members["__call"]); - var constructSignatures = getSignaturesOfSymbol(members["__new"]); + var callSignatures = getSignaturesOfSymbol(members.get("__call")); + var constructSignatures = getSignaturesOfSymbol(members.get("__new")); var stringIndexInfo = getIndexInfoOfSymbol(symbol, 0 /* String */); var numberIndexInfo = getIndexInfoOfSymbol(symbol, 1 /* Number */); setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo); @@ -28375,23 +30435,27 @@ var ts; // Combinations of function, class, enum and module var members = emptySymbols; var constructSignatures = emptyArray; - if (symbol.flags & 1952 /* HasExports */) { + var stringIndexInfo = undefined; + if (symbol.exports) { members = getExportsOfSymbol(symbol); } if (symbol.flags & 32 /* Class */) { var classType = getDeclaredTypeOfClassOrInterface(symbol); - constructSignatures = getSignaturesOfSymbol(symbol.members["__constructor"]); + constructSignatures = getSignaturesOfSymbol(symbol.members.get("__constructor")); if (!constructSignatures.length) { constructSignatures = getDefaultConstructSignatures(classType); } var baseConstructorType = getBaseConstructorTypeOfClass(classType); - if (baseConstructorType.flags & 32768 /* Object */) { + if (baseConstructorType.flags & (32768 /* Object */ | 131072 /* Intersection */ | 540672 /* TypeVariable */)) { members = createSymbolTable(getNamedMembers(members)); - addInheritedMembers(members, getPropertiesOfObjectType(baseConstructorType)); + addInheritedMembers(members, getPropertiesOfType(baseConstructorType)); + } + else if (baseConstructorType === anyType) { + stringIndexInfo = createIndexInfo(anyType, /*isReadonly*/ false); } } var numberIndexInfo = symbol.flags & 384 /* Enum */ ? enumNumberIndexInfo : undefined; - setStructuredTypeMembers(type, members, emptyArray, constructSignatures, undefined, numberIndexInfo); + setStructuredTypeMembers(type, members, emptyArray, constructSignatures, stringIndexInfo, numberIndexInfo); // We resolve the members before computing the signatures because a signature may use // typeof with a qualified name expression that circularly references the type we are // in the process of resolving (see issue #6072). The temporarily empty signature list @@ -28412,12 +30476,15 @@ var ts; var typeParameter = getTypeParameterFromMappedType(type); var constraintType = getConstraintTypeFromMappedType(type); var templateType = getTemplateTypeFromMappedType(type); - var modifiersType = getApparentType(getModifiersTypeFromMappedType(type)); + var modifiersType = getApparentType(getModifiersTypeFromMappedType(type)); // The 'T' in 'keyof T' var templateReadonly = !!type.declaration.readonlyToken; var templateOptional = !!type.declaration.questionToken; - if (type.declaration.typeParameter.constraint.kind === 168 /* TypeOperator */) { + if (type.declaration.typeParameter.constraint.kind === 170 /* TypeOperator */) { // We have a { [P in keyof T]: X } - forEachType(getLiteralTypeFromPropertyNames(modifiersType), addMemberForKeyType); + for (var _i = 0, _a = getPropertiesOfType(modifiersType); _i < _a.length; _i++) { + var propertySymbol = _a[_i]; + addMemberForKeyType(getLiteralTypeFromPropertyName(propertySymbol), propertySymbol); + } if (getIndexInfoOfType(modifiersType, 0 /* String */)) { addMemberForKeyType(stringType); } @@ -28431,11 +30498,11 @@ var ts; forEachType(iterationType, addMemberForKeyType); } setStructuredTypeMembers(type, members, emptyArray, emptyArray, stringIndexInfo, undefined); - function addMemberForKeyType(t) { + function addMemberForKeyType(t, propertySymbol) { // 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 = createUnaryTypeMapper(typeParameter, t); + var iterationMapper = createTypeMapper([typeParameter], [t]); var templateMapper = type.mapper ? combineTypeMappers(type.mapper, iterationMapper) : iterationMapper; var propType = instantiateType(templateType, templateMapper); // If the current iteration type constituent is a string literal type, create a property. @@ -28443,11 +30510,14 @@ var ts; if (t.flags & 32 /* StringLiteral */) { var propName = t.text; var modifiersProp = getPropertyOfType(modifiersType, propName); - var isOptional = templateOptional || !!(modifiersProp && modifiersProp.flags & 536870912 /* Optional */); - var prop = createSymbol(4 /* Property */ | 67108864 /* Transient */ | (isOptional ? 536870912 /* Optional */ : 0), propName); + var isOptional = templateOptional || !!(modifiersProp && modifiersProp.flags & 67108864 /* Optional */); + var prop = createSymbol(4 /* Property */ | (isOptional ? 67108864 /* Optional */ : 0), propName); + prop.checkFlags = templateReadonly || modifiersProp && isReadonlySymbol(modifiersProp) ? 8 /* Readonly */ : 0; prop.type = propType; - prop.isReadonly = templateReadonly || modifiersProp && isReadonlySymbol(modifiersProp); - members[propName] = prop; + if (propertySymbol) { + prop.syntheticOrigin = propertySymbol; + } + members.set(propName, prop); } else if (t.flags & 2 /* String */) { stringIndexInfo = createIndexInfo(propType, templateReadonly); @@ -28471,7 +30541,7 @@ var ts; function getModifiersTypeFromMappedType(type) { if (!type.modifiersType) { var constraintDeclaration = type.declaration.typeParameter.constraint; - if (constraintDeclaration.kind === 168 /* TypeOperator */) { + if (constraintDeclaration.kind === 170 /* TypeOperator */) { // 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. @@ -28489,9 +30559,6 @@ var ts; } return type.modifiersType; } - function getErasedTemplateTypeFromMappedType(type) { - return instantiateType(getTemplateTypeFromMappedType(type), createUnaryTypeMapper(getTypeParameterFromMappedType(type), anyType)); - } function isGenericMappedType(type) { if (getObjectFlags(type) & 32 /* Mapped */) { var constraintType = getConstraintTypeFromMappedType(type); @@ -28532,42 +30599,40 @@ var ts; return emptyArray; } /** If the given type is an object type and that type has a property by the given name, - * return the symbol for that property. Otherwise return undefined. */ + * return the symbol for that property. Otherwise return undefined. + */ function getPropertyOfObjectType(type, name) { if (type.flags & 32768 /* Object */) { var resolved = resolveStructuredTypeMembers(type); - var symbol = resolved.members[name]; + var symbol = resolved.members.get(name); if (symbol && symbolIsValue(symbol)) { return symbol; } } } function getPropertiesOfUnionOrIntersectionType(type) { - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var current = _a[_i]; - for (var _b = 0, _c = getPropertiesOfType(current); _b < _c.length; _b++) { - var prop = _c[_b]; - getUnionOrIntersectionProperty(type, prop.name); - } - // The properties of a union type are those that are present in all constituent types, so - // we only need to check the properties of the first type - if (type.flags & 65536 /* Union */) { - break; - } - } - var props = type.resolvedProperties; - if (props) { - var result = []; - for (var key in props) { - var prop = props[key]; - // We need to filter out partial properties in union types - if (!(prop.flags & 268435456 /* SyntheticProperty */ && prop.isPartial)) { - result.push(prop); + if (!type.resolvedProperties) { + var members = ts.createMap(); + for (var _i = 0, _a = type.types; _i < _a.length; _i++) { + var current = _a[_i]; + for (var _b = 0, _c = getPropertiesOfType(current); _b < _c.length; _b++) { + var prop = _c[_b]; + if (!members.has(prop.name)) { + var combinedProp = getPropertyOfUnionOrIntersectionType(type, prop.name); + if (combinedProp) { + members.set(prop.name, combinedProp); + } + } + } + // The properties of a union type are those that are present in all constituent types, so + // we only need to check the properties of the first type + if (type.flags & 65536 /* Union */) { + break; } } - return result; + type.resolvedProperties = getNamedMembers(members); } - return emptyArray; + return type.resolvedProperties; } function getPropertiesOfType(type) { type = getApparentType(type); @@ -28575,19 +30640,114 @@ var ts; getPropertiesOfUnionOrIntersectionType(type) : getPropertiesOfObjectType(type); } - /** - * The apparent type of a type parameter is the base constraint instantiated with the type parameter - * as the type argument for the 'this' type. - */ - function getApparentTypeOfTypeVariable(type) { - if (!type.resolvedApparentType) { - var constraintType = getConstraintOfTypeVariable(type); - while (constraintType && constraintType.flags & 16384 /* TypeParameter */) { - constraintType = getConstraintOfTypeVariable(constraintType); + function getConstraintOfType(type) { + return type.flags & 16384 /* TypeParameter */ ? getConstraintOfTypeParameter(type) : + type.flags & 524288 /* IndexedAccess */ ? getConstraintOfIndexedAccess(type) : + getBaseConstraintOfType(type); + } + function getConstraintOfTypeParameter(typeParameter) { + return hasNonCircularBaseConstraint(typeParameter) ? getConstraintFromTypeParameter(typeParameter) : undefined; + } + function getConstraintOfIndexedAccess(type) { + var baseObjectType = getBaseConstraintOfType(type.objectType); + var baseIndexType = getBaseConstraintOfType(type.indexType); + return baseObjectType || baseIndexType ? getIndexedAccessType(baseObjectType || type.objectType, baseIndexType || type.indexType) : undefined; + } + function getBaseConstraintOfType(type) { + if (type.flags & (540672 /* TypeVariable */ | 196608 /* UnionOrIntersection */)) { + var constraint = getResolvedBaseConstraint(type); + if (constraint !== noConstraintType && constraint !== circularConstraintType) { + return constraint; } - type.resolvedApparentType = getTypeWithThisArgument(constraintType || emptyObjectType, type); } - return type.resolvedApparentType; + else if (type.flags & 262144 /* Index */) { + return stringType; + } + return undefined; + } + function hasNonCircularBaseConstraint(type) { + return getResolvedBaseConstraint(type) !== circularConstraintType; + } + /** + * Return the resolved base constraint of a type variable. The noConstraintType singleton is returned if the + * type variable has no constraint, and the circularConstraintType singleton is returned if the constraint + * circularly references the type variable. + */ + function getResolvedBaseConstraint(type) { + var typeStack; + var circular; + if (!type.resolvedBaseConstraint) { + typeStack = []; + var constraint = getBaseConstraint(type); + type.resolvedBaseConstraint = circular ? circularConstraintType : getTypeWithThisArgument(constraint || noConstraintType, type); + } + return type.resolvedBaseConstraint; + function getBaseConstraint(t) { + if (ts.contains(typeStack, t)) { + circular = true; + return undefined; + } + typeStack.push(t); + var result = computeBaseConstraint(t); + typeStack.pop(); + return result; + } + function computeBaseConstraint(t) { + if (t.flags & 16384 /* TypeParameter */) { + var constraint = getConstraintFromTypeParameter(t); + return t.isThisType ? constraint : + constraint ? getBaseConstraint(constraint) : undefined; + } + if (t.flags & 196608 /* UnionOrIntersection */) { + var types = t.types; + var baseTypes = []; + for (var _i = 0, types_3 = types; _i < types_3.length; _i++) { + var type_2 = types_3[_i]; + var baseType = getBaseConstraint(type_2); + if (baseType) { + baseTypes.push(baseType); + } + } + return t.flags & 65536 /* Union */ && baseTypes.length === types.length ? getUnionType(baseTypes) : + t.flags & 131072 /* Intersection */ && baseTypes.length ? getIntersectionType(baseTypes) : + undefined; + } + if (t.flags & 262144 /* Index */) { + return stringType; + } + if (t.flags & 524288 /* IndexedAccess */) { + var baseObjectType = getBaseConstraint(t.objectType); + var baseIndexType = getBaseConstraint(t.indexType); + var baseIndexedAccess = baseObjectType && baseIndexType ? getIndexedAccessType(baseObjectType, baseIndexType) : undefined; + return baseIndexedAccess && baseIndexedAccess !== unknownType ? getBaseConstraint(baseIndexedAccess) : undefined; + } + return t; + } + } + function getApparentTypeOfIntersectionType(type) { + return type.resolvedApparentType || (type.resolvedApparentType = getTypeWithThisArgument(type, type)); + } + /** + * Gets the default type for a type parameter. + * + * If the type parameter is the result of an instantiation, this gets the instantiated + * default type of its target. If the type parameter has no default type, `undefined` + * is returned. + * + * This function *does not* perform a circularity check. + */ + function getDefaultFromTypeParameter(typeParameter) { + if (!typeParameter.default) { + if (typeParameter.target) { + var targetDefault = getDefaultFromTypeParameter(typeParameter.target); + typeParameter.default = targetDefault ? instantiateType(targetDefault, typeParameter.mapper) : noConstraintType; + } + else { + var defaultDeclaration = typeParameter.symbol && ts.forEach(typeParameter.symbol.declarations, function (decl) { return ts.isTypeParameter(decl) && decl.default; }); + typeParameter.default = defaultDeclaration ? getTypeFromTypeNode(defaultDeclaration) : noConstraintType; + } + } + return typeParameter.default === noConstraintType ? undefined : typeParameter.default; } /** * For a type parameter, return the base constraint of the type parameter. For the string, number, @@ -28595,26 +30755,31 @@ 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 & 540672 /* TypeVariable */ ? getApparentTypeOfTypeVariable(type) : type; - return t.flags & 262178 /* StringLike */ ? globalStringType : - t.flags & 340 /* NumberLike */ ? globalNumberType : - t.flags & 136 /* BooleanLike */ ? globalBooleanType : - t.flags & 512 /* ESSymbol */ ? getGlobalESSymbolType() : - t; + var t = type.flags & 540672 /* TypeVariable */ ? getBaseConstraintOfType(type) || emptyObjectType : type; + return t.flags & 131072 /* Intersection */ ? getApparentTypeOfIntersectionType(t) : + t.flags & 262178 /* StringLike */ ? globalStringType : + t.flags & 340 /* NumberLike */ ? globalNumberType : + t.flags & 136 /* BooleanLike */ ? globalBooleanType : + t.flags & 512 /* ESSymbol */ ? getGlobalESSymbolType(/*reportErrors*/ languageVersion >= 2 /* ES2015 */) : + t.flags & 16777216 /* NonPrimitive */ ? emptyObjectType : + t; } function createUnionOrIntersectionProperty(containingType, name) { - var types = containingType.types; var props; + var types = containingType.types; + var isUnion = containingType.flags & 65536 /* Union */; + var excludeModifiers = isUnion ? 24 /* NonPublicAccessibilityModifier */ : 0; // Flags we want to propagate to the result if they exist in all source symbols - var commonFlags = (containingType.flags & 131072 /* Intersection */) ? 536870912 /* Optional */ : 0 /* None */; - var isReadonly = false; - var isPartial = false; - for (var _i = 0, types_2 = types; _i < types_2.length; _i++) { - var current = types_2[_i]; + var commonFlags = isUnion ? 0 /* None */ : 67108864 /* Optional */; + var syntheticFlag = 4 /* SyntheticMethod */; + var checkFlags = 0; + for (var _i = 0, types_4 = types; _i < types_4.length; _i++) { + var current = types_4[_i]; var type = getApparentType(current); if (type !== unknownType) { var prop = getPropertyOfType(type, name); - if (prop && !(getDeclarationModifierFlagsFromSymbol(prop) & (8 /* Private */ | 16 /* Protected */))) { + var modifiers = prop ? getDeclarationModifierFlagsFromSymbol(prop) : 0; + if (prop && !(modifiers & excludeModifiers)) { commonFlags &= prop.flags; if (!props) { props = [prop]; @@ -28622,25 +30787,29 @@ var ts; else if (!ts.contains(props, prop)) { props.push(prop); } - if (isReadonlySymbol(prop)) { - isReadonly = true; + checkFlags |= (isReadonlySymbol(prop) ? 8 /* Readonly */ : 0) | + (!(modifiers & 24 /* NonPublicAccessibilityModifier */) ? 64 /* ContainsPublic */ : 0) | + (modifiers & 16 /* Protected */ ? 128 /* ContainsProtected */ : 0) | + (modifiers & 8 /* Private */ ? 256 /* ContainsPrivate */ : 0) | + (modifiers & 32 /* Static */ ? 512 /* ContainsStatic */ : 0); + if (!isMethodLike(prop)) { + syntheticFlag = 2 /* SyntheticProperty */; } } - else if (containingType.flags & 65536 /* Union */) { - isPartial = true; + else if (isUnion) { + checkFlags |= 16 /* Partial */; } } } if (!props) { return undefined; } - if (props.length === 1 && !isPartial) { + if (props.length === 1 && !(checkFlags & 16 /* Partial */)) { return props[0]; } var propTypes = []; var declarations = []; var commonType = undefined; - var hasNonUniformType = false; for (var _a = 0, props_1 = props; _a < props_1.length; _a++) { var prop = props_1[_a]; if (prop.declarations) { @@ -28651,17 +30820,15 @@ var ts; commonType = type; } else if (type !== commonType) { - hasNonUniformType = true; + checkFlags |= 32 /* HasNonUniformType */; } propTypes.push(type); } - var result = createSymbol(4 /* Property */ | 67108864 /* Transient */ | 268435456 /* SyntheticProperty */ | commonFlags, name); + var result = createSymbol(4 /* Property */ | commonFlags, name); + result.checkFlags = syntheticFlag | checkFlags; result.containingType = containingType; - result.hasNonUniformType = hasNonUniformType; - result.isPartial = isPartial; result.declarations = declarations; - result.isReadonly = isReadonly; - result.type = containingType.flags & 65536 /* Union */ ? getUnionType(propTypes) : getIntersectionType(propTypes); + result.type = isUnion ? getUnionType(propTypes) : getIntersectionType(propTypes); return result; } // Return the symbol for a given property in a union or intersection type, or undefined if the property @@ -28670,12 +30837,12 @@ var ts; // these partial properties when identifying discriminant properties, but otherwise they are filtered out // and do not appear to be present in the union type. function getUnionOrIntersectionProperty(type, name) { - var properties = type.resolvedProperties || (type.resolvedProperties = ts.createMap()); - var property = properties[name]; + var properties = type.propertyCache || (type.propertyCache = ts.createMap()); + var property = properties.get(name); if (!property) { property = createUnionOrIntersectionProperty(type, name); if (property) { - properties[name] = property; + properties.set(name, property); } } return property; @@ -28683,7 +30850,7 @@ var ts; function getPropertyOfUnionOrIntersectionType(type, name) { var property = getUnionOrIntersectionProperty(type, name); // We need to filter out partial properties in union types - return property && !(property.flags & 268435456 /* SyntheticProperty */ && property.isPartial) ? property : undefined; + return property && !(getCheckFlags(property) & 16 /* Partial */) ? property : undefined; } /** * Return the symbol for the property with the given name in the given type. Creates synthetic union properties when @@ -28697,7 +30864,7 @@ var ts; type = getApparentType(type); if (type.flags & 32768 /* Object */) { var resolved = resolveStructuredTypeMembers(type); - var symbol = resolved.members[name]; + var symbol = resolved.members.get(name); if (symbol && symbolIsValue(symbol)) { return symbol; } @@ -28786,16 +30953,16 @@ var ts; } function symbolsToArray(symbols) { var result = []; - for (var id in symbols) { + symbols.forEach(function (symbol, id) { if (!isReservedMemberName(id)) { - result.push(symbols[id]); + result.push(symbol); } - } + }); return result; } function isJSDocOptionalParameter(node) { if (node.flags & 65536 /* JavaScriptFile */) { - if (node.type && node.type.kind === 273 /* JSDocOptionalType */) { + if (node.type && node.type.kind === 278 /* JSDocOptionalType */) { return true; } var paramTags = ts.getJSDocParameterTags(node); @@ -28806,7 +30973,7 @@ var ts; return true; } if (paramTag.typeExpression) { - return paramTag.typeExpression.type.kind === 273 /* JSDocOptionalType */; + return paramTag.typeExpression.type.kind === 278 /* JSDocOptionalType */; } } } @@ -28831,10 +30998,16 @@ var ts; ts.Debug.assert(parameterIndex >= 0); return parameterIndex >= signature.minArgumentCount; } + var iife = ts.getImmediatelyInvokedFunctionExpression(node.parent); + if (iife) { + return !node.type && + !node.dotDotDotToken && + ts.indexOf(node.parent.parameters, node) >= iife.arguments.length; + } return false; } function createTypePredicateFromTypePredicateNode(node) { - if (node.parameterName.kind === 70 /* Identifier */) { + if (node.parameterName.kind === 71 /* Identifier */) { var parameterName = node.parameterName; return { kind: 1 /* Identifier */, @@ -28850,19 +31023,68 @@ var ts; }; } } + /** + * Gets the minimum number of type arguments needed to satisfy all non-optional type + * parameters. + */ + function getMinTypeArgumentCount(typeParameters) { + var minTypeArgumentCount = 0; + if (typeParameters) { + for (var i = 0; i < typeParameters.length; i++) { + if (!getDefaultFromTypeParameter(typeParameters[i])) { + minTypeArgumentCount = i + 1; + } + } + } + return minTypeArgumentCount; + } + /** + * Fill in default types for unsupplied type arguments. If `typeArguments` is undefined + * when a default type is supplied, a new array will be created and returned. + * + * @param typeArguments The supplied type arguments. + * @param typeParameters The requested type parameters. + * @param minTypeArgumentCount The minimum number of required type arguments. + */ + function fillMissingTypeArguments(typeArguments, typeParameters, minTypeArgumentCount, location) { + var numTypeParameters = ts.length(typeParameters); + if (numTypeParameters) { + var numTypeArguments = ts.length(typeArguments); + var isJavaScript = ts.isInJavaScriptFile(location); + if ((isJavaScript || numTypeArguments >= minTypeArgumentCount) && numTypeArguments <= numTypeParameters) { + if (!typeArguments) { + typeArguments = []; + } + // Map an unsatisfied type parameter with a default type. + // If a type parameter does not have a default type, or if the default type + // is a forward reference, the empty object type is used. + for (var i = numTypeArguments; i < numTypeParameters; i++) { + typeArguments[i] = isJavaScript ? anyType : emptyObjectType; + } + for (var i = numTypeArguments; i < numTypeParameters; i++) { + var mapper = createTypeMapper(typeParameters, typeArguments); + var defaultType = getDefaultFromTypeParameter(typeParameters[i]); + typeArguments[i] = defaultType ? instantiateType(defaultType, mapper) : isJavaScript ? anyType : emptyObjectType; + } + } + } + return typeArguments; + } function getSignatureFromDeclaration(declaration) { var links = getNodeLinks(declaration); if (!links.resolvedSignature) { var parameters = []; var hasLiteralTypes = false; - var minArgumentCount = -1; + var minArgumentCount = 0; var thisParameter = undefined; var hasThisParameter = void 0; + var iife = ts.getImmediatelyInvokedFunctionExpression(declaration); var isJSConstructSignature = ts.isJSDocConstructSignature(declaration); + var isUntypedSignatureInJSFile = !iife && !isJSConstructSignature && ts.isInJavaScriptFile(declaration) && !ts.hasJSDocParameterTags(declaration); // If this is a JSDoc construct signature, then skip the first parameter in the // parameter list. The first parameter represents the return type of the construct // signature. - for (var i = isJSConstructSignature ? 1 : 0, n = declaration.parameters.length; i < n; i++) { + for (var i = isJSConstructSignature ? 1 : 0; i < declaration.parameters.length; i++) { var param = declaration.parameters[i]; var paramSymbol = param.symbol; // Include parameter symbol instead of property symbol in the signature @@ -28877,43 +31099,36 @@ var ts; else { parameters.push(paramSymbol); } - if (param.type && param.type.kind === 171 /* LiteralType */) { + if (param.type && param.type.kind === 173 /* LiteralType */) { hasLiteralTypes = true; } - if (param.initializer || param.questionToken || param.dotDotDotToken || isJSDocOptionalParameter(param)) { - if (minArgumentCount < 0) { - minArgumentCount = i - (hasThisParameter ? 1 : 0); - } - } - else { - // If we see any required parameters, it means the prior ones were not in fact optional. - minArgumentCount = -1; + // Record a new minimum argument count if this is not an optional parameter + var isOptionalParameter_1 = param.initializer || param.questionToken || param.dotDotDotToken || + iife && parameters.length > iife.arguments.length && !param.type || + isJSDocOptionalParameter(param) || + isUntypedSignatureInJSFile; + if (!isOptionalParameter_1) { + minArgumentCount = parameters.length; } } // If only one accessor includes a this-type annotation, the other behaves as if it had the same type annotation - if ((declaration.kind === 151 /* GetAccessor */ || declaration.kind === 152 /* SetAccessor */) && + if ((declaration.kind === 153 /* GetAccessor */ || declaration.kind === 154 /* SetAccessor */) && !ts.hasDynamicName(declaration) && (!hasThisParameter || !thisParameter)) { - var otherKind = declaration.kind === 151 /* GetAccessor */ ? 152 /* SetAccessor */ : 151 /* GetAccessor */; + var otherKind = declaration.kind === 153 /* GetAccessor */ ? 154 /* SetAccessor */ : 153 /* GetAccessor */; var other = ts.getDeclarationOfKind(declaration.symbol, otherKind); if (other) { thisParameter = getAnnotatedAccessorThisParameter(other); } } - if (minArgumentCount < 0) { - minArgumentCount = declaration.parameters.length - (hasThisParameter ? 1 : 0); - } - if (isJSConstructSignature) { - minArgumentCount--; - } - var classType = declaration.kind === 150 /* Constructor */ ? + var classType = declaration.kind === 152 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : undefined; var typeParameters = classType ? classType.localTypeParameters : declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : getTypeParametersFromJSDocTemplate(declaration); var returnType = getSignatureReturnTypeFromDeclaration(declaration, isJSConstructSignature, classType); - var typePredicate = declaration.type && declaration.type.kind === 156 /* TypePredicate */ ? + var typePredicate = declaration.type && declaration.type.kind === 158 /* TypePredicate */ ? createTypePredicateFromTypePredicateNode(declaration.type) : undefined; links.resolvedSignature = createSignature(declaration, typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount, ts.hasRestParameter(declaration), hasLiteralTypes); @@ -28938,35 +31153,63 @@ 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 === 151 /* GetAccessor */ && !ts.hasDynamicName(declaration)) { - var setter = ts.getDeclarationOfKind(declaration.symbol, 152 /* SetAccessor */); + if (declaration.kind === 153 /* GetAccessor */ && !ts.hasDynamicName(declaration)) { + var setter = ts.getDeclarationOfKind(declaration.symbol, 154 /* SetAccessor */); return getAnnotatedAccessorType(setter); } if (ts.nodeIsMissing(declaration.body)) { return anyType; } } + function containsArgumentsReference(declaration) { + var links = getNodeLinks(declaration); + if (links.containsArgumentsReference === undefined) { + if (links.flags & 8192 /* CaptureArguments */) { + links.containsArgumentsReference = true; + } + else { + links.containsArgumentsReference = traverse(declaration.body); + } + } + return links.containsArgumentsReference; + function traverse(node) { + if (!node) + return false; + switch (node.kind) { + case 71 /* Identifier */: + return node.text === "arguments" && ts.isPartOfExpression(node); + case 149 /* PropertyDeclaration */: + case 151 /* MethodDeclaration */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + return node.name.kind === 144 /* ComputedPropertyName */ + && traverse(node.name); + default: + return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && ts.forEachChild(node, traverse); + } + } + } function getSignaturesOfSymbol(symbol) { if (!symbol) return emptyArray; var result = []; - for (var i = 0, len = symbol.declarations.length; i < len; i++) { + for (var i = 0; i < symbol.declarations.length; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 158 /* FunctionType */: - case 159 /* ConstructorType */: - case 225 /* FunctionDeclaration */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - case 274 /* JSDocFunctionType */: + case 160 /* FunctionType */: + case 161 /* ConstructorType */: + case 228 /* FunctionDeclaration */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: + case 152 /* Constructor */: + case 155 /* CallSignature */: + case 156 /* ConstructSignature */: + case 157 /* IndexSignature */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + case 186 /* FunctionExpression */: + case 187 /* ArrowFunction */: + case 279 /* 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). @@ -29013,10 +31256,11 @@ var ts; } if (!popTypeResolution()) { type = anyType; - if (compilerOptions.noImplicitAny) { + if (noImplicitAny) { var declaration = signature.declaration; - if (declaration.name) { - error(declaration.name, 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, ts.declarationNameToString(declaration.name)); + var name = ts.getNameOfDeclaration(declaration); + if (name) { + error(name, 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, ts.declarationNameToString(name)); } else { error(declaration, ts.Diagnostics.Function_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); @@ -29037,9 +31281,14 @@ var ts; return anyType; } function getSignatureInstantiation(signature, typeArguments) { + typeArguments = fillMissingTypeArguments(typeArguments, signature.typeParameters, getMinTypeArgumentCount(signature.typeParameters)); var instantiations = signature.instantiations || (signature.instantiations = ts.createMap()); var id = getTypeListId(typeArguments); - return instantiations[id] || (instantiations[id] = createSignatureInstantiation(signature, typeArguments)); + var instantiation = instantiations.get(id); + if (!instantiation) { + instantiations.set(id, instantiation = createSignatureInstantiation(signature, typeArguments)); + } + return instantiation; } function createSignatureInstantiation(signature, typeArguments) { return instantiateSignature(signature, createTypeMapper(signature.typeParameters, typeArguments), /*eraseTypeParameters*/ true); @@ -29058,7 +31307,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 === 150 /* Constructor */ || signature.declaration.kind === 154 /* ConstructSignature */; + var isConstructor = signature.declaration.kind === 152 /* Constructor */ || signature.declaration.kind === 156 /* ConstructSignature */; var type = createObjectType(16 /* Anonymous */); type.members = emptySymbols; type.properties = emptyArray; @@ -29069,10 +31318,10 @@ var ts; return signature.isolatedSignatureType; } function getIndexSymbol(symbol) { - return symbol.members["__index"]; + return symbol.members.get("__index"); } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 /* Number */ ? 132 /* NumberKeyword */ : 134 /* StringKeyword */; + var syntaxKind = kind === 1 /* Number */ ? 133 /* NumberKeyword */ : 136 /* StringKeyword */; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { @@ -29099,21 +31348,9 @@ var ts; return undefined; } function getConstraintDeclaration(type) { - return ts.getDeclarationOfKind(type.symbol, 143 /* TypeParameter */).constraint; + return ts.getDeclarationOfKind(type.symbol, 145 /* TypeParameter */).constraint; } - function hasConstraintReferenceTo(type, target) { - var checked; - while (type && type.flags & 16384 /* TypeParameter */ && !(type.isThisType) && !ts.contains(checked, type)) { - if (type === target) { - return true; - } - (checked || (checked = [])).push(type); - var constraintDeclaration = getConstraintDeclaration(type); - type = constraintDeclaration && getTypeFromTypeNode(constraintDeclaration); - } - return false; - } - function getConstraintOfTypeParameter(typeParameter) { + function getConstraintFromTypeParameter(typeParameter) { if (!typeParameter.constraint) { if (typeParameter.target) { var targetConstraint = getConstraintOfTypeParameter(typeParameter.target); @@ -29121,33 +31358,23 @@ var ts; } else { var constraintDeclaration = getConstraintDeclaration(typeParameter); - var constraint = getTypeFromTypeNode(constraintDeclaration); - if (hasConstraintReferenceTo(constraint, typeParameter)) { - error(constraintDeclaration, ts.Diagnostics.Type_parameter_0_has_a_circular_constraint, typeToString(typeParameter)); - constraint = unknownType; - } - typeParameter.constraint = constraint; + typeParameter.constraint = constraintDeclaration ? getTypeFromTypeNode(constraintDeclaration) : noConstraintType; } } return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } - function getConstraintOfTypeVariable(type) { - return type.flags & 16384 /* TypeParameter */ ? getConstraintOfTypeParameter(type) : - type.flags & 524288 /* IndexedAccess */ ? type.constraint : - undefined; - } function getParentSymbolOfTypeParameter(typeParameter) { - return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 143 /* TypeParameter */).parent); + return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 145 /* TypeParameter */).parent); } function getTypeListId(types) { var result = ""; if (types) { - var length_3 = types.length; + var length_4 = types.length; var i = 0; - while (i < length_3) { + while (i < length_4) { var startId = types[i].id; var count = 1; - while (i + count < length_3 && types[i + count].id === startId + count) { + while (i + count < length_4 && types[i + count].id === startId + count) { count++; } if (result.length) { @@ -29168,8 +31395,8 @@ var ts; // that care about the presence of such types at arbitrary depth in a containing type. function getPropagatingFlagsOfTypes(types, excludeKinds) { var result = 0; - for (var _i = 0, types_3 = types; _i < types_3.length; _i++) { - var type = types_3[_i]; + for (var _i = 0, types_5 = types; _i < types_5.length; _i++) { + var type = types_5[_i]; if (!(type.flags & excludeKinds)) { result |= type.flags; } @@ -29178,9 +31405,10 @@ var ts; } function createTypeReference(target, typeArguments) { var id = getTypeListId(typeArguments); - var type = target.instantiations[id]; + var type = target.instantiations.get(id); if (!type) { - type = target.instantiations[id] = createObjectType(4 /* Reference */, target.symbol); + type = createObjectType(4 /* Reference */, target.symbol); + target.instantiations.set(id, type); type.flags |= typeArguments ? getPropagatingFlagsOfTypes(typeArguments, /*excludeKinds*/ 0) : 0; type.target = target; type.typeArguments = typeArguments; @@ -29196,21 +31424,26 @@ var ts; return type; } function getTypeReferenceArity(type) { - return type.target.typeParameters ? type.target.typeParameters.length : 0; + return ts.length(type.target.typeParameters); } // Get type from reference to class or interface function getTypeFromClassOrInterfaceReference(node, symbol) { var type = getDeclaredTypeOfSymbol(getMergedSymbol(symbol)); var typeParameters = type.localTypeParameters; if (typeParameters) { - if (!node.typeArguments || node.typeArguments.length !== typeParameters.length) { - error(node, ts.Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, /*enclosingDeclaration*/ undefined, 1 /* WriteArrayAsGenericType */), typeParameters.length); + var numTypeArguments = ts.length(node.typeArguments); + var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); + if (!ts.isInJavaScriptFile(node) && (numTypeArguments < minTypeArgumentCount || numTypeArguments > typeParameters.length)) { + error(node, minTypeArgumentCount === typeParameters.length + ? ts.Diagnostics.Generic_type_0_requires_1_type_argument_s + : ts.Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments, typeToString(type, /*enclosingDeclaration*/ undefined, 1 /* WriteArrayAsGenericType */), minTypeArgumentCount, typeParameters.length); return unknownType; } // In a type reference, the outer type parameters of the referenced class or interface are automatically // supplied as type arguments and the type reference only specifies arguments for the local type parameters // of the class or interface. - return createTypeReference(type, ts.concatenate(type.outerTypeParameters, ts.map(node.typeArguments, getTypeFromTypeNode))); + var typeArguments = ts.concatenate(type.outerTypeParameters, fillMissingTypeArguments(ts.map(node.typeArguments, getTypeFromTypeNode), typeParameters, minTypeArgumentCount, node)); + return createTypeReference(type, typeArguments); } if (node.typeArguments) { error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type)); @@ -29223,7 +31456,11 @@ var ts; var links = getSymbolLinks(symbol); var typeParameters = links.typeParameters; var id = getTypeListId(typeArguments); - return links.instantiations[id] || (links.instantiations[id] = instantiateTypeNoAlias(type, createTypeMapper(typeParameters, typeArguments))); + var instantiation = links.instantiations.get(id); + if (!instantiation) { + links.instantiations.set(id, instantiation = instantiateTypeNoAlias(type, createTypeMapper(typeParameters, fillMissingTypeArguments(typeArguments, typeParameters, getMinTypeArgumentCount(typeParameters))))); + } + return instantiation; } // Get type from reference to type alias. When a type alias is generic, the declared type of the type alias may include // references to the type parameters of the alias. We replace those with the actual type arguments by instantiating the @@ -29232,8 +31469,12 @@ var ts; var type = getDeclaredTypeOfSymbol(symbol); var typeParameters = getSymbolLinks(symbol).typeParameters; if (typeParameters) { - if (!node.typeArguments || node.typeArguments.length !== typeParameters.length) { - error(node, ts.Diagnostics.Generic_type_0_requires_1_type_argument_s, symbolToString(symbol), typeParameters.length); + var numTypeArguments = ts.length(node.typeArguments); + var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); + if (numTypeArguments < minTypeArgumentCount || numTypeArguments > typeParameters.length) { + error(node, minTypeArgumentCount === typeParameters.length + ? ts.Diagnostics.Generic_type_0_requires_1_type_argument_s + : ts.Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments, symbolToString(symbol), minTypeArgumentCount, typeParameters.length); return unknownType; } var typeArguments = ts.map(node.typeArguments, getTypeFromTypeNode); @@ -29255,11 +31496,11 @@ var ts; } function getTypeReferenceName(node) { switch (node.kind) { - case 157 /* TypeReference */: + case 159 /* TypeReference */: return node.typeName; - case 272 /* JSDocTypeReference */: + case 277 /* JSDocTypeReference */: return node.name; - case 199 /* ExpressionWithTypeArguments */: + case 201 /* ExpressionWithTypeArguments */: // We only support expressions that are simple qualified names. For other // expressions this produces undefined. var expr = node.expression; @@ -29285,7 +31526,7 @@ var ts; if (symbol.flags & 524288 /* TypeAlias */) { return getTypeFromTypeAliasReference(node, symbol); } - if (symbol.flags & 107455 /* Value */ && node.kind === 272 /* JSDocTypeReference */) { + if (symbol.flags & 107455 /* Value */ && node.kind === 277 /* JSDocTypeReference */) { // A JSDocTypeReference may have resolved to a value (as opposed to a type). In // that case, the type of this reference is just the type of the value we resolved // to. @@ -29293,19 +31534,54 @@ var ts; } return getTypeFromNonGenericTypeReference(node, symbol); } + function getPrimitiveTypeFromJSDocTypeReference(node) { + if (ts.isIdentifier(node.name)) { + switch (node.name.text) { + case "String": + return stringType; + case "Number": + return numberType; + case "Boolean": + return booleanType; + case "Void": + return voidType; + case "Undefined": + return undefinedType; + case "Null": + return nullType; + case "Object": + return anyType; + case "Function": + return anyFunctionType; + case "Array": + case "array": + return !node.typeArguments || !node.typeArguments.length ? createArrayType(anyType) : undefined; + case "Promise": + case "promise": + return !node.typeArguments || !node.typeArguments.length ? createPromiseType(anyType) : undefined; + } + } + } + function getTypeFromJSDocNullableTypeNode(node) { + var type = getTypeFromTypeNode(node.type); + return strictNullChecks ? getUnionType([type, nullType]) : type; + } function getTypeFromTypeReference(node) { var links = getNodeLinks(node); if (!links.resolvedType) { var symbol = void 0; var type = void 0; - if (node.kind === 272 /* JSDocTypeReference */) { - var typeReferenceName = getTypeReferenceName(node); - symbol = resolveTypeReferenceName(typeReferenceName); - type = getTypeReferenceType(node, symbol); + if (node.kind === 277 /* JSDocTypeReference */) { + type = getPrimitiveTypeFromJSDocTypeReference(node); + if (!type) { + var typeReferenceName = getTypeReferenceName(node); + symbol = resolveTypeReferenceName(typeReferenceName); + type = getTypeReferenceType(node, symbol); + } } else { // We only support expressions that are simple qualified names. For other expressions this produces undefined. - var typeNameOrExpression = node.kind === 157 /* TypeReference */ + var typeNameOrExpression = node.kind === 159 /* TypeReference */ ? node.typeName : ts.isEntityNameExpression(node.expression) ? node.expression @@ -29337,12 +31613,12 @@ var ts; function getTypeOfGlobalSymbol(symbol, arity) { function getTypeDeclaration(symbol) { var declarations = symbol.declarations; - for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { - var declaration = declarations_3[_i]; + for (var _i = 0, declarations_4 = declarations; _i < declarations_4.length; _i++) { + var declaration = declarations_4[_i]; switch (declaration.kind) { - case 226 /* ClassDeclaration */: - case 227 /* InterfaceDeclaration */: - case 229 /* EnumDeclaration */: + case 229 /* ClassDeclaration */: + case 230 /* InterfaceDeclaration */: + case 232 /* EnumDeclaration */: return declaration; } } @@ -29355,24 +31631,68 @@ var ts; error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_be_a_class_or_interface_type, symbol.name); return arity ? emptyGenericType : emptyObjectType; } - if ((type.typeParameters ? type.typeParameters.length : 0) !== arity) { + if (ts.length(type.typeParameters) !== arity) { error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_have_1_type_parameter_s, symbol.name, arity); return arity ? emptyGenericType : emptyObjectType; } return type; } - function getGlobalValueSymbol(name) { - return getGlobalSymbol(name, 107455 /* Value */, ts.Diagnostics.Cannot_find_global_value_0); + function getGlobalValueSymbol(name, reportErrors) { + return getGlobalSymbol(name, 107455 /* Value */, reportErrors ? ts.Diagnostics.Cannot_find_global_value_0 : undefined); } - function getGlobalTypeSymbol(name) { - return getGlobalSymbol(name, 793064 /* Type */, ts.Diagnostics.Cannot_find_global_type_0); + function getGlobalTypeSymbol(name, reportErrors) { + return getGlobalSymbol(name, 793064 /* Type */, reportErrors ? ts.Diagnostics.Cannot_find_global_type_0 : undefined); } function getGlobalSymbol(name, meaning, diagnostic) { return resolveName(undefined, name, meaning, diagnostic, name); } - function getGlobalType(name, arity) { + function getGlobalType(name, arity, reportErrors) { + var symbol = getGlobalTypeSymbol(name, reportErrors); + return symbol || reportErrors ? getTypeOfGlobalSymbol(symbol, arity) : undefined; + } + function getGlobalTypedPropertyDescriptorType() { + return deferredGlobalTypedPropertyDescriptorType || (deferredGlobalTypedPropertyDescriptorType = getGlobalType("TypedPropertyDescriptor", /*arity*/ 1, /*reportErrors*/ true)) || emptyGenericType; + } + function getGlobalTemplateStringsArrayType() { + return deferredGlobalTemplateStringsArrayType || (deferredGlobalTemplateStringsArrayType = getGlobalType("TemplateStringsArray", /*arity*/ 0, /*reportErrors*/ true)) || emptyObjectType; + } + function getGlobalESSymbolConstructorSymbol(reportErrors) { + return deferredGlobalESSymbolConstructorSymbol || (deferredGlobalESSymbolConstructorSymbol = getGlobalValueSymbol("Symbol", reportErrors)); + } + function getGlobalESSymbolType(reportErrors) { + return deferredGlobalESSymbolType || (deferredGlobalESSymbolType = getGlobalType("Symbol", /*arity*/ 0, reportErrors)) || emptyObjectType; + } + function getGlobalPromiseType(reportErrors) { + return deferredGlobalPromiseType || (deferredGlobalPromiseType = getGlobalType("Promise", /*arity*/ 1, reportErrors)) || emptyGenericType; + } + function getGlobalPromiseConstructorSymbol(reportErrors) { + return deferredGlobalPromiseConstructorSymbol || (deferredGlobalPromiseConstructorSymbol = getGlobalValueSymbol("Promise", reportErrors)); + } + function getGlobalPromiseConstructorLikeType(reportErrors) { + return deferredGlobalPromiseConstructorLikeType || (deferredGlobalPromiseConstructorLikeType = getGlobalType("PromiseConstructorLike", /*arity*/ 0, reportErrors)) || emptyObjectType; + } + function getGlobalAsyncIterableType(reportErrors) { + return deferredGlobalAsyncIterableType || (deferredGlobalAsyncIterableType = getGlobalType("AsyncIterable", /*arity*/ 1, reportErrors)) || emptyGenericType; + } + function getGlobalAsyncIteratorType(reportErrors) { + return deferredGlobalAsyncIteratorType || (deferredGlobalAsyncIteratorType = getGlobalType("AsyncIterator", /*arity*/ 1, reportErrors)) || emptyGenericType; + } + function getGlobalAsyncIterableIteratorType(reportErrors) { + return deferredGlobalAsyncIterableIteratorType || (deferredGlobalAsyncIterableIteratorType = getGlobalType("AsyncIterableIterator", /*arity*/ 1, reportErrors)) || emptyGenericType; + } + function getGlobalIterableType(reportErrors) { + return deferredGlobalIterableType || (deferredGlobalIterableType = getGlobalType("Iterable", /*arity*/ 1, reportErrors)) || emptyGenericType; + } + function getGlobalIteratorType(reportErrors) { + return deferredGlobalIteratorType || (deferredGlobalIteratorType = getGlobalType("Iterator", /*arity*/ 1, reportErrors)) || emptyGenericType; + } + function getGlobalIterableIteratorType(reportErrors) { + return deferredGlobalIterableIteratorType || (deferredGlobalIterableIteratorType = getGlobalType("IterableIterator", /*arity*/ 1, reportErrors)) || emptyGenericType; + } + function getGlobalTypeOrUndefined(name, arity) { if (arity === void 0) { arity = 0; } - return getTypeOfGlobalSymbol(getGlobalTypeSymbol(name), arity); + var symbol = getGlobalSymbol(name, 793064 /* Type */, /*diagnostic*/ undefined); + return symbol && getTypeOfGlobalSymbol(symbol, arity); } /** * Returns a type that is inside a namespace at the global scope, e.g. @@ -29383,26 +31703,26 @@ var ts; var typeSymbol = namespaceSymbol && getSymbol(namespaceSymbol.exports, name, 793064 /* Type */); return typeSymbol && getDeclaredTypeOfSymbol(typeSymbol); } - /** - * Creates a TypeReference for a generic `TypedPropertyDescriptor`. - */ - function createTypedPropertyDescriptorType(propertyType) { - var globalTypedPropertyDescriptorType = getGlobalTypedPropertyDescriptorType(); - return globalTypedPropertyDescriptorType !== emptyGenericType - ? createTypeReference(globalTypedPropertyDescriptorType, [propertyType]) - : emptyObjectType; - } /** * Instantiates a global type that is generic with some element type, and returns that instantiation. */ function createTypeFromGenericGlobalType(genericGlobalType, typeArguments) { return genericGlobalType !== emptyGenericType ? createTypeReference(genericGlobalType, typeArguments) : emptyObjectType; } - function createIterableType(elementType) { - return createTypeFromGenericGlobalType(getGlobalIterableType(), [elementType]); + function createTypedPropertyDescriptorType(propertyType) { + return createTypeFromGenericGlobalType(getGlobalTypedPropertyDescriptorType(), [propertyType]); } - function createIterableIteratorType(elementType) { - return createTypeFromGenericGlobalType(getGlobalIterableIteratorType(), [elementType]); + function createAsyncIterableType(iteratedType) { + return createTypeFromGenericGlobalType(getGlobalAsyncIterableType(/*reportErrors*/ true), [iteratedType]); + } + function createAsyncIterableIteratorType(iteratedType) { + return createTypeFromGenericGlobalType(getGlobalAsyncIterableIteratorType(/*reportErrors*/ true), [iteratedType]); + } + function createIterableType(iteratedType) { + return createTypeFromGenericGlobalType(getGlobalIterableType(/*reportErrors*/ true), [iteratedType]); + } + function createIterableIteratorType(iteratedType) { + return createTypeFromGenericGlobalType(getGlobalIterableIteratorType(/*reportErrors*/ true), [iteratedType]); } function createArrayType(elementType) { return createTypeFromGenericGlobalType(globalArrayType, [elementType]); @@ -29427,7 +31747,7 @@ var ts; for (var i = 0; i < arity; i++) { var typeParameter = createType(16384 /* TypeParameter */); typeParameters.push(typeParameter); - var property = createSymbol(4 /* Property */ | 67108864 /* Transient */, "" + i); + var property = createSymbol(4 /* Property */, "" + i); property.type = typeParameter; properties.push(property); } @@ -29436,7 +31756,7 @@ var ts; type.outerTypeParameters = undefined; type.localTypeParameters = typeParameters; type.instantiations = ts.createMap(); - type.instantiations[getTypeListId(type.typeParameters)] = type; + type.instantiations.set(getTypeListId(type.typeParameters), type); type.target = type; type.typeArguments = type.typeParameters; type.thisType = createType(16384 /* TypeParameter */); @@ -29520,14 +31840,14 @@ var ts; // 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) { - for (var _i = 0, types_4 = types; _i < types_4.length; _i++) { - var type = types_4[_i]; + for (var _i = 0, types_6 = types; _i < types_6.length; _i++) { + var type = types_6[_i]; addTypeToUnion(typeSet, type); } } function containsIdenticalType(types, type) { - for (var _i = 0, types_5 = types; _i < types_5.length; _i++) { - var t = types_5[_i]; + for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { + var t = types_7[_i]; if (isTypeIdenticalTo(t, type)) { return true; } @@ -29535,8 +31855,9 @@ var ts; return false; } function isSubtypeOfAny(candidate, types) { - for (var i = 0, len = types.length; i < len; i++) { - if (candidate !== types[i] && isTypeSubtypeOf(candidate, types[i])) { + for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { + var type = types_8[_i]; + if (candidate !== type && isTypeSubtypeOf(candidate, type)) { return true; } } @@ -29622,10 +31943,11 @@ var ts; return types[0]; } var id = getTypeListId(types); - var type = unionTypes[id]; + var type = unionTypes.get(id); if (!type) { var propagatedFlags = getPropagatingFlagsOfTypes(types, /*excludeKinds*/ 6144 /* Nullable */); - type = unionTypes[id] = createType(65536 /* Union */ | propagatedFlags); + type = createType(65536 /* Union */ | propagatedFlags); + unionTypes.set(id, type); type.types = types; type.aliasSymbol = aliasSymbol; type.aliasTypeArguments = aliasTypeArguments; @@ -29646,18 +31968,27 @@ var ts; else if (type.flags & 1 /* Any */) { typeSet.containsAny = true; } + else if (getObjectFlags(type) & 16 /* Anonymous */ && isEmptyObjectType(type)) { + typeSet.containsEmptyObject = true; + } else if (!(type.flags & 8192 /* Never */) && (strictNullChecks || !(type.flags & 6144 /* Nullable */)) && !ts.contains(typeSet, type)) { + if (type.flags & 32768 /* Object */) { + typeSet.containsObjectType = true; + } if (type.flags & 65536 /* Union */ && typeSet.unionIndex === undefined) { typeSet.unionIndex = typeSet.length; } - typeSet.push(type); + if (!(type.flags & 32768 /* Object */ && type.objectFlags & 16 /* Anonymous */ && + type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */) && containsIdenticalType(typeSet, type))) { + typeSet.push(type); + } } } // 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 addTypesToIntersection(typeSet, types) { - for (var _i = 0, types_6 = types; _i < types_6.length; _i++) { - var type = types_6[_i]; + for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { + var type = types_9[_i]; addTypeToIntersection(typeSet, type); } } @@ -29680,6 +32011,9 @@ var ts; if (typeSet.containsAny) { return anyType; } + if (typeSet.containsEmptyObject && !typeSet.containsObjectType) { + typeSet.push(emptyObjectType); + } if (typeSet.length === 1) { return typeSet[0]; } @@ -29692,10 +32026,11 @@ var ts; /*subtypeReduction*/ false, aliasSymbol, aliasTypeArguments); } var id = getTypeListId(typeSet); - var type = intersectionTypes[id]; + var type = intersectionTypes.get(id); if (!type) { var propagatedFlags = getPropagatingFlagsOfTypes(typeSet, /*excludeKinds*/ 6144 /* Nullable */); - type = intersectionTypes[id] = createType(131072 /* Intersection */ | propagatedFlags); + type = createType(131072 /* Intersection */ | propagatedFlags); + intersectionTypes.set(id, type); type.types = typeSet; type.aliasSymbol = aliasSymbol; type.aliasTypeArguments = aliasTypeArguments; @@ -29745,28 +32080,10 @@ var ts; var type = createType(524288 /* IndexedAccess */); type.objectType = objectType; type.indexType = indexType; - // We eagerly compute the constraint of the indexed access type such that circularity - // errors are immediately caught and reported. For example, class C { x: this["x"] } - // becomes an error only when the constraint is eagerly computed. - if (type.objectType.flags & 229376 /* StructuredType */) { - // The constraint of T[K], where T is an object, union, or intersection type, - // is the type of the string index signature of T, if any. - type.constraint = getIndexTypeOfType(type.objectType, 0 /* String */); - } - else if (type.objectType.flags & 540672 /* TypeVariable */) { - // The constraint of T[K], where T is a type variable, is A[K], where A is the - // apparent type of T. - var apparentType = getApparentTypeOfTypeVariable(type.objectType); - if (apparentType !== emptyObjectType) { - type.constraint = isTypeOfKind(type.indexType, 262178 /* StringLike */) ? - getIndexedAccessType(apparentType, type.indexType) : - getIndexTypeOfType(apparentType, 0 /* String */); - } - } return type; } function getPropertyTypeForIndexType(objectType, indexType, accessNode, cacheSymbol) { - var accessExpression = accessNode && accessNode.kind === 178 /* ElementAccessExpression */ ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 180 /* ElementAccessExpression */ ? accessNode : undefined; var propName = indexType.flags & (32 /* StringLiteral */ | 64 /* NumberLiteral */ | 256 /* EnumLiteral */) ? indexType.text : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, /*reportError*/ false) ? @@ -29795,14 +32112,14 @@ var ts; getIndexInfoOfType(objectType, 0 /* String */) || undefined; if (indexInfo) { - if (accessExpression && ts.isAssignmentTarget(accessExpression) && indexInfo.isReadonly) { + if (accessExpression && indexInfo.isReadonly && (ts.isAssignmentTarget(accessExpression) || ts.isDeleteTarget(accessExpression))) { error(accessExpression, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); return unknownType; } return indexInfo.type; } if (accessExpression && !isConstEnumObjectType(objectType)) { - if (compilerOptions.noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors) { + if (noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors) { if (getIndexTypeOfType(objectType, 1 /* Number */)) { error(accessExpression.argumentExpression, ts.Diagnostics.Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number); } @@ -29814,7 +32131,7 @@ var ts; } } if (accessNode) { - var indexNode = accessNode.kind === 178 /* ElementAccessExpression */ ? accessNode.argumentExpression : accessNode.indexType; + var indexNode = accessNode.kind === 180 /* 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.text, typeToString(objectType)); } @@ -29824,16 +32141,17 @@ var ts; else { error(indexNode, ts.Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType)); } + return unknownType; } - return unknownType; + return anyType; } function getIndexedAccessForMappedType(type, indexType, accessNode) { - var accessExpression = accessNode && accessNode.kind === 178 /* ElementAccessExpression */ ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 180 /* ElementAccessExpression */ ? accessNode : undefined; if (accessExpression && ts.isAssignmentTarget(accessExpression) && type.declaration.readonlyToken) { error(accessExpression, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(type)); return unknownType; } - var mapper = createUnaryTypeMapper(getTypeParameterFromMappedType(type), indexType); + var mapper = createTypeMapper([getTypeParameterFromMappedType(type)], [indexType]); var templateMapper = type.mapper ? combineTypeMappers(type.mapper, mapper) : mapper; return instantiateType(getTemplateTypeFromMappedType(type), templateMapper); } @@ -29845,18 +32163,11 @@ var ts; // 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 (maybeTypeOfKind(indexType, 540672 /* TypeVariable */ | 262144 /* Index */) || - maybeTypeOfKind(objectType, 540672 /* TypeVariable */) && !(accessNode && accessNode.kind === 178 /* ElementAccessExpression */) || + maybeTypeOfKind(objectType, 540672 /* TypeVariable */) && !(accessNode && accessNode.kind === 180 /* ElementAccessExpression */) || isGenericMappedType(objectType)) { if (objectType.flags & 1 /* Any */) { return objectType; } - // We first check that the index type is assignable to 'keyof T' for the object type. - if (accessNode) { - if (!isTypeAssignableTo(indexType, getIndexType(objectType))) { - error(accessNode, ts.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(objectType)); - return unknownType; - } - } // If the object type is a mapped type { [P in K]: E }, we instantiate E using a mapper that substitutes // the index type for P. For example, for an index access { [P in K]: Box }[X], we construct the // type Box. @@ -29865,7 +32176,11 @@ var ts; } // Otherwise we defer the operation by creating an indexed access type. var id = objectType.id + "," + indexType.id; - return indexedAccessTypes[id] || (indexedAccessTypes[id] = createIndexedAccessType(objectType, indexType)); + var type = indexedAccessTypes.get(id); + if (!type) { + indexedAccessTypes.set(id, type = createIndexedAccessType(objectType, indexType)); + } + return type; } // In the following we resolve T[K] to the type of the property in T selected by K. var apparentObjectType = getApparentType(objectType); @@ -29909,7 +32224,7 @@ var ts; if (!links.resolvedType) { // Deferred resolution of members is handled by resolveObjectTypeMembers var aliasSymbol = getAliasSymbolForTypeNode(node); - if (ts.isEmpty(node.symbol.members) && !aliasSymbol) { + if (node.symbol.members.size === 0 && !aliasSymbol) { links.resolvedType = emptyTypeLiteralType; } else { @@ -29922,7 +32237,7 @@ var ts; return links.resolvedType; } function getAliasSymbolForTypeNode(node) { - return node.parent.kind === 228 /* TypeAliasDeclaration */ ? getSymbolOfNode(node.parent) : undefined; + return node.parent.kind === 231 /* TypeAliasDeclaration */ ? getSymbolOfNode(node.parent) : undefined; } function getAliasTypeArgumentsForTypeNode(node) { var symbol = getAliasSymbolForTypeNode(node); @@ -29933,7 +32248,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, isFromObjectLiteral) { + function getSpreadType(left, right) { if (left.flags & 1 /* Any */ || right.flags & 1 /* Any */) { return anyType; } @@ -29946,10 +32261,13 @@ var ts; return left; } if (left.flags & 65536 /* Union */) { - return mapType(left, function (t) { return getSpreadType(t, right, isFromObjectLiteral); }); + return mapType(left, function (t) { return getSpreadType(t, right); }); } if (right.flags & 65536 /* Union */) { - return mapType(right, function (t) { return getSpreadType(left, t, isFromObjectLiteral); }); + return mapType(right, function (t) { return getSpreadType(left, t); }); + } + if (right.flags & 16777216 /* NonPrimitive */) { + return emptyObjectType; } var members = ts.createMap(); var skippedPrivateMembers = ts.createMap(); @@ -29967,42 +32285,55 @@ var ts; for (var _i = 0, _a = getPropertiesOfType(right); _i < _a.length; _i++) { var rightProp = _a[_i]; // we approximate own properties as non-methods plus methods that are inside the object literal - var isOwnProperty = !(rightProp.flags & 8192 /* Method */) || isFromObjectLiteral; var isSetterWithoutGetter = rightProp.flags & 65536 /* SetAccessor */ && !(rightProp.flags & 32768 /* GetAccessor */); if (getDeclarationModifierFlagsFromSymbol(rightProp) & (8 /* Private */ | 16 /* Protected */)) { - skippedPrivateMembers[rightProp.name] = true; + skippedPrivateMembers.set(rightProp.name, true); } - else if (isOwnProperty && !isSetterWithoutGetter) { - members[rightProp.name] = rightProp; + else if (!isClassMethod(rightProp) && !isSetterWithoutGetter) { + members.set(rightProp.name, getNonReadonlySymbol(rightProp)); } } for (var _b = 0, _c = getPropertiesOfType(left); _b < _c.length; _b++) { var leftProp = _c[_b]; if (leftProp.flags & 65536 /* SetAccessor */ && !(leftProp.flags & 32768 /* GetAccessor */) - || leftProp.name in skippedPrivateMembers) { + || skippedPrivateMembers.has(leftProp.name) + || isClassMethod(leftProp)) { continue; } - if (leftProp.name in members) { - var rightProp = members[leftProp.name]; + if (members.has(leftProp.name)) { + var rightProp = members.get(leftProp.name); var rightType = getTypeOfSymbol(rightProp); - if (maybeTypeOfKind(rightType, 2048 /* Undefined */) || rightProp.flags & 536870912 /* Optional */) { + if (maybeTypeOfKind(rightType, 2048 /* Undefined */) || rightProp.flags & 67108864 /* Optional */) { var declarations = ts.concatenate(leftProp.declarations, rightProp.declarations); - var flags = 4 /* Property */ | 67108864 /* Transient */ | (leftProp.flags & 536870912 /* Optional */); + var flags = 4 /* Property */ | (leftProp.flags & 67108864 /* Optional */); var result = createSymbol(flags, leftProp.name); result.type = getUnionType([getTypeOfSymbol(leftProp), getTypeWithFacts(rightType, 131072 /* NEUndefined */)]); result.leftSpread = leftProp; result.rightSpread = rightProp; result.declarations = declarations; - result.isReadonly = isReadonlySymbol(leftProp) || isReadonlySymbol(rightProp); - members[leftProp.name] = result; + members.set(leftProp.name, result); } } else { - members[leftProp.name] = leftProp; + members.set(leftProp.name, getNonReadonlySymbol(leftProp)); } } return createAnonymousType(undefined, members, emptyArray, emptyArray, stringIndexInfo, numberIndexInfo); } + function getNonReadonlySymbol(prop) { + if (!isReadonlySymbol(prop)) { + return prop; + } + var flags = 4 /* Property */ | (prop.flags & 67108864 /* Optional */); + var result = createSymbol(flags, prop.name); + result.type = getTypeOfSymbol(prop); + result.declarations = prop.declarations; + result.syntheticOrigin = prop; + return result; + } + function isClassMethod(prop) { + return prop.flags & 8192 /* Method */ && ts.find(prop.declarations, function (decl) { return ts.isClassLike(decl.parent); }); + } function createLiteralType(flags, text) { var type = createType(flags); type.text = text; @@ -30024,7 +32355,11 @@ var ts; } function getLiteralTypeForText(flags, text) { var map = flags & 32 /* StringLiteral */ ? stringLiteralTypes : numericLiteralTypes; - return map[text] || (map[text] = createLiteralType(flags, text)); + var type = map.get(text); + if (!type) { + map.set(text, type = createLiteralType(flags, text)); + } + return type; } function getTypeFromLiteralTypeNode(node) { var links = getNodeLinks(node); @@ -30052,9 +32387,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 === 227 /* InterfaceDeclaration */)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 230 /* InterfaceDeclaration */)) { if (!(ts.getModifierFlags(container) & 32 /* Static */) && - (container.kind !== 150 /* Constructor */ || ts.isNodeDescendantOf(node, container.body))) { + (container.kind !== 152 /* Constructor */ || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; } } @@ -30070,88 +32405,85 @@ var ts; } function getTypeFromTypeNode(node) { switch (node.kind) { - case 118 /* AnyKeyword */: - case 263 /* JSDocAllType */: - case 264 /* JSDocUnknownType */: + case 119 /* AnyKeyword */: + case 268 /* JSDocAllType */: + case 269 /* JSDocUnknownType */: return anyType; - case 134 /* StringKeyword */: + case 136 /* StringKeyword */: return stringType; - case 132 /* NumberKeyword */: + case 133 /* NumberKeyword */: return numberType; - case 121 /* BooleanKeyword */: + case 122 /* BooleanKeyword */: return booleanType; - case 135 /* SymbolKeyword */: + case 137 /* SymbolKeyword */: return esSymbolType; - case 104 /* VoidKeyword */: + case 105 /* VoidKeyword */: return voidType; - case 137 /* UndefinedKeyword */: + case 139 /* UndefinedKeyword */: return undefinedType; - case 94 /* NullKeyword */: + case 95 /* NullKeyword */: return nullType; - case 129 /* NeverKeyword */: + case 130 /* NeverKeyword */: return neverType; - case 289 /* JSDocNullKeyword */: - return nullType; - case 290 /* JSDocUndefinedKeyword */: - return undefinedType; - case 291 /* JSDocNeverKeyword */: - return neverType; - case 167 /* ThisType */: - case 98 /* ThisKeyword */: + case 134 /* ObjectKeyword */: + return nonPrimitiveType; + case 169 /* ThisType */: + case 99 /* ThisKeyword */: return getTypeFromThisTypeNode(node); - case 171 /* LiteralType */: + case 173 /* LiteralType */: return getTypeFromLiteralTypeNode(node); - case 288 /* JSDocLiteralType */: + case 293 /* JSDocLiteralType */: return getTypeFromLiteralTypeNode(node.literal); - case 157 /* TypeReference */: - case 272 /* JSDocTypeReference */: + case 159 /* TypeReference */: + case 277 /* JSDocTypeReference */: return getTypeFromTypeReference(node); - case 156 /* TypePredicate */: + case 158 /* TypePredicate */: return booleanType; - case 199 /* ExpressionWithTypeArguments */: + case 201 /* ExpressionWithTypeArguments */: return getTypeFromTypeReference(node); - case 160 /* TypeQuery */: + case 162 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 162 /* ArrayType */: - case 265 /* JSDocArrayType */: + case 164 /* ArrayType */: + case 270 /* JSDocArrayType */: return getTypeFromArrayTypeNode(node); - case 163 /* TupleType */: + case 165 /* TupleType */: return getTypeFromTupleTypeNode(node); - case 164 /* UnionType */: - case 266 /* JSDocUnionType */: + case 166 /* UnionType */: + case 271 /* JSDocUnionType */: return getTypeFromUnionTypeNode(node); - case 165 /* IntersectionType */: + case 167 /* IntersectionType */: return getTypeFromIntersectionTypeNode(node); - case 166 /* ParenthesizedType */: - case 268 /* JSDocNullableType */: - case 269 /* JSDocNonNullableType */: - case 276 /* JSDocConstructorType */: - case 277 /* JSDocThisType */: - case 273 /* JSDocOptionalType */: + case 273 /* JSDocNullableType */: + return getTypeFromJSDocNullableTypeNode(node); + case 168 /* ParenthesizedType */: + case 274 /* JSDocNonNullableType */: + case 281 /* JSDocConstructorType */: + case 282 /* JSDocThisType */: + case 278 /* JSDocOptionalType */: return getTypeFromTypeNode(node.type); - case 270 /* JSDocRecordType */: + case 275 /* JSDocRecordType */: return getTypeFromTypeNode(node.literal); - case 158 /* FunctionType */: - case 159 /* ConstructorType */: - case 161 /* TypeLiteral */: - case 287 /* JSDocTypeLiteral */: - case 274 /* JSDocFunctionType */: + case 160 /* FunctionType */: + case 161 /* ConstructorType */: + case 163 /* TypeLiteral */: + case 292 /* JSDocTypeLiteral */: + case 279 /* JSDocFunctionType */: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 168 /* TypeOperator */: + case 170 /* TypeOperator */: return getTypeFromTypeOperatorNode(node); - case 169 /* IndexedAccessType */: + case 171 /* IndexedAccessType */: return getTypeFromIndexedAccessTypeNode(node); - case 170 /* MappedType */: + case 172 /* MappedType */: return getTypeFromMappedTypeNode(node); // This function assumes that an identifier or qualified name is a type expression // Callers should first ensure this by calling isTypeNode - case 70 /* Identifier */: - case 141 /* QualifiedName */: + case 71 /* Identifier */: + case 143 /* QualifiedName */: var symbol = getSymbolAtLocation(node); return symbol && getDeclaredTypeOfSymbol(symbol); - case 267 /* JSDocTupleType */: + case 272 /* JSDocTupleType */: return getTypeFromJSDocTupleType(node); - case 275 /* JSDocVariadicType */: + case 280 /* JSDocVariadicType */: return getTypeFromJSDocVariadicType(node); default: return unknownType; @@ -30178,13 +32510,13 @@ var ts; var instantiations = mapper.instantiations || (mapper.instantiations = []); return instantiations[type.id] || (instantiations[type.id] = instantiator(type, mapper)); } - function createUnaryTypeMapper(source, target) { + function makeUnaryTypeMapper(source, target) { return function (t) { return t === source ? target : t; }; } - function createBinaryTypeMapper(source1, target1, source2, target2) { + function makeBinaryTypeMapper(source1, target1, source2, target2) { return function (t) { return t === source1 ? target1 : t === source2 ? target2 : t; }; } - function createArrayTypeMapper(sources, targets) { + function makeArrayTypeMapper(sources, targets) { return function (t) { for (var i = 0; i < sources.length; i++) { if (t === sources[i]) { @@ -30195,15 +32527,23 @@ var ts; }; } function createTypeMapper(sources, targets) { - var count = sources.length; - var mapper = count == 1 ? createUnaryTypeMapper(sources[0], targets ? targets[0] : anyType) : - count == 2 ? createBinaryTypeMapper(sources[0], targets ? targets[0] : anyType, sources[1], targets ? targets[1] : anyType) : - createArrayTypeMapper(sources, targets); + var mapper = sources.length === 1 ? makeUnaryTypeMapper(sources[0], targets ? targets[0] : anyType) : + sources.length === 2 ? makeBinaryTypeMapper(sources[0], targets ? targets[0] : anyType, sources[1], targets ? targets[1] : anyType) : + makeArrayTypeMapper(sources, targets); mapper.mappedTypes = sources; return mapper; } function createTypeEraser(sources) { - return createTypeMapper(sources, undefined); + return createTypeMapper(sources, /*targets*/ undefined); + } + /** + * Maps forward-references to later types parameters to the empty object type. + * This is used during inference when instantiating type parameter defaults. + */ + function createBackreferenceMapper(typeParameters, index) { + var mapper = function (t) { return ts.indexOf(typeParameters, t) >= index ? emptyObjectType : t; }; + mapper.mappedTypes = typeParameters; + return mapper; } function getInferenceMapper(context) { if (!context.mapper) { @@ -30228,7 +32568,12 @@ var ts; } function combineTypeMappers(mapper1, mapper2) { var mapper = function (t) { return instantiateType(mapper1(t), mapper2); }; - mapper.mappedTypes = mapper1.mappedTypes; + mapper.mappedTypes = ts.concatenate(mapper1.mappedTypes, mapper2.mappedTypes); + return mapper; + } + function createReplacementMapper(source, target, baseMapper) { + var mapper = function (t) { return t === source ? target : baseMapper(t); }; + mapper.mappedTypes = baseMapper.mappedTypes; return mapper; } function cloneTypeParameter(typeParameter) { @@ -30276,7 +32621,7 @@ var ts; return result; } function instantiateSymbol(symbol, mapper) { - if (symbol.flags & 16777216 /* Instantiated */) { + if (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 @@ -30286,7 +32631,8 @@ var ts; } // Keep the flags from the symbol we're instantiating. Mark that is instantiated, and // also transient so that we can just store data on it directly. - var result = createSymbol(16777216 /* Instantiated */ | 67108864 /* Transient */ | symbol.flags, symbol.name); + var result = createSymbol(symbol.flags, symbol.name); + result.checkFlags = 1 /* Instantiated */; result.declarations = symbol.declarations; result.parent = symbol.parent; result.target = symbol; @@ -30313,17 +32659,16 @@ var ts; var constraintType = getConstraintTypeFromMappedType(type); if (constraintType.flags & 262144 /* Index */) { var typeVariable_1 = constraintType.type; - var mappedTypeVariable = instantiateType(typeVariable_1, mapper); - if (typeVariable_1 !== mappedTypeVariable) { - return mapType(mappedTypeVariable, function (t) { - if (isMappableType(t)) { - var replacementMapper = createUnaryTypeMapper(typeVariable_1, t); - var combinedMapper = mapper.mappedTypes && mapper.mappedTypes.length === 1 ? replacementMapper : combineTypeMappers(replacementMapper, mapper); - combinedMapper.mappedTypes = mapper.mappedTypes; - return instantiateMappedObjectType(type, combinedMapper); - } - return t; - }); + if (typeVariable_1.flags & 16384 /* TypeParameter */) { + var mappedTypeVariable = instantiateType(typeVariable_1, mapper); + if (typeVariable_1 !== mappedTypeVariable) { + return mapType(mappedTypeVariable, function (t) { + if (isMappableType(t)) { + return instantiateMappedObjectType(type, createReplacementMapper(typeVariable_1, t, mapper)); + } + return t; + }); + } } } return instantiateMappedObjectType(type, mapper); @@ -30347,26 +32692,28 @@ var ts; // Starting with the parent of the symbol's declaration, check if the mapper maps any of // the type parameters introduced by enclosing declarations. We just pick the first // declaration since multiple declarations will all have the same parent anyway. - var node = symbol.declarations[0]; - while (node) { + return !!ts.findAncestor(symbol.declarations[0], function (node) { + if (node.kind === 233 /* ModuleDeclaration */ || node.kind === 265 /* SourceFile */) { + return "quit"; + } switch (node.kind) { - case 158 /* FunctionType */: - case 159 /* ConstructorType */: - case 225 /* FunctionDeclaration */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: - case 227 /* InterfaceDeclaration */: - case 228 /* TypeAliasDeclaration */: + case 160 /* FunctionType */: + case 161 /* ConstructorType */: + case 228 /* FunctionDeclaration */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: + case 152 /* Constructor */: + case 155 /* CallSignature */: + case 156 /* ConstructSignature */: + case 157 /* IndexSignature */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + case 186 /* FunctionExpression */: + case 187 /* ArrowFunction */: + case 229 /* ClassDeclaration */: + case 199 /* ClassExpression */: + case 230 /* InterfaceDeclaration */: + case 231 /* TypeAliasDeclaration */: var declaration = node; if (declaration.typeParameters) { for (var _i = 0, _a = declaration.typeParameters; _i < _a.length; _i++) { @@ -30376,14 +32723,19 @@ var ts; } } } - if (ts.isClassLike(node) || node.kind === 227 /* InterfaceDeclaration */) { + if (ts.isClassLike(node) || node.kind === 230 /* InterfaceDeclaration */) { var thisType = getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType; if (thisType && ts.contains(mappedTypes, thisType)) { return true; } } break; - case 274 /* JSDocFunctionType */: + case 172 /* MappedType */: + if (ts.contains(mappedTypes, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter)))) { + return true; + } + break; + case 279 /* JSDocFunctionType */: var func = node; for (var _b = 0, _c = func.parameters; _b < _c.length; _b++) { var p = _c[_b]; @@ -30392,18 +32744,13 @@ var ts; } } break; - case 230 /* ModuleDeclaration */: - case 261 /* SourceFile */: - return false; } - node = node.parent; - } - return false; + }); } function isTopLevelTypeAlias(symbol) { if (symbol.declarations && symbol.declarations.length) { var parentKind = symbol.declarations[0].parent.kind; - return parentKind === 261 /* SourceFile */ || parentKind === 231 /* ModuleBlock */; + return parentKind === 265 /* SourceFile */ || parentKind === 234 /* ModuleBlock */; } return false; } @@ -30480,28 +32827,36 @@ var ts; // 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 !== 149 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 151 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: + case 186 /* FunctionExpression */: + case 187 /* ArrowFunction */: return isContextSensitiveFunctionLikeDeclaration(node); - case 176 /* ObjectLiteralExpression */: + case 178 /* ObjectLiteralExpression */: return ts.forEach(node.properties, isContextSensitive); - case 175 /* ArrayLiteralExpression */: + case 177 /* ArrayLiteralExpression */: return ts.forEach(node.elements, isContextSensitive); - case 193 /* ConditionalExpression */: + case 195 /* ConditionalExpression */: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 192 /* BinaryExpression */: - return node.operatorToken.kind === 53 /* BarBarToken */ && + case 194 /* BinaryExpression */: + return node.operatorToken.kind === 54 /* BarBarToken */ && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 257 /* PropertyAssignment */: + case 261 /* PropertyAssignment */: return isContextSensitive(node.initializer); - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: return isContextSensitiveFunctionLikeDeclaration(node); - case 183 /* ParenthesizedExpression */: + case 185 /* ParenthesizedExpression */: return isContextSensitive(node.expression); + case 254 /* JsxAttributes */: + return ts.forEach(node.properties, isContextSensitive); + case 253 /* 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 256 /* JsxExpression */: + // It is possible to that node.expression is undefined (e.g
) + return node.expression && isContextSensitive(node.expression); } return false; } @@ -30515,7 +32870,7 @@ var ts; return true; } // For arrow functions we now know we're not context sensitive. - if (node.kind === 185 /* ArrowFunction */) { + if (node.kind === 187 /* ArrowFunction */) { return false; } // If the first parameter is not an explicit 'this' parameter, then the function has @@ -30537,9 +32892,12 @@ var ts; result.properties = resolved.properties; result.callSignatures = emptyArray; result.constructSignatures = emptyArray; - type = result; + return result; } } + else if (type.flags & 131072 /* Intersection */) { + return getIntersectionType(ts.map(type.types, getTypeWithoutSignatures)); + } return type; } // TYPE CHECKING @@ -30562,7 +32920,7 @@ var ts; // subtype of T but not structurally identical to T. This specifically means that two distinct but // structurally identical types (such as two classes) are not considered instances of each other. function isTypeInstanceOf(source, target) { - return source === target || isTypeSubtypeOf(source, target) && !isTypeIdenticalTo(source, target); + return getTargetType(source) === getTargetType(target) || isTypeSubtypeOf(source, target) && !isTypeIdenticalTo(source, target); } /** * This is *not* a bi-directional relationship. @@ -30725,18 +33083,33 @@ var ts; sourceNonRestParamCount; } } + function isEmptyResolvedType(t) { + return t.properties.length === 0 && + t.callSignatures.length === 0 && + t.constructSignatures.length === 0 && + !t.stringIndexInfo && + !t.numberIndexInfo; + } + function isEmptyObjectType(type) { + return type.flags & 32768 /* Object */ ? isEmptyResolvedType(resolveStructuredTypeMembers(type)) : + type.flags & 65536 /* Union */ ? ts.forEach(type.types, isEmptyObjectType) : + type.flags & 131072 /* Intersection */ ? !ts.forEach(type.types, function (t) { return !isEmptyObjectType(t); }) : + false; + } function isEnumTypeRelatedTo(source, target, errorReporter) { if (source === target) { return true; } var id = source.id + "," + target.id; - if (enumRelation[id] !== undefined) { - return enumRelation[id]; + var relation = enumRelation.get(id); + if (relation !== undefined) { + return relation; } if (source.symbol.name !== target.symbol.name || !(source.symbol.flags & 256 /* RegularEnum */) || !(target.symbol.flags & 256 /* RegularEnum */) || (source.flags & 65536 /* Union */) !== (target.flags & 65536 /* Union */)) { - return enumRelation[id] = false; + enumRelation.set(id, false); + return false; } var targetEnumType = getTypeOfSymbol(target.symbol); for (var _i = 0, _a = getPropertiesOfType(getTypeOfSymbol(source.symbol)); _i < _a.length; _i++) { @@ -30747,11 +33120,13 @@ var ts; if (errorReporter) { errorReporter(ts.Diagnostics.Property_0_is_missing_in_type_1, property.name, typeToString(target, /*enclosingDeclaration*/ undefined, 128 /* UseFullyQualifiedType */)); } - return enumRelation[id] = false; + enumRelation.set(id, false); + return false; } } } - return enumRelation[id] = true; + enumRelation.set(id, true); + return true; } function isSimpleTypeRelatedTo(source, target, relation, errorReporter) { if (target.flags & 8192 /* Never */) @@ -30772,6 +33147,8 @@ var ts; return true; if (source.flags & 4096 /* Null */ && (!strictNullChecks || target.flags & 4096 /* Null */)) return true; + if (source.flags & 32768 /* Object */ && target.flags & 16777216 /* NonPrimitive */) + return true; if (relation === assignableRelation || relation === comparableRelation) { if (source.flags & 1 /* Any */) return true; @@ -30803,13 +33180,13 @@ var ts; } if (source.flags & 32768 /* Object */ && target.flags & 32768 /* Object */) { var id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; - var related = relation[id]; + var related = relation.get(id); if (related !== undefined) { return related === 1 /* Succeeded */; } } - if (source.flags & 507904 /* StructuredOrTypeParameter */ || target.flags & 507904 /* StructuredOrTypeParameter */) { - return checkTypeRelatedTo(source, target, relation, undefined, undefined, undefined); + if (source.flags & 1032192 /* StructuredOrTypeVariable */ || target.flags & 1032192 /* StructuredOrTypeVariable */) { + return checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined); } return false; } @@ -30873,7 +33250,7 @@ var ts; if ((globalStringType === source && stringType === target) || (globalNumberType === source && numberType === target) || (globalBooleanType === source && booleanType === target) || - (getGlobalESSymbolType() === source && esSymbolType === target)) { + (getGlobalESSymbolType(/*reportErrors*/ false) === source && esSymbolType === target)) { reportError(ts.Diagnostics._0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible, targetType, sourceType); } } @@ -30896,10 +33273,12 @@ var ts; } return false; } - // Compare two types and return - // Ternary.True if they are related with no assumptions, - // Ternary.Maybe if they are related with assumptions of other relationships, or - // Ternary.False if they are not related. + /** + * Compare two types and return + * * Ternary.True if they are related with no assumptions, + * * Ternary.Maybe if they are related with assumptions of other relationships, or + * * Ternary.False if they are not related. + */ function isRelatedTo(source, target, reportErrors, headMessage) { var result; if (source.flags & 96 /* StringOrNumberLiteral */ && source.flags & 1048576 /* FreshLiteral */) { @@ -30946,143 +33325,37 @@ var ts; return result; } } - else if (target.flags & 65536 /* Union */) { - if (result = typeRelatedToSomeType(source, target, reportErrors && !(source.flags & 8190 /* Primitive */) && !(target.flags & 8190 /* Primitive */))) { - return result; - } - } - else if (target.flags & 131072 /* Intersection */) { - if (result = typeRelatedToEachType(source, target, reportErrors)) { - return result; - } - } - else if (source.flags & 131072 /* Intersection */) { - // Check to see if any constituents of the intersection are immediately related to the target. - // - // Don't report errors though. Checking whether a constituent is related to the source is not actually - // useful and leads to some confusing error messages. Instead it is better to let the below checks - // take care of this, or to not elaborate at all. For instance, - // - // - For an object type (such as 'C = A & B'), users are usually more interested in structural errors. - // - // - For a union type (such as '(A | B) = (C & D)'), it's better to hold onto the whole intersection - // than to report that 'D' is not assignable to 'A' or 'B'. - // - // - For a primitive type or type parameter (such as 'number = A & B') there is no point in - // breaking the intersection apart. - if (result = someTypeRelatedToType(source, target, /*reportErrors*/ false)) { - return result; - } - } - else if (target.flags & 16384 /* TypeParameter */) { - // A source type { [P in keyof T]: X } is related to a target type T if X is related to T[P]. - if (getObjectFlags(source) & 32 /* Mapped */ && getConstraintTypeFromMappedType(source) === getIndexType(target)) { - if (!source.declaration.questionToken) { - var templateType = getTemplateTypeFromMappedType(source); - var indexedAccessType = getIndexedAccessType(target, getTypeParameterFromMappedType(source)); - if (result = isRelatedTo(templateType, indexedAccessType, reportErrors)) { - return result; - } - } - } - else { - // Given a type parameter K with a constraint keyof T, a type S is - // assignable to K if S is assignable to keyof T. - var constraint = getConstraintOfTypeParameter(target); - if (constraint && constraint.flags & 262144 /* Index */) { - if (result = isRelatedTo(source, constraint, reportErrors)) { - return result; - } - } - } - } - else if (target.flags & 262144 /* Index */) { - // A keyof S is related to a keyof T if T is related to S. - if (source.flags & 262144 /* Index */) { - if (result = isRelatedTo(target.type, source.type, /*reportErrors*/ false)) { - return result; - } - } - // Given a type variable T with a constraint C, a type S is assignable to - // keyof T if S is assignable to keyof C. - if (target.type.flags & 540672 /* TypeVariable */) { - var constraint = getConstraintOfTypeVariable(target.type); - if (constraint) { - if (result = isRelatedTo(source, getIndexType(constraint), reportErrors)) { - return result; - } - } - } - } - else if (target.flags & 524288 /* IndexedAccess */) { - // if we have indexed access types with identical index types, see if relationship holds for - // the two object types. - if (source.flags & 524288 /* IndexedAccess */ && source.indexType === target.indexType) { - if (result = isRelatedTo(source.objectType, target.objectType, reportErrors)) { - return result; - } - } - // 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 apparent type of S. - if (target.constraint) { - if (result = isRelatedTo(source, target.constraint, reportErrors)) { - errorInfo = saveErrorInfo; - return result; - } - } - } - if (source.flags & 16384 /* TypeParameter */) { - // A source type T is related to a target type { [P in keyof T]: X } if T[P] is related to X. - if (getObjectFlags(target) & 32 /* Mapped */ && getConstraintTypeFromMappedType(target) === getIndexType(source)) { - var indexedAccessType = getIndexedAccessType(source, getTypeParameterFromMappedType(target)); - var templateType = getTemplateTypeFromMappedType(target); - if (result = isRelatedTo(indexedAccessType, templateType, reportErrors)) { - errorInfo = saveErrorInfo; - return result; - } - } - else { - var constraint = getConstraintOfTypeParameter(source); - if (!constraint || constraint.flags & 1 /* Any */) { - constraint = emptyObjectType; - } - // The constraint may need to be further instantiated with its 'this' type. - constraint = getTypeWithThisArgument(constraint, source); - // Report constraint errors only if the constraint is not the empty object type - var reportConstraintErrors = reportErrors && constraint !== emptyObjectType; - if (result = isRelatedTo(constraint, target, reportConstraintErrors)) { - errorInfo = saveErrorInfo; - return result; - } - } - } - else if (source.flags & 524288 /* 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 apparent type of S. - if (source.constraint) { - if (result = isRelatedTo(source.constraint, target, reportErrors)) { - errorInfo = saveErrorInfo; - return result; - } - } - } else { - if (getObjectFlags(source) & 4 /* Reference */ && getObjectFlags(target) & 4 /* Reference */ && source.target === target.target) { - // We have type references to same target type, see if relationship holds for all type arguments - if (result = typeArgumentsRelatedTo(source, target, reportErrors)) { + if (target.flags & 65536 /* Union */) { + if (result = typeRelatedToSomeType(source, target, reportErrors && !(source.flags & 8190 /* Primitive */) && !(target.flags & 8190 /* Primitive */))) { return result; } } - // Even if relationship doesn't hold for unions, intersections, or generic type references, - // it may hold in a structural comparison. - var apparentSource = getApparentType(source); - // In a check of the form X = A & B, we will have previously checked if A relates to X or B relates - // to X. Failing both of those we want to check if the aggregation of A and B's members structurally - // relates to X. Thus, we include intersection types on the source side here. - if (apparentSource.flags & (32768 /* Object */ | 131072 /* Intersection */) && target.flags & 32768 /* Object */) { - // Report structural errors only if we haven't reported any errors yet - var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo && !(source.flags & 8190 /* Primitive */); - if (result = objectTypeRelatedTo(apparentSource, source, target, reportStructuralErrors)) { + else if (target.flags & 131072 /* Intersection */) { + if (result = typeRelatedToEachType(source, target, reportErrors)) { + return result; + } + } + else if (source.flags & 131072 /* Intersection */) { + // Check to see if any constituents of the intersection are immediately related to the target. + // + // Don't report errors though. Checking whether a constituent is related to the source is not actually + // useful and leads to some confusing error messages. Instead it is better to let the below checks + // take care of this, or to not elaborate at all. For instance, + // + // - For an object type (such as 'C = A & B'), users are usually more interested in structural errors. + // + // - For a union type (such as '(A | B) = (C & D)'), it's better to hold onto the whole intersection + // than to report that 'D' is not assignable to 'A' or 'B'. + // + // - For a primitive type or type parameter (such as 'number = A & B') there is no point in + // breaking the intersection apart. + if (result = someTypeRelatedToType(source, target, /*reportErrors*/ false)) { + return result; + } + } + if (source.flags & 1032192 /* StructuredOrTypeVariable */ || target.flags & 1032192 /* StructuredOrTypeVariable */) { + if (result = recursiveTypeRelatedTo(source, target, reportErrors)) { errorInfo = saveErrorInfo; return result; } @@ -31102,13 +33375,7 @@ var ts; function isIdenticalTo(source, target) { var result; if (source.flags & 32768 /* Object */ && target.flags & 32768 /* Object */) { - if (getObjectFlags(source) & 4 /* Reference */ && getObjectFlags(target) & 4 /* Reference */ && source.target === target.target) { - // We have type references to same target type, see if all type arguments are identical - if (result = typeArgumentsRelatedTo(source, target, /*reportErrors*/ false)) { - return result; - } - } - return objectTypeRelatedTo(source, source, target, /*reportErrors*/ false); + return recursiveTypeRelatedTo(source, target, /*reportErrors*/ false); } if (source.flags & 65536 /* Union */ && target.flags & 65536 /* Union */ || source.flags & 131072 /* Intersection */ && target.flags & 131072 /* Intersection */) { @@ -31120,49 +33387,30 @@ var ts; } return 0 /* False */; } - // Check if a property with the given name is known anywhere in the given type. In an object type, a property - // is considered known if the object type is empty and the check is for assignability, if the object type has - // index signatures, or if the property is actually declared in the object type. In a union or intersection - // type, a property is considered known if it is known in any constituent type. - function isKnownProperty(type, name) { - if (type.flags & 32768 /* Object */) { - var resolved = resolveStructuredTypeMembers(type); - if ((relation === assignableRelation || relation === comparableRelation) && (type === globalObjectType || isEmptyObjectType(resolved)) || - resolved.stringIndexInfo || - (resolved.numberIndexInfo && isNumericLiteralName(name)) || - getPropertyOfType(type, name)) { - return true; - } - } - else if (type.flags & 196608 /* UnionOrIntersection */) { - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var t = _a[_i]; - if (isKnownProperty(t, name)) { - return true; - } - } - } - return false; - } - function isEmptyObjectType(t) { - return t.properties.length === 0 && - t.callSignatures.length === 0 && - t.constructSignatures.length === 0 && - !t.stringIndexInfo && - !t.numberIndexInfo; - } function hasExcessProperties(source, target, reportErrors) { if (maybeTypeOfKind(target, 32768 /* Object */) && !(getObjectFlags(target) & 512 /* ObjectLiteralPatternWithComputedProperties */)) { + var isComparingJsxAttributes = !!(source.flags & 33554432 /* JsxAttributes */); + if ((relation === assignableRelation || relation === comparableRelation) && + (isTypeSubsetOf(globalObjectType, target) || (!isComparingJsxAttributes && isEmptyObjectType(target)))) { + return false; + } for (var _i = 0, _a = getPropertiesOfObjectType(source); _i < _a.length; _i++) { var prop = _a[_i]; - if (!isKnownProperty(target, prop.name)) { + if (!isKnownProperty(target, prop.name, isComparingJsxAttributes)) { if (reportErrors) { // We know *exactly* where things went wrong when comparing the types. // Use this property as the error node as this will be more helpful in // reasoning about what went wrong. ts.Debug.assert(!!errorNode); - errorNode = prop.valueDeclaration; - reportError(ts.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(prop), typeToString(target)); + if (ts.isJsxAttributes(errorNode) || ts.isJsxOpeningLikeElement(errorNode)) { + // JsxAttributes has an object-literal flag and undergo same type-assignablity check as normal object-literal. + // However, using an object-literal error message will be very confusing to the users so we give different a message. + reportError(ts.Diagnostics.Property_0_does_not_exist_on_type_1, symbolToString(prop), typeToString(target)); + } + else { + errorNode = prop.valueDeclaration; + reportError(ts.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(prop), typeToString(target)); + } } return true; } @@ -31188,20 +33436,42 @@ var ts; if (target.flags & 65536 /* Union */ && containsType(targetTypes, source)) { return -1 /* True */; } - var len = targetTypes.length; - for (var i = 0; i < len; i++) { - var related = isRelatedTo(source, targetTypes[i], reportErrors && i === len - 1); + for (var _i = 0, targetTypes_1 = targetTypes; _i < targetTypes_1.length; _i++) { + var type = targetTypes_1[_i]; + var related = isRelatedTo(source, type, /*reportErrors*/ false); if (related) { return related; } } + if (reportErrors) { + var discriminantType = findMatchingDiscriminantType(source, target); + isRelatedTo(source, discriminantType || targetTypes[targetTypes.length - 1], /*reportErrors*/ true); + } return 0 /* False */; } + function findMatchingDiscriminantType(source, target) { + var sourceProperties = getPropertiesOfObjectType(source); + if (sourceProperties) { + for (var _i = 0, sourceProperties_1 = sourceProperties; _i < sourceProperties_1.length; _i++) { + var sourceProperty = sourceProperties_1[_i]; + if (isDiscriminantProperty(target, sourceProperty.name)) { + var sourceType = getTypeOfSymbol(sourceProperty); + for (var _a = 0, _b = target.types; _a < _b.length; _a++) { + var type = _b[_a]; + var targetType = getTypeOfPropertyOfType(type, sourceProperty.name); + if (targetType && isRelatedTo(sourceType, targetType)) { + return type; + } + } + } + } + } + } function typeRelatedToEachType(source, target, reportErrors) { var result = -1 /* True */; var targetTypes = target.types; - for (var _i = 0, targetTypes_1 = targetTypes; _i < targetTypes_1.length; _i++) { - var targetType = targetTypes_1[_i]; + for (var _i = 0, targetTypes_2 = targetTypes; _i < targetTypes_2.length; _i++) { + var targetType = targetTypes_2[_i]; var related = isRelatedTo(source, targetType, reportErrors); if (!related) { return 0 /* False */; @@ -31254,22 +33524,22 @@ var ts; } return result; } - // Determine if two object types are related by structure. First, check if the result is already available in the global cache. + // Determine if possibly recursive types are related. First, check if the result is already available in the global cache. // Second, check if we have already started a comparison of the given two types in which case we assume the result to be true. // Third, check if both types are part of deeply nested chains of generic type instantiations and if so assume the types are // equal and infinitely expanding. Fourth, if we have reached a depth of 100 nested comparisons, assume we have runaway recursion // and issue an error. Otherwise, actually compare the structure of the two types. - function objectTypeRelatedTo(source, originalSource, target, reportErrors) { + function recursiveTypeRelatedTo(source, target, reportErrors) { if (overflow) { return 0 /* False */; } var id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; - var related = relation[id]; + var related = relation.get(id); if (related !== undefined) { if (reportErrors && related === 2 /* Failed */) { // We are elaborating errors and the cached result is an unreported failure. Record the result as a reported // failure and continue computing the relation such that errors get reported. - relation[id] = 3 /* FailedAndReported */; + relation.set(id, 3 /* FailedAndReported */); } else { return related === 1 /* Succeeded */ ? -1 /* True */ : 0 /* False */; @@ -31278,7 +33548,7 @@ var ts; if (depth > 0) { for (var i = 0; i < depth; i++) { // If source and target are already being compared, consider them related with assumptions - if (maybeStack[i][id]) { + if (maybeStack[i].get(id)) { return 1 /* Maybe */; } } @@ -31296,76 +33566,190 @@ var ts; sourceStack[depth] = source; targetStack[depth] = target; maybeStack[depth] = ts.createMap(); - maybeStack[depth][id] = 1 /* Succeeded */; + maybeStack[depth].set(id, 1 /* Succeeded */); depth++; var saveExpandingFlags = expandingFlags; - if (!(expandingFlags & 1) && isDeeplyNestedGeneric(source, sourceStack, depth)) + if (!(expandingFlags & 1) && isDeeplyNestedType(source, sourceStack, depth)) expandingFlags |= 1; - if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack, depth)) + if (!(expandingFlags & 2) && isDeeplyNestedType(target, targetStack, depth)) expandingFlags |= 2; - var result; - if (expandingFlags === 3) { - result = 1 /* Maybe */; - } - else if (isGenericMappedType(source) || isGenericMappedType(target)) { - result = mappedTypeRelatedTo(source, target, reportErrors); - } - else { - result = propertiesRelatedTo(source, target, reportErrors); - if (result) { - result &= signaturesRelatedTo(source, target, 0 /* Call */, reportErrors); - if (result) { - result &= signaturesRelatedTo(source, target, 1 /* Construct */, reportErrors); - if (result) { - result &= indexTypesRelatedTo(source, originalSource, target, 0 /* String */, reportErrors); - if (result) { - result &= indexTypesRelatedTo(source, originalSource, target, 1 /* Number */, reportErrors); - } - } - } - } - } + var result = expandingFlags !== 3 ? structuredTypeRelatedTo(source, target, reportErrors) : 1 /* Maybe */; expandingFlags = saveExpandingFlags; depth--; if (result) { var maybeCache = maybeStack[depth]; // If result is definitely true, copy assumptions to global cache, else copy to next level up var destinationCache = (result === -1 /* True */ || depth === 0) ? relation : maybeStack[depth - 1]; - ts.copyProperties(maybeCache, destinationCache); + ts.copyEntries(maybeCache, destinationCache); } else { // A false result goes straight into global cache (when something is false under assumptions it // will also be false without assumptions) - relation[id] = reportErrors ? 3 /* FailedAndReported */ : 2 /* Failed */; + relation.set(id, reportErrors ? 3 /* FailedAndReported */ : 2 /* Failed */); } return result; } - // A type [P in S]: X is related to a type [P in T]: Y if T is related to S and X is related to Y. - function mappedTypeRelatedTo(source, target, reportErrors) { - if (isGenericMappedType(target)) { - if (isGenericMappedType(source)) { - var result_2; - if (relation === identityRelation) { - var readonlyMatches = !source.declaration.readonlyToken === !target.declaration.readonlyToken; - var optionalMatches = !source.declaration.questionToken === !target.declaration.questionToken; - if (readonlyMatches && optionalMatches) { - if (result_2 = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) { - return result_2 & isRelatedTo(getErasedTemplateTypeFromMappedType(source), getErasedTemplateTypeFromMappedType(target), reportErrors); - } - } - } - else { - if (relation === comparableRelation || !source.declaration.questionToken || target.declaration.questionToken) { - if (result_2 = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) { - return result_2 & isRelatedTo(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target), reportErrors); - } + function structuredTypeRelatedTo(source, target, reportErrors) { + var result; + var saveErrorInfo = errorInfo; + if (target.flags & 16384 /* TypeParameter */) { + // A source type { [P in keyof T]: X } is related to a target type T if X is related to T[P]. + if (getObjectFlags(source) & 32 /* Mapped */ && getConstraintTypeFromMappedType(source) === getIndexType(target)) { + if (!source.declaration.questionToken) { + var templateType = getTemplateTypeFromMappedType(source); + var indexedAccessType = getIndexedAccessType(target, getTypeParameterFromMappedType(source)); + if (result = isRelatedTo(templateType, indexedAccessType, reportErrors)) { + return result; } } } } + else if (target.flags & 262144 /* Index */) { + // A keyof S is related to a keyof T if T is related to S. + if (source.flags & 262144 /* Index */) { + if (result = isRelatedTo(target.type, source.type, /*reportErrors*/ false)) { + return result; + } + } + // 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); + if (constraint) { + if (result = isRelatedTo(source, getIndexType(constraint), reportErrors)) { + return result; + } + } + } + else if (target.flags & 524288 /* 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 apparent type of S. + var constraint = getConstraintOfType(target); + if (constraint) { + if (result = isRelatedTo(source, constraint, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } + } + if (source.flags & 16384 /* TypeParameter */) { + // A source type T is related to a target type { [P in keyof T]: X } if T[P] is related to X. + if (getObjectFlags(target) & 32 /* Mapped */ && getConstraintTypeFromMappedType(target) === getIndexType(source)) { + var indexedAccessType = getIndexedAccessType(source, getTypeParameterFromMappedType(target)); + var templateType = getTemplateTypeFromMappedType(target); + if (result = isRelatedTo(indexedAccessType, templateType, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } + else { + var constraint = getConstraintOfTypeParameter(source); + // A type parameter with no constraint is not related to the non-primitive object type. + if (constraint || !(target.flags & 16777216 /* NonPrimitive */)) { + if (!constraint || constraint.flags & 1 /* Any */) { + constraint = emptyObjectType; + } + // The constraint may need to be further instantiated with its 'this' type. + constraint = getTypeWithThisArgument(constraint, source); + // Report constraint errors only if the constraint is not the empty object type + var reportConstraintErrors = reportErrors && constraint !== emptyObjectType; + if (result = isRelatedTo(constraint, target, reportConstraintErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } + } + } + else if (source.flags & 524288 /* 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 apparent type of S. + var constraint = getConstraintOfType(source); + if (constraint) { + if (result = isRelatedTo(constraint, target, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } + else if (target.flags & 524288 /* IndexedAccess */ && source.indexType === target.indexType) { + // if we have indexed access types with identical index types, see if relationship holds for + // the two object types. + if (result = isRelatedTo(source.objectType, target.objectType, reportErrors)) { + return result; + } + } + } + else { + if (getObjectFlags(source) & 4 /* Reference */ && getObjectFlags(target) & 4 /* Reference */ && source.target === target.target) { + // We have type references to same target type, see if relationship holds for all type arguments + if (result = typeArgumentsRelatedTo(source, target, reportErrors)) { + return result; + } + } + // Even if relationship doesn't hold for unions, intersections, or generic type references, + // it may hold in a structural comparison. + var sourceIsPrimitive = !!(source.flags & 8190 /* Primitive */); + if (relation !== identityRelation) { + source = getApparentType(source); + } + // In a check of the form X = A & B, we will have previously checked if A relates to X or B relates + // to X. Failing both of those we want to check if the aggregation of A and B's members structurally + // relates to X. Thus, we include intersection types on the source side here. + if (source.flags & (32768 /* Object */ | 131072 /* Intersection */) && target.flags & 32768 /* Object */) { + // Report structural errors only if we haven't reported any errors yet + var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo && !sourceIsPrimitive; + if (isGenericMappedType(source) || isGenericMappedType(target)) { + result = mappedTypeRelatedTo(source, target, reportStructuralErrors); + } + else { + result = propertiesRelatedTo(source, target, reportStructuralErrors); + if (result) { + result &= signaturesRelatedTo(source, target, 0 /* Call */, reportStructuralErrors); + if (result) { + result &= signaturesRelatedTo(source, target, 1 /* Construct */, reportStructuralErrors); + if (result) { + result &= indexTypesRelatedTo(source, target, 0 /* String */, sourceIsPrimitive, reportStructuralErrors); + if (result) { + result &= indexTypesRelatedTo(source, target, 1 /* Number */, sourceIsPrimitive, reportStructuralErrors); + } + } + } + } + } + if (result) { + errorInfo = saveErrorInfo; + return result; + } + } + } + return 0 /* False */; + } + // A type [P in S]: X is related to a type [Q in T]: Y if T is related to S and X' is + // related to Y, where X' is an instantiation of X in which P is replaced with Q. Notice + // that S and T are contra-variant whereas X and Y are co-variant. + function mappedTypeRelatedTo(source, target, reportErrors) { + if (isGenericMappedType(target)) { + if (isGenericMappedType(source)) { + var sourceReadonly = !!source.declaration.readonlyToken; + var sourceOptional = !!source.declaration.questionToken; + var targetReadonly = !!target.declaration.readonlyToken; + var targetOptional = !!target.declaration.questionToken; + var modifiersRelated = relation === identityRelation ? + sourceReadonly === targetReadonly && sourceOptional === targetOptional : + relation === comparableRelation || !sourceOptional || targetOptional; + if (modifiersRelated) { + var result_2; + if (result_2 = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) { + var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]); + return result_2 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors); + } + } + } + else if (target.declaration.questionToken && isEmptyObjectType(source)) { + return -1 /* True */; + } + } else if (relation !== identityRelation) { var resolved = resolveStructuredTypeMembers(target); - if (isEmptyObjectType(resolved) || resolved.stringIndexInfo && resolved.stringIndexInfo.type.flags & 1 /* Any */) { + if (isEmptyResolvedType(resolved) || resolved.stringIndexInfo && resolved.stringIndexInfo.type.flags & 1 /* Any */) { return -1 /* True */; } } @@ -31378,22 +33762,28 @@ var ts; var result = -1 /* True */; var properties = getPropertiesOfObjectType(target); var requireOptionalProperties = relation === subtypeRelation && !(getObjectFlags(source) & 128 /* ObjectLiteral */); - for (var _i = 0, properties_3 = properties; _i < properties_3.length; _i++) { - var targetProp = properties_3[_i]; + for (var _i = 0, properties_4 = properties; _i < properties_4.length; _i++) { + var targetProp = properties_4[_i]; var sourceProp = getPropertyOfType(source, targetProp.name); if (sourceProp !== targetProp) { if (!sourceProp) { - if (!(targetProp.flags & 536870912 /* Optional */) || requireOptionalProperties) { + if (!(targetProp.flags & 67108864 /* Optional */) || requireOptionalProperties) { if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_missing_in_type_1, symbolToString(targetProp), typeToString(source)); } return 0 /* False */; } } - else if (!(targetProp.flags & 134217728 /* Prototype */)) { + else if (!(targetProp.flags & 16777216 /* Prototype */)) { var sourcePropFlags = getDeclarationModifierFlagsFromSymbol(sourceProp); var targetPropFlags = getDeclarationModifierFlagsFromSymbol(targetProp); if (sourcePropFlags & 8 /* Private */ || targetPropFlags & 8 /* Private */) { + if (getCheckFlags(sourceProp) & 256 /* ContainsPrivate */) { + if (reportErrors) { + reportError(ts.Diagnostics.Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1, symbolToString(sourceProp), typeToString(source)); + } + return 0 /* False */; + } if (sourceProp.valueDeclaration !== targetProp.valueDeclaration) { if (reportErrors) { if (sourcePropFlags & 8 /* Private */ && targetPropFlags & 8 /* Private */) { @@ -31407,12 +33797,9 @@ var ts; } } else if (targetPropFlags & 16 /* Protected */) { - var sourceDeclaredInClass = sourceProp.parent && sourceProp.parent.flags & 32 /* Class */; - var sourceClass = sourceDeclaredInClass ? getDeclaredTypeOfSymbol(getParentOfSymbol(sourceProp)) : undefined; - var targetClass = getDeclaredTypeOfSymbol(getParentOfSymbol(targetProp)); - if (!sourceClass || !hasBaseType(sourceClass, targetClass)) { + if (!isValidOverrideOf(sourceProp, targetProp)) { if (reportErrors) { - reportError(ts.Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2, symbolToString(targetProp), typeToString(sourceClass || source), typeToString(targetClass)); + reportError(ts.Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2, symbolToString(targetProp), typeToString(getDeclaringClass(sourceProp) || source), typeToString(getDeclaringClass(targetProp) || target)); } return 0 /* False */; } @@ -31432,7 +33819,7 @@ var ts; } result &= related; // When checking for comparability, be more lenient with optional properties. - if (relation !== comparableRelation && sourceProp.flags & 536870912 /* Optional */ && !(targetProp.flags & 536870912 /* Optional */)) { + if (relation !== comparableRelation && sourceProp.flags & 67108864 /* Optional */ && !(targetProp.flags & 67108864 /* Optional */)) { // TypeScript 1.0 spec (April 2014): 3.8.3 // S is a subtype of a type T, and T is a supertype of S if ... // S' and T are object types and, for each member M in T.. @@ -31460,8 +33847,8 @@ var ts; return 0 /* False */; } var result = -1 /* True */; - for (var _i = 0, sourceProperties_1 = sourceProperties; _i < sourceProperties_1.length; _i++) { - var sourceProp = sourceProperties_1[_i]; + for (var _i = 0, sourceProperties_2 = sourceProperties; _i < sourceProperties_2.length; _i++) { + var sourceProp = sourceProperties_2[_i]; var targetProp = getPropertyOfObjectType(target, sourceProp.name); if (!targetProp) { return 0 /* False */; @@ -31500,24 +33887,38 @@ var ts; } var result = -1 /* True */; var saveErrorInfo = errorInfo; - outer: for (var _i = 0, targetSignatures_1 = targetSignatures; _i < targetSignatures_1.length; _i++) { - var t = targetSignatures_1[_i]; - // Only elaborate errors from the first failure - var shouldElaborateErrors = reportErrors; - for (var _a = 0, sourceSignatures_1 = sourceSignatures; _a < sourceSignatures_1.length; _a++) { - var s = sourceSignatures_1[_a]; - var related = signatureRelatedTo(s, t, shouldElaborateErrors); - if (related) { - result &= related; - errorInfo = saveErrorInfo; - continue outer; + if (getObjectFlags(source) & 64 /* Instantiated */ && getObjectFlags(target) & 64 /* Instantiated */ && source.symbol === target.symbol) { + // We instantiations of the same anonymous type (which typically will be the type of a method). + // Simply do a pairwise comparison of the signatures in the two signature lists instead of the + // much more expensive N * M comparison matrix we explore below. + for (var i = 0; i < targetSignatures.length; i++) { + var related = signatureRelatedTo(sourceSignatures[i], targetSignatures[i], reportErrors); + if (!related) { + return 0 /* False */; } - shouldElaborateErrors = false; + result &= related; } - if (shouldElaborateErrors) { - reportError(ts.Diagnostics.Type_0_provides_no_match_for_the_signature_1, typeToString(source), signatureToString(t, /*enclosingDeclaration*/ undefined, /*flags*/ undefined, kind)); + } + else { + outer: for (var _i = 0, targetSignatures_1 = targetSignatures; _i < targetSignatures_1.length; _i++) { + var t = targetSignatures_1[_i]; + // Only elaborate errors from the first failure + var shouldElaborateErrors = reportErrors; + for (var _a = 0, sourceSignatures_1 = sourceSignatures; _a < sourceSignatures_1.length; _a++) { + var s = sourceSignatures_1[_a]; + var related = signatureRelatedTo(s, t, shouldElaborateErrors); + if (related) { + result &= related; + errorInfo = saveErrorInfo; + continue outer; + } + shouldElaborateErrors = false; + } + if (shouldElaborateErrors) { + reportError(ts.Diagnostics.Type_0_provides_no_match_for_the_signature_1, typeToString(source), signatureToString(t, /*enclosingDeclaration*/ undefined, /*flags*/ undefined, kind)); + } + return 0 /* False */; } - return 0 /* False */; } return result; } @@ -31534,7 +33935,7 @@ var ts; return 0 /* False */; } var result = -1 /* True */; - for (var i = 0, len = sourceSignatures.length; i < len; i++) { + for (var i = 0; i < sourceSignatures.length; i++) { var related = compareSignaturesIdentical(sourceSignatures[i], targetSignatures[i], /*partialMatch*/ false, /*ignoreThisTypes*/ false, /*ignoreReturnTypes*/ false, isRelatedTo); if (!related) { return 0 /* False */; @@ -31567,12 +33968,12 @@ var ts; } return related; } - function indexTypesRelatedTo(source, originalSource, target, kind, reportErrors) { + function indexTypesRelatedTo(source, target, kind, sourceIsPrimitive, reportErrors) { if (relation === identityRelation) { return indexTypesIdenticalTo(source, target, kind); } var targetInfo = getIndexInfoOfType(target, kind); - if (!targetInfo || ((targetInfo.type.flags & 1 /* Any */) && !(originalSource.flags & 8190 /* Primitive */))) { + if (!targetInfo || targetInfo.type.flags & 1 /* Any */ && !sourceIsPrimitive) { // Index signature of type any permits assignment from everything but primitives return -1 /* True */; } @@ -31634,6 +34035,45 @@ var ts; return false; } } + // Invoke the callback for each underlying property symbol of the given symbol and return the first + // value that isn't undefined. + function forEachProperty(prop, callback) { + if (getCheckFlags(prop) & 6 /* Synthetic */) { + for (var _i = 0, _a = prop.containingType.types; _i < _a.length; _i++) { + var t = _a[_i]; + var p = getPropertyOfType(t, prop.name); + var result = p && forEachProperty(p, callback); + if (result) { + return result; + } + } + return undefined; + } + return callback(prop); + } + // Return the declaring class type of a property or undefined if property not declared in class + function getDeclaringClass(prop) { + return prop.parent && prop.parent.flags & 32 /* Class */ ? getDeclaredTypeOfSymbol(getParentOfSymbol(prop)) : undefined; + } + // Return true if some underlying source property is declared in a class that derives + // from the given base class. + function isPropertyInClassDerivedFrom(prop, baseClass) { + return forEachProperty(prop, function (sp) { + var sourceClass = getDeclaringClass(sp); + return sourceClass ? hasBaseType(sourceClass, baseClass) : false; + }); + } + // Return true if source property is a valid override of protected parts of target property. + function isValidOverrideOf(sourceProp, targetProp) { + return !forEachProperty(targetProp, function (tp) { return getDeclarationModifierFlagsFromSymbol(tp) & 16 /* Protected */ ? + !isPropertyInClassDerivedFrom(sourceProp, getDeclaringClass(tp)) : false; }); + } + // Return true if the given class derives from each of the declaring classes of the protected + // constituents of the given property. + function isClassDerivedFromDeclaringClasses(checkClass, prop) { + return forEachProperty(prop, function (p) { return getDeclarationModifierFlagsFromSymbol(p) & 16 /* Protected */ ? + !hasBaseType(checkClass, getDeclaringClass(p)) : false; }) ? undefined : checkClass; + } // Return true if the given type is the constructor type for an abstract class function isAbstractConstructorType(type) { if (getObjectFlags(type) & 16 /* Anonymous */) { @@ -31647,22 +34087,24 @@ var ts; } return false; } - // Return true if the given type is part of a deeply nested chain of generic instantiations. We consider this to be the case - // when structural type comparisons have been started for 10 or more instantiations of the same generic type. It is possible, - // though highly unlikely, for this test to be true in a situation where a chain of instantiations is not infinitely expanding. - // Effectively, we will generate a false positive when two types are structurally equal to at least 10 levels, but unequal at - // some level beyond that. - function isDeeplyNestedGeneric(type, stack, depth) { - // We track type references (created by createTypeReference) and instantiated types (created by instantiateType) - if (getObjectFlags(type) & (4 /* Reference */ | 64 /* Instantiated */) && depth >= 5) { + // Return true if the given type is deeply nested. We consider this to be the case when structural type comparisons + // for 5 or more occurrences or instantiations of the type have been recorded on the given stack. It is possible, + // though highly unlikely, for this test to be true in a situation where a chain of instantiations is not infinitely + // expanding. Effectively, we will generate a false positive when two types are structurally equal to at least 5 + // levels, but unequal at some level beyond that. + function isDeeplyNestedType(type, stack, depth) { + // We track all object types that have an associated symbol (representing the origin of the type) + if (depth >= 5 && type.flags & 32768 /* Object */) { var symbol = type.symbol; - var count = 0; - for (var i = 0; i < depth; i++) { - var t = stack[i]; - if (getObjectFlags(t) & (4 /* Reference */ | 64 /* Instantiated */) && t.symbol === symbol) { - count++; - if (count >= 5) - return true; + if (symbol) { + var count = 0; + for (var i = 0; i < depth; i++) { + var t = stack[i]; + if (t.flags & 32768 /* Object */ && t.symbol === symbol) { + count++; + if (count >= 5) + return true; + } } } } @@ -31689,7 +34131,7 @@ var ts; } } else { - if ((sourceProp.flags & 536870912 /* Optional */) !== (targetProp.flags & 536870912 /* Optional */)) { + if ((sourceProp.flags & 67108864 /* Optional */) !== (targetProp.flags & 67108864 /* Optional */)) { return 0 /* False */; } } @@ -31733,7 +34175,7 @@ var ts; // the constraints with a common set of type arguments to get relatable entities in places where // type parameters occur in the constraints. The complexity of doing that doesn't seem worthwhile, // particularly as we're comparing erased versions of the signatures below. - if ((source.typeParameters ? source.typeParameters.length : 0) !== (target.typeParameters ? target.typeParameters.length : 0)) { + if (ts.length(source.typeParameters) !== ts.length(target.typeParameters)) { return 0 /* False */; } // Spec 1.0 Section 3.8.3 & 3.8.4: @@ -31773,8 +34215,8 @@ var ts; return signature.hasRestParameter && parameterIndex >= signature.parameters.length - 1; } function isSupertypeOfEach(candidate, types) { - for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { - var t = types_7[_i]; + for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { + var t = types_10[_i]; if (candidate !== t && !isTypeSubtypeOf(t, candidate)) return false; } @@ -31782,8 +34224,8 @@ var ts; } function literalTypesWithSameBaseType(types) { var commonBaseType; - for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { - var t = types_8[_i]; + for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { + var t = types_11[_i]; var baseType = getBaseTypeOfLiteralType(t); if (!commonBaseType) { commonBaseType = baseType; @@ -31889,8 +34331,8 @@ var ts; } function getFalsyFlagsOfTypes(types) { var result = 0; - for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { - var t = types_9[_i]; + for (var _i = 0, types_12 = types; _i < types_12.length; _i++) { + var t = types_12[_i]; result |= getFalsyFlags(t); } return result; @@ -31922,7 +34364,7 @@ var ts; types.push(undefinedType); if (flags & 4096 /* Null */) types.push(nullType); - return getUnionType(types, /*subtypeReduction*/ true); + return getUnionType(types); } function removeDefinitelyFalsyTypes(type) { return getFalsyFlags(type) & 7392 /* DefinitelyFalsy */ ? @@ -31941,8 +34383,8 @@ var ts; getSignaturesOfType(type, 0 /* Call */).length === 0 && getSignaturesOfType(type, 1 /* Construct */).length === 0; } - function createTransientSymbol(source, type) { - var symbol = createSymbol(source.flags | 67108864 /* Transient */, source.name); + function createSymbolWithType(source, type) { + var symbol = createSymbol(source.flags, source.name); symbol.declarations = source.declarations; symbol.parent = source.parent; symbol.type = type; @@ -31958,9 +34400,8 @@ var ts; var property = _a[_i]; var original = getTypeOfSymbol(property); var updated = f(original); - members[property.name] = updated === original ? property : createTransientSymbol(property, updated); + members.set(property.name, updated === original ? property : createSymbolWithType(property, updated)); } - ; return members; } /** @@ -31984,11 +34425,19 @@ var ts; type.regularType = regularNew; return regularNew; } + function getWidenedProperty(prop) { + var original = getTypeOfSymbol(prop); + var widened = getWidenedType(original); + return widened === original ? prop : createSymbolWithType(prop, widened); + } function getWidenedTypeOfObjectLiteral(type) { - var members = transformTypeOfMembers(type, function (prop) { - var widened = getWidenedType(prop); - return prop === widened ? prop : widened; - }); + var members = ts.createMap(); + for (var _i = 0, _a = getPropertiesOfObjectType(type); _i < _a.length; _i++) { + var prop = _a[_i]; + // Since get accessors already widen their return value there is no need to + // widen accessor based properties here. + members.set(prop.name, prop.flags & 4 /* Property */ ? getWidenedProperty(prop) : prop); + } var stringIndexInfo = getIndexInfoOfType(type, 0 /* String */); var numberIndexInfo = getIndexInfoOfType(type, 1 /* Number */); return createAnonymousType(type.symbol, members, emptyArray, emptyArray, stringIndexInfo && createIndexInfo(getWidenedType(stringIndexInfo.type), stringIndexInfo.isReadonly), numberIndexInfo && createIndexInfo(getWidenedType(numberIndexInfo.type), numberIndexInfo.isReadonly)); @@ -32060,25 +34509,25 @@ var ts; var typeAsString = typeToString(getWidenedType(type)); var diagnostic; switch (declaration.kind) { - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: + case 149 /* PropertyDeclaration */: + case 148 /* PropertySignature */: diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; - case 144 /* Parameter */: + case 146 /* 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 174 /* BindingElement */: + case 176 /* BindingElement */: diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type; break; - case 225 /* FunctionDeclaration */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: + case 228 /* FunctionDeclaration */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + case 186 /* FunctionExpression */: + case 187 /* ArrowFunction */: if (!declaration.name) { error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; @@ -32088,10 +34537,10 @@ var ts; default: diagnostic = ts.Diagnostics.Variable_0_implicitly_has_an_1_type; } - error(declaration, diagnostic, ts.declarationNameToString(declaration.name), typeAsString); + error(declaration, diagnostic, ts.declarationNameToString(ts.getNameOfDeclaration(declaration)), typeAsString); } function reportErrorsFromWidening(declaration, type) { - if (produceDiagnostics && compilerOptions.noImplicitAny && type.flags & 2097152 /* ContainsWideningType */) { + if (produceDiagnostics && noImplicitAny && type.flags & 2097152 /* ContainsWideningType */) { // Report implicit any error within type if possible, otherwise report error on declaration if (!reportWideningErrorsInType(type)) { reportImplicitAnyError(declaration, type); @@ -32118,13 +34567,14 @@ var ts; callback(getTypeAtPosition(source, i), getTypeAtPosition(target, i)); } } - function createInferenceContext(signature, inferUnionTypes) { + function createInferenceContext(signature, inferUnionTypes, useAnyForNoInferences) { var inferences = ts.map(signature.typeParameters, createTypeInferencesObject); return { signature: signature, inferUnionTypes: inferUnionTypes, inferences: inferences, inferredTypes: new Array(signature.typeParameters.length), + useAnyForNoInferences: useAnyForNoInferences }; } function createTypeInferencesObject() { @@ -32171,19 +34621,19 @@ var ts; var typeInferencesArray = [typeInferences]; var templateType = getTemplateTypeFromMappedType(target); var readonlyMask = target.declaration.readonlyToken ? false : true; - var optionalMask = target.declaration.questionToken ? 0 : 536870912 /* Optional */; + var optionalMask = target.declaration.questionToken ? 0 : 67108864 /* Optional */; var members = createSymbolTable(properties); - for (var _i = 0, properties_4 = properties; _i < properties_4.length; _i++) { - var prop = properties_4[_i]; + for (var _i = 0, properties_5 = properties; _i < properties_5.length; _i++) { + var prop = properties_5[_i]; var inferredPropType = inferTargetType(getTypeOfSymbol(prop)); if (!inferredPropType) { return undefined; } - var inferredProp = createSymbol(4 /* Property */ | 67108864 /* Transient */ | prop.flags & optionalMask, prop.name); + var inferredProp = createSymbol(4 /* Property */ | prop.flags & optionalMask, prop.name); + inferredProp.checkFlags = readonlyMask && isReadonlySymbol(prop) ? 8 /* Readonly */ : 0; inferredProp.declarations = prop.declarations; inferredProp.type = inferredPropType; - inferredProp.isReadonly = readonlyMask && isReadonlySymbol(prop); - members[prop.name] = inferredProp; + members.set(prop.name, inferredProp); } if (indexInfo) { var inferredIndexType = inferTargetType(indexInfo.type); @@ -32320,8 +34770,8 @@ var ts; var typeVariableCount = 0; var typeVariable = void 0; // First infer to each type in union or intersection that isn't a type variable - for (var _d = 0, targetTypes_2 = targetTypes; _d < targetTypes_2.length; _d++) { - var t = targetTypes_2[_d]; + for (var _d = 0, targetTypes_3 = targetTypes; _d < targetTypes_3.length; _d++) { + var t = targetTypes_3[_d]; if (t.flags & 540672 /* TypeVariable */ && ts.contains(typeVariables, t)) { typeVariable = t; typeVariableCount++; @@ -32353,14 +34803,14 @@ var ts; if (isInProcess(source, target)) { return; } - if (isDeeplyNestedGeneric(source, sourceStack, depth) && isDeeplyNestedGeneric(target, targetStack, depth)) { + if (isDeeplyNestedType(source, sourceStack, depth) && isDeeplyNestedType(target, targetStack, depth)) { return; } var key = source.id + "," + target.id; - if (visited[key]) { + if (visited.get(key)) { return; } - visited[key] = true; + visited.set(key, true); if (depth === 0) { sourceStack = []; targetStack = []; @@ -32407,8 +34857,8 @@ var ts; } function inferFromProperties(source, target) { var properties = getPropertiesOfObjectType(target); - for (var _i = 0, properties_5 = properties; _i < properties_5.length; _i++) { - var targetProp = properties_5[_i]; + for (var _i = 0, properties_6 = properties; _i < properties_6.length; _i++) { + var targetProp = properties_6[_i]; var sourceProp = getPropertyOfObjectType(source, targetProp.name); if (sourceProp) { inferFromTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); @@ -32458,8 +34908,8 @@ var ts; } } function typeIdenticalToSomeType(type, types) { - for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { - var t = types_10[_i]; + for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { + var t = types_13[_i]; if (isTypeIdenticalTo(t, type)) { return true; } @@ -32509,11 +34959,20 @@ var ts; inferenceSucceeded = !!unionOrSuperType; } else { - // Infer 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. + // 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. - inferredType = emptyObjectType; + var defaultType = getDefaultFromTypeParameter(context.signature.typeParameters[index]); + 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), getInferenceMapper(context))); + } + else { + inferredType = context.useAnyForNoInferences ? anyType : emptyObjectType; + } inferenceSucceeded = true; } context.inferredTypes[index] = inferredType; @@ -32554,33 +35013,21 @@ 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 - while (node) { - switch (node.kind) { - case 160 /* TypeQuery */: - return true; - case 70 /* Identifier */: - case 141 /* QualifiedName */: - node = node.parent; - continue; - default: - return false; - } - } - ts.Debug.fail("should not get here"); + return !!ts.findAncestor(node, function (n) { return n.kind === 162 /* TypeQuery */ ? true : n.kind === 71 /* Identifier */ || n.kind === 143 /* 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 // leftmost identifier followed by zero or more property names separated by dots. // The result is undefined if the reference isn't a dotted name. function getFlowCacheKey(node) { - if (node.kind === 70 /* Identifier */) { + if (node.kind === 71 /* Identifier */) { var symbol = getResolvedSymbol(node); return symbol !== unknownSymbol ? "" + getSymbolId(symbol) : undefined; } - if (node.kind === 98 /* ThisKeyword */) { + if (node.kind === 99 /* ThisKeyword */) { return "0"; } - if (node.kind === 177 /* PropertyAccessExpression */) { + if (node.kind === 179 /* PropertyAccessExpression */) { var key = getFlowCacheKey(node.expression); return key && key + "." + node.name.text; } @@ -32588,31 +35035,33 @@ var ts; } function getLeftmostIdentifierOrThis(node) { switch (node.kind) { - case 70 /* Identifier */: - case 98 /* ThisKeyword */: + case 71 /* Identifier */: + case 99 /* ThisKeyword */: return node; - case 177 /* PropertyAccessExpression */: + case 179 /* PropertyAccessExpression */: return getLeftmostIdentifierOrThis(node.expression); } return undefined; } function isMatchingReference(source, target) { switch (source.kind) { - case 70 /* Identifier */: - return target.kind === 70 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || - (target.kind === 223 /* VariableDeclaration */ || target.kind === 174 /* BindingElement */) && + case 71 /* Identifier */: + return target.kind === 71 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || + (target.kind === 226 /* VariableDeclaration */ || target.kind === 176 /* BindingElement */) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target); - case 98 /* ThisKeyword */: - return target.kind === 98 /* ThisKeyword */; - case 177 /* PropertyAccessExpression */: - return target.kind === 177 /* PropertyAccessExpression */ && + case 99 /* ThisKeyword */: + return target.kind === 99 /* ThisKeyword */; + case 97 /* SuperKeyword */: + return target.kind === 97 /* SuperKeyword */; + case 179 /* PropertyAccessExpression */: + return target.kind === 179 /* PropertyAccessExpression */ && source.name.text === target.name.text && isMatchingReference(source.expression, target.expression); } return false; } function containsMatchingReference(source, target) { - while (source.kind === 177 /* PropertyAccessExpression */) { + while (source.kind === 179 /* PropertyAccessExpression */) { source = source.expression; if (isMatchingReference(source, target)) { return true; @@ -32625,15 +35074,15 @@ 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 === 177 /* PropertyAccessExpression */ && + return target.kind === 179 /* PropertyAccessExpression */ && containsMatchingReference(source, target.expression) && isDiscriminantProperty(getDeclaredTypeOfReference(target.expression), target.name.text); } function getDeclaredTypeOfReference(expr) { - if (expr.kind === 70 /* Identifier */) { + if (expr.kind === 71 /* Identifier */) { return getTypeOfSymbol(getResolvedSymbol(expr)); } - if (expr.kind === 177 /* PropertyAccessExpression */) { + if (expr.kind === 179 /* PropertyAccessExpression */) { var type = getDeclaredTypeOfReference(expr.expression); return type && getTypeOfPropertyOfType(type, expr.name.text); } @@ -32642,9 +35091,9 @@ var ts; function isDiscriminantProperty(type, name) { if (type && type.flags & 65536 /* Union */) { var prop = getUnionOrIntersectionProperty(type, name); - if (prop && prop.flags & 268435456 /* SyntheticProperty */) { + if (prop && getCheckFlags(prop) & 2 /* SyntheticProperty */) { if (prop.isDiscriminantProperty === undefined) { - prop.isDiscriminantProperty = prop.hasNonUniformType && isLiteralType(getTypeOfSymbol(prop)); + prop.isDiscriminantProperty = prop.checkFlags & 32 /* HasNonUniformType */ && isLiteralType(getTypeOfSymbol(prop)); } return prop.isDiscriminantProperty; } @@ -32663,7 +35112,7 @@ var ts; } } } - if (callExpression.expression.kind === 177 /* PropertyAccessExpression */ && + if (callExpression.expression.kind === 179 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, callExpression.expression.expression)) { return true; } @@ -32705,8 +35154,8 @@ var ts; } function getTypeFactsOfTypes(types) { var result = 0 /* None */; - for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { - var t = types_11[_i]; + for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { + var t = types_14[_i]; result |= getTypeFacts(t); } return result; @@ -32716,7 +35165,7 @@ var ts; // check. This gives us a quicker out in the common case where an object type is not a function. var resolved = resolveStructuredTypeMembers(type); return !!(resolved.callSignatures.length || resolved.constructSignatures.length || - resolved.members["bind"] && isTypeSubtypeOf(type, globalFunctionType)); + resolved.members.get("bind") && isTypeSubtypeOf(type, globalFunctionType)); } function getTypeFacts(type) { var flags = type.flags; @@ -32759,9 +35208,11 @@ var ts; if (flags & 512 /* ESSymbol */) { return strictNullChecks ? 1981320 /* SymbolStrictFacts */ : 4193160 /* SymbolFacts */; } - if (flags & 16384 /* TypeParameter */) { - var constraint = getConstraintOfTypeParameter(type); - return getTypeFacts(constraint || emptyObjectType); + if (flags & 16777216 /* NonPrimitive */) { + return strictNullChecks ? 6166480 /* ObjectStrictFacts */ : 8378320 /* ObjectFacts */; + } + if (flags & 540672 /* TypeVariable */) { + return getTypeFacts(getBaseConstraintOfType(type) || emptyObjectType); } if (flags & 196608 /* UnionOrIntersection */) { return getTypeFactsOfTypes(type.types); @@ -32787,17 +35238,23 @@ var ts; } function getTypeOfDestructuredArrayElement(type, index) { return isTupleLikeType(type) && getTypeOfPropertyOfType(type, "" + index) || - checkIteratedTypeOrElementType(type, /*errorNode*/ undefined, /*allowStringInput*/ false) || + checkIteratedTypeOrElementType(type, /*errorNode*/ undefined, /*allowStringInput*/ false, /*allowAsyncIterable*/ false) || unknownType; } function getTypeOfDestructuredSpreadExpression(type) { - return createArrayType(checkIteratedTypeOrElementType(type, /*errorNode*/ undefined, /*allowStringInput*/ false) || unknownType); + return createArrayType(checkIteratedTypeOrElementType(type, /*errorNode*/ undefined, /*allowStringInput*/ false, /*allowAsyncIterable*/ false) || unknownType); } function getAssignedTypeOfBinaryExpression(node) { - return node.parent.kind === 175 /* ArrayLiteralExpression */ || node.parent.kind === 257 /* PropertyAssignment */ ? + var isDestructuringDefaultAssignment = node.parent.kind === 177 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || + node.parent.kind === 261 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); + return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); } + function isDestructuringAssignmentTarget(parent) { + return parent.parent.kind === 194 /* BinaryExpression */ && parent.parent.left === parent || + parent.parent.kind === 216 /* ForOfStatement */ && parent.parent.initializer === parent; + } function getAssignedTypeOfArrayLiteralElement(node, element) { return getTypeOfDestructuredArrayElement(getAssignedType(node), ts.indexOf(node.elements, element)); } @@ -32813,21 +35270,21 @@ var ts; function getAssignedType(node) { var parent = node.parent; switch (parent.kind) { - case 212 /* ForInStatement */: + case 215 /* ForInStatement */: return stringType; - case 213 /* ForOfStatement */: - return checkRightHandSideOfForOf(parent.expression) || unknownType; - case 192 /* BinaryExpression */: + case 216 /* ForOfStatement */: + return checkRightHandSideOfForOf(parent.expression, parent.awaitModifier) || unknownType; + case 194 /* BinaryExpression */: return getAssignedTypeOfBinaryExpression(parent); - case 186 /* DeleteExpression */: + case 188 /* DeleteExpression */: return undefinedType; - case 175 /* ArrayLiteralExpression */: + case 177 /* ArrayLiteralExpression */: return getAssignedTypeOfArrayLiteralElement(parent, node); - case 196 /* SpreadElement */: + case 198 /* SpreadElement */: return getAssignedTypeOfSpreadExpression(parent); - case 257 /* PropertyAssignment */: + case 261 /* PropertyAssignment */: return getAssignedTypeOfPropertyAssignment(parent); - case 258 /* ShorthandPropertyAssignment */: + case 262 /* ShorthandPropertyAssignment */: return getAssignedTypeOfShorthandPropertyAssignment(parent); } return unknownType; @@ -32835,7 +35292,7 @@ var ts; function getInitialTypeOfBindingElement(node) { var pattern = node.parent; var parentType = getInitialType(pattern.parent); - var type = pattern.kind === 172 /* ObjectBindingPattern */ ? + var type = pattern.kind === 174 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, ts.indexOf(pattern.elements, node)) : @@ -32853,39 +35310,39 @@ var ts; if (node.initializer) { return getTypeOfInitializer(node.initializer); } - if (node.parent.parent.kind === 212 /* ForInStatement */) { + if (node.parent.parent.kind === 215 /* ForInStatement */) { return stringType; } - if (node.parent.parent.kind === 213 /* ForOfStatement */) { - return checkRightHandSideOfForOf(node.parent.parent.expression) || unknownType; + if (node.parent.parent.kind === 216 /* ForOfStatement */) { + return checkRightHandSideOfForOf(node.parent.parent.expression, node.parent.parent.awaitModifier) || unknownType; } return unknownType; } function getInitialType(node) { - return node.kind === 223 /* VariableDeclaration */ ? + return node.kind === 226 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); } function getInitialOrAssignedType(node) { - return node.kind === 223 /* VariableDeclaration */ || node.kind === 174 /* BindingElement */ ? + return node.kind === 226 /* VariableDeclaration */ || node.kind === 176 /* BindingElement */ ? getInitialType(node) : getAssignedType(node); } function isEmptyArrayAssignment(node) { - return node.kind === 223 /* VariableDeclaration */ && node.initializer && + return node.kind === 226 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral(node.initializer) || - node.kind !== 174 /* BindingElement */ && node.parent.kind === 192 /* BinaryExpression */ && + node.kind !== 176 /* BindingElement */ && node.parent.kind === 194 /* BinaryExpression */ && isEmptyArrayLiteral(node.parent.right); } function getReferenceCandidate(node) { switch (node.kind) { - case 183 /* ParenthesizedExpression */: + case 185 /* ParenthesizedExpression */: return getReferenceCandidate(node.expression); - case 192 /* BinaryExpression */: + case 194 /* BinaryExpression */: switch (node.operatorToken.kind) { - case 57 /* EqualsToken */: + case 58 /* EqualsToken */: return getReferenceCandidate(node.left); - case 25 /* CommaToken */: + case 26 /* CommaToken */: return getReferenceCandidate(node.right); } } @@ -32893,13 +35350,13 @@ var ts; } function getReferenceRoot(node) { var parent = node.parent; - return parent.kind === 183 /* ParenthesizedExpression */ || - parent.kind === 192 /* BinaryExpression */ && parent.operatorToken.kind === 57 /* EqualsToken */ && parent.left === node || - parent.kind === 192 /* BinaryExpression */ && parent.operatorToken.kind === 25 /* CommaToken */ && parent.right === node ? + return parent.kind === 185 /* ParenthesizedExpression */ || + parent.kind === 194 /* BinaryExpression */ && parent.operatorToken.kind === 58 /* EqualsToken */ && parent.left === node || + parent.kind === 194 /* BinaryExpression */ && parent.operatorToken.kind === 26 /* CommaToken */ && parent.right === node ? getReferenceRoot(parent) : node; } function getTypeOfSwitchClause(clause) { - if (clause.kind === 253 /* CaseClause */) { + if (clause.kind === 257 /* CaseClause */) { var caseType = getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); return isUnitType(caseType) ? caseType : undefined; } @@ -32947,8 +35404,32 @@ var ts; } return f(type) ? type : neverType; } - function mapType(type, f) { - return type.flags & 65536 /* Union */ ? getUnionType(ts.map(type.types, f)) : f(type); + // Apply a mapping function to a type and return the resulting type. If the source type + // 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) { + if (!(type.flags & 65536 /* Union */)) { + return mapper(type); + } + var types = type.types; + var mappedType; + var mappedTypes; + for (var _i = 0, types_15 = types; _i < types_15.length; _i++) { + var current = types_15[_i]; + var t = mapper(current); + if (t) { + if (!mappedType) { + mappedType = t; + } + else if (!mappedTypes) { + mappedTypes = [mappedType, t]; + } + else { + mappedTypes.push(t); + } + } + } + return mappedTypes ? getUnionType(mappedTypes) : mappedType; } function extractTypesOfKind(type, kind) { return filterType(type, function (t) { return (t.flags & kind) !== 0; }); @@ -32992,7 +35473,7 @@ var ts; // we defer subtype reduction until the evolving array type is finalized into a manifest // array type. function addEvolvingArrayElementType(evolvingArrayType, node) { - var elementType = getBaseTypeOfLiteralType(getTypeOfExpression(node)); + var elementType = getBaseTypeOfLiteralType(getContextFreeTypeOfExpression(node)); return isTypeSubsetOf(elementType, evolvingArrayType.elementType) ? evolvingArrayType : getEvolvingArrayType(getUnionType([evolvingArrayType.elementType, elementType])); } function createFinalArrayType(elementType) { @@ -33014,8 +35495,8 @@ var ts; } function isEvolvingArrayTypeList(types) { var hasEvolvingArrayType = false; - for (var _i = 0, types_12 = types; _i < types_12.length; _i++) { - var t = types_12[_i]; + for (var _i = 0, types_16 = types; _i < types_16.length; _i++) { + var t = types_16[_i]; if (!(t.flags & 8192 /* Never */)) { if (!(getObjectFlags(t) & 256 /* EvolvingArray */)) { return false; @@ -33038,12 +35519,12 @@ var ts; function isEvolvingArrayOperationTarget(node) { var root = getReferenceRoot(node); var parent = root.parent; - var isLengthPushOrUnshift = parent.kind === 177 /* PropertyAccessExpression */ && (parent.name.text === "length" || - parent.parent.kind === 179 /* CallExpression */ && ts.isPushOrUnshiftIdentifier(parent.name)); - var isElementAssignment = parent.kind === 178 /* ElementAccessExpression */ && + var isLengthPushOrUnshift = parent.kind === 179 /* PropertyAccessExpression */ && (parent.name.text === "length" || + parent.parent.kind === 181 /* CallExpression */ && ts.isPushOrUnshiftIdentifier(parent.name)); + var isElementAssignment = parent.kind === 180 /* ElementAccessExpression */ && parent.expression === root && - parent.parent.kind === 192 /* BinaryExpression */ && - parent.parent.operatorToken.kind === 57 /* EqualsToken */ && + parent.parent.kind === 194 /* BinaryExpression */ && + parent.parent.operatorToken.kind === 58 /* EqualsToken */ && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && isTypeAnyOrAllConstituentTypesHaveKind(getTypeOfExpression(parent.argumentExpression), 340 /* NumberLike */ | 2048 /* Undefined */); @@ -33057,7 +35538,7 @@ var ts; return links.maybeTypePredicate; } function getMaybeTypePredicate(node) { - if (node.expression.kind !== 96 /* SuperKeyword */) { + if (node.expression.kind !== 97 /* SuperKeyword */) { var funcType = checkNonNullExpression(node.expression); if (funcType !== silentNeverType) { var apparentType = getApparentType(funcType); @@ -33069,14 +35550,12 @@ var ts; } return false; } - function getFlowTypeOfReference(reference, declaredType, assumeInitialized, flowContainer) { + function getFlowTypeOfReference(reference, declaredType, initialType, flowContainer, couldBeUninitialized) { + if (initialType === void 0) { initialType = declaredType; } var key; - if (!reference.flowNode || assumeInitialized && !(declaredType.flags & 1033215 /* Narrowable */)) { + if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 17810431 /* Narrowable */)) { return declaredType; } - var initialType = assumeInitialized ? declaredType : - declaredType === autoType || declaredType === autoArrayType ? undefinedType : - includeFalsyTypes(declaredType, 2048 /* Undefined */); var visitedFlowStart = visitedFlowCount; var evolvedType = getTypeFromFlowType(getTypeAtFlowNode(reference.flowNode)); visitedFlowCount = visitedFlowStart; @@ -33085,7 +35564,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 = getObjectFlags(evolvedType) & 256 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? anyArrayType : finalizeEvolvingArrayType(evolvedType); - if (reference.parent.kind === 201 /* NonNullExpression */ && getTypeWithFacts(resultType, 524288 /* NEUndefinedOrNull */).flags & 8192 /* Never */) { + if (reference.parent.kind === 203 /* NonNullExpression */ && getTypeWithFacts(resultType, 524288 /* NEUndefinedOrNull */).flags & 8192 /* Never */) { return declaredType; } return resultType; @@ -33102,7 +35581,19 @@ var ts; } } var type = void 0; - if (flow.flags & 16 /* Assignment */) { + if (flow.flags & 4096 /* AfterFinally */) { + // block flow edge: finally -> pre-try (for larger explanation check comment in binder.ts - bindTryStatement + flow.locked = true; + type = getTypeAtFlowNode(flow.antecedent); + flow.locked = false; + } + else if (flow.flags & 2048 /* PreFinally */) { + // locked pre-finally flows are filtered out in getTypeAtFlowBranchLabel + // so here just redirect to antecedent + flow = flow.antecedent; + continue; + } + else if (flow.flags & 16 /* Assignment */) { type = getTypeAtFlowAssignment(flow); if (!type) { flow = flow.antecedent; @@ -33134,7 +35625,7 @@ var ts; else if (flow.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 !== 177 /* PropertyAccessExpression */) { + if (container && container !== flowContainer && reference.kind !== 179 /* PropertyAccessExpression */ && reference.kind !== 99 /* ThisKeyword */) { flow = container.flowNode; continue; } @@ -33188,7 +35679,7 @@ var ts; } function getTypeAtFlowArrayMutation(flow) { var node = flow.node; - var expr = node.kind === 179 /* CallExpression */ ? + var expr = node.kind === 181 /* CallExpression */ ? node.expression.expression : node.left.expression; if (isMatchingReference(reference, getReferenceCandidate(expr))) { @@ -33196,7 +35687,7 @@ var ts; var type = getTypeFromFlowType(flowType); if (getObjectFlags(type) & 256 /* EvolvingArray */) { var evolvedType_1 = type; - if (node.kind === 179 /* CallExpression */) { + if (node.kind === 181 /* CallExpression */) { for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { var arg = _a[_i]; evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg); @@ -33255,6 +35746,12 @@ var ts; var seenIncomplete = false; for (var _i = 0, _a = flow.antecedents; _i < _a.length; _i++) { var antecedent = _a[_i]; + if (antecedent.flags & 2048 /* PreFinally */ && antecedent.lock.locked) { + // if flow correspond to branch from pre-try to finally and this branch is locked - this means that + // we initially have started following the flow outside the finally block. + // in this case we should ignore this branch. + continue; + } var flowType = getTypeAtFlowNode(antecedent); var type = getTypeFromFlowType(flowType); // If the type at a particular antecedent path is the declared type and the @@ -33287,8 +35784,9 @@ var ts; if (!key) { key = getFlowCacheKey(reference); } - if (cache[key]) { - return cache[key]; + var cached = cache.get(key); + if (cached) { + return cached; } // If this flow loop junction and reference are already being processed, return // the union of the types computed for each branch so far, marked as incomplete. @@ -33323,8 +35821,9 @@ var ts; // If we see a value appear in the cache it is a sign that control flow analysis // was restarted and completed by checkExpressionCached. We can simply pick up // the resulting type and bail out. - if (cache[key]) { - return cache[key]; + var cached_1 = cache.get(key); + if (cached_1) { + return cached_1; } if (!ts.contains(antecedentTypes, type)) { antecedentTypes.push(type); @@ -33348,10 +35847,11 @@ var ts; if (isIncomplete(firstAntecedentType)) { return createFlowType(result, /*incomplete*/ true); } - return cache[key] = result; + cache.set(key, result); + return result; } function isMatchingReferenceDiscriminant(expr) { - return expr.kind === 177 /* PropertyAccessExpression */ && + return expr.kind === 179 /* PropertyAccessExpression */ && declaredType.flags & 65536 /* Union */ && isMatchingReference(reference, expr.expression) && isDiscriminantProperty(declaredType, expr.name.text); @@ -33376,19 +35876,19 @@ var ts; } function narrowTypeByBinaryExpression(type, expr, assumeTrue) { switch (expr.operatorToken.kind) { - case 57 /* EqualsToken */: + case 58 /* EqualsToken */: return narrowTypeByTruthiness(type, expr.left, assumeTrue); - case 31 /* EqualsEqualsToken */: - case 32 /* ExclamationEqualsToken */: - case 33 /* EqualsEqualsEqualsToken */: - case 34 /* ExclamationEqualsEqualsToken */: + case 32 /* EqualsEqualsToken */: + case 33 /* ExclamationEqualsToken */: + case 34 /* EqualsEqualsEqualsToken */: + case 35 /* ExclamationEqualsEqualsToken */: var operator_1 = expr.operatorToken.kind; var left_1 = getReferenceCandidate(expr.left); var right_1 = getReferenceCandidate(expr.right); - if (left_1.kind === 187 /* TypeOfExpression */ && right_1.kind === 9 /* StringLiteral */) { + if (left_1.kind === 189 /* TypeOfExpression */ && right_1.kind === 9 /* StringLiteral */) { return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue); } - if (right_1.kind === 187 /* TypeOfExpression */ && left_1.kind === 9 /* StringLiteral */) { + if (right_1.kind === 189 /* TypeOfExpression */ && left_1.kind === 9 /* StringLiteral */) { return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue); } if (isMatchingReference(reference, left_1)) { @@ -33407,9 +35907,9 @@ var ts; return declaredType; } break; - case 92 /* InstanceOfKeyword */: + case 93 /* InstanceOfKeyword */: return narrowTypeByInstanceof(type, expr, assumeTrue); - case 25 /* CommaToken */: + case 26 /* CommaToken */: return narrowType(type, expr.right, assumeTrue); } return type; @@ -33418,7 +35918,7 @@ var ts; if (type.flags & 1 /* Any */) { return type; } - if (operator === 32 /* ExclamationEqualsToken */ || operator === 34 /* ExclamationEqualsEqualsToken */) { + if (operator === 33 /* ExclamationEqualsToken */ || operator === 35 /* ExclamationEqualsEqualsToken */) { assumeTrue = !assumeTrue; } var valueType = getTypeOfExpression(value); @@ -33426,15 +35926,15 @@ var ts; if (!strictNullChecks) { return type; } - var doubleEquals = operator === 31 /* EqualsEqualsToken */ || operator === 32 /* ExclamationEqualsToken */; + var doubleEquals = operator === 32 /* EqualsEqualsToken */ || operator === 33 /* ExclamationEqualsToken */; var facts = doubleEquals ? assumeTrue ? 65536 /* EQUndefinedOrNull */ : 524288 /* NEUndefinedOrNull */ : - value.kind === 94 /* NullKeyword */ ? + value.kind === 95 /* NullKeyword */ ? assumeTrue ? 32768 /* EQNull */ : 262144 /* NENull */ : assumeTrue ? 16384 /* EQUndefined */ : 131072 /* NEUndefined */; return getTypeWithFacts(type, facts); } - if (type.flags & 33281 /* NotUnionOrUnit */) { + if (type.flags & 16810497 /* NotUnionOrUnit */) { return type; } if (assumeTrue) { @@ -33458,21 +35958,29 @@ var ts; } return type; } - if (operator === 32 /* ExclamationEqualsToken */ || operator === 34 /* ExclamationEqualsEqualsToken */) { + if (operator === 33 /* ExclamationEqualsToken */ || operator === 35 /* ExclamationEqualsEqualsToken */) { assumeTrue = !assumeTrue; } if (assumeTrue && !(type.flags & 65536 /* Union */)) { // We narrow a non-union type to an exact primitive type if the non-union type // is a supertype of that primitive type. For example, type 'any' can be narrowed // to one of the primitive types. - var targetType = typeofTypesByName[literal.text]; - if (targetType && isTypeSubtypeOf(targetType, type)) { - return targetType; + var targetType = typeofTypesByName.get(literal.text); + if (targetType) { + if (isTypeSubtypeOf(targetType, type)) { + return targetType; + } + if (type.flags & 540672 /* TypeVariable */) { + var constraint = getBaseConstraintOfType(type) || anyType; + if (isTypeSubtypeOf(targetType, constraint)) { + return getIntersectionType([type, targetType]); + } + } } } var facts = assumeTrue ? - typeofEQFacts[literal.text] || 64 /* TypeofEQHostObject */ : - typeofNEFacts[literal.text] || 8192 /* TypeofNEHostObject */; + typeofEQFacts.get(literal.text) || 64 /* TypeofEQHostObject */ : + typeofNEFacts.get(literal.text) || 8192 /* TypeofNEHostObject */; return getTypeWithFacts(type, facts); } function narrowTypeBySwitchOnDiscriminant(type, switchStatement, clauseStart, clauseEnd) { @@ -33555,10 +36063,9 @@ var ts; // Otherwise, if the candidate type is assignable to the target type, narrow to the candidate // type. Otherwise, the types are completely unrelated, so narrow to an intersection of the // two types. - var targetType = type.flags & 16384 /* TypeParameter */ ? getApparentType(type) : type; return isTypeSubtypeOf(candidate, type) ? candidate : isTypeAssignableTo(type, candidate) ? type : - isTypeAssignableTo(candidate, targetType) ? candidate : + isTypeAssignableTo(candidate, type) ? candidate : getIntersectionType([type, candidate]); } function narrowTypeByTypePredicate(type, callExpression, assumeTrue) { @@ -33575,7 +36082,7 @@ var ts; return type; } if (ts.isIdentifierTypePredicate(predicate)) { - var predicateArgument = callExpression.arguments[predicate.parameterIndex]; + var predicateArgument = callExpression.arguments[predicate.parameterIndex - (signature.thisParameter ? 1 : 0)]; if (predicateArgument) { if (isMatchingReference(reference, predicateArgument)) { return getNarrowedType(type, predicate.type, assumeTrue, isTypeSubtypeOf); @@ -33587,7 +36094,7 @@ var ts; } else { var invokedExpression = ts.skipParentheses(callExpression.expression); - if (invokedExpression.kind === 178 /* ElementAccessExpression */ || invokedExpression.kind === 177 /* PropertyAccessExpression */) { + if (invokedExpression.kind === 180 /* ElementAccessExpression */ || invokedExpression.kind === 179 /* PropertyAccessExpression */) { var accessExpression = invokedExpression; var possibleReference = ts.skipParentheses(accessExpression.expression); if (isMatchingReference(reference, possibleReference)) { @@ -33604,18 +36111,19 @@ var ts; // will be a subtype or the same type as the argument. function narrowType(type, expr, assumeTrue) { switch (expr.kind) { - case 70 /* Identifier */: - case 98 /* ThisKeyword */: - case 177 /* PropertyAccessExpression */: + case 71 /* Identifier */: + case 99 /* ThisKeyword */: + case 97 /* SuperKeyword */: + case 179 /* PropertyAccessExpression */: return narrowTypeByTruthiness(type, expr, assumeTrue); - case 179 /* CallExpression */: + case 181 /* CallExpression */: return narrowTypeByTypePredicate(type, expr, assumeTrue); - case 183 /* ParenthesizedExpression */: + case 185 /* ParenthesizedExpression */: return narrowType(type, expr.expression, assumeTrue); - case 192 /* BinaryExpression */: + case 194 /* BinaryExpression */: return narrowTypeByBinaryExpression(type, expr, assumeTrue); - case 190 /* PrefixUnaryExpression */: - if (expr.operator === 50 /* ExclamationToken */) { + case 192 /* PrefixUnaryExpression */: + if (expr.operator === 51 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } break; @@ -33628,7 +36136,7 @@ var ts; // an dotted name expression, and if the location is not an assignment target, obtain the type // of the expression (which will reflect control flow analysis). If the expression indeed // resolved to the given symbol, return the narrowed type. - if (location.kind === 70 /* Identifier */) { + if (location.kind === 71 /* Identifier */) { if (ts.isRightSideOfQualifiedNameOrPropertyAccess(location)) { location = location.parent; } @@ -33647,15 +36155,12 @@ var ts; return getTypeOfSymbol(symbol); } function getControlFlowContainer(node) { - while (true) { - node = node.parent; - if (ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || - node.kind === 231 /* ModuleBlock */ || - node.kind === 261 /* SourceFile */ || - node.kind === 147 /* PropertyDeclaration */) { - return node; - } - } + return ts.findAncestor(node.parent, function (node) { + return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || + node.kind === 234 /* ModuleBlock */ || + node.kind === 265 /* SourceFile */ || + node.kind === 149 /* PropertyDeclaration */; + }); } // Check if a parameter is assigned anywhere within its declaring function. function isParameterAssigned(symbol) { @@ -33670,21 +36175,13 @@ var ts; return symbol.isAssigned || false; } function hasParentWithAssignmentsMarked(node) { - while (true) { - node = node.parent; - if (!node) { - return false; - } - if (ts.isFunctionLike(node) && getNodeLinks(node).flags & 4194304 /* AssignmentsMarked */) { - return true; - } - } + return !!ts.findAncestor(node.parent, function (node) { return ts.isFunctionLike(node) && !!(getNodeLinks(node).flags & 4194304 /* AssignmentsMarked */); }); } function markParameterAssignments(node) { - if (node.kind === 70 /* Identifier */) { + if (node.kind === 71 /* Identifier */) { if (ts.isAssignmentTarget(node)) { var symbol = getResolvedSymbol(node); - if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 144 /* Parameter */) { + if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 146 /* Parameter */) { symbol.isAssigned = true; } } @@ -33696,6 +36193,15 @@ var ts; function isConstVariable(symbol) { return symbol.flags & 3 /* Variable */ && (getDeclarationNodeFlagsFromSymbol(symbol) & 2 /* Const */) !== 0 && getTypeOfSymbol(symbol) !== autoArrayType; } + /** 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 === 146 /* Parameter */ && + declaration.initializer && + getFalsyFlags(declaredType) & 2048 /* Undefined */ && + !(getFalsyFlags(checkExpression(declaration.initializer)) & 2048 /* Undefined */); + return annotationIncludesUndefined ? getTypeWithFacts(declaredType, 131072 /* NEUndefined */) : declaredType; + } function checkIdentifier(node) { var symbol = getResolvedSymbol(node); if (symbol === unknownSymbol) { @@ -33710,16 +36216,14 @@ var ts; if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); if (languageVersion < 2 /* ES2015 */) { - if (container.kind === 185 /* ArrowFunction */) { + if (container.kind === 187 /* 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 */)) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method); } } - if (node.flags & 16384 /* AwaitContext */) { - getNodeLinks(container).flags |= 8192 /* CaptureArguments */; - } + getNodeLinks(container).flags |= 8192 /* CaptureArguments */; return getTypeOfSymbol(symbol); } if (symbol.flags & 8388608 /* Alias */ && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) { @@ -33731,7 +36235,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_1.kind === 226 /* ClassDeclaration */ + if (declaration_1.kind === 229 /* ClassDeclaration */ && ts.nodeIsDecorated(declaration_1)) { var container = ts.getContainingClass(node); while (container !== undefined) { @@ -33743,14 +36247,14 @@ var ts; container = ts.getContainingClass(container); } } - else if (declaration_1.kind === 197 /* ClassExpression */) { + else if (declaration_1.kind === 199 /* 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_1) { - if (container.kind === 147 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { + if (container.kind === 149 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { getNodeLinks(declaration_1).flags |= 8388608 /* ClassWithConstructorReference */; getNodeLinks(node).flags |= 16777216 /* ConstructorReferenceInClass */; } @@ -33762,6 +36266,7 @@ var ts; } checkCollisionWithCapturedSuperVariable(node, node); checkCollisionWithCapturedThisVariable(node, node); + checkCollisionWithCapturedNewTargetVariable(node, node); checkNestedBlockScopedBinding(node, symbol); var type = getTypeOfSymbol(localOrExportSymbol); var declaration = localOrExportSymbol.valueDeclaration; @@ -33784,15 +36289,15 @@ 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 === 144 /* Parameter */; + var isParameter = ts.getRootDeclaration(declaration).kind === 146 /* Parameter */; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); var isOuterVariable = flowContainer !== declarationContainer; // 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 === 184 /* FunctionExpression */ || - flowContainer.kind === 185 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && + while (flowContainer !== declarationContainer && (flowContainer.kind === 186 /* FunctionExpression */ || + flowContainer.kind === 187 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } @@ -33800,16 +36305,19 @@ var ts; // the entire control flow graph from the variable's declaration (i.e. when the flow container and // declaration container are the same). var assumeInitialized = isParameter || isOuterVariable || - type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & 1 /* Any */) !== 0) || + type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & 1 /* Any */) !== 0 || isInTypeQuery(node) || node.parent.kind === 246 /* ExportSpecifier */) || ts.isInAmbientContext(declaration); - var flowType = getFlowTypeOfReference(node, type, assumeInitialized, flowContainer); + var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, ts.getRootDeclaration(declaration)) : type) : + type === autoType || type === autoArrayType ? undefinedType : + includeFalsyTypes(type, 2048 /* Undefined */); + var flowType = getFlowTypeOfReference(node, type, initialType, flowContainer, !assumeInitialized); // A variable is considered uninitialized when it is possible to analyze the entire control flow graph // from declaration to use, and when the variable's declared type doesn't include undefined but the // control flow based type does include undefined. if (type === autoType || type === autoArrayType) { if (flowType === autoType || flowType === autoArrayType) { - if (compilerOptions.noImplicitAny) { - error(declaration.name, ts.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined, symbolToString(symbol), typeToString(flowType)); + if (noImplicitAny) { + error(ts.getNameOfDeclaration(declaration), ts.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined, symbolToString(symbol), typeToString(flowType)); error(node, ts.Diagnostics.Variable_0_implicitly_has_an_1_type, symbolToString(symbol), typeToString(flowType)); } return convertAutoToAny(flowType); @@ -33823,19 +36331,12 @@ var ts; return assignmentKind ? getBaseTypeOfLiteralType(flowType) : flowType; } function isInsideFunction(node, threshold) { - var current = node; - while (current && current !== threshold) { - if (ts.isFunctionLike(current)) { - return true; - } - current = current.parent; - } - return false; + return !!ts.findAncestor(node, function (n) { return n === threshold ? "quit" : ts.isFunctionLike(n); }); } function checkNestedBlockScopedBinding(node, symbol) { if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || - symbol.valueDeclaration.parent.kind === 256 /* CatchClause */) { + symbol.valueDeclaration.parent.kind === 260 /* CatchClause */) { return; } // 1. walk from the use site up to the declaration and check @@ -33860,8 +36361,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 === 211 /* ForStatement */ && - ts.getAncestor(symbol.valueDeclaration, 224 /* VariableDeclarationList */).parent === container && + if (container.kind === 214 /* ForStatement */ && + ts.getAncestor(symbol.valueDeclaration, 227 /* VariableDeclarationList */).parent === container && isAssignedInBodyOfForStatement(node, container)) { getNodeLinks(symbol.valueDeclaration).flags |= 2097152 /* NeedsLoopOutParameter */; } @@ -33873,9 +36374,9 @@ var ts; } } function isAssignedInBodyOfForStatement(node, container) { - var current = node; // skip parenthesized nodes - while (current.parent.kind === 183 /* ParenthesizedExpression */) { + var current = node; + while (current.parent.kind === 185 /* ParenthesizedExpression */) { current = current.parent; } // check if node is used as LHS in some assignment expression @@ -33883,28 +36384,20 @@ var ts; if (ts.isAssignmentTarget(current)) { isAssigned = true; } - else if ((current.parent.kind === 190 /* PrefixUnaryExpression */ || current.parent.kind === 191 /* PostfixUnaryExpression */)) { + else if ((current.parent.kind === 192 /* PrefixUnaryExpression */ || current.parent.kind === 193 /* PostfixUnaryExpression */)) { var expr = current.parent; - isAssigned = expr.operator === 42 /* PlusPlusToken */ || expr.operator === 43 /* MinusMinusToken */; + isAssigned = expr.operator === 43 /* PlusPlusToken */ || expr.operator === 44 /* MinusMinusToken */; } if (!isAssigned) { return false; } // at this point we know that node is the target of assignment // now check that modification happens inside the statement part of the ForStatement - while (current !== container) { - if (current === container.statement) { - return true; - } - else { - current = current.parent; - } - } - return false; + return !!ts.findAncestor(current, function (n) { return n === container ? "quit" : n === container.statement; }); } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 147 /* PropertyDeclaration */ || container.kind === 150 /* Constructor */) { + if (container.kind === 149 /* PropertyDeclaration */ || container.kind === 152 /* Constructor */) { var classNode = container.parent; getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } @@ -33972,36 +36465,38 @@ var ts; // tell whether 'this' needs to be captured. var container = ts.getThisContainer(node, /* includeArrowFunctions */ true); var needToCaptureLexicalThis = false; - if (container.kind === 150 /* Constructor */) { + if (container.kind === 152 /* 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 === 185 /* ArrowFunction */) { + if (container.kind === 187 /* 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 230 /* ModuleDeclaration */: + case 233 /* 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 229 /* EnumDeclaration */: + case 232 /* 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 150 /* Constructor */: + case 152 /* 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 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: + case 149 /* PropertyDeclaration */: + case 148 /* PropertySignature */: if (ts.getModifierFlags(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 142 /* ComputedPropertyName */: + case 144 /* ComputedPropertyName */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } @@ -34013,8 +36508,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 === 184 /* FunctionExpression */ && - ts.isInJavaScriptFile(container.parent) && + if (container.kind === 186 /* FunctionExpression */ && + container.parent.kind === 194 /* 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 @@ -34034,7 +36529,7 @@ var ts; if (ts.isClassLike(container.parent)) { var symbol = getSymbolOfNode(container.parent); var type = ts.hasModifier(container, 32 /* Static */) ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol).thisType; - return getFlowTypeOfReference(node, type, /*assumeInitialized*/ true, /*flowContainer*/ undefined); + return getFlowTypeOfReference(node, type); } if (ts.isInJavaScriptFile(node)) { var type = getTypeForThisExpressionFromJSDoc(container); @@ -34042,7 +36537,7 @@ var ts; return type; } } - if (compilerOptions.noImplicitThis) { + if (noImplicitThis) { // With noImplicitThis, functions may not reference 'this' if it has type 'any' error(node, ts.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation); } @@ -34050,28 +36545,23 @@ var ts; } function getTypeForThisExpressionFromJSDoc(node) { var jsdocType = ts.getJSDocType(node); - if (jsdocType && jsdocType.kind === 274 /* JSDocFunctionType */) { + if (jsdocType && jsdocType.kind === 279 /* JSDocFunctionType */) { var jsDocFunctionType = jsdocType; - if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].type.kind === 277 /* JSDocThisType */) { + if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].type.kind === 282 /* JSDocThisType */) { return getTypeFromTypeNode(jsDocFunctionType.parameters[0].type); } } } function isInConstructorArgumentInitializer(node, constructorDecl) { - for (var n = node; n && n !== constructorDecl; n = n.parent) { - if (n.kind === 144 /* Parameter */) { - return true; - } - } - return false; + return !!ts.findAncestor(node, function (n) { return n === constructorDecl ? "quit" : n.kind === 146 /* Parameter */; }); } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 179 /* CallExpression */ && node.parent.expression === node; + var isCallExpression = node.parent.kind === 181 /* 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 === 185 /* ArrowFunction */) { + while (container && container.kind === 187 /* ArrowFunction */) { container = ts.getSuperContainer(container, /*stopOnFunctions*/ true); needToCaptureLexicalThis = languageVersion < 2 /* ES2015 */; } @@ -34084,17 +36574,14 @@ var ts; // class B { // [super.foo()]() {} // } - var current = node; - while (current && current !== container && current.kind !== 142 /* ComputedPropertyName */) { - current = current.parent; - } - if (current && current.kind === 142 /* ComputedPropertyName */) { + var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 144 /* ComputedPropertyName */; }); + if (current && current.kind === 144 /* 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 === 176 /* ObjectLiteralExpression */)) { + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 178 /* ObjectLiteralExpression */)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { @@ -34102,7 +36589,7 @@ var ts; } return unknownType; } - if (!isCallExpression && container.kind === 150 /* Constructor */) { + if (!isCallExpression && container.kind === 152 /* 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.getModifierFlags(container) & 32 /* Static */) || isCallExpression) { @@ -34168,7 +36655,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 === 149 /* MethodDeclaration */ && ts.getModifierFlags(container) & 256 /* Async */) { + if (container.kind === 151 /* MethodDeclaration */ && ts.getModifierFlags(container) & 256 /* Async */) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096 /* AsyncMethodWithSuperBinding */; } @@ -34182,7 +36669,7 @@ var ts; // in this case they should also use correct lexical this captureLexicalThis(node.parent, container); } - if (container.parent.kind === 176 /* ObjectLiteralExpression */) { + if (container.parent.kind === 178 /* 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; @@ -34202,7 +36689,7 @@ var ts; } return unknownType; } - if (container.kind === 150 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 152 /* 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; @@ -34217,7 +36704,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 === 150 /* Constructor */; + return container.kind === 152 /* Constructor */; } else { // TS 1.0 SPEC (April 2014) @@ -34225,29 +36712,47 @@ 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 === 176 /* ObjectLiteralExpression */) { + if (ts.isClassLike(container.parent) || container.parent.kind === 178 /* ObjectLiteralExpression */) { if (ts.getModifierFlags(container) & 32 /* Static */) { - return container.kind === 149 /* MethodDeclaration */ || - container.kind === 148 /* MethodSignature */ || - container.kind === 151 /* GetAccessor */ || - container.kind === 152 /* SetAccessor */; + return container.kind === 151 /* MethodDeclaration */ || + container.kind === 150 /* MethodSignature */ || + container.kind === 153 /* GetAccessor */ || + container.kind === 154 /* SetAccessor */; } else { - return container.kind === 149 /* MethodDeclaration */ || - container.kind === 148 /* MethodSignature */ || - container.kind === 151 /* GetAccessor */ || - container.kind === 152 /* SetAccessor */ || - container.kind === 147 /* PropertyDeclaration */ || - container.kind === 146 /* PropertySignature */ || - container.kind === 150 /* Constructor */; + return container.kind === 151 /* MethodDeclaration */ || + container.kind === 150 /* MethodSignature */ || + container.kind === 153 /* GetAccessor */ || + container.kind === 154 /* SetAccessor */ || + container.kind === 149 /* PropertyDeclaration */ || + container.kind === 148 /* PropertySignature */ || + container.kind === 152 /* Constructor */; } } } return false; } } + function getContainingObjectLiteral(func) { + return (func.kind === 151 /* MethodDeclaration */ || + func.kind === 153 /* GetAccessor */ || + func.kind === 154 /* SetAccessor */) && func.parent.kind === 178 /* ObjectLiteralExpression */ ? func.parent : + func.kind === 186 /* FunctionExpression */ && func.parent.kind === 261 /* PropertyAssignment */ ? func.parent.parent : + undefined; + } + function getThisTypeArgument(type) { + return getObjectFlags(type) & 4 /* Reference */ && type.target === globalThisType ? type.typeArguments[0] : undefined; + } + function getThisTypeFromContextualType(type) { + return mapType(type, function (t) { + return t.flags & 131072 /* Intersection */ ? ts.forEach(t.types, getThisTypeArgument) : getThisTypeArgument(t); + }); + } function getContextualThisParameterType(func) { - if (isContextSensitiveFunctionOrObjectLiteralMethod(func) && func.kind !== 185 /* ArrowFunction */) { + if (func.kind === 187 /* ArrowFunction */) { + return undefined; + } + if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { var contextualSignature = getContextualSignature(func); if (contextualSignature) { var thisParameter = contextualSignature.thisParameter; @@ -34256,6 +36761,40 @@ var ts; } } } + if (noImplicitThis) { + var containingLiteral = getContainingObjectLiteral(func); + if (containingLiteral) { + // We have an object literal method. Check if the containing object literal has a contextual type + // that includes a ThisType. If so, T is the contextual type for 'this'. We continue looking in + // any directly enclosing object literals. + var contextualType = getApparentTypeOfContextualType(containingLiteral); + var literal = containingLiteral; + var type = contextualType; + while (type) { + var thisType = getThisTypeFromContextualType(type); + if (thisType) { + return instantiateType(thisType, getContextualMapper(containingLiteral)); + } + if (literal.parent.kind !== 261 /* PropertyAssignment */) { + break; + } + literal = literal.parent.parent; + type = getApparentTypeOfContextualType(literal); + } + // There was no contextual ThisType for the containing object literal, so the contextual type + // for 'this' is the non-null form of the contextual type for the containing object literal or + // the type of the object literal itself. + return contextualType ? getNonNullableType(contextualType) : checkExpressionCached(containingLiteral); + } + // In an assignment of the form 'obj.xxx = function(...)' or 'obj[xxx] = function(...)', the + // contextual type for 'this' is 'obj'. + if (func.parent.kind === 194 /* BinaryExpression */ && func.parent.operatorToken.kind === 58 /* EqualsToken */) { + var target = func.parent.left; + if (target.kind === 179 /* PropertyAccessExpression */ || target.kind === 180 /* ElementAccessExpression */) { + return checkExpressionCached(target.expression); + } + } + } return undefined; } // Return contextual type of parameter or undefined if no contextual type is available @@ -34263,23 +36802,23 @@ var ts; var func = parameter.parent; if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { var iife = ts.getImmediatelyInvokedFunctionExpression(func); - if (iife) { + if (iife && iife.arguments) { var indexOfParameter = ts.indexOf(func.parameters, parameter); - if (iife.arguments && indexOfParameter < iife.arguments.length) { - if (parameter.dotDotDotToken) { - var restTypes = []; - for (var i = indexOfParameter; i < iife.arguments.length; i++) { - restTypes.push(getWidenedLiteralType(checkExpression(iife.arguments[i]))); - } - return createArrayType(getUnionType(restTypes)); + if (parameter.dotDotDotToken) { + var restTypes = []; + for (var i = indexOfParameter; i < iife.arguments.length; i++) { + restTypes.push(getWidenedLiteralType(checkExpression(iife.arguments[i]))); } - var links = getNodeLinks(iife); - var cached = links.resolvedSignature; - links.resolvedSignature = anySignature; - var type = getWidenedLiteralType(checkExpression(iife.arguments[indexOfParameter])); - links.resolvedSignature = cached; - return type; + return restTypes.length ? createArrayType(getUnionType(restTypes)) : undefined; } + var links = getNodeLinks(iife); + var cached = links.resolvedSignature; + links.resolvedSignature = anySignature; + var type = indexOfParameter < iife.arguments.length ? + getWidenedLiteralType(checkExpression(iife.arguments[indexOfParameter])) : + parameter.initializer ? undefined : undefinedWideningType; + links.resolvedSignature = cached; + return type; } var contextualSignature = getContextualSignature(func); if (contextualSignature) { @@ -34313,7 +36852,7 @@ var ts; if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 144 /* Parameter */) { + if (declaration.kind === 146 /* Parameter */) { var type = getContextuallyTypedParameterType(declaration); if (type) { return type; @@ -34324,11 +36863,11 @@ var ts; } if (ts.isBindingPattern(declaration.parent)) { var parentDeclaration = declaration.parent.parent; - var name_19 = declaration.propertyName || declaration.name; - if (ts.isVariableLike(parentDeclaration) && + var name = declaration.propertyName || declaration.name; + if (parentDeclaration.kind !== 176 /* BindingElement */ && parentDeclaration.type && - !ts.isBindingPattern(name_19)) { - var text = ts.getTextOfPropertyName(name_19); + !ts.isBindingPattern(name)) { + var text = ts.getTextOfPropertyName(name); if (text) { return getTypeOfPropertyOfType(getTypeFromTypeNode(parentDeclaration.type), text); } @@ -34339,33 +36878,34 @@ var ts; } function getContextualTypeForReturnExpression(node) { var func = ts.getContainingFunction(node); - if (ts.isAsyncFunctionLike(func)) { - var contextualReturnType = getContextualReturnType(func); - if (contextualReturnType) { - return getPromisedType(contextualReturnType); + if (func) { + var functionFlags = ts.getFunctionFlags(func); + if (functionFlags & 1 /* Generator */) { + return undefined; } - return undefined; - } - if (func && !func.asteriskToken) { - return getContextualReturnType(func); + var contextualReturnType = getContextualReturnType(func); + return functionFlags & 2 /* Async */ + ? contextualReturnType && getAwaitedTypeOfPromise(contextualReturnType) // Async function + : contextualReturnType; // Regular function } return undefined; } function getContextualTypeForYieldOperand(node) { var func = ts.getContainingFunction(node); if (func) { + var functionFlags = ts.getFunctionFlags(func); var contextualReturnType = getContextualReturnType(func); if (contextualReturnType) { return node.asteriskToken ? contextualReturnType - : getElementTypeOfIterableIterator(contextualReturnType); + : getIteratedTypeOfGenerator(contextualReturnType, (functionFlags & 2 /* Async */) !== 0); } } return undefined; } function isInParameterInitializerBeforeContainingFunction(node) { while (node.parent && !ts.isFunctionLike(node.parent)) { - if (node.parent.kind === 144 /* Parameter */ && node.parent.initializer === node) { + if (node.parent.kind === 146 /* Parameter */ && node.parent.initializer === node) { return true; } node = node.parent; @@ -34376,8 +36916,8 @@ var ts; // 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.type || - functionDecl.kind === 150 /* Constructor */ || - functionDecl.kind === 151 /* GetAccessor */ && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(functionDecl.symbol, 152 /* SetAccessor */))) { + functionDecl.kind === 152 /* Constructor */ || + functionDecl.kind === 153 /* GetAccessor */ && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(functionDecl.symbol, 154 /* SetAccessor */))) { return getReturnTypeOfSignature(getSignatureFromDeclaration(functionDecl)); } // Otherwise, if the containing function is contextually typed by a function type with exactly one call signature @@ -34399,7 +36939,7 @@ var ts; return undefined; } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 181 /* TaggedTemplateExpression */) { + if (template.parent.kind === 183 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -34407,7 +36947,7 @@ var ts; function getContextualTypeForBinaryOperand(node) { var binaryExpression = node.parent; var operator = binaryExpression.operatorToken.kind; - if (operator >= 57 /* FirstAssignment */ && operator <= 69 /* LastAssignment */) { + if (operator >= 58 /* FirstAssignment */ && operator <= 70 /* LastAssignment */) { // Don't do this for special property assignments to avoid circularity if (ts.getSpecialPropertyAssignmentKind(binaryExpression) !== 0 /* None */) { return undefined; @@ -34417,7 +36957,7 @@ var ts; return getTypeOfExpression(binaryExpression.left); } } - else if (operator === 53 /* BarBarToken */) { + else if (operator === 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. var type = getContextualType(binaryExpression); @@ -34426,48 +36966,21 @@ var ts; } return type; } - else if (operator === 52 /* AmpersandAmpersandToken */ || operator === 25 /* CommaToken */) { + else if (operator === 53 /* AmpersandAmpersandToken */ || operator === 26 /* CommaToken */) { if (node === binaryExpression.right) { return getContextualType(binaryExpression); } } return undefined; } - // Apply a mapping function to a contextual type and return the resulting type. If the contextual type - // is a union type, the mapping function is applied to each constituent type and a union of the resulting - // types is returned. - function applyToContextualType(type, mapper) { - if (!(type.flags & 65536 /* Union */)) { - return mapper(type); - } - var types = type.types; - var mappedType; - var mappedTypes; - for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { - var current = types_13[_i]; - var t = mapper(current); - if (t) { - if (!mappedType) { - mappedType = t; - } - else if (!mappedTypes) { - mappedTypes = [mappedType, t]; - } - else { - mappedTypes.push(t); - } - } - } - return mappedTypes ? getUnionType(mappedTypes) : mappedType; - } function getTypeOfPropertyOfContextualType(type, name) { - return applyToContextualType(type, function (t) { + return mapType(type, function (t) { var prop = t.flags & 229376 /* StructuredType */ ? getPropertyOfType(t, name) : undefined; return prop ? getTypeOfSymbol(prop) : undefined; }); } function getIndexTypeOfContextualType(type, kind) { - return applyToContextualType(type, function (t) { return getIndexTypeOfStructuredType(t, kind); }); + return mapType(type, function (t) { return getIndexTypeOfStructuredType(t, kind); }); } // Return true if the given contextual type is a tuple-like type function contextualTypeIsTupleLikeType(type) { @@ -34514,7 +37027,7 @@ var ts; var index = ts.indexOf(arrayLiteral.elements, node); return getTypeOfPropertyOfContextualType(type, "" + index) || getIndexTypeOfContextualType(type, 1 /* Number */) - || (languageVersion >= 2 /* ES2015 */ ? getElementTypeOfIterable(type, /*errorNode*/ undefined) : undefined); + || getIteratedTypeOrElementType(type, /*errorNode*/ undefined, /*allowStringInput*/ false, /*allowAsyncIterable*/ false, /*checkAssignability*/ false); } return undefined; } @@ -34523,20 +37036,46 @@ var ts; var conditional = node.parent; return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional) : undefined; } + function getContextualTypeForJsxExpression(node) { + // JSX expression can appear in two position : JSX Element's children or JSX attribute + var jsxAttributes = ts.isJsxAttributeLike(node.parent) ? + node.parent.parent : + node.parent.openingElement.attributes; // node.parent is JsxElement + // When we trying to resolve JsxOpeningLikeElement as a stateless function element, we will already give its attributes a contextual type + // which is a type of the parameter of the signature we are trying out. + // If there is no contextual type (e.g. we are trying to resolve stateful component), get attributes type from resolving element's tagName + var attributesType = getContextualType(jsxAttributes); + if (!attributesType || isTypeAny(attributesType)) { + return undefined; + } + if (ts.isJsxAttribute(node.parent)) { + // JSX expression is in JSX attribute + return getTypeOfPropertyOfType(attributesType, node.parent.name.text); + } + else if (node.parent.kind === 249 /* JsxElement */) { + // 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(); + return jsxChildrenPropertyName && jsxChildrenPropertyName !== "" ? getTypeOfPropertyOfType(attributesType, jsxChildrenPropertyName) : anyType; + } + else { + // JSX expression is in JSX spread attribute + return attributesType; + } + } function getContextualTypeForJsxAttribute(attribute) { - var kind = attribute.kind; - var jsxElement = attribute.parent; - var attrsType = getJsxElementAttributesType(jsxElement); - if (attribute.kind === 250 /* JsxAttribute */) { - if (!attrsType || isTypeAny(attrsType)) { + // When we trying to resolve JsxOpeningLikeElement as a stateless function element, we will already give its attributes a contextual type + // which is a type of the parameter of the signature we are trying out. + // If there is no contextual type (e.g. we are trying to resolve stateful component), get attributes type from resolving element's tagName + var attributesType = getContextualType(attribute.parent); + if (ts.isJsxAttribute(attribute)) { + if (!attributesType || isTypeAny(attributesType)) { return undefined; } - return getTypeOfPropertyOfType(attrsType, attribute.name.text); + return getTypeOfPropertyOfType(attributesType, attribute.name.text); } - else if (attribute.kind === 251 /* JsxSpreadAttribute */) { - return attrsType; + else { + return attributesType; } - ts.Debug.fail("Expected JsxAttribute or JsxSpreadAttribute, got ts.SyntaxKind[" + kind + "]"); } // Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily // be "pushed" onto a node using the contextualType property. @@ -34571,45 +37110,52 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 223 /* VariableDeclaration */: - case 144 /* Parameter */: - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 174 /* BindingElement */: + case 226 /* VariableDeclaration */: + case 146 /* Parameter */: + case 149 /* PropertyDeclaration */: + case 148 /* PropertySignature */: + case 176 /* BindingElement */: return getContextualTypeForInitializerExpression(node); - case 185 /* ArrowFunction */: - case 216 /* ReturnStatement */: + case 187 /* ArrowFunction */: + case 219 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 195 /* YieldExpression */: + case 197 /* YieldExpression */: return getContextualTypeForYieldOperand(parent); - case 179 /* CallExpression */: - case 180 /* NewExpression */: + case 181 /* CallExpression */: + case 182 /* NewExpression */: return getContextualTypeForArgument(parent, node); - case 182 /* TypeAssertionExpression */: - case 200 /* AsExpression */: + case 184 /* TypeAssertionExpression */: + case 202 /* AsExpression */: return getTypeFromTypeNode(parent.type); - case 192 /* BinaryExpression */: + case 194 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node); - case 257 /* PropertyAssignment */: - case 258 /* ShorthandPropertyAssignment */: + case 261 /* PropertyAssignment */: + case 262 /* ShorthandPropertyAssignment */: return getContextualTypeForObjectLiteralElement(parent); - case 175 /* ArrayLiteralExpression */: + case 177 /* ArrayLiteralExpression */: return getContextualTypeForElementExpression(node); - case 193 /* ConditionalExpression */: + case 195 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node); - case 202 /* TemplateSpan */: - ts.Debug.assert(parent.parent.kind === 194 /* TemplateExpression */); + case 205 /* TemplateSpan */: + ts.Debug.assert(parent.parent.kind === 196 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 183 /* ParenthesizedExpression */: + case 185 /* ParenthesizedExpression */: return getContextualType(parent); - case 252 /* JsxExpression */: - return getContextualType(parent); - case 250 /* JsxAttribute */: - case 251 /* JsxSpreadAttribute */: + case 256 /* JsxExpression */: + return getContextualTypeForJsxExpression(parent); + case 253 /* JsxAttribute */: + case 255 /* JsxSpreadAttribute */: return getContextualTypeForJsxAttribute(parent); + case 251 /* JsxOpeningElement */: + case 250 /* JsxSelfClosingElement */: + return getAttributesTypeFromJsxOpeningLikeElement(parent); } return undefined; } + function getContextualMapper(node) { + node = ts.findAncestor(node, function (n) { return !!n.contextualMapper; }); + return node ? node.contextualMapper : identityMapper; + } // If the given type is an object or union type, if that type has a single signature, and if // that signature is non-generic, return the signature. Otherwise return undefined. function getNonGenericSignature(type, node) { @@ -34637,7 +37183,7 @@ var ts; return sourceLength < targetParameterCount; } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 184 /* FunctionExpression */ || node.kind === 185 /* ArrowFunction */; + return node.kind === 186 /* FunctionExpression */ || node.kind === 187 /* ArrowFunction */; } function getContextualSignatureForFunctionLikeDeclaration(node) { // Only function expressions, arrow functions, and object literal methods are contextually typed. @@ -34656,7 +37202,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 !== 149 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 151 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var type = getContextualTypeForFunctionLikeDeclaration(node); if (!type) { return undefined; @@ -34666,8 +37212,8 @@ var ts; } var signatureList; var types = type.types; - for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { - var current = types_14[_i]; + for (var _i = 0, types_17 = types; _i < types_17.length; _i++) { + var current = types_17[_i]; var signature = getNonGenericSignature(current, node); if (signature) { if (!signatureList) { @@ -34694,40 +37240,25 @@ var ts; } return result; } - /** - * Detect if the mapper implies an inference context. Specifically, there are 4 possible values - * for a mapper. Let's go through each one of them: - * - * 1. undefined - this means we are not doing inferential typing, but we may do contextual typing, - * which could cause us to assign a parameter a type - * 2. identityMapper - means we want to avoid assigning a parameter a type, whether or not we are in - * inferential typing (context is undefined for the identityMapper) - * 3. a mapper created by createInferenceMapper - we are doing inferential typing, we want to assign - * types to parameters and fix type parameters (context is defined) - * 4. an instantiation mapper created by createTypeMapper or createTypeEraser - this should never be - * passed as the contextual mapper when checking an expression (context is undefined for these) - * - * isInferentialContext is detecting if we are in case 3 - */ - function isInferentialContext(mapper) { - return mapper && mapper.context; - } - function checkSpreadExpression(node, contextualMapper) { - var arrayOrIterableType = checkExpression(node.expression, contextualMapper); - return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, /*allowStringInput*/ false); + function checkSpreadExpression(node, checkMode) { + if (languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { + checkExternalEmitHelpers(node, 1536 /* SpreadIncludes */); + } + var arrayOrIterableType = checkExpression(node.expression, checkMode); + return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, /*allowStringInput*/ false, /*allowAsyncIterable*/ false); } function hasDefaultValue(node) { - return (node.kind === 174 /* BindingElement */ && !!node.initializer) || - (node.kind === 192 /* BinaryExpression */ && node.operatorToken.kind === 57 /* EqualsToken */); + return (node.kind === 176 /* BindingElement */ && !!node.initializer) || + (node.kind === 194 /* BinaryExpression */ && node.operatorToken.kind === 58 /* EqualsToken */); } - function checkArrayLiteral(node, contextualMapper) { + function checkArrayLiteral(node, checkMode) { var elements = node.elements; var hasSpreadElement = false; var elementTypes = []; var inDestructuringPattern = ts.isAssignmentTarget(node); for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) { var e = elements_1[_i]; - if (inDestructuringPattern && e.kind === 196 /* SpreadElement */) { + if (inDestructuringPattern && e.kind === 198 /* SpreadElement */) { // Given the following situation: // var c: {}; // [...c] = ["", 0]; @@ -34740,18 +37271,18 @@ var ts; // get the contextual element type from it. So we do something similar to // getContextualTypeForElementExpression, which will crucially not error // if there is no index type / iterated type. - var restArrayType = checkExpression(e.expression, contextualMapper); + var restArrayType = checkExpression(e.expression, checkMode); var restElementType = getIndexTypeOfType(restArrayType, 1 /* Number */) || - (languageVersion >= 2 /* ES2015 */ ? getElementTypeOfIterable(restArrayType, /*errorNode*/ undefined) : undefined); + getIteratedTypeOrElementType(restArrayType, /*errorNode*/ undefined, /*allowStringInput*/ false, /*allowAsyncIterable*/ false, /*checkAssignability*/ false); if (restElementType) { elementTypes.push(restElementType); } } else { - var type = checkExpressionForMutableLocation(e, contextualMapper); + var type = checkExpressionForMutableLocation(e, checkMode); elementTypes.push(type); } - hasSpreadElement = hasSpreadElement || e.kind === 196 /* SpreadElement */; + hasSpreadElement = hasSpreadElement || e.kind === 198 /* SpreadElement */; } if (!hasSpreadElement) { // If array literal is actually a destructuring pattern, mark it as an implied type. We do this such @@ -34766,7 +37297,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 === 173 /* ArrayBindingPattern */ || pattern.kind === 175 /* ArrayLiteralExpression */)) { + if (pattern && (pattern.kind === 175 /* ArrayBindingPattern */ || pattern.kind === 177 /* ArrayLiteralExpression */)) { var patternElements = pattern.elements; for (var i = elementTypes.length; i < patternElements.length; i++) { var patternElement = patternElements[i]; @@ -34774,7 +37305,7 @@ var ts; elementTypes.push(contextualType.typeArguments[i]); } else { - if (patternElement.kind !== 198 /* OmittedExpression */) { + if (patternElement.kind !== 200 /* OmittedExpression */) { error(patternElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); } elementTypes.push(unknownType); @@ -34791,7 +37322,7 @@ var ts; strictNullChecks ? neverType : undefinedWideningType); } function isNumericName(name) { - return name.kind === 142 /* ComputedPropertyName */ ? isNumericComputedName(name) : isNumericLiteralName(name.text); + return name.kind === 144 /* ComputedPropertyName */ ? isNumericComputedName(name) : isNumericLiteralName(name.text); } function isNumericComputedName(name) { // It seems odd to consider an expression of type Any to result in a numeric name, @@ -34853,7 +37384,7 @@ var ts; var unionType = propTypes.length ? getUnionType(propTypes, /*subtypeReduction*/ true) : undefinedType; return createIndexInfo(unionType, /*isReadonly*/ false); } - function checkObjectLiteral(node, contextualMapper) { + function checkObjectLiteral(node, checkMode) { var inDestructuringPattern = ts.isAssignmentTarget(node); // Grammar checking checkGrammarObjectLiteralExpression(node, inDestructuringPattern); @@ -34863,7 +37394,8 @@ var ts; var propagatedFlags = 0; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 172 /* ObjectBindingPattern */ || contextualType.pattern.kind === 176 /* ObjectLiteralExpression */); + (contextualType.pattern.kind === 174 /* ObjectBindingPattern */ || contextualType.pattern.kind === 178 /* ObjectLiteralExpression */); + var isJSObjectLiteral = !contextualType && ts.isInJavaScriptFile(node); var typeFlags = 0; var patternWithComputedProperties = false; var hasComputedStringProperty = false; @@ -34872,29 +37404,29 @@ var ts; for (var i = 0; i < node.properties.length; i++) { var memberDecl = node.properties[i]; var member = memberDecl.symbol; - if (memberDecl.kind === 257 /* PropertyAssignment */ || - memberDecl.kind === 258 /* ShorthandPropertyAssignment */ || + if (memberDecl.kind === 261 /* PropertyAssignment */ || + memberDecl.kind === 262 /* ShorthandPropertyAssignment */ || ts.isObjectLiteralMethod(memberDecl)) { var type = void 0; - if (memberDecl.kind === 257 /* PropertyAssignment */) { - type = checkPropertyAssignment(memberDecl, contextualMapper); + if (memberDecl.kind === 261 /* PropertyAssignment */) { + type = checkPropertyAssignment(memberDecl, checkMode); } - else if (memberDecl.kind === 149 /* MethodDeclaration */) { - type = checkObjectLiteralMethod(memberDecl, contextualMapper); + else if (memberDecl.kind === 151 /* MethodDeclaration */) { + type = checkObjectLiteralMethod(memberDecl, checkMode); } else { - ts.Debug.assert(memberDecl.kind === 258 /* ShorthandPropertyAssignment */); - type = checkExpressionForMutableLocation(memberDecl.name, contextualMapper); + ts.Debug.assert(memberDecl.kind === 262 /* ShorthandPropertyAssignment */); + type = checkExpressionForMutableLocation(memberDecl.name, checkMode); } typeFlags |= type.flags; - var prop = createSymbol(4 /* Property */ | 67108864 /* Transient */ | member.flags, member.name); + var prop = createSymbol(4 /* Property */ | member.flags, member.name); 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 === 257 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 258 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 261 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 262 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); if (isOptional) { - prop.flags |= 536870912 /* Optional */; + prop.flags |= 67108864 /* Optional */; } if (ts.hasDynamicName(memberDecl)) { patternWithComputedProperties = true; @@ -34905,7 +37437,7 @@ var ts; // binding pattern specifies a default value for the property, make the property optional. var impliedProp = getPropertyOfType(contextualType, member.name); if (impliedProp) { - prop.flags |= impliedProp.flags & 536870912 /* Optional */; + prop.flags |= impliedProp.flags & 67108864 /* Optional */; } else if (!compilerOptions.suppressExcessPropertyErrors && !getIndexInfoOfType(contextualType, 0 /* String */)) { error(memberDecl.name, ts.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(member), typeToString(contextualType)); @@ -34920,12 +37452,12 @@ var ts; prop.target = member; member = prop; } - else if (memberDecl.kind === 259 /* SpreadAssignment */) { - if (languageVersion < 5 /* ESNext */) { + else if (memberDecl.kind === 263 /* SpreadAssignment */) { + if (languageVersion < 2 /* ES2015 */) { checkExternalEmitHelpers(memberDecl, 2 /* Assign */); } if (propertiesArray.length > 0) { - spread = getSpreadType(spread, createObjectLiteralType(), /*isFromObjectLiteral*/ true); + spread = getSpreadType(spread, createObjectLiteralType()); propertiesArray = []; propertiesTable = ts.createMap(); hasComputedStringProperty = false; @@ -34937,7 +37469,7 @@ var ts; error(memberDecl, ts.Diagnostics.Spread_types_may_only_be_created_from_object_types); return unknownType; } - spread = getSpreadType(spread, type, /*isFromObjectLiteral*/ false); + spread = getSpreadType(spread, type); offset = i + 1; continue; } @@ -34947,8 +37479,8 @@ 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 === 151 /* GetAccessor */ || memberDecl.kind === 152 /* SetAccessor */); - checkAccessorDeclaration(memberDecl); + ts.Debug.assert(memberDecl.kind === 153 /* GetAccessor */ || memberDecl.kind === 154 /* SetAccessor */); + checkNodeDeferred(memberDecl); } if (ts.hasDynamicName(memberDecl)) { if (isNumericName(memberDecl.name)) { @@ -34959,7 +37491,7 @@ var ts; } } else { - propertiesTable[member.name] = member; + propertiesTable.set(member.name, member); } propertiesArray.push(member); } @@ -34968,18 +37500,18 @@ var ts; if (contextualTypeHasPattern) { for (var _i = 0, _a = getPropertiesOfType(contextualType); _i < _a.length; _i++) { var prop = _a[_i]; - if (!propertiesTable[prop.name]) { - if (!(prop.flags & 536870912 /* Optional */)) { + if (!propertiesTable.get(prop.name)) { + if (!(prop.flags & 67108864 /* Optional */)) { error(prop.valueDeclaration || prop.bindingElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); } - propertiesTable[prop.name] = prop; + propertiesTable.set(prop.name, prop); propertiesArray.push(prop); } } } if (spread !== emptyObjectType) { if (propertiesArray.length > 0) { - spread = getSpreadType(spread, createObjectLiteralType(), /*isFromObjectLiteral*/ true); + spread = getSpreadType(spread, createObjectLiteralType()); } if (spread.flags & 32768 /* Object */) { // only set the symbol and flags if this is a (fresh) object type @@ -34990,8 +37522,8 @@ var ts; } return createObjectLiteralType(); function createObjectLiteralType() { - var stringIndexInfo = hasComputedStringProperty ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 0 /* String */) : undefined; - var numberIndexInfo = hasComputedNumberProperty ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 1 /* Number */) : undefined; + 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, emptyArray, emptyArray, stringIndexInfo, numberIndexInfo); var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 1048576 /* FreshLiteral */; result.flags |= 4194304 /* ContainsObjectLiteral */ | freshObjectLiteralFlag | (typeFlags & 14680064 /* PropagatingFlags */); @@ -35009,13 +37541,13 @@ var ts; } } function isValidSpreadType(type) { - return !!(type.flags & (1 /* Any */ | 4096 /* Null */ | 2048 /* Undefined */) || + return !!(type.flags & (1 /* Any */ | 4096 /* Null */ | 2048 /* Undefined */ | 16777216 /* NonPrimitive */) || type.flags & 32768 /* Object */ && !isGenericMappedType(type) || type.flags & 196608 /* UnionOrIntersection */ && !ts.forEach(type.types, function (t) { return !isValidSpreadType(t); })); } function checkJsxSelfClosingElement(node) { checkJsxOpeningLikeElement(node); - return jsxElementType || anyType; + return getJsxGlobalElementType() || anyType; } function checkJsxElement(node) { // Check attributes @@ -35027,22 +37559,7 @@ var ts; else { checkExpression(node.closingElement.tagName); } - // Check children - for (var _i = 0, _a = node.children; _i < _a.length; _i++) { - var child = _a[_i]; - switch (child.kind) { - case 252 /* JsxExpression */: - checkJsxExpression(child); - break; - case 246 /* JsxElement */: - checkJsxElement(child); - break; - case 247 /* JsxSelfClosingElement */: - checkJsxSelfClosingElement(child); - break; - } - } - return jsxElementType || anyType; + return getJsxGlobalElementType() || anyType; } /** * Returns true iff the JSX element name would be a valid JS identifier, ignoring restrictions about keywords not being identifiers @@ -35056,84 +37573,161 @@ var ts; */ function isJsxIntrinsicIdentifier(tagName) { // TODO (yuisu): comment - if (tagName.kind === 177 /* PropertyAccessExpression */ || tagName.kind === 98 /* ThisKeyword */) { + if (tagName.kind === 179 /* PropertyAccessExpression */ || tagName.kind === 99 /* ThisKeyword */) { return false; } else { return ts.isIntrinsicJsxName(tagName.text); } } - function checkJsxAttribute(node, elementAttributesType, nameTable) { - var correspondingPropType = undefined; - // Look up the corresponding property for this attribute - if (elementAttributesType === emptyObjectType && isUnhyphenatedJsxName(node.name.text)) { - // If there is no 'props' property, you may not have non-"data-" attributes - error(node.parent, ts.Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property, getJsxElementPropertiesName()); - } - else if (elementAttributesType && !isTypeAny(elementAttributesType)) { - var correspondingPropSymbol = getPropertyOfType(elementAttributesType, node.name.text); - correspondingPropType = correspondingPropSymbol && getTypeOfSymbol(correspondingPropSymbol); - if (isUnhyphenatedJsxName(node.name.text)) { - var attributeType = getTypeOfPropertyOfType(elementAttributesType, ts.getTextOfPropertyName(node.name)) || getIndexTypeOfType(elementAttributesType, 0 /* String */); - if (attributeType) { - correspondingPropType = attributeType; + /** + * Get attributes type of the JSX opening-like element. The result is from resolving "attributes" property of the opening-like element. + * + * @param openingLikeElement a JSX opening-like element + * @param filter a function to remove attributes that will not participate in checking whether attributes are assignable + * @return an anonymous type (similar to the one returned by checkObjectLiteral) in which its properties are attributes property. + * @remarks Because this function calls getSpreadType, it needs to use the same checks as checkObjectLiteral, + * which also calls getSpreadType. + */ + function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, filter, checkMode) { + var attributes = openingLikeElement.attributes; + var attributesTable = ts.createMap(); + var spread = emptyObjectType; + var attributesArray = []; + var hasSpreadAnyType = false; + var typeToIntersect; + var explicitlySpecifyChildrenAttribute = false; + var jsxChildrenPropertyName = getJsxElementChildrenPropertyname(); + for (var _i = 0, _a = attributes.properties; _i < _a.length; _i++) { + var attributeDecl = _a[_i]; + var member = attributeDecl.symbol; + if (ts.isJsxAttribute(attributeDecl)) { + var exprType = attributeDecl.initializer ? + checkExpression(attributeDecl.initializer, checkMode) : + trueType; // is sugar for + var attributeSymbol = createSymbol(4 /* Property */ | 134217728 /* Transient */ | member.flags, member.name); + attributeSymbol.declarations = member.declarations; + attributeSymbol.parent = member.parent; + if (member.valueDeclaration) { + attributeSymbol.valueDeclaration = member.valueDeclaration; + } + attributeSymbol.type = exprType; + attributeSymbol.target = member; + attributesTable.set(attributeSymbol.name, attributeSymbol); + attributesArray.push(attributeSymbol); + if (attributeDecl.name.text === jsxChildrenPropertyName) { + explicitlySpecifyChildrenAttribute = true; + } + } + else { + ts.Debug.assert(attributeDecl.kind === 255 /* JsxSpreadAttribute */); + if (attributesArray.length > 0) { + spread = getSpreadType(spread, createJsxAttributesType(attributes.symbol, attributesTable)); + attributesArray = []; + attributesTable = ts.createMap(); + } + var exprType = checkExpression(attributeDecl.expression); + if (isTypeAny(exprType)) { + hasSpreadAnyType = true; + } + if (isValidSpreadType(exprType)) { + spread = getSpreadType(spread, exprType); } else { - // If there's no corresponding property with this name, error - if (!correspondingPropType) { - error(node.name, ts.Diagnostics.Property_0_does_not_exist_on_type_1, node.name.text, typeToString(elementAttributesType)); - return unknownType; + typeToIntersect = typeToIntersect ? getIntersectionType([typeToIntersect, exprType]) : exprType; + } + } + } + if (!hasSpreadAnyType) { + if (spread !== emptyObjectType) { + if (attributesArray.length > 0) { + spread = getSpreadType(spread, createJsxAttributesType(attributes.symbol, attributesTable)); + attributesArray = []; + attributesTable = ts.createMap(); + } + attributesArray = getPropertiesOfType(spread); + } + attributesTable = ts.createMap(); + if (attributesArray) { + ts.forEach(attributesArray, function (attr) { + if (!filter || filter(attr)) { + attributesTable.set(attr.name, attr); + } + }); + } + } + // Handle children attribute + var parent = openingLikeElement.parent.kind === 249 /* 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 = []; + for (var _b = 0, _c = parent.children; _b < _c.length; _b++) { + var child = _c[_b]; + // In React, JSX text that contains only whitespaces will be ignored so we don't want to type-check that + // because then type of children property will have constituent of string type. + if (child.kind === 10 /* JsxText */) { + if (!child.containsOnlyWhiteSpaces) { + childrenTypes.push(stringType); } } - } - } - var exprType; - if (node.initializer) { - exprType = checkExpression(node.initializer); - } - else { - // is sugar for - exprType = booleanType; - } - if (correspondingPropType) { - checkTypeAssignableTo(exprType, correspondingPropType, node); - } - nameTable[node.name.text] = true; - return exprType; - } - function checkJsxSpreadAttribute(node, elementAttributesType, nameTable) { - if (compilerOptions.jsx === 2 /* React */) { - checkExternalEmitHelpers(node, 2 /* Assign */); - } - var type = checkExpression(node.expression); - var props = getPropertiesOfType(type); - for (var _i = 0, props_2 = props; _i < props_2.length; _i++) { - var prop = props_2[_i]; - // Is there a corresponding property in the element attributes type? Skip checking of properties - // that have already been assigned to, as these are not actually pushed into the resulting type - if (!nameTable[prop.name]) { - var targetPropSym = getPropertyOfType(elementAttributesType, prop.name); - if (targetPropSym) { - var msg = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property, prop.name); - checkTypeAssignableTo(getTypeOfSymbol(prop), getTypeOfSymbol(targetPropSym), node, undefined, msg); + else { + childrenTypes.push(checkExpression(child, checkMode)); } - nameTable[prop.name] = true; + } + if (!hasSpreadAnyType && jsxChildrenPropertyName && jsxChildrenPropertyName !== "") { + // Error if there is a attribute named "children" explicitly specified and children element. + // This is because children element will overwrite the value from attributes. + // Note: we will not warn "children" attribute overwritten if "children" attribute is specified in object spread. + if (explicitlySpecifyChildrenAttribute) { + error(attributes, ts.Diagnostics._0_are_specified_twice_The_attribute_named_0_will_be_overwritten, jsxChildrenPropertyName); + } + // If there are children in the body of JSX element, create dummy attribute "children" with anyType so that it will pass the attribute checking process + var childrenPropSymbol = createSymbol(4 /* Property */ | 134217728 /* Transient */, jsxChildrenPropertyName); + childrenPropSymbol.type = childrenTypes.length === 1 ? + childrenTypes[0] : + createArrayType(getUnionType(childrenTypes, /*subtypeReduction*/ false)); + attributesTable.set(jsxChildrenPropertyName, childrenPropSymbol); } } - return type; - } - function getJsxType(name) { - if (jsxTypes[name] === undefined) { - return jsxTypes[name] = getExportedTypeFromNamespace(JsxNames.JSX, name) || unknownType; + if (hasSpreadAnyType) { + return anyType; + } + var attributeType = createJsxAttributesType(attributes.symbol, attributesTable); + return typeToIntersect && attributesTable.size ? getIntersectionType([typeToIntersect, attributeType]) : + typeToIntersect ? typeToIntersect : attributeType; + /** + * Create anonymous type from given attributes symbol table. + * @param symbol a symbol of JsxAttributes containing attributes corresponding to attributesTable + * @param attributesTable a symbol table of attributes property + */ + function createJsxAttributesType(symbol, attributesTable) { + var result = createAnonymousType(symbol, attributesTable, emptyArray, emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined); + result.flags |= 33554432 /* JsxAttributes */ | 4194304 /* ContainsObjectLiteral */; + result.objectFlags |= 128 /* ObjectLiteral */; + return result; } - return jsxTypes[name]; } /** - * Looks up an intrinsic tag name and returns a symbol that either points to an intrinsic - * property (in which case nodeLinks.jsxFlags will be IntrinsicNamedElement) or an intrinsic - * string index signature (in which case nodeLinks.jsxFlags will be IntrinsicIndexedElement). - * May also return unknownSymbol if both of these lookups fail. - */ + * Check attributes property of opening-like element. This function is called during chooseOverload to get call signature of a JSX opening-like element. + * (See "checkApplicableSignatureForJsxOpeningLikeElement" for how the function is used) + * @param node a JSXAttributes to be resolved of its type + */ + function checkJsxAttributes(node, checkMode) { + return createJsxAttributesTypeFromAttributesProperty(node.parent, /*filter*/ undefined, checkMode); + } + function getJsxType(name) { + var jsxType = jsxTypes.get(name); + if (jsxType === undefined) { + jsxTypes.set(name, jsxType = getExportedTypeFromNamespace(JsxNames.JSX, name) || unknownType); + } + return jsxType; + } + /** + * Looks up an intrinsic tag name and returns a symbol that either points to an intrinsic + * property (in which case nodeLinks.jsxFlags will be IntrinsicNamedElement) or an intrinsic + * string index signature (in which case nodeLinks.jsxFlags will be IntrinsicIndexedElement). + * May also return unknownSymbol if both of these lookups fail. + */ function getIntrinsicTagSymbol(node) { var links = getNodeLinks(node); if (!links.resolvedSymbol) { @@ -35156,7 +37750,7 @@ var ts; return links.resolvedSymbol = unknownSymbol; } else { - if (compilerOptions.noImplicitAny) { + if (noImplicitAny) { error(node, ts.Diagnostics.JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists, JsxNames.IntrinsicElements); } return links.resolvedSymbol = unknownSymbol; @@ -35186,7 +37780,49 @@ var ts; return unknownType; } } - return getUnionType(ts.map(signatures, getReturnTypeOfSignature), /*subtypeReduction*/ true); + var instantiatedSignatures = []; + for (var _i = 0, signatures_3 = signatures; _i < signatures_3.length; _i++) { + var signature = signatures_3[_i]; + if (signature.typeParameters) { + var typeArguments = fillMissingTypeArguments(/*typeArguments*/ undefined, signature.typeParameters, /*minTypeArgumentCount*/ 0); + instantiatedSignatures.push(getSignatureInstantiation(signature, typeArguments)); + } + else { + instantiatedSignatures.push(signature); + } + } + return getUnionType(ts.map(instantiatedSignatures, getReturnTypeOfSignature), /*subtypeReduction*/ true); + } + /** + * 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. + * + * @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); + // JSX.ElementAttributesProperty | JSX.ElementChildrenAttribute [symbol] + var jsxElementAttribPropInterfaceSym = jsxNamespace && getSymbol(jsxNamespace.exports, nameOfAttribPropContainer, 793064 /* Type */); + // JSX.ElementAttributesProperty | JSX.ElementChildrenAttribute [type] + var jsxElementAttribPropInterfaceType = jsxElementAttribPropInterfaceSym && getDeclaredTypeOfSymbol(jsxElementAttribPropInterfaceSym); + // The properties of JSX.ElementAttributesProperty | JSX.ElementChildrenAttribute + var propertiesOfJsxElementAttribPropInterface = jsxElementAttribPropInterfaceType && getPropertiesOfType(jsxElementAttribPropInterfaceType); + if (propertiesOfJsxElementAttribPropInterface) { + // Element Attributes has zero properties, so the element attributes type will be the class instance type + if (propertiesOfJsxElementAttribPropInterface.length === 0) { + return ""; + } + else if (propertiesOfJsxElementAttribPropInterface.length === 1) { + return propertiesOfJsxElementAttribPropInterface[0].name; + } + else if (propertiesOfJsxElementAttribPropInterface.length > 1) { + // More than one property on ElementAttributesProperty is an error + error(jsxElementAttribPropInterfaceSym.declarations[0], ts.Diagnostics.The_global_type_JSX_0_may_not_have_more_than_one_property, nameOfAttribPropContainer); + } + } + return undefined; } /// e.g. "props" for React.d.ts, /// or 'undefined' if ElementAttributesProperty doesn't exist (which means all @@ -35194,55 +37830,163 @@ var ts; /// or '' if it has 0 properties (which means every /// non-intrinsic elements' attributes type is the element instance type) function getJsxElementPropertiesName() { - // JSX - var jsxNamespace = getGlobalSymbol(JsxNames.JSX, 1920 /* Namespace */, /*diagnosticMessage*/ undefined); - // JSX.ElementAttributesProperty [symbol] - var attribsPropTypeSym = jsxNamespace && getSymbol(jsxNamespace.exports, JsxNames.ElementAttributesPropertyNameContainer, 793064 /* Type */); - // JSX.ElementAttributesProperty [type] - var attribPropType = attribsPropTypeSym && getDeclaredTypeOfSymbol(attribsPropTypeSym); - // The properties of JSX.ElementAttributesProperty - var attribProperties = attribPropType && getPropertiesOfType(attribPropType); - if (attribProperties) { - // Element Attributes has zero properties, so the element attributes type will be the class instance type - if (attribProperties.length === 0) { - return ""; - } - else if (attribProperties.length === 1) { - return attribProperties[0].name; - } - else { - error(attribsPropTypeSym.declarations[0], ts.Diagnostics.The_global_type_JSX_0_may_not_have_more_than_one_property, JsxNames.ElementAttributesPropertyNameContainer); - return undefined; - } + if (!_hasComputedJsxElementPropertiesName) { + _hasComputedJsxElementPropertiesName = true; + _jsxElementPropertiesName = getNameFromJsxElementAttributesContainer(JsxNames.ElementAttributesPropertyNameContainer); } - else { - // No interface exists, so the element attributes type will be an implicit any + return _jsxElementPropertiesName; + } + function getJsxElementChildrenPropertyname() { + if (!_hasComputedJsxElementChildrenPropertyName) { + _hasComputedJsxElementChildrenPropertyName = true; + _jsxElementChildrenPropertyName = getNameFromJsxElementAttributesContainer(JsxNames.ElementChildrenAttributeNameContainer); + } + return _jsxElementChildrenPropertyName; + } + function getApparentTypeOfJsxPropsType(propsType) { + if (!propsType) { return undefined; } + if (propsType.flags & 131072 /* Intersection */) { + var propsApparentType = []; + for (var _i = 0, _a = propsType.types; _i < _a.length; _i++) { + var t = _a[_i]; + propsApparentType.push(getApparentType(t)); + } + return getIntersectionType(propsApparentType); + } + return getApparentType(propsType); } /** - * Given React element instance type and the class type, resolve the Jsx type - * Pass elemType to handle individual type in the union typed element type. + * Get JSX attributes type by trying to resolve openingLikeElement as a stateless function component. + * Return only attributes type of successfully resolved call signature. + * This function assumes that the caller handled other possible element type of the JSX element (e.g. stateful component) + * Unlike tryGetAllJsxStatelessFunctionAttributesType, this function is a default behavior of type-checkers. + * @param openingLikeElement a JSX opening-like element to find attributes type + * @param elementType a type of the opening-like element. This elementType can't be an union type + * @param elemInstanceType an element instance type (the result of newing or invoking this tag) + * @param elementClassType a JSX-ElementClass type. This is a result of looking up ElementClass interface in the JSX global */ - function getResolvedJsxType(node, elemType, elemClassType) { - if (!elemType) { - elemType = checkExpression(node.tagName); + function defaultTryGetJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType) { + ts.Debug.assert(!(elementType.flags & 65536 /* Union */)); + if (!elementClassType || !isTypeAssignableTo(elemInstanceType, elementClassType)) { + var jsxStatelessElementType = getJsxGlobalStatelessElementType(); + 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); + if (callSignature !== unknownSignature) { + var callReturnType = callSignature && getReturnTypeOfSignature(callSignature); + var paramType = callReturnType && (callSignature.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(callSignature.parameters[0])); + paramType = getApparentTypeOfJsxPropsType(paramType); + if (callReturnType && isTypeAssignableTo(callReturnType, jsxStatelessElementType)) { + // Intersect in JSX.IntrinsicAttributes if it exists + var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); + if (intrinsicAttributes !== unknownType) { + paramType = intersectTypes(intrinsicAttributes, paramType); + } + return paramType; + } + } + } } - if (elemType.flags & 65536 /* Union */) { - var types = elemType.types; - return getUnionType(ts.map(types, function (type) { - return getResolvedJsxType(node, type, elemClassType); + return undefined; + } + /** + * Get JSX attributes type by trying to resolve openingLikeElement as a stateless function component. + * Return all attributes type of resolved call signature including candidate signatures. + * This function assumes that the caller handled other possible element type of the JSX element. + * This function is a behavior used by language service when looking up completion in JSX element. + * @param openingLikeElement a JSX opening-like element to find attributes type + * @param elementType a type of the opening-like element. This elementType can't be an union type + * @param elemInstanceType an element instance type (the result of newing or invoking this tag) + * @param elementClassType a JSX-ElementClass type. This is a result of looking up ElementClass interface in the JSX global + */ + function tryGetAllJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType) { + ts.Debug.assert(!(elementType.flags & 65536 /* 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(); + if (jsxStatelessElementType) { + // We don't call getResolvedSignature because here we have already resolve the type of JSX Element. + var candidatesOutArray = []; + getResolvedJsxStatelessFunctionSignature(openingLikeElement, elementType, candidatesOutArray); + var result = void 0; + var allMatchingAttributesType = void 0; + for (var _i = 0, candidatesOutArray_1 = candidatesOutArray; _i < candidatesOutArray_1.length; _i++) { + var candidate = candidatesOutArray_1[_i]; + var callReturnType = getReturnTypeOfSignature(candidate); + var paramType = callReturnType && (candidate.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(candidate.parameters[0])); + paramType = getApparentTypeOfJsxPropsType(paramType); + if (callReturnType && isTypeAssignableTo(callReturnType, jsxStatelessElementType)) { + var shouldBeCandidate = true; + for (var _a = 0, _b = openingLikeElement.attributes.properties; _a < _b.length; _a++) { + var attribute = _b[_a]; + if (ts.isJsxAttribute(attribute) && + isUnhyphenatedJsxName(attribute.name.text) && + !getPropertyOfType(paramType, attribute.name.text)) { + shouldBeCandidate = false; + break; + } + } + if (shouldBeCandidate) { + result = intersectTypes(result, paramType); + } + allMatchingAttributesType = intersectTypes(allMatchingAttributesType, paramType); + } + } + // If we can't find any matching, just return everything. + if (!result) { + result = allMatchingAttributesType; + } + // Intersect in JSX.IntrinsicAttributes if it exists + var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); + if (intrinsicAttributes !== unknownType) { + result = intersectTypes(intrinsicAttributes, result); + } + return result; + } + } + return undefined; + } + /** + * Resolve attributes type of the given opening-like element. The attributes type is a type of attributes associated with the given elementType. + * For instance: + * declare function Foo(attr: { p1: string}): JSX.Element; + * ; // This function will try resolve "Foo" and return an attributes type of "Foo" which is "{ p1: string }" + * + * The function is intended to initially be called from getAttributesTypeFromJsxOpeningLikeElement which already handle JSX-intrinsic-element.. + * This function will try to resolve custom JSX attributes type in following order: string literal, stateless function, and stateful component + * + * @param openingLikeElement a non-intrinsic JSXOPeningLikeElement + * @param shouldIncludeAllStatelessAttributesType a boolean indicating whether to include all attributes types from all stateless function signature + * @param elementType an instance type of the given opening-like element. If undefined, the function will check type openinglikeElement's tagname. + * @param elementClassType a JSX-ElementClass type. This is a result of looking up ElementClass interface in the JSX global (imported from react.d.ts) + * @return attributes type if able to resolve the type of node + * anyType if there is no type ElementAttributesProperty or there is an error + * emptyObjectType if there is no "prop" in the element instance type + */ + function resolveCustomJsxElementAttributesType(openingLikeElement, shouldIncludeAllStatelessAttributesType, elementType, elementClassType) { + if (!elementType) { + elementType = checkExpression(openingLikeElement.tagName); + } + if (elementType.flags & 65536 /* Union */) { + var types = elementType.types; + return getUnionType(types.map(function (type) { + return resolveCustomJsxElementAttributesType(openingLikeElement, shouldIncludeAllStatelessAttributesType, type, elementClassType); }), /*subtypeReduction*/ true); } // 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 (elemType.flags & 2 /* String */) { + if (elementType.flags & 2 /* String */) { return anyType; } - else if (elemType.flags & 32 /* StringLiteral */) { + else if (elementType.flags & 32 /* StringLiteral */) { // If the elemType is a stringLiteral type, we can then provide a check to make sure that the string literal type is one of the Jsx intrinsic element type + // For example: + // var CustomTag: "h1" = "h1"; + // Hello World var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements); if (intrinsicElementsType !== unknownType) { - var stringLiteralTypeName = elemType.text; + var stringLiteralTypeName = elementType.text; var intrinsicProp = getPropertyOfType(intrinsicElementsType, stringLiteralTypeName); if (intrinsicProp) { return getTypeOfSymbol(intrinsicProp); @@ -35251,34 +37995,24 @@ var ts; if (indexSignatureType) { return indexSignatureType; } - error(node, ts.Diagnostics.Property_0_does_not_exist_on_type_1, stringLiteralTypeName, "JSX." + JsxNames.IntrinsicElements); + error(openingLikeElement, ts.Diagnostics.Property_0_does_not_exist_on_type_1, stringLiteralTypeName, "JSX." + JsxNames.IntrinsicElements); } // If we need to report an error, we already done so here. So just return any to prevent any more error downstream return anyType; } // Get the element instance type (the result of newing or invoking this tag) - var elemInstanceType = getJsxElementInstanceType(node, elemType); - if (!elemClassType || !isTypeAssignableTo(elemInstanceType, elemClassType)) { - // Is this is a stateless function component? See if its single signature's return type is - // assignable to the JSX Element Type - if (jsxElementType) { - var callSignatures = elemType && getSignaturesOfType(elemType, 0 /* Call */); - var callSignature = callSignatures && callSignatures.length > 0 && callSignatures[0]; - var callReturnType = callSignature && getReturnTypeOfSignature(callSignature); - var paramType = callReturnType && (callSignature.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(callSignature.parameters[0])); - if (callReturnType && isTypeAssignableTo(callReturnType, jsxElementType)) { - // Intersect in JSX.IntrinsicAttributes if it exists - var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); - if (intrinsicAttributes !== unknownType) { - paramType = intersectTypes(intrinsicAttributes, paramType); - } - return paramType; - } - } + var elemInstanceType = getJsxElementInstanceType(openingLikeElement, elementType); + // If we should include all stateless attributes type, then get all attributes type from all stateless function signature. + // Otherwise get only attributes type from the signature picked by choose-overload logic. + var statelessAttributesType = shouldIncludeAllStatelessAttributesType ? + tryGetAllJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType) : + defaultTryGetJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType); + if (statelessAttributesType) { + return statelessAttributesType; } // Issue an error if this return type isn't assignable to JSX.ElementClass - if (elemClassType) { - checkTypeRelatedTo(elemInstanceType, elemClassType, assignableRelation, node, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements); + if (elementClassType) { + checkTypeRelatedTo(elemInstanceType, elementClassType, assignableRelation, openingLikeElement, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements); } if (isTypeAny(elemInstanceType)) { return elemInstanceType; @@ -35302,11 +38036,6 @@ var ts; // Props is of type 'any' or unknown return attributesType; } - else if (attributesType.flags & 65536 /* Union */) { - // Props cannot be a union type - error(node.tagName, ts.Diagnostics.JSX_element_attributes_type_0_may_not_be_a_union_type, typeToString(attributesType)); - return anyType; - } else { // Normal case -- add in IntrinsicClassElements and IntrinsicElements var apparentAttributesType = attributesType; @@ -35331,30 +38060,68 @@ var ts; } } /** - * Given an opening/self-closing element, get the 'element attributes type', i.e. the type that tells - * us which attributes are valid on a given element. + * Get attributes type of the given intrinsic opening-like Jsx element by resolving the tag name. + * The function is intended to be called from a function which has checked that the opening element is an intrinsic element. + * @param node an intrinsic JSX opening-like element */ - function getJsxElementAttributesType(node) { + function getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node) { + ts.Debug.assert(isJsxIntrinsicIdentifier(node.tagName)); var links = getNodeLinks(node); - if (!links.resolvedJsxType) { - if (isJsxIntrinsicIdentifier(node.tagName)) { - var symbol = getIntrinsicTagSymbol(node); - if (links.jsxFlags & 1 /* IntrinsicNamedElement */) { - return links.resolvedJsxType = getTypeOfSymbol(symbol); - } - else if (links.jsxFlags & 2 /* IntrinsicIndexedElement */) { - return links.resolvedJsxType = getIndexInfoOfSymbol(symbol, 0 /* String */).type; - } - else { - return links.resolvedJsxType = unknownType; - } + if (!links.resolvedJsxElementAttributesType) { + var symbol = getIntrinsicTagSymbol(node); + if (links.jsxFlags & 1 /* IntrinsicNamedElement */) { + return links.resolvedJsxElementAttributesType = getTypeOfSymbol(symbol); + } + else if (links.jsxFlags & 2 /* IntrinsicIndexedElement */) { + return links.resolvedJsxElementAttributesType = getIndexInfoOfSymbol(symbol, 0 /* String */).type; } else { - var elemClassType = getJsxGlobalElementClassType(); - return links.resolvedJsxType = getResolvedJsxType(node, undefined, elemClassType); + return links.resolvedJsxElementAttributesType = unknownType; } } - return links.resolvedJsxType; + return links.resolvedJsxElementAttributesType; + } + /** + * Get attributes type of the given custom opening-like JSX element. + * This function is intended to be called from a caller that handles intrinsic JSX element already. + * @param node a custom JSX opening-like element + * @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) { + var links = getNodeLinks(node); + if (!links.resolvedJsxElementAttributesType) { + var elemClassType = getJsxGlobalElementClassType(); + return links.resolvedJsxElementAttributesType = resolveCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType, /*elementType*/ undefined, elemClassType); + } + return links.resolvedJsxElementAttributesType; + } + /** + * Get all possible attributes type, especially from an overload stateless function component, of the given JSX opening-like element. + * This function is called by language service (see: completions-tryGetGlobalSymbols). + * @param node a JSX opening-like element to get attributes type for + */ + function getAllAttributesTypeFromJsxOpeningLikeElement(node) { + if (isJsxIntrinsicIdentifier(node.tagName)) { + return getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node); + } + else { + // Because in language service, the given JSX opening-like element may be incomplete and therefore, + // we can't resolve to exact signature if the element is a stateless function component so the best thing to do is return all attributes type from all overloads. + return getCustomJsxElementAttributesType(node, /*shouldIncludeAllStatelessAttributesType*/ true); + } + } + /** + * Get the attributes type, which indicates the attributes that are valid on the given JSXOpeningLikeElement. + * @param node a JSXOpeningLikeElement node + * @return an attributes type of the given node + */ + function getAttributesTypeFromJsxOpeningLikeElement(node) { + if (isJsxIntrinsicIdentifier(node.tagName)) { + return getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node); + } + else { + return getCustomJsxElementAttributesType(node, /*shouldIncludeAllStatelessAttributesType*/ false); + } } /** * Given a JSX attribute, returns the symbol for the corresponds property @@ -35362,17 +38129,34 @@ var ts; * that have no matching element attributes type property. */ function getJsxAttributePropertySymbol(attrib) { - var attributesType = getJsxElementAttributesType(attrib.parent); + var attributesType = getAttributesTypeFromJsxOpeningLikeElement(attrib.parent.parent); var prop = getPropertyOfType(attributesType, attrib.name.text); return prop || unknownSymbol; } function getJsxGlobalElementClassType() { - if (!jsxElementClassType) { - jsxElementClassType = getExportedTypeFromNamespace(JsxNames.JSX, JsxNames.ElementClass); + if (!deferredJsxElementClassType) { + deferredJsxElementClassType = getExportedTypeFromNamespace(JsxNames.JSX, JsxNames.ElementClass); } - return jsxElementClassType; + return deferredJsxElementClassType; } - /// Returns all the properties of the Jsx.IntrinsicElements interface + function getJsxGlobalElementType() { + if (!deferredJsxElementType) { + deferredJsxElementType = getExportedTypeFromNamespace(JsxNames.JSX, JsxNames.Element); + } + return deferredJsxElementType; + } + function getJsxGlobalStatelessElementType() { + if (!deferredJsxStatelessElementType) { + var jsxElementType = getJsxGlobalElementType(); + if (jsxElementType) { + deferredJsxStatelessElementType = getUnionType([jsxElementType, nullType]); + } + } + return deferredJsxStatelessElementType; + } + /** + * Returns all the properties of the Jsx.IntrinsicElements interface + */ function getJsxIntrinsicTagNames() { var intrinsics = getJsxType(JsxNames.IntrinsicElements); return intrinsics ? getPropertiesOfType(intrinsics) : emptyArray; @@ -35382,8 +38166,8 @@ var ts; if ((compilerOptions.jsx || 0 /* None */) === 0 /* None */) { error(errorNode, ts.Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided); } - if (jsxElementType === undefined) { - if (compilerOptions.noImplicitAny) { + if (getJsxGlobalElementType() === undefined) { + if (noImplicitAny) { error(errorNode, ts.Diagnostics.JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist); } } @@ -35405,39 +38189,87 @@ var ts; markAliasSymbolAsReferenced(reactSym); } } - var targetAttributesType = getJsxElementAttributesType(node); - var nameTable = ts.createMap(); - // Process this array in right-to-left order so we know which - // attributes (mostly from spreads) are being overwritten and - // thus should have their types ignored - var sawSpreadedAny = false; - for (var i = node.attributes.length - 1; i >= 0; i--) { - if (node.attributes[i].kind === 250 /* JsxAttribute */) { - checkJsxAttribute((node.attributes[i]), targetAttributesType, nameTable); + checkJsxAttributesAssignableToTagNameAttributes(node); + } + /** + * Check if a property with the given name is known anywhere in the given type. In an object type, a property + * is considered known if the object type is empty and the check is for assignability, if the object type has + * index signatures, or if the property is actually declared in the object type. In a union or intersection + * type, a property is considered known if it is known in any constituent type. + * @param targetType a type to search a given name in + * @param name a property name to search + * @param isComparingJsxAttributes a boolean flag indicating whether we are searching in JsxAttributesType + */ + function isKnownProperty(targetType, name, isComparingJsxAttributes) { + if (targetType.flags & 32768 /* Object */) { + var resolved = resolveStructuredTypeMembers(targetType); + if (resolved.stringIndexInfo || resolved.numberIndexInfo && isNumericLiteralName(name) || + getPropertyOfType(targetType, name) || isComparingJsxAttributes && !isUnhyphenatedJsxName(name)) { + // For JSXAttributes, if the attribute has a hyphenated name, consider that the attribute to be known. + return true; } - else { - ts.Debug.assert(node.attributes[i].kind === 251 /* JsxSpreadAttribute */); - var spreadType = checkJsxSpreadAttribute((node.attributes[i]), targetAttributesType, nameTable); - if (isTypeAny(spreadType)) { - sawSpreadedAny = true; + } + else if (targetType.flags & 196608 /* UnionOrIntersection */) { + for (var _i = 0, _a = targetType.types; _i < _a.length; _i++) { + var t = _a[_i]; + if (isKnownProperty(t, name, isComparingJsxAttributes)) { + return true; } } } - // Check that all required properties have been provided. If an 'any' - // was spreaded in, though, assume that it provided all required properties - if (targetAttributesType && !sawSpreadedAny) { - var targetProperties = getPropertiesOfType(targetAttributesType); - for (var i = 0; i < targetProperties.length; i++) { - if (!(targetProperties[i].flags & 536870912 /* Optional */) && - !nameTable[targetProperties[i].name]) { - error(node, ts.Diagnostics.Property_0_is_missing_in_type_1, targetProperties[i].name, typeToString(targetAttributesType)); + return false; + } + /** + * Check whether the given attributes of JSX opening-like element is assignable to the tagName attributes. + * Get the attributes type of the opening-like element through resolving the tagName, "target attributes" + * Check assignablity between given attributes property, "source attributes", and the "target attributes" + * @param openingLikeElement an opening-like JSX element to check its JSXAttributes + */ + function checkJsxAttributesAssignableToTagNameAttributes(openingLikeElement) { + // The function involves following steps: + // 1. Figure out expected attributes type by resolving tagName of the JSX opening-like element, targetAttributesType. + // During these steps, we will try to resolve the tagName as intrinsic name, stateless function, stateful component (in the order) + // 2. Solved JSX attributes type given by users, sourceAttributesType, which is by resolving "attributes" property of the JSX opening-like element. + // 3. Check if the two are assignable to each other + // targetAttributesType is a type of an attributes from resolving tagName of an opening-like JSX element. + var targetAttributesType = isJsxIntrinsicIdentifier(openingLikeElement.tagName) ? + getIntrinsicAttributesTypeFromJsxOpeningLikeElement(openingLikeElement) : + getCustomJsxElementAttributesType(openingLikeElement, /*shouldIncludeAllStatelessAttributesType*/ false); + // sourceAttributesType is a type of an attributes properties. + // i.e
+ // attr1 and attr2 are treated as JSXAttributes attached in the JsxOpeningLikeElement as "attributes". + var sourceAttributesType = createJsxAttributesTypeFromAttributesProperty(openingLikeElement, function (attribute) { + return isUnhyphenatedJsxName(attribute.name) || !!(getPropertyOfType(targetAttributesType, attribute.name)); + }); + // 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, getJsxElementPropertiesName()); + } + else { + // Check if sourceAttributesType assignable to targetAttributesType though this check will allow excess properties + var isSourceAttributeTypeAssignableToTarget = checkTypeAssignableTo(sourceAttributesType, targetAttributesType, openingLikeElement.attributes.properties.length > 0 ? openingLikeElement.attributes : openingLikeElement); + // After we check for assignability, we will do another pass to check that all explicitly specified attributes have correct name corresponding in targetAttributeType. + // This will allow excess properties in spread type as it is very common pattern to spread outter attributes into React component in its render method. + if (isSourceAttributeTypeAssignableToTarget && !isTypeAny(sourceAttributesType) && !isTypeAny(targetAttributesType)) { + for (var _i = 0, _a = openingLikeElement.attributes.properties; _i < _a.length; _i++) { + var attribute = _a[_i]; + if (ts.isJsxAttribute(attribute) && !isKnownProperty(targetAttributesType, attribute.name.text, /*isComparingJsxAttributes*/ true)) { + error(attribute, ts.Diagnostics.Property_0_does_not_exist_on_type_1, attribute.name.text, typeToString(targetAttributesType)); + // We break here so that errors won't be cascading + break; + } } } } } - function checkJsxExpression(node) { + function checkJsxExpression(node, checkMode) { if (node.expression) { - return checkExpression(node.expression); + var type = checkExpression(node.expression, checkMode); + if (node.dotDotDotToken && type !== anyType && !isArrayType(type)) { + error(node, ts.Diagnostics.JSX_spread_child_must_be_an_array_type, node.toString(), typeToString(type)); + } + return type; } else { return unknownType; @@ -35446,14 +38278,32 @@ 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 : 147 /* PropertyDeclaration */; + return s.valueDeclaration ? s.valueDeclaration.kind : 149 /* PropertyDeclaration */; } function getDeclarationModifierFlagsFromSymbol(s) { - return s.valueDeclaration ? ts.getCombinedModifierFlags(s.valueDeclaration) : s.flags & 134217728 /* Prototype */ ? 4 /* Public */ | 32 /* Static */ : 0; + if (s.valueDeclaration) { + var flags = ts.getCombinedModifierFlags(s.valueDeclaration); + return s.parent && s.parent.flags & 32 /* Class */ ? flags : flags & ~28 /* AccessibilityModifier */; + } + if (getCheckFlags(s) & 6 /* Synthetic */) { + var checkFlags = s.checkFlags; + var accessModifier = checkFlags & 256 /* ContainsPrivate */ ? 8 /* Private */ : + checkFlags & 64 /* ContainsPublic */ ? 4 /* Public */ : + 16 /* Protected */; + var staticModifier = checkFlags & 512 /* ContainsStatic */ ? 32 /* Static */ : 0; + return accessModifier | staticModifier; + } + if (s.flags & 16777216 /* Prototype */) { + return 4 /* Public */ | 32 /* Static */; + } + return 0; } function getDeclarationNodeFlagsFromSymbol(s) { return s.valueDeclaration ? ts.getCombinedNodeFlags(s.valueDeclaration) : 0; } + function isMethodLike(symbol) { + return !!(symbol.flags & 8192 /* Method */ || getCheckFlags(symbol) & 4 /* SyntheticMethod */); + } /** * Check whether the requested property access is valid. * Returns true if node is a valid property access, and false otherwise. @@ -35462,13 +38312,17 @@ var ts; * @param type The type of left. * @param prop The symbol for the right hand side of the property access. */ - function checkClassPropertyAccess(node, left, type, prop) { + function checkPropertyAccessibility(node, left, type, prop) { var flags = getDeclarationModifierFlagsFromSymbol(prop); - var declaringClass = getDeclaredTypeOfSymbol(getParentOfSymbol(prop)); - var errorNode = node.kind === 177 /* PropertyAccessExpression */ || node.kind === 223 /* VariableDeclaration */ ? + var errorNode = node.kind === 179 /* PropertyAccessExpression */ || node.kind === 226 /* VariableDeclaration */ ? node.name : node.right; - if (left.kind === 96 /* SuperKeyword */) { + if (getCheckFlags(prop) & 256 /* ContainsPrivate */) { + // Synthetic property with private constituent property + error(errorNode, ts.Diagnostics.Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1, symbolToString(prop), typeToString(type)); + return false; + } + if (left.kind === 97 /* SuperKeyword */) { // TS 1.0 spec (April 2014): 4.8.2 // - In a constructor, instance member function, instance member accessor, or // instance member variable initializer where this references a derived class instance, @@ -35476,18 +38330,22 @@ var ts; // - In a static member function or static member accessor // where this references the constructor function object of a derived class, // a super property access is permitted and must specify a public static member function of the base class. - if (languageVersion < 2 /* ES2015 */ && getDeclarationKindFromSymbol(prop) !== 149 /* MethodDeclaration */) { - // `prop` refers to a *property* declared in the super class - // rather than a *method*, so it does not satisfy the above criteria. - error(errorNode, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); - return false; + if (languageVersion < 2 /* ES2015 */) { + var hasNonMethodDeclaration = forEachProperty(prop, function (p) { + var propKind = getDeclarationKindFromSymbol(p); + return propKind !== 151 /* MethodDeclaration */ && propKind !== 150 /* MethodSignature */; + }); + if (hasNonMethodDeclaration) { + error(errorNode, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); + return false; + } } if (flags & 128 /* Abstract */) { // A method cannot be accessed in a super property access if the method is abstract. // This error could mask a private property access error. But, a member // cannot simultaneously be private and abstract, so this will trigger an // additional error elsewhere. - error(errorNode, ts.Diagnostics.Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression, symbolToString(prop), typeToString(declaringClass)); + error(errorNode, ts.Diagnostics.Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression, symbolToString(prop), typeToString(getDeclaringClass(prop))); return false; } } @@ -35500,24 +38358,25 @@ var ts; if (flags & 8 /* Private */) { var declaringClassDeclaration = getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop)); if (!isNodeWithinClass(node, declaringClassDeclaration)) { - error(errorNode, ts.Diagnostics.Property_0_is_private_and_only_accessible_within_class_1, symbolToString(prop), typeToString(declaringClass)); + error(errorNode, ts.Diagnostics.Property_0_is_private_and_only_accessible_within_class_1, symbolToString(prop), typeToString(getDeclaringClass(prop))); return false; } return true; } // Property is known to be protected at this point // All protected properties of a supertype are accessible in a super access - if (left.kind === 96 /* SuperKeyword */) { + if (left.kind === 97 /* SuperKeyword */) { return true; } - // Get the enclosing class that has the declaring class as its base type + // Find the first enclosing class that has the declaring classes of the protected constituents + // of the property as base classes var enclosingClass = forEachEnclosingClass(node, function (enclosingDeclaration) { var enclosingClass = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingDeclaration)); - return hasBaseType(enclosingClass, declaringClass) ? enclosingClass : undefined; + return isClassDerivedFromDeclaringClasses(enclosingClass, prop) ? enclosingClass : undefined; }); // A protected property is accessible if the property is within the declaring class or classes derived from it if (!enclosingClass) { - error(errorNode, ts.Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString(prop), typeToString(declaringClass)); + error(errorNode, ts.Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString(prop), typeToString(getDeclaringClass(prop) || type)); return false; } // No further restrictions for static properties @@ -35529,7 +38388,6 @@ var ts; // get the original type -- represented as the type constraint of the 'this' type type = getConstraintOfTypeParameter(type); } - // TODO: why is the first part of this check here? if (!(getObjectFlags(getTargetType(type)) & 3 /* ClassOrInterface */ && hasBaseType(type, enclosingClass))) { error(errorNode, ts.Diagnostics.Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1, symbolToString(prop), typeToString(enclosingClass)); return false; @@ -35537,16 +38395,17 @@ var ts; return true; } function checkNonNullExpression(node) { - var type = checkExpression(node); - if (strictNullChecks) { - var kind = getFalsyFlags(type) & 6144 /* Nullable */; - if (kind) { - error(node, kind & 2048 /* Undefined */ ? kind & 4096 /* Null */ ? - ts.Diagnostics.Object_is_possibly_null_or_undefined : - ts.Diagnostics.Object_is_possibly_undefined : - ts.Diagnostics.Object_is_possibly_null); - } - return getNonNullableType(type); + return checkNonNullType(checkExpression(node), node); + } + function checkNonNullType(type, errorNode) { + var kind = (strictNullChecks ? getFalsyFlags(type) : type.flags) & 6144 /* Nullable */; + if (kind) { + error(errorNode, kind & 2048 /* Undefined */ ? kind & 4096 /* Null */ ? + ts.Diagnostics.Object_is_possibly_null_or_undefined : + ts.Diagnostics.Object_is_possibly_undefined : + ts.Diagnostics.Object_is_possibly_null); + var t = getNonNullableType(type); + return t.flags & (6144 /* Nullable */ | 8192 /* Never */) ? unknownType : t; } return type; } @@ -35575,7 +38434,7 @@ var ts; noUnusedIdentifiers && (prop.flags & 106500 /* ClassMember */) && prop.valueDeclaration && (ts.getModifierFlags(prop.valueDeclaration) & 8 /* Private */)) { - if (prop.flags & 16777216 /* Instantiated */) { + if (getCheckFlags(prop) & 1 /* Instantiated */) { getSymbolLinks(prop).target.isReferenced = true; } else { @@ -35583,6 +38442,15 @@ var ts; } } } + function isInPropertyInitializer(node) { + while (node) { + if (node.parent && node.parent.kind === 149 /* PropertyDeclaration */ && node.parent.initializer === node) { + return true; + } + node = node.parent; + } + return false; + } function checkPropertyAccessExpressionOrQualifiedName(node, left, right) { var type = checkNonNullExpression(left); if (isTypeAny(type) || type === silentNeverType) { @@ -35595,16 +38463,30 @@ var ts; } var prop = getPropertyOfType(apparentType, right.text); if (!prop) { + var stringIndexType = getIndexTypeOfType(apparentType, 0 /* String */); + if (stringIndexType) { + return stringIndexType; + } if (right.text && !checkAndReportErrorForExtendingInterface(node)) { reportNonexistentProperty(right, type.flags & 16384 /* TypeParameter */ && type.isThisType ? apparentType : type); } return unknownType; } + if (prop.valueDeclaration) { + if (isInPropertyInitializer(node) && + !isBlockScopedNameDeclaredBeforeUse(prop.valueDeclaration, right)) { + error(right, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, right.text); + } + if (prop.valueDeclaration.kind === 229 /* ClassDeclaration */ && + node.parent && node.parent.kind !== 159 /* TypeReference */ && + !ts.isInAmbientContext(prop.valueDeclaration) && + !isBlockScopedNameDeclaredBeforeUse(prop.valueDeclaration, right)) { + error(right, ts.Diagnostics.Class_0_used_before_its_declaration, right.text); + } + } markPropertyAsReferenced(prop); getNodeLinks(node).resolvedSymbol = prop; - if (prop.parent && prop.parent.flags & 32 /* Class */) { - checkClassPropertyAccess(node, left, apparentType, prop); - } + checkPropertyAccessibility(node, left, apparentType, prop); var propType = getTypeOfSymbol(prop); var assignmentKind = ts.getAssignmentTargetKind(node); if (assignmentKind) { @@ -35616,23 +38498,23 @@ var ts; // 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 !== 177 /* PropertyAccessExpression */ || assignmentKind === 1 /* Definite */ || + if (node.kind !== 179 /* PropertyAccessExpression */ || assignmentKind === 1 /* Definite */ || !(prop.flags & (3 /* Variable */ | 4 /* Property */ | 98304 /* Accessor */)) && !(prop.flags & 8192 /* Method */ && propType.flags & 65536 /* Union */)) { return propType; } - var flowType = getFlowTypeOfReference(node, propType, /*assumeInitialized*/ true, /*flowContainer*/ undefined); + var flowType = getFlowTypeOfReference(node, propType); return assignmentKind ? getBaseTypeOfLiteralType(flowType) : flowType; } function isValidPropertyAccess(node, propertyName) { - var left = node.kind === 177 /* PropertyAccessExpression */ + var left = node.kind === 179 /* PropertyAccessExpression */ ? node.expression : node.left; var type = checkExpression(left); if (type !== unknownType && !isTypeAny(type)) { var prop = getPropertyOfType(getWidenedType(type), propertyName); - if (prop && prop.parent && prop.parent.flags & 32 /* Class */) { - return checkClassPropertyAccess(node, left, type, prop); + if (prop) { + return checkPropertyAccessibility(node, left, type, prop); } } return true; @@ -35642,13 +38524,13 @@ var ts; */ function getForInVariableSymbol(node) { var initializer = node.initializer; - if (initializer.kind === 224 /* VariableDeclarationList */) { + if (initializer.kind === 227 /* VariableDeclarationList */) { var variable = initializer.declarations[0]; if (variable && !ts.isBindingPattern(variable.name)) { return getSymbolOfNode(variable); } } - else if (initializer.kind === 70 /* Identifier */) { + else if (initializer.kind === 71 /* Identifier */) { return getResolvedSymbol(initializer); } return undefined; @@ -35665,13 +38547,13 @@ var ts; */ function isForInVariableForNumericPropertyNames(expr) { var e = ts.skipParentheses(expr); - if (e.kind === 70 /* Identifier */) { + if (e.kind === 71 /* Identifier */) { var symbol = getResolvedSymbol(e); if (symbol.flags & 3 /* Variable */) { var child = expr; var node = expr.parent; while (node) { - if (node.kind === 212 /* ForInStatement */ && + if (node.kind === 215 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { @@ -35689,7 +38571,7 @@ var ts; var indexExpression = node.argumentExpression; if (!indexExpression) { var sourceFile = ts.getSourceFileOfNode(node); - if (node.parent.kind === 180 /* NewExpression */ && node.parent.expression === node) { + if (node.parent.kind === 182 /* 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); @@ -35709,7 +38591,7 @@ var ts; error(indexExpression, ts.Diagnostics.A_const_enum_member_can_only_be_accessed_using_a_string_literal); return unknownType; } - return getIndexedAccessType(objectType, indexType, node); + return checkIndexedAccessIndexType(getIndexedAccessType(objectType, indexType, node), node); } function checkThatExpressionIsProperSymbolReference(expression, expressionType, reportError) { if (expressionType === unknownType) { @@ -35733,7 +38615,7 @@ var ts; if (!leftHandSideSymbol) { return false; } - var globalESSymbol = getGlobalESSymbolConstructorSymbol(); + var globalESSymbol = getGlobalESSymbolConstructorSymbol(/*reportErrors*/ true); if (!globalESSymbol) { // Already errored when we tried to look up the symbol return false; @@ -35747,10 +38629,10 @@ var ts; return true; } function resolveUntypedCall(node) { - if (node.kind === 181 /* TaggedTemplateExpression */) { + if (node.kind === 183 /* TaggedTemplateExpression */) { checkExpression(node.template); } - else if (node.kind !== 145 /* Decorator */) { + else if (node.kind !== 147 /* Decorator */) { ts.forEach(node.arguments, function (argument) { checkExpression(argument); }); @@ -35777,16 +38659,16 @@ var ts; var specializedIndex = -1; var spliceIndex; ts.Debug.assert(!result.length); - for (var _i = 0, signatures_2 = signatures; _i < signatures_2.length; _i++) { - var signature = signatures_2[_i]; + for (var _i = 0, signatures_4 = signatures; _i < signatures_4.length; _i++) { + var signature = signatures_4[_i]; var symbol = signature.declaration && getSymbolOfNode(signature.declaration); - var parent_9 = signature.declaration && signature.declaration.parent; + var parent = signature.declaration && signature.declaration.parent; if (!lastSymbol || symbol === lastSymbol) { - if (lastParent && parent_9 === lastParent) { + if (lastParent && parent === lastParent) { index++; } else { - lastParent = parent_9; + lastParent = parent; index = cutoffIndex; } } @@ -35794,7 +38676,7 @@ var ts; // current declaration belongs to a different symbol // set cutoffIndex so re-orderings in the future won't change result set from 0 to cutoffIndex index = cutoffIndex = result.length; - lastParent = parent_9; + lastParent = parent; } lastSymbol = symbol; // specialized signatures always need to be placed before non-specialized signatures regardless @@ -35816,7 +38698,7 @@ var ts; function getSpreadArgumentIndex(args) { for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg && arg.kind === 196 /* SpreadElement */) { + if (arg && arg.kind === 198 /* SpreadElement */) { return i; } } @@ -35829,13 +38711,17 @@ var ts; var callIsIncomplete; // In incomplete call we want to be lenient when we have too few arguments var isDecorator; var spreadArgIndex = -1; - if (node.kind === 181 /* TaggedTemplateExpression */) { + if (ts.isJsxOpeningLikeElement(node)) { + // The arity check will be done in "checkApplicableSignatureForJsxOpeningLikeElement". + return true; + } + if (node.kind === 183 /* TaggedTemplateExpression */) { var tagExpression = node; // 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 === 194 /* TemplateExpression */) { + if (tagExpression.template.kind === 196 /* 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; @@ -35848,11 +38734,11 @@ var ts; // 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; - ts.Debug.assert(templateLiteral.kind === 12 /* NoSubstitutionTemplateLiteral */); + ts.Debug.assert(templateLiteral.kind === 13 /* NoSubstitutionTemplateLiteral */); callIsIncomplete = !!templateLiteral.isUnterminated; } } - else if (node.kind === 145 /* Decorator */) { + else if (node.kind === 147 /* Decorator */) { isDecorator = true; typeArguments = undefined; argCount = getEffectiveArgumentCount(node, /*args*/ undefined, signature); @@ -35861,19 +38747,21 @@ var ts; var callExpression = node; if (!callExpression.arguments) { // This only happens when we have something of the form: 'new C' - ts.Debug.assert(callExpression.kind === 180 /* NewExpression */); + ts.Debug.assert(callExpression.kind === 182 /* NewExpression */); return signature.minArgumentCount === 0; } argCount = signatureHelpTrailingComma ? args.length + 1 : args.length; - // If we are missing the close paren, the call is incomplete. + // If we are missing the close parenthesis, the call is incomplete. callIsIncomplete = callExpression.arguments.end === callExpression.end; typeArguments = callExpression.typeArguments; spreadArgIndex = getSpreadArgumentIndex(args); } // If the user supplied type arguments, but the number of type arguments does not match // the declared number of type parameters, the call has an incorrect arity. + var numTypeParameters = ts.length(signature.typeParameters); + var minTypeArgumentCount = getMinTypeArgumentCount(signature.typeParameters); var hasRightNumberOfTypeArgs = !typeArguments || - (signature.typeParameters && typeArguments.length === signature.typeParameters.length); + (typeArguments.length >= minTypeArgumentCount && typeArguments.length <= numTypeParameters); if (!hasRightNumberOfTypeArgs) { return false; } @@ -35903,7 +38791,7 @@ 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) { - var context = createInferenceContext(signature, /*inferUnionTypes*/ true); + var context = createInferenceContext(signature, /*inferUnionTypes*/ true, /*useAnyForNoInferences*/ false); forEachMatchingParameterType(contextualSignature, signature, function (source, target) { // Type parameters from outer context referenced by source type are fixed by instantiation of the source type inferTypesWithContext(context, instantiateType(source, contextualMapper), target); @@ -35945,7 +38833,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 !== 198 /* OmittedExpression */) { + if (arg === undefined || arg.kind !== 200 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i); // If the effective argument type is 'undefined', there is no synthetic type @@ -35980,7 +38868,7 @@ var ts; var typeParameters = signature.typeParameters; var typeArgumentsAreAssignable = true; var mapper; - for (var i = 0; i < typeParameters.length; i++) { + for (var i = 0; i < typeArgumentNodes.length; i++) { if (typeArgumentsAreAssignable /* so far */) { var constraint = getConstraintOfTypeParameter(typeParameters[i]); if (constraint) { @@ -36000,9 +38888,44 @@ var ts; } return typeArgumentsAreAssignable; } + /** + * Check if the given signature can possibly be a signature called by the JSX opening-like element. + * @param node a JSX opening-like element we are trying to figure its call signature + * @param signature a candidate signature we are trying whether it is a call signature + * @param relation a relationship to check parameter and argument type + * @param excludeArgument + */ + function checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation) { + // JSX opening-like element has correct arity for stateless-function component if the one of the following condition is true: + // 1. callIsIncomplete + // 2. attributes property has same number of properties as the parameter object type. + // We can figure that out by resolving attributes property and check number of properties in the resolved type + // If the call has correct arity, we will then check if the argument type and parameter type is assignable + var callIsIncomplete = node.attributes.end === node.end; // If we are missing the close "/>", the call is incomplete + if (callIsIncomplete) { + return true; + } + var headMessage = ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1; + // Stateless function components can have maximum of three arguments: "props", "context", and "updater". + // However "context" and "updater" are implicit and can't be specify by users. Only the first parameter, props, + // can be specified by users through attributes property. + var paramType = getTypeAtPosition(signature, 0); + var attributesType = checkExpressionWithContextualType(node.attributes, paramType, /*contextualMapper*/ undefined); + var argProperties = getPropertiesOfType(attributesType); + for (var _i = 0, argProperties_1 = argProperties; _i < argProperties_1.length; _i++) { + var arg = argProperties_1[_i]; + if (!getPropertyOfType(paramType, arg.name) && isUnhyphenatedJsxName(arg.name)) { + return false; + } + } + return checkTypeRelatedTo(attributesType, paramType, relation, /*errorNode*/ undefined, headMessage); + } function checkApplicableSignature(node, args, signature, relation, excludeArgument, reportErrors) { + if (ts.isJsxOpeningLikeElement(node)) { + return checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation); + } var thisType = getThisTypeOfSignature(signature); - if (thisType && thisType !== voidType && node.kind !== 180 /* NewExpression */) { + if (thisType && thisType !== voidType && node.kind !== 182 /* 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. @@ -36019,7 +38942,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 !== 198 /* OmittedExpression */) { + if (arg === undefined || arg.kind !== 200 /* OmittedExpression */) { // Check spread elements against rest type (from arity check we know spread argument corresponds to a rest parameter) var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i); @@ -36041,12 +38964,12 @@ var ts; * Returns the this argument in calls like x.f(...) and x[f](...). Undefined otherwise. */ function getThisArgumentOfCall(node) { - if (node.kind === 179 /* CallExpression */) { + if (node.kind === 181 /* CallExpression */) { var callee = node.expression; - if (callee.kind === 177 /* PropertyAccessExpression */) { + if (callee.kind === 179 /* PropertyAccessExpression */) { return callee.expression; } - else if (callee.kind === 178 /* ElementAccessExpression */) { + else if (callee.kind === 180 /* ElementAccessExpression */) { return callee.expression; } } @@ -36062,53 +38985,56 @@ var ts; */ function getEffectiveCallArguments(node) { var args; - if (node.kind === 181 /* TaggedTemplateExpression */) { + if (node.kind === 183 /* TaggedTemplateExpression */) { var template = node.template; args = [undefined]; - if (template.kind === 194 /* TemplateExpression */) { + if (template.kind === 196 /* TemplateExpression */) { ts.forEach(template.templateSpans, function (span) { args.push(span.expression); }); } } - else if (node.kind === 145 /* Decorator */) { + else if (node.kind === 147 /* 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. return undefined; } + else if (ts.isJsxOpeningLikeElement(node)) { + args = node.attributes.properties.length > 0 ? [node.attributes] : emptyArray; + } else { args = node.arguments || emptyArray; } return args; } /** - * Returns the effective argument count for a node that works like a function invocation. - * If 'node' is a Decorator, the number of arguments is derived from the decoration - * target and the signature: - * If 'node.target' is a class declaration or class expression, the effective argument - * count is 1. - * If 'node.target' is a parameter declaration, the effective argument count is 3. - * If 'node.target' is a property declaration, the effective argument count is 2. - * If 'node.target' is a method or accessor declaration, the effective argument count - * is 3, although it can be 2 if the signature only accepts two arguments, allowing - * us to match a property decorator. - * Otherwise, the argument count is the length of the 'args' array. - */ + * Returns the effective argument count for a node that works like a function invocation. + * If 'node' is a Decorator, the number of arguments is derived from the decoration + * target and the signature: + * If 'node.target' is a class declaration or class expression, the effective argument + * count is 1. + * If 'node.target' is a parameter declaration, the effective argument count is 3. + * If 'node.target' is a property declaration, the effective argument count is 2. + * If 'node.target' is a method or accessor declaration, the effective argument count + * is 3, although it can be 2 if the signature only accepts two arguments, allowing + * us to match a property decorator. + * Otherwise, the argument count is the length of the 'args' array. + */ function getEffectiveArgumentCount(node, args, signature) { - if (node.kind === 145 /* Decorator */) { + if (node.kind === 147 /* Decorator */) { switch (node.parent.kind) { - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: + case 229 /* ClassDeclaration */: + case 199 /* ClassExpression */: // A class decorator will have one argument (see `ClassDecorator` in core.d.ts) return 1; - case 147 /* PropertyDeclaration */: + case 149 /* PropertyDeclaration */: // A property declaration decorator will have two arguments (see // `PropertyDecorator` in core.d.ts) return 2; - case 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 151 /* MethodDeclaration */: + case 153 /* GetAccessor */: + case 154 /* 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. @@ -36118,7 +39044,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 144 /* Parameter */: + case 146 /* Parameter */: // A parameter declaration decorator will have three arguments (see // `ParameterDecorator` in core.d.ts) return 3; @@ -36129,38 +39055,38 @@ var ts; } } /** - * Returns the effective type of the first argument to a decorator. - * If 'node' is a class declaration or class expression, the effective argument type - * is the type of the static side of the class. - * If 'node' is a parameter declaration, the effective argument type is either the type - * of the static or instance side of the class for the parameter's parent method, - * depending on whether the method is declared static. - * For a constructor, the type is always the type of the static side of the class. - * If 'node' is a property, method, or accessor declaration, the effective argument - * type is the type of the static or instance side of the parent class for class - * element, depending on whether the element is declared static. - */ + * Returns the effective type of the first argument to a decorator. + * If 'node' is a class declaration or class expression, the effective argument type + * is the type of the static side of the class. + * If 'node' is a parameter declaration, the effective argument type is either the type + * of the static or instance side of the class for the parameter's parent method, + * depending on whether the method is declared static. + * For a constructor, the type is always the type of the static side of the class. + * If 'node' is a property, method, or accessor declaration, the effective argument + * type is the type of the static or instance side of the parent class for class + * element, depending on whether the element is declared static. + */ function getEffectiveDecoratorFirstArgumentType(node) { // The first argument to a decorator is its `target`. - if (node.kind === 226 /* ClassDeclaration */) { + if (node.kind === 229 /* 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 === 144 /* Parameter */) { + if (node.kind === 146 /* Parameter */) { // For a parameter decorator, the `target` is the parent type of the // parameter's containing method. node = node.parent; - if (node.kind === 150 /* Constructor */) { + if (node.kind === 152 /* Constructor */) { var classSymbol = getSymbolOfNode(node); return getTypeOfSymbol(classSymbol); } } - if (node.kind === 147 /* PropertyDeclaration */ || - node.kind === 149 /* MethodDeclaration */ || - node.kind === 151 /* GetAccessor */ || - node.kind === 152 /* SetAccessor */) { + if (node.kind === 149 /* PropertyDeclaration */ || + node.kind === 151 /* MethodDeclaration */ || + node.kind === 153 /* GetAccessor */ || + node.kind === 154 /* 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 @@ -36171,48 +39097,50 @@ var ts; return unknownType; } /** - * Returns the effective type for the second argument to a decorator. - * If 'node' is a parameter, its effective argument type is one of the following: - * If 'node.parent' is a constructor, the effective argument type is 'any', as we - * will emit `undefined`. - * If 'node.parent' is a member with an identifier, numeric, or string literal name, - * the effective argument type will be a string literal type for the member name. - * If 'node.parent' is a computed property name, the effective argument type will - * either be a symbol type or the string type. - * If 'node' is a member with an identifier, numeric, or string literal name, the - * effective argument type will be a string literal type for the member name. - * If 'node' is a computed property name, the effective argument type will either - * be a symbol type or the string type. - * A class decorator does not have a second argument type. - */ + * Returns the effective type for the second argument to a decorator. + * If 'node' is a parameter, its effective argument type is one of the following: + * If 'node.parent' is a constructor, the effective argument type is 'any', as we + * will emit `undefined`. + * If 'node.parent' is a member with an identifier, numeric, or string literal name, + * the effective argument type will be a string literal type for the member name. + * If 'node.parent' is a computed property name, the effective argument type will + * either be a symbol type or the string type. + * If 'node' is a member with an identifier, numeric, or string literal name, the + * effective argument type will be a string literal type for the member name. + * If 'node' is a computed property name, the effective argument type will either + * be a symbol type or the string type. + * A class decorator does not have a second argument type. + */ function getEffectiveDecoratorSecondArgumentType(node) { // The second argument to a decorator is its `propertyKey` - if (node.kind === 226 /* ClassDeclaration */) { + if (node.kind === 229 /* ClassDeclaration */) { ts.Debug.fail("Class decorators should not have a second synthetic argument."); return unknownType; } - if (node.kind === 144 /* Parameter */) { + if (node.kind === 146 /* Parameter */) { node = node.parent; - if (node.kind === 150 /* Constructor */) { + if (node.kind === 152 /* 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 === 147 /* PropertyDeclaration */ || - node.kind === 149 /* MethodDeclaration */ || - node.kind === 151 /* GetAccessor */ || - node.kind === 152 /* SetAccessor */) { + if (node.kind === 149 /* PropertyDeclaration */ || + node.kind === 151 /* MethodDeclaration */ || + node.kind === 153 /* GetAccessor */ || + node.kind === 154 /* 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 // be either string or symbol. var element = node; switch (element.name.kind) { - case 70 /* Identifier */: + case 71 /* Identifier */: case 8 /* NumericLiteral */: case 9 /* StringLiteral */: return getLiteralTypeForText(32 /* StringLiteral */, element.name.text); - case 142 /* ComputedPropertyName */: + case 144 /* ComputedPropertyName */: var nameType = checkComputedPropertyName(element.name); if (isTypeOfKind(nameType, 512 /* ESSymbol */)) { return nameType; @@ -36229,30 +39157,30 @@ var ts; return unknownType; } /** - * Returns the effective argument type for the third argument to a decorator. - * If 'node' is a parameter, the effective argument type is the number type. - * If 'node' is a method or accessor, the effective argument type is a - * `TypedPropertyDescriptor` instantiated with the type of the member. - * Class and property decorators do not have a third effective argument. - */ + * Returns the effective argument type for the third argument to a decorator. + * If 'node' is a parameter, the effective argument type is the number type. + * If 'node' is a method or accessor, the effective argument type is a + * `TypedPropertyDescriptor` instantiated with the type of the member. + * Class and property decorators do not have a third effective argument. + */ 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 === 226 /* ClassDeclaration */) { + if (node.kind === 229 /* ClassDeclaration */) { ts.Debug.fail("Class decorators should not have a third synthetic argument."); return unknownType; } - if (node.kind === 144 /* Parameter */) { + if (node.kind === 146 /* Parameter */) { // The `parameterIndex` for a parameter decorator is always a number return numberType; } - if (node.kind === 147 /* PropertyDeclaration */) { + if (node.kind === 149 /* PropertyDeclaration */) { ts.Debug.fail("Property decorators should not have a third synthetic argument."); return unknownType; } - if (node.kind === 149 /* MethodDeclaration */ || - node.kind === 151 /* GetAccessor */ || - node.kind === 152 /* SetAccessor */) { + if (node.kind === 151 /* MethodDeclaration */ || + node.kind === 153 /* GetAccessor */ || + node.kind === 154 /* SetAccessor */) { // The `descriptor` for a method decorator will be a `TypedPropertyDescriptor` // for the type of the member. var propertyType = getTypeOfNode(node); @@ -36262,8 +39190,8 @@ var ts; return unknownType; } /** - * Returns the effective argument type for the provided argument to a decorator. - */ + * Returns the effective argument type for the provided argument to a decorator. + */ function getEffectiveDecoratorArgumentType(node, argIndex) { if (argIndex === 0) { return getEffectiveDecoratorFirstArgumentType(node.parent); @@ -36278,16 +39206,16 @@ var ts; return unknownType; } /** - * Gets the effective argument type for an argument in a call expression. - */ + * Gets the effective argument type for an argument in a call expression. + */ function getEffectiveArgumentType(node, argIndex) { // 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 === 145 /* Decorator */) { + if (node.kind === 147 /* Decorator */) { return getEffectiveDecoratorArgumentType(node, argIndex); } - else if (argIndex === 0 && node.kind === 181 /* TaggedTemplateExpression */) { + else if (argIndex === 0 && node.kind === 183 /* TaggedTemplateExpression */) { return getGlobalTemplateStringsArrayType(); } // This is not a synthetic argument, so we return 'undefined' @@ -36295,25 +39223,25 @@ var ts; return undefined; } /** - * Gets the effective argument expression for an argument in a call expression. - */ + * Gets the effective argument expression for an argument in a call expression. + */ function getEffectiveArgument(node, args, argIndex) { // For a decorator or the first argument of a tagged template expression we return undefined. - if (node.kind === 145 /* Decorator */ || - (argIndex === 0 && node.kind === 181 /* TaggedTemplateExpression */)) { + if (node.kind === 147 /* Decorator */ || + (argIndex === 0 && node.kind === 183 /* TaggedTemplateExpression */)) { return undefined; } return args[argIndex]; } /** - * Gets the error node to use when reporting errors for an effective argument. - */ + * Gets the error node to use when reporting errors for an effective argument. + */ function getEffectiveArgumentErrorNode(node, argIndex, arg) { - if (node.kind === 145 /* Decorator */) { + if (node.kind === 147 /* Decorator */) { // For a decorator, we use the expression of the decorator for error reporting. return node.expression; } - else if (argIndex === 0 && node.kind === 181 /* TaggedTemplateExpression */) { + else if (argIndex === 0 && node.kind === 183 /* TaggedTemplateExpression */) { // For a the first argument of a tagged template expression, we use the template of the tag for error reporting. return node.template; } @@ -36322,16 +39250,31 @@ var ts; } } function resolveCall(node, signatures, candidatesOutArray, headMessage) { - var isTaggedTemplate = node.kind === 181 /* TaggedTemplateExpression */; - var isDecorator = node.kind === 145 /* Decorator */; + var isTaggedTemplate = node.kind === 183 /* TaggedTemplateExpression */; + var isDecorator = node.kind === 147 /* Decorator */; + var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node); var typeArguments; - if (!isTaggedTemplate && !isDecorator) { + if (!isTaggedTemplate && !isDecorator && !isJsxOpeningOrSelfClosingElement) { typeArguments = node.typeArguments; // We already perform checking on the type arguments on the class declaration itself. - if (node.expression.kind !== 96 /* SuperKeyword */) { + if (node.expression.kind !== 97 /* SuperKeyword */) { ts.forEach(typeArguments, checkSourceElement); } } + if (signatures.length === 1) { + var declaration = signatures[0].declaration; + if (declaration && ts.isInJavaScriptFile(declaration) && !ts.hasJSDocParameterTags(declaration)) { + if (containsArgumentsReference(declaration)) { + var signatureWithRest = cloneSignature(signatures[0]); + var syntheticArgsSymbol = createSymbol(3 /* Variable */, "args"); + syntheticArgsSymbol.type = anyArrayType; + syntheticArgsSymbol.isRestParameter = true; + signatureWithRest.parameters = ts.concatenate(signatureWithRest.parameters, [syntheticArgsSymbol]); + signatureWithRest.hasRestParameter = true; + signatures = [signatureWithRest]; + } + } + } var candidates = candidatesOutArray || []; // reorderCandidates fills up the candidates array directly reorderCandidates(signatures, candidates); @@ -36394,7 +39337,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 === 179 /* CallExpression */ && node.arguments.hasTrailingComma; + var signatureHelpTrailingComma = candidatesOutArray && node.kind === 181 /* 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 @@ -36423,6 +39366,10 @@ var ts; // If candidate is undefined, it means that no candidates had a suitable arity. In that case, // skip the checkApplicableSignature check. if (candidateForArgumentError) { + if (isJsxOpeningOrSelfClosingElement) { + // We do not report any error here because any error will be handled in "resolveCustomJsxElementAttributesType". + return candidateForArgumentError; + } // excludeArgument is undefined, in this case also equivalent to [undefined, undefined, ...] // The importance of excludeArgument is to prevent us from typing function expression parameters // in arguments too early. If possible, we'd like to only type them once we know the correct @@ -36444,7 +39391,7 @@ var ts; if (headMessage) { diagnosticChainHead = ts.chainDiagnosticMessages(diagnosticChainHead, headMessage); } - reportNoCommonSupertypeError(inferenceCandidates, node.expression || node.tag, diagnosticChainHead); + reportNoCommonSupertypeError(inferenceCandidates, node.tagName || node.expression || node.tag, diagnosticChainHead); } } else { @@ -36485,20 +39432,20 @@ var ts; var candidate = void 0; var typeArgumentsAreValid = void 0; var inferenceContext = originalCandidate.typeParameters - ? createInferenceContext(originalCandidate, /*inferUnionTypes*/ false) + ? createInferenceContext(originalCandidate, /*inferUnionTypes*/ false, /*useAnyForNoInferences*/ ts.isInJavaScriptFile(node)) : undefined; while (true) { candidate = originalCandidate; if (candidate.typeParameters) { var typeArgumentTypes = void 0; if (typeArguments) { - typeArgumentTypes = ts.map(typeArguments, getTypeFromTypeNode); + typeArgumentTypes = fillMissingTypeArguments(ts.map(typeArguments, getTypeFromTypeNode), candidate.typeParameters, getMinTypeArgumentCount(candidate.typeParameters)); typeArgumentsAreValid = checkTypeArguments(candidate, typeArguments, typeArgumentTypes, /*reportErrors*/ false); } else { inferTypeArguments(node, candidate, args, excludeArgument, inferenceContext); - typeArgumentsAreValid = inferenceContext.failedTypeParameterIndex === undefined; typeArgumentTypes = inferenceContext.inferredTypes; + typeArgumentsAreValid = inferenceContext.failedTypeParameterIndex === undefined; } if (!typeArgumentsAreValid) { break; @@ -36508,7 +39455,7 @@ var ts; if (!checkApplicableSignature(node, args, candidate, relation, excludeArgument, /*reportErrors*/ false)) { break; } - var index = excludeArgument ? ts.indexOf(excludeArgument, true) : -1; + var index = excludeArgument ? ts.indexOf(excludeArgument, /*value*/ true) : -1; if (index < 0) { return candidate; } @@ -36540,14 +39487,14 @@ var ts; } } function resolveCallExpression(node, candidatesOutArray) { - if (node.expression.kind === 96 /* SuperKeyword */) { + if (node.expression.kind === 97 /* SuperKeyword */) { var superType = checkSuperExpression(node.expression); if (superType !== unknownType) { // In super call, the candidate signatures are the matching arity signatures of the base constructor function instantiated // with the type arguments specified in the extends clause. var baseTypeNode = ts.getClassExtendsHeritageClauseElement(ts.getContainingClass(node)); if (baseTypeNode) { - var baseConstructors = getInstantiatedConstructorsForTypeArguments(superType, baseTypeNode.typeArguments); + var baseConstructors = getInstantiatedConstructorsForTypeArguments(superType, baseTypeNode.typeArguments, baseTypeNode); return resolveCall(node, baseConstructors, candidatesOutArray); } } @@ -36642,7 +39589,7 @@ var ts; // only the class declaration node will have the Abstract flag set. var valueDecl = expressionType.symbol && getClassLikeDeclarationOfSymbol(expressionType.symbol); if (valueDecl && ts.getModifierFlags(valueDecl) & 128 /* Abstract */) { - error(node, ts.Diagnostics.Cannot_create_an_instance_of_the_abstract_class_0, ts.declarationNameToString(valueDecl.name)); + error(node, ts.Diagnostics.Cannot_create_an_instance_of_the_abstract_class_0, ts.declarationNameToString(ts.getNameOfDeclaration(valueDecl))); return resolveErrorCall(node); } // TS 1.0 spec: 4.11 @@ -36739,26 +39686,26 @@ var ts; return resolveCall(node, callSignatures, candidatesOutArray); } /** - * Gets the localized diagnostic head message to use for errors when resolving a decorator as a call expression. - */ + * Gets the localized diagnostic head message to use for errors when resolving a decorator as a call expression. + */ function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: + case 229 /* ClassDeclaration */: + case 199 /* ClassExpression */: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 144 /* Parameter */: + case 146 /* Parameter */: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 147 /* PropertyDeclaration */: + case 149 /* PropertyDeclaration */: return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 151 /* MethodDeclaration */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; } } /** - * Resolves a decorator as if it were a call expression. - */ + * Resolves a decorator as if it were a call expression. + */ function resolveDecorator(node, candidatesOutArray) { var funcType = checkExpression(node.expression); var apparentType = getApparentType(funcType); @@ -36780,21 +39727,73 @@ var ts; } return resolveCall(node, callSignatures, candidatesOutArray, headMessage); } + /** + * This function is similar to getResolvedSignature but is exclusively for trying to resolve JSX stateless-function component. + * The main reason we have to use this function instead of getResolvedSignature because, the caller of this function will already check the type of openingLikeElement's tagName + * and pass the type as elementType. The elementType can not be a union (as such case should be handled by the caller of this function) + * Note: at this point, we are still not sure whether the opening-like element is a stateless function component or not. + * @param openingLikeElement an opening-like JSX element to try to resolve as JSX stateless function + * @param elementType an element type of the opneing-like element by checking opening-like element's tagname. + * @param candidatesOutArray an array of signature to be filled in by the function. It is passed by signature help in the language service; + * the function will fill it up with appropriate candidate signatures + */ + function getResolvedJsxStatelessFunctionSignature(openingLikeElement, elementType, candidatesOutArray) { + ts.Debug.assert(!(elementType.flags & 65536 /* Union */)); + var callSignature = resolveStatelessJsxOpeningLikeElement(openingLikeElement, elementType, candidatesOutArray); + return callSignature; + } + /** + * Try treating a given opening-like element as stateless function component and resolve a tagName to a function signature. + * @param openingLikeElement an JSX opening-like element we want to try resolve its stateless function if possible + * @param elementType a type of the opening-like JSX element, a result of resolving tagName in opening-like element. + * @param candidatesOutArray an array of signature to be filled in by the function. It is passed by signature help in the language service; + * the function will fill it up with appropriate candidate signatures + * @return a resolved signature if we can find function matching function signature through resolve call or a first signature in the list of functions. + * otherwise return undefined if tag-name of the opening-like element doesn't have call signatures + */ + function resolveStatelessJsxOpeningLikeElement(openingLikeElement, elementType, candidatesOutArray) { + // If this function is called from language service, elementType can be a union type. This is not possible if the function is called from compiler (see: resolveCustomJsxElementAttributesType) + if (elementType.flags & 65536 /* Union */) { + var types = elementType.types; + var result = void 0; + for (var _i = 0, types_18 = types; _i < types_18.length; _i++) { + var type = types_18[_i]; + result = result || resolveStatelessJsxOpeningLikeElement(openingLikeElement, type, candidatesOutArray); + } + return result; + } + var callSignatures = elementType && getSignaturesOfType(elementType, 0 /* Call */); + if (callSignatures && callSignatures.length > 0) { + var callSignature = void 0; + callSignature = resolveCall(openingLikeElement, callSignatures, candidatesOutArray); + return callSignature; + } + return undefined; + } function resolveSignature(node, candidatesOutArray) { switch (node.kind) { - case 179 /* CallExpression */: + case 181 /* CallExpression */: return resolveCallExpression(node, candidatesOutArray); - case 180 /* NewExpression */: + case 182 /* NewExpression */: return resolveNewExpression(node, candidatesOutArray); - case 181 /* TaggedTemplateExpression */: + case 183 /* TaggedTemplateExpression */: return resolveTaggedTemplateExpression(node, candidatesOutArray); - case 145 /* Decorator */: + case 147 /* Decorator */: return resolveDecorator(node, candidatesOutArray); + case 251 /* JsxOpeningElement */: + case 250 /* JsxSelfClosingElement */: + // This code-path is called by language service + return resolveStatelessJsxOpeningLikeElement(node, checkExpression(node.tagName), candidatesOutArray); } ts.Debug.fail("Branch in 'resolveSignature' should be unreachable."); } - // candidatesOutArray is passed by signature help in the language service, and collectCandidates - // must fill it up with the appropriate candidate signatures + /** + * Resolve a signature of a given call-like expression. + * @param node a call-like expression to try resolve a signature for + * @param candidatesOutArray an array of signature to be filled in by the function. It is passed by signature help in the language service; + * the function will fill it up with appropriate candidate signatures + * @return a signature of the call-like expression or undefined if one can't be found + */ function getResolvedSignature(node, candidatesOutArray) { var links = getNodeLinks(node); // If getResolvedSignature has already been called, we will have cached the resolvedSignature. @@ -36834,28 +39833,31 @@ var ts; // Grammar checking; stop grammar-checking if checkGrammarTypeArguments return true checkGrammarTypeArguments(node, node.typeArguments) || checkGrammarArguments(node, node.arguments); var signature = getResolvedSignature(node); - if (node.expression.kind === 96 /* SuperKeyword */) { + if (node.expression.kind === 97 /* SuperKeyword */) { return voidType; } - if (node.kind === 180 /* NewExpression */) { + if (node.kind === 182 /* NewExpression */) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 150 /* Constructor */ && - declaration.kind !== 154 /* ConstructSignature */ && - declaration.kind !== 159 /* ConstructorType */ && + declaration.kind !== 152 /* Constructor */ && + declaration.kind !== 156 /* ConstructSignature */ && + declaration.kind !== 161 /* 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 // in a JS file // Note:JS inferred classes might come from a variable declaration instead of a function declaration. // In this case, using getResolvedSymbol directly is required to avoid losing the members from the declaration. - var funcSymbol = node.expression.kind === 70 /* Identifier */ ? + var funcSymbol = node.expression.kind === 71 /* Identifier */ ? getResolvedSymbol(node.expression) : checkExpression(node.expression).symbol; - if (funcSymbol && funcSymbol.members && (funcSymbol.flags & 16 /* Function */ || ts.isDeclarationOfFunctionExpression(funcSymbol))) { + if (funcSymbol && ts.isDeclarationOfFunctionOrClassExpression(funcSymbol)) { + funcSymbol = getSymbolOfNode(funcSymbol.valueDeclaration.initializer); + } + if (funcSymbol && funcSymbol.members && funcSymbol.flags & 16 /* Function */) { return getInferredClassType(funcSymbol); } - else if (compilerOptions.noImplicitAny) { + else if (noImplicitAny) { error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } return anyType; @@ -36882,9 +39884,9 @@ var ts; return false; } var targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ - ? 225 /* FunctionDeclaration */ + ? 228 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ - ? 223 /* VariableDeclaration */ + ? 226 /* VariableDeclaration */ : 0 /* Unknown */; if (targetDeclarationKind !== 0 /* Unknown */) { var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind); @@ -36911,6 +39913,22 @@ var ts; function checkNonNullAssertion(node) { return getNonNullableType(checkExpression(node.expression)); } + function checkMetaProperty(node) { + checkGrammarMetaProperty(node); + var container = ts.getNewTargetContainer(node); + if (!container) { + 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 === 152 /* Constructor */) { + var symbol = getSymbolOfNode(container.parent); + return getTypeOfSymbol(symbol); + } + else { + var symbol = getSymbolOfNode(container); + return getTypeOfSymbol(symbol); + } + } function getTypeOfParameter(symbol) { var type = getTypeOfSymbol(symbol); if (strictNullChecks) { @@ -36926,9 +39944,12 @@ var ts; pos < signature.parameters.length - 1 ? getTypeOfParameter(signature.parameters[pos]) : getRestTypeOfSignature(signature) : pos < signature.parameters.length ? getTypeOfParameter(signature.parameters[pos]) : anyType; } - function assignContextualParameterTypes(signature, context, mapper) { + function getTypeOfFirstParameterOfSignature(signature) { + return signature.parameters.length > 0 ? getTypeAtPosition(signature, 0) : neverType; + } + function assignContextualParameterTypes(signature, context, mapper, checkMode) { var len = signature.parameters.length - (signature.hasRestParameter ? 1 : 0); - if (isInferentialContext(mapper)) { + if (checkMode === 2 /* Inferential */) { for (var i = 0; i < len; i++) { var declaration = signature.parameters[i].valueDeclaration; if (declaration.type) { @@ -36940,23 +39961,23 @@ var ts; var parameter = signature.thisParameter; if (!parameter || parameter.valueDeclaration && !parameter.valueDeclaration.type) { if (!parameter) { - signature.thisParameter = createTransientSymbol(context.thisParameter, undefined); + signature.thisParameter = createSymbolWithType(context.thisParameter, /*type*/ undefined); } - assignTypeToParameterAndFixTypeParameters(signature.thisParameter, getTypeOfSymbol(context.thisParameter), mapper); + assignTypeToParameterAndFixTypeParameters(signature.thisParameter, getTypeOfSymbol(context.thisParameter), mapper, checkMode); } } for (var i = 0; i < len; i++) { var parameter = signature.parameters[i]; if (!parameter.valueDeclaration.type) { var contextualParameterType = getTypeAtPosition(context, i); - assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper); + assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper, checkMode); } } if (signature.hasRestParameter && isRestParameterIndex(context, signature.parameters.length - 1)) { var parameter = ts.lastOrUndefined(signature.parameters); if (!parameter.valueDeclaration.type) { var contextualParameterType = getTypeOfSymbol(ts.lastOrUndefined(context.parameters)); - assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper); + assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper, checkMode); } } } @@ -36967,7 +39988,7 @@ var ts; for (var _i = 0, _a = node.name.elements; _i < _a.length; _i++) { var element = _a[_i]; if (!ts.isOmittedExpression(element)) { - if (element.name.kind === 70 /* Identifier */) { + if (element.name.kind === 71 /* Identifier */) { getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element); } assignBindingElementTypes(element); @@ -36975,19 +39996,19 @@ var ts; } } } - function assignTypeToParameterAndFixTypeParameters(parameter, contextualType, mapper) { + function assignTypeToParameterAndFixTypeParameters(parameter, contextualType, mapper, checkMode) { var links = getSymbolLinks(parameter); if (!links.type) { links.type = instantiateType(contextualType, mapper); + var name = ts.getNameOfDeclaration(parameter.valueDeclaration); // if inference didn't come up with anything but {}, fall back to the binding pattern if present. if (links.type === emptyObjectType && - (parameter.valueDeclaration.name.kind === 172 /* ObjectBindingPattern */ || - parameter.valueDeclaration.name.kind === 173 /* ArrayBindingPattern */)) { - links.type = getTypeFromBindingPattern(parameter.valueDeclaration.name); + (name.kind === 174 /* ObjectBindingPattern */ || name.kind === 175 /* ArrayBindingPattern */)) { + links.type = getTypeFromBindingPattern(name); } assignBindingElementTypes(parameter.valueDeclaration); } - else if (isInferentialContext(mapper)) { + else if (checkMode === 2 /* Inferential */) { // Even if the parameter already has a type, it might be because it was given a type while // processing the function as an argument to a prior signature during overload resolution. // If this was the case, it may have caused some type parameters to be fixed. So here, @@ -37029,10 +40050,10 @@ var ts; } function createPromiseType(promisedType) { // creates a `Promise` type where `T` is the promisedType argument - var globalPromiseType = getGlobalPromiseType(); + var globalPromiseType = getGlobalPromiseType(/*reportErrors*/ true); if (globalPromiseType !== emptyGenericType) { // if the promised type is itself a promise, get the underlying type; otherwise, fallback to the promised type - promisedType = getAwaitedType(promisedType); + promisedType = getAwaitedType(promisedType) || emptyObjectType; return createTypeReference(globalPromiseType, [promisedType]); } return emptyObjectType; @@ -37043,53 +40064,63 @@ var ts; error(func, ts.Diagnostics.An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option); return unknownType; } + else if (!getGlobalPromiseConstructorSymbol(/*reportErrors*/ true)) { + error(func, ts.Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option); + } return promiseType; } - function getReturnTypeFromBody(func, contextualMapper) { + function getReturnTypeFromBody(func, checkMode) { var contextualSignature = getContextualSignatureForFunctionLikeDeclaration(func); if (!func.body) { return unknownType; } - var isAsync = ts.isAsyncFunctionLike(func); + var functionFlags = ts.getFunctionFlags(func); var type; - if (func.body.kind !== 204 /* Block */) { - type = checkExpressionCached(func.body, contextualMapper); - if (isAsync) { + if (func.body.kind !== 207 /* 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 // Promise/A+ compatible implementation will always assimilate any foreign promise, so the // return type of the body should be unwrapped to its awaited type, which we will wrap in // the native Promise type later in this function. - type = checkAwaitedType(type, func, ts.Diagnostics.Return_expression_in_async_function_does_not_have_a_valid_callable_then_member); + type = checkAwaitedType(type, /*errorNode*/ func, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); } } else { var types = void 0; - var funcIsGenerator = !!func.asteriskToken; - if (funcIsGenerator) { - types = checkAndAggregateYieldOperandTypes(func, contextualMapper); - if (types.length === 0) { - var iterableIteratorAny = createIterableIteratorType(anyType); - if (compilerOptions.noImplicitAny) { + if (functionFlags & 1 /* Generator */) { + types = ts.concatenate(checkAndAggregateYieldOperandTypes(func, checkMode), checkAndAggregateReturnExpressionTypes(func, checkMode)); + if (!types || types.length === 0) { + var iterableIteratorAny = functionFlags & 2 /* Async */ + ? createAsyncIterableIteratorType(anyType) // AsyncGenerator function + : createIterableIteratorType(anyType); // Generator function + if (noImplicitAny) { error(func.asteriskToken, ts.Diagnostics.Generator_implicitly_has_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type, typeToString(iterableIteratorAny)); } return iterableIteratorAny; } } else { - types = checkAndAggregateReturnExpressionTypes(func, contextualMapper); + types = checkAndAggregateReturnExpressionTypes(func, checkMode); if (!types) { // For an async function, the return type will not be never, but rather a Promise for never. - return isAsync ? createPromiseReturnType(func, neverType) : neverType; + return functionFlags & 2 /* Async */ + ? createPromiseReturnType(func, neverType) // Async function + : neverType; // Normal function } if (types.length === 0) { // For an async function, the return type will not be void, but rather a Promise for void. - return isAsync ? createPromiseReturnType(func, voidType) : voidType; + return functionFlags & 2 /* Async */ + ? createPromiseReturnType(func, voidType) // Async function + : voidType; // Normal function } } // Return a union of the return expression types. type = getUnionType(types, /*subtypeReduction*/ true); - if (funcIsGenerator) { - type = createIterableIteratorType(type); + if (functionFlags & 1 /* Generator */) { + type = functionFlags & 2 /* Async */ + ? createAsyncIterableIteratorType(type) // AsyncGenerator function + : createIterableIteratorType(type); // Generator function } } if (!contextualSignature) { @@ -37104,17 +40135,25 @@ var ts; // From within an async function you can return either a non-promise value or a promise. Any // Promise/A+ compatible implementation will always assimilate any foreign promise, so the // return type of the body is awaited type of the body, wrapped in a native Promise type. - return isAsync ? createPromiseReturnType(func, widenedType) : widenedType; + return (functionFlags & 3 /* AsyncGenerator */) === 2 /* Async */ + ? createPromiseReturnType(func, widenedType) // Async function + : widenedType; // Generator function, AsyncGenerator function, or normal function } - function checkAndAggregateYieldOperandTypes(func, contextualMapper) { + function checkAndAggregateYieldOperandTypes(func, checkMode) { var aggregatedTypes = []; + var functionFlags = ts.getFunctionFlags(func); ts.forEachYieldExpression(func.body, function (yieldExpression) { var expr = yieldExpression.expression; if (expr) { - var type = checkExpressionCached(expr, contextualMapper); + var type = checkExpressionCached(expr, checkMode); if (yieldExpression.asteriskToken) { // A yield* expression effectively yields everything that its operand yields - type = checkElementTypeOfIterable(type, yieldExpression.expression); + 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); } if (!ts.contains(aggregatedTypes, type)) { aggregatedTypes.push(type); @@ -37142,26 +40181,26 @@ var ts; return false; } var lastStatement = ts.lastOrUndefined(func.body.statements); - if (lastStatement && lastStatement.kind === 218 /* SwitchStatement */ && isExhaustiveSwitchStatement(lastStatement)) { + if (lastStatement && lastStatement.kind === 221 /* SwitchStatement */ && isExhaustiveSwitchStatement(lastStatement)) { return false; } return true; } - function checkAndAggregateReturnExpressionTypes(func, contextualMapper) { - var isAsync = ts.isAsyncFunctionLike(func); + function checkAndAggregateReturnExpressionTypes(func, checkMode) { + var functionFlags = ts.getFunctionFlags(func); var aggregatedTypes = []; var hasReturnWithNoExpression = functionHasImplicitReturn(func); var hasReturnOfTypeNever = false; ts.forEachReturnStatement(func.body, function (returnStatement) { var expr = returnStatement.expression; if (expr) { - var type = checkExpressionCached(expr, contextualMapper); - if (isAsync) { + var type = checkExpressionCached(expr, checkMode); + if (functionFlags & 2 /* Async */) { // From within an async function you can return either a non-promise value or a promise. Any // Promise/A+ compatible implementation will always assimilate any foreign promise, so the // return type of the body should be unwrapped to its awaited type, which should be wrapped in // the native Promise type by the caller. - type = checkAwaitedType(type, func, ts.Diagnostics.Return_expression_in_async_function_does_not_have_a_valid_callable_then_member); + type = checkAwaitedType(type, func, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); } if (type.flags & 8192 /* Never */) { hasReturnOfTypeNever = true; @@ -37175,7 +40214,7 @@ var ts; } }); if (aggregatedTypes.length === 0 && !hasReturnWithNoExpression && (hasReturnOfTypeNever || - func.kind === 184 /* FunctionExpression */ || func.kind === 185 /* ArrowFunction */)) { + func.kind === 186 /* FunctionExpression */ || func.kind === 187 /* ArrowFunction */)) { return undefined; } if (strictNullChecks && aggregatedTypes.length && hasReturnWithNoExpression) { @@ -37204,7 +40243,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 !== 204 /* Block */ || !functionHasImplicitReturn(func)) { + if (ts.nodeIsMissing(func.body) || func.body.kind !== 207 /* Block */ || !functionHasImplicitReturn(func)) { return; } var hasExplicitReturn = func.flags & 256 /* HasExplicitReturn */; @@ -37236,22 +40275,22 @@ var ts; error(func.type || func, ts.Diagnostics.Not_all_code_paths_return_a_value); } } - function checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper) { - ts.Debug.assert(node.kind !== 149 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { + ts.Debug.assert(node.kind !== 151 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); // Grammar checking var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 184 /* FunctionExpression */) { + if (!hasGrammarError && node.kind === 186 /* FunctionExpression */) { checkGrammarForGenerator(node); } // The identityMapper object is used to indicate that function expressions are wildcards - if (contextualMapper === identityMapper && isContextSensitive(node)) { + if (checkMode === 1 /* SkipContextSensitive */ && isContextSensitive(node)) { checkNodeDeferred(node); return anyFunctionType; } var links = getNodeLinks(node); var type = getTypeOfSymbol(node.symbol); var contextSensitive = isContextSensitive(node); - var mightFixTypeParameters = contextSensitive && isInferentialContext(contextualMapper); + var mightFixTypeParameters = contextSensitive && checkMode === 2 /* Inferential */; // Check if function expression is contextually typed and assign parameter types if so. // See the comment in assignTypeToParameterAndFixTypeParameters to understand why we need to // check mightFixTypeParameters. @@ -37266,10 +40305,10 @@ var ts; if (contextualSignature) { var signature = getSignaturesOfType(type, 0 /* Call */)[0]; if (contextSensitive) { - assignContextualParameterTypes(signature, contextualSignature, contextualMapper || identityMapper); + assignContextualParameterTypes(signature, contextualSignature, getContextualMapper(node), checkMode); } if (mightFixTypeParameters || !node.type && !signature.resolvedReturnType) { - var returnType = getReturnTypeFromBody(node, contextualMapper); + var returnType = getReturnTypeFromBody(node, checkMode); if (!signature.resolvedReturnType) { signature.resolvedReturnType = returnType; } @@ -37281,17 +40320,21 @@ var ts; } } } - if (produceDiagnostics && node.kind !== 149 /* MethodDeclaration */) { + if (produceDiagnostics && node.kind !== 151 /* MethodDeclaration */) { checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithCapturedNewTargetVariable(node, node.name); } return type; } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - ts.Debug.assert(node.kind !== 149 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); - var isAsync = ts.isAsyncFunctionLike(node); - var returnOrPromisedType = node.type && (isAsync ? checkAsyncFunctionReturnType(node) : getTypeFromTypeNode(node.type)); - if (!node.asteriskToken) { + ts.Debug.assert(node.kind !== 151 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + var functionFlags = ts.getFunctionFlags(node); + var returnOrPromisedType = node.type && + ((functionFlags & 3 /* AsyncGenerator */) === 2 /* Async */ ? + checkAsyncFunctionReturnType(node) : + getTypeFromTypeNode(node.type)); // AsyncGenerator function, Generator function, or normal function + if ((functionFlags & 1 /* Generator */) === 0) { // return is not necessary in the body of generators checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnOrPromisedType); } @@ -37304,7 +40347,7 @@ var ts; // checkFunctionExpressionBodies). So it must be done now. getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 204 /* Block */) { + if (node.body.kind === 207 /* Block */) { checkSourceElement(node.body); } else { @@ -37315,8 +40358,8 @@ var ts; // its return type annotation. var exprType = checkExpression(node.body); if (returnOrPromisedType) { - if (isAsync) { - var awaitedType = checkAwaitedType(exprType, node.body, ts.Diagnostics.Expression_body_for_async_arrow_function_does_not_have_a_valid_callable_then_member); + if ((functionFlags & 3 /* AsyncGenerator */) === 2 /* Async */) { + 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 { @@ -37341,21 +40384,21 @@ var ts; // Get accessors without matching set accessors // Enum members // Unions and intersections of the above (unions and intersections eagerly set isReadonly on creation) - return symbol.isReadonly || - symbol.flags & 4 /* Property */ && (getDeclarationModifierFlagsFromSymbol(symbol) & 64 /* Readonly */) !== 0 || - symbol.flags & 3 /* Variable */ && (getDeclarationNodeFlagsFromSymbol(symbol) & 2 /* Const */) !== 0 || + return !!(getCheckFlags(symbol) & 8 /* Readonly */ || + symbol.flags & 4 /* Property */ && getDeclarationModifierFlagsFromSymbol(symbol) & 64 /* Readonly */ || + symbol.flags & 3 /* Variable */ && getDeclarationNodeFlagsFromSymbol(symbol) & 2 /* Const */ || symbol.flags & 98304 /* Accessor */ && !(symbol.flags & 65536 /* SetAccessor */) || - (symbol.flags & 8 /* EnumMember */) !== 0; + symbol.flags & 8 /* EnumMember */); } function isReferenceToReadonlyEntity(expr, symbol) { if (isReadonlySymbol(symbol)) { // Allow assignments to readonly properties within constructors of the same class declaration. if (symbol.flags & 4 /* Property */ && - (expr.kind === 177 /* PropertyAccessExpression */ || expr.kind === 178 /* ElementAccessExpression */) && - expr.expression.kind === 98 /* ThisKeyword */) { + (expr.kind === 179 /* PropertyAccessExpression */ || expr.kind === 180 /* 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 === 150 /* Constructor */)) + if (!(func && func.kind === 152 /* Constructor */)) return true; // If func.parent is a class and symbol is a (readonly) property of that class, or // if func is a constructor and symbol is a (readonly) parameter property declared in it, @@ -37367,13 +40410,13 @@ var ts; return false; } function isReferenceThroughNamespaceImport(expr) { - if (expr.kind === 177 /* PropertyAccessExpression */ || expr.kind === 178 /* ElementAccessExpression */) { + if (expr.kind === 179 /* PropertyAccessExpression */ || expr.kind === 180 /* ElementAccessExpression */) { var node = ts.skipParentheses(expr.expression); - if (node.kind === 70 /* Identifier */) { + if (node.kind === 71 /* Identifier */) { var symbol = getNodeLinks(node).resolvedSymbol; if (symbol.flags & 8388608 /* Alias */) { var declaration = getDeclarationOfAliasSymbol(symbol); - return declaration && declaration.kind === 237 /* NamespaceImport */; + return declaration && declaration.kind === 240 /* NamespaceImport */; } } } @@ -37382,7 +40425,7 @@ var ts; function checkReferenceExpression(expr, invalidReferenceMessage) { // References are combinations of identifiers, parentheses, and property accesses. var node = ts.skipParentheses(expr); - if (node.kind !== 70 /* Identifier */ && node.kind !== 177 /* PropertyAccessExpression */ && node.kind !== 178 /* ElementAccessExpression */) { + if (node.kind !== 71 /* Identifier */ && node.kind !== 179 /* PropertyAccessExpression */ && node.kind !== 180 /* ElementAccessExpression */) { error(expr, invalidReferenceMessage); return false; } @@ -37390,11 +40433,21 @@ var ts; } function checkDeleteExpression(node) { checkExpression(node.expression); + var expr = ts.skipParentheses(node.expression); + if (expr.kind !== 179 /* PropertyAccessExpression */ && expr.kind !== 180 /* ElementAccessExpression */) { + error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference); + return booleanType; + } + var links = getNodeLinks(expr); + var symbol = getExportSymbolOfValueSymbolIfExported(links.resolvedSymbol); + if (symbol && isReadonlySymbol(symbol)) { + error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_read_only_property); + } return booleanType; } function checkTypeOfExpression(node) { checkExpression(node.expression); - return stringType; + return typeofType; } function checkVoidExpression(node) { checkExpression(node.expression); @@ -37411,32 +40464,33 @@ var ts; } } var operandType = checkExpression(node.expression); - return checkAwaitedType(operandType, node); + return checkAwaitedType(operandType, node, ts.Diagnostics.Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); } function checkPrefixUnaryExpression(node) { var operandType = checkExpression(node.operand); if (operandType === silentNeverType) { return silentNeverType; } - if (node.operator === 37 /* MinusToken */ && node.operand.kind === 8 /* NumericLiteral */) { + if (node.operator === 38 /* MinusToken */ && node.operand.kind === 8 /* NumericLiteral */) { return getFreshTypeOfLiteralType(getLiteralTypeForText(64 /* NumberLiteral */, "" + -node.operand.text)); } switch (node.operator) { - case 36 /* PlusToken */: - case 37 /* MinusToken */: - case 51 /* TildeToken */: + case 37 /* PlusToken */: + case 38 /* MinusToken */: + case 52 /* TildeToken */: + checkNonNullType(operandType, node.operand); if (maybeTypeOfKind(operandType, 512 /* ESSymbol */)) { error(node.operand, ts.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts.tokenToString(node.operator)); } return numberType; - case 50 /* ExclamationToken */: + case 51 /* ExclamationToken */: var facts = getTypeFacts(operandType) & (1048576 /* Truthy */ | 2097152 /* Falsy */); return facts === 1048576 /* Truthy */ ? falseType : facts === 2097152 /* Falsy */ ? trueType : booleanType; - case 42 /* PlusPlusToken */: - case 43 /* MinusMinusToken */: - var ok = checkArithmeticOperandType(node.operand, getNonNullableType(operandType), ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); + case 43 /* PlusPlusToken */: + case 44 /* MinusMinusToken */: + var ok = checkArithmeticOperandType(node.operand, checkNonNullType(operandType, node.operand), ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); if (ok) { // run check only if former checks succeeded to avoid reporting cascading errors checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access); @@ -37450,7 +40504,7 @@ var ts; if (operandType === silentNeverType) { return silentNeverType; } - var ok = checkArithmeticOperandType(node.operand, getNonNullableType(operandType), ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); + var ok = checkArithmeticOperandType(node.operand, checkNonNullType(operandType, node.operand), ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); if (ok) { // run check only if former checks succeeded to avoid reporting cascading errors checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access); @@ -37465,8 +40519,8 @@ var ts; } if (type.flags & 196608 /* UnionOrIntersection */) { var types = type.types; - for (var _i = 0, types_15 = types; _i < types_15.length; _i++) { - var t = types_15[_i]; + for (var _i = 0, types_19 = types; _i < types_19.length; _i++) { + var t = types_19[_i]; if (maybeTypeOfKind(t, kind)) { return true; } @@ -37483,8 +40537,8 @@ var ts; } if (type.flags & 65536 /* Union */) { var types = type.types; - for (var _i = 0, types_16 = types; _i < types_16.length; _i++) { - var t = types_16[_i]; + for (var _i = 0, types_20 = types; _i < types_20.length; _i++) { + var t = types_20[_i]; if (!isTypeOfKind(t, kind)) { return false; } @@ -37493,8 +40547,8 @@ var ts; } if (type.flags & 131072 /* Intersection */) { var types = type.types; - for (var _a = 0, types_17 = types; _a < types_17.length; _a++) { - var t = types_17[_a]; + for (var _a = 0, types_21 = types; _a < types_21.length; _a++) { + var t = types_21[_a]; if (isTypeOfKind(t, kind)) { return true; } @@ -37514,14 +40568,17 @@ var ts; } // TypeScript 1.0 spec (April 2014): 4.15.4 // The instanceof operator requires the left operand to be of type Any, an object type, or a type parameter type, - // and the right operand to be of type Any or a subtype of the 'Function' interface type. + // and the right operand to be of type Any, a subtype of the 'Function' interface type, or have a call or construct signature. // The result is always of the Boolean primitive type. // NOTE: do not raise error if leftType is unknown as related error was already reported if (isTypeOfKind(leftType, 8190 /* Primitive */)) { error(left, ts.Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } // NOTE: do not raise error if right is unknown as related error was already reported - if (!(isTypeAny(rightType) || isTypeSubtypeOf(rightType, globalFunctionType))) { + if (!(isTypeAny(rightType) || + getSignaturesOfType(rightType, 0 /* Call */).length || + getSignaturesOfType(rightType, 1 /* Construct */).length || + isTypeSubtypeOf(rightType, globalFunctionType))) { error(right, ts.Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type); } return booleanType; @@ -37530,6 +40587,8 @@ var ts; if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } + leftType = checkNonNullType(leftType, left); + rightType = checkNonNullType(rightType, right); // TypeScript 1.0 spec (April 2014): 4.15.5 // The in operator requires the left operand to be of type Any, the String primitive type, or the Number primitive type, // and the right operand to be of type Any, an object type, or a type parameter type. @@ -37537,37 +40596,37 @@ var ts; if (!(isTypeComparableTo(leftType, stringType) || isTypeOfKind(leftType, 340 /* NumberLike */ | 512 /* ESSymbol */))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } - if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, 32768 /* Object */ | 540672 /* TypeVariable */)) { + if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, 32768 /* Object */ | 540672 /* TypeVariable */ | 16777216 /* NonPrimitive */)) { 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; } function checkObjectLiteralAssignment(node, sourceType) { var properties = node.properties; - for (var _i = 0, properties_6 = properties; _i < properties_6.length; _i++) { - var p = properties_6[_i]; + for (var _i = 0, properties_7 = properties; _i < properties_7.length; _i++) { + var p = properties_7[_i]; checkObjectLiteralDestructuringPropertyAssignment(sourceType, p, properties); } return sourceType; } /** Note: If property cannot be a SpreadAssignment, then allProperties does not need to be provided */ function checkObjectLiteralDestructuringPropertyAssignment(objectLiteralType, property, allProperties) { - if (property.kind === 257 /* PropertyAssignment */ || property.kind === 258 /* ShorthandPropertyAssignment */) { - var name_20 = property.name; - if (name_20.kind === 142 /* ComputedPropertyName */) { - checkComputedPropertyName(name_20); + if (property.kind === 261 /* PropertyAssignment */ || property.kind === 262 /* ShorthandPropertyAssignment */) { + var name = property.name; + if (name.kind === 144 /* ComputedPropertyName */) { + checkComputedPropertyName(name); } - if (isComputedNonLiteralName(name_20)) { + if (isComputedNonLiteralName(name)) { return undefined; } - var text = ts.getTextOfPropertyName(name_20); + var text = ts.getTextOfPropertyName(name); var type = isTypeAny(objectLiteralType) ? objectLiteralType : getTypeOfPropertyOfType(objectLiteralType, text) || isNumericLiteralName(text) && getIndexTypeOfType(objectLiteralType, 1 /* Number */) || getIndexTypeOfType(objectLiteralType, 0 /* String */); if (type) { - if (property.kind === 258 /* ShorthandPropertyAssignment */) { + if (property.kind === 262 /* ShorthandPropertyAssignment */) { return checkDestructuringAssignment(property, type); } else { @@ -37576,10 +40635,10 @@ var ts; } } else { - error(name_20, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(objectLiteralType), ts.declarationNameToString(name_20)); + error(name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(objectLiteralType), ts.declarationNameToString(name)); } } - else if (property.kind === 259 /* SpreadAssignment */) { + else if (property.kind === 263 /* SpreadAssignment */) { if (languageVersion < 5 /* ESNext */) { checkExternalEmitHelpers(property, 4 /* Rest */); } @@ -37596,22 +40655,25 @@ var ts; error(property, ts.Diagnostics.Property_assignment_expected); } } - function checkArrayLiteralAssignment(node, sourceType, contextualMapper) { + function checkArrayLiteralAssignment(node, sourceType, checkMode) { + if (languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { + checkExternalEmitHelpers(node, 512 /* Read */); + } // This elementType will be used if the specific property corresponding to this index is not // present (aka the tuple element property). This call also checks that the parentType is in // fact an iterable or array (depending on target language). - var elementType = checkIteratedTypeOrElementType(sourceType, node, /*allowStringInput*/ false) || unknownType; + var elementType = checkIteratedTypeOrElementType(sourceType, node, /*allowStringInput*/ false, /*allowAsyncIterable*/ false) || unknownType; var elements = node.elements; for (var i = 0; i < elements.length; i++) { - checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, elementType, contextualMapper); + checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, elementType, checkMode); } return sourceType; } - function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, contextualMapper) { + function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { var elements = node.elements; var element = elements[elementIndex]; - if (element.kind !== 198 /* OmittedExpression */) { - if (element.kind !== 196 /* SpreadElement */) { + if (element.kind !== 200 /* OmittedExpression */) { + if (element.kind !== 198 /* SpreadElement */) { var propName = "" + elementIndex; var type = isTypeAny(sourceType) ? sourceType @@ -37619,7 +40681,7 @@ var ts; ? getTypeOfPropertyOfType(sourceType, propName) : elementType; if (type) { - return checkDestructuringAssignment(element, type, contextualMapper); + return checkDestructuringAssignment(element, type, checkMode); } else { // We still need to check element expression here because we may need to set appropriate flag on the expression @@ -37639,20 +40701,20 @@ var ts; } else { var restExpression = element.expression; - if (restExpression.kind === 192 /* BinaryExpression */ && restExpression.operatorToken.kind === 57 /* EqualsToken */) { + if (restExpression.kind === 194 /* BinaryExpression */ && restExpression.operatorToken.kind === 58 /* EqualsToken */) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { - return checkDestructuringAssignment(restExpression, createArrayType(elementType), contextualMapper); + return checkDestructuringAssignment(restExpression, createArrayType(elementType), checkMode); } } } } return undefined; } - function checkDestructuringAssignment(exprOrAssignment, sourceType, contextualMapper) { + function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode) { var target; - if (exprOrAssignment.kind === 258 /* ShorthandPropertyAssignment */) { + if (exprOrAssignment.kind === 262 /* ShorthandPropertyAssignment */) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { // In strict null checking mode, if a default value of a non-undefined type is specified, remove @@ -37661,28 +40723,28 @@ var ts; !(getFalsyFlags(checkExpression(prop.objectAssignmentInitializer)) & 2048 /* Undefined */)) { sourceType = getTypeWithFacts(sourceType, 131072 /* NEUndefined */); } - checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, contextualMapper); + checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, checkMode); } target = exprOrAssignment.name; } else { target = exprOrAssignment; } - if (target.kind === 192 /* BinaryExpression */ && target.operatorToken.kind === 57 /* EqualsToken */) { - checkBinaryExpression(target, contextualMapper); + if (target.kind === 194 /* BinaryExpression */ && target.operatorToken.kind === 58 /* EqualsToken */) { + checkBinaryExpression(target, checkMode); target = target.left; } - if (target.kind === 176 /* ObjectLiteralExpression */) { + if (target.kind === 178 /* ObjectLiteralExpression */) { return checkObjectLiteralAssignment(target, sourceType); } - if (target.kind === 175 /* ArrayLiteralExpression */) { - return checkArrayLiteralAssignment(target, sourceType, contextualMapper); + if (target.kind === 177 /* ArrayLiteralExpression */) { + return checkArrayLiteralAssignment(target, sourceType, checkMode); } - return checkReferenceAssignment(target, sourceType, contextualMapper); + return checkReferenceAssignment(target, sourceType, checkMode); } - function checkReferenceAssignment(target, sourceType, contextualMapper) { - var targetType = checkExpression(target, contextualMapper); - var error = target.parent.kind === 259 /* SpreadAssignment */ ? + function checkReferenceAssignment(target, sourceType, checkMode) { + var targetType = checkExpression(target, checkMode); + var error = target.parent.kind === 263 /* 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)) { @@ -37701,52 +40763,52 @@ var ts; function isSideEffectFree(node) { node = ts.skipParentheses(node); switch (node.kind) { - case 70 /* Identifier */: + case 71 /* Identifier */: case 9 /* StringLiteral */: - case 11 /* RegularExpressionLiteral */: - case 181 /* TaggedTemplateExpression */: - case 194 /* TemplateExpression */: - case 12 /* NoSubstitutionTemplateLiteral */: + case 12 /* RegularExpressionLiteral */: + case 183 /* TaggedTemplateExpression */: + case 196 /* TemplateExpression */: + case 13 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: - case 100 /* TrueKeyword */: - case 85 /* FalseKeyword */: - case 94 /* NullKeyword */: - case 137 /* UndefinedKeyword */: - case 184 /* FunctionExpression */: - case 197 /* ClassExpression */: - case 185 /* ArrowFunction */: - case 175 /* ArrayLiteralExpression */: - case 176 /* ObjectLiteralExpression */: - case 187 /* TypeOfExpression */: - case 201 /* NonNullExpression */: - case 247 /* JsxSelfClosingElement */: - case 246 /* JsxElement */: + case 101 /* TrueKeyword */: + case 86 /* FalseKeyword */: + case 95 /* NullKeyword */: + case 139 /* UndefinedKeyword */: + case 186 /* FunctionExpression */: + case 199 /* ClassExpression */: + case 187 /* ArrowFunction */: + case 177 /* ArrayLiteralExpression */: + case 178 /* ObjectLiteralExpression */: + case 189 /* TypeOfExpression */: + case 203 /* NonNullExpression */: + case 250 /* JsxSelfClosingElement */: + case 249 /* JsxElement */: return true; - case 193 /* ConditionalExpression */: + case 195 /* ConditionalExpression */: return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); - case 192 /* BinaryExpression */: + case 194 /* BinaryExpression */: if (ts.isAssignmentOperator(node.operatorToken.kind)) { return false; } return isSideEffectFree(node.left) && isSideEffectFree(node.right); - case 190 /* PrefixUnaryExpression */: - case 191 /* PostfixUnaryExpression */: + case 192 /* PrefixUnaryExpression */: + case 193 /* PostfixUnaryExpression */: // Unary operators ~, !, +, and - have no side effects. // The rest do. switch (node.operator) { - case 50 /* ExclamationToken */: - case 36 /* PlusToken */: - case 37 /* MinusToken */: - case 51 /* TildeToken */: + case 51 /* ExclamationToken */: + case 37 /* PlusToken */: + case 38 /* MinusToken */: + case 52 /* TildeToken */: return true; } return false; // Some forms listed here for clarity - case 188 /* VoidExpression */: // Explicit opt-out - case 182 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings - case 200 /* AsExpression */: // Not SEF, but can produce useful type warnings + case 190 /* VoidExpression */: // Explicit opt-out + case 184 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings + case 202 /* AsExpression */: // Not SEF, but can produce useful type warnings default: return false; } @@ -37761,54 +40823,44 @@ var ts; firstAssignableToSecond && !secondAssignableToFirst ? type2 : getUnionType([type1, type2], /*subtypeReduction*/ true); } - function checkBinaryExpression(node, contextualMapper) { - return checkBinaryLikeExpression(node.left, node.operatorToken, node.right, contextualMapper, node); + function checkBinaryExpression(node, checkMode) { + return checkBinaryLikeExpression(node.left, node.operatorToken, node.right, checkMode, node); } - function checkBinaryLikeExpression(left, operatorToken, right, contextualMapper, errorNode) { + function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { var operator = operatorToken.kind; - if (operator === 57 /* EqualsToken */ && (left.kind === 176 /* ObjectLiteralExpression */ || left.kind === 175 /* ArrayLiteralExpression */)) { - return checkDestructuringAssignment(left, checkExpression(right, contextualMapper), contextualMapper); + if (operator === 58 /* EqualsToken */ && (left.kind === 178 /* ObjectLiteralExpression */ || left.kind === 177 /* ArrayLiteralExpression */)) { + return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode); } - var leftType = checkExpression(left, contextualMapper); - var rightType = checkExpression(right, contextualMapper); + var leftType = checkExpression(left, checkMode); + var rightType = checkExpression(right, checkMode); switch (operator) { - case 38 /* AsteriskToken */: - case 39 /* AsteriskAsteriskToken */: - case 60 /* AsteriskEqualsToken */: - case 61 /* AsteriskAsteriskEqualsToken */: - case 40 /* SlashToken */: - case 62 /* SlashEqualsToken */: - case 41 /* PercentToken */: - case 63 /* PercentEqualsToken */: - case 37 /* MinusToken */: - case 59 /* MinusEqualsToken */: - case 44 /* LessThanLessThanToken */: - case 64 /* LessThanLessThanEqualsToken */: - case 45 /* GreaterThanGreaterThanToken */: - case 65 /* GreaterThanGreaterThanEqualsToken */: - case 46 /* GreaterThanGreaterThanGreaterThanToken */: - case 66 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - case 48 /* BarToken */: - case 68 /* BarEqualsToken */: - case 49 /* CaretToken */: - case 69 /* CaretEqualsToken */: - case 47 /* AmpersandToken */: - case 67 /* AmpersandEqualsToken */: + case 39 /* AsteriskToken */: + case 40 /* AsteriskAsteriskToken */: + case 61 /* AsteriskEqualsToken */: + case 62 /* AsteriskAsteriskEqualsToken */: + case 41 /* SlashToken */: + case 63 /* SlashEqualsToken */: + case 42 /* PercentToken */: + case 64 /* PercentEqualsToken */: + case 38 /* MinusToken */: + case 60 /* MinusEqualsToken */: + case 45 /* LessThanLessThanToken */: + case 65 /* LessThanLessThanEqualsToken */: + case 46 /* GreaterThanGreaterThanToken */: + case 66 /* GreaterThanGreaterThanEqualsToken */: + case 47 /* GreaterThanGreaterThanGreaterThanToken */: + case 67 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 49 /* BarToken */: + case 69 /* BarEqualsToken */: + case 50 /* CaretToken */: + case 70 /* CaretEqualsToken */: + case 48 /* AmpersandToken */: + case 68 /* AmpersandEqualsToken */: if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } - // TypeScript 1.0 spec (April 2014): 4.19.1 - // These operators require their operands to be of type Any, the Number primitive type, - // or an enum type. Operands of an enum type are treated - // as having the primitive type Number. If one operand is the null or undefined value, - // it is treated as having the type of the other operand. - // The result is always of the Number primitive type. - if (leftType.flags & 6144 /* Nullable */) - leftType = rightType; - if (rightType.flags & 6144 /* Nullable */) - rightType = leftType; - leftType = getNonNullableType(leftType); - rightType = getNonNullableType(rightType); + leftType = checkNonNullType(leftType, left); + rightType = checkNonNullType(rightType, right); var suggestedOperator = void 0; // if a user tries to apply a bitwise operator to 2 boolean operands // try and return them a helpful suggestion @@ -37826,21 +40878,15 @@ var ts; } } return numberType; - case 36 /* PlusToken */: - case 58 /* PlusEqualsToken */: + case 37 /* PlusToken */: + case 59 /* PlusEqualsToken */: if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } - // TypeScript 1.0 spec (April 2014): 4.19.2 - // The binary + operator requires both operands to be of the Number primitive type or an enum type, - // or at least one of the operands to be of type Any or the String primitive type. - // If one operand is the null or undefined value, it is treated as having the type of the other operand. - if (leftType.flags & 6144 /* Nullable */) - leftType = rightType; - if (rightType.flags & 6144 /* Nullable */) - rightType = leftType; - leftType = getNonNullableType(leftType); - rightType = getNonNullableType(rightType); + if (!isTypeOfKind(leftType, 1 /* Any */ | 262178 /* StringLike */) && !isTypeOfKind(rightType, 1 /* Any */ | 262178 /* StringLike */)) { + leftType = checkNonNullType(leftType, left); + rightType = checkNonNullType(rightType, right); + } var resultType = void 0; if (isTypeOfKind(leftType, 340 /* NumberLike */) && isTypeOfKind(rightType, 340 /* NumberLike */)) { // Operands of an enum type are treated as having the primitive type Number. @@ -37866,26 +40912,26 @@ var ts; reportOperatorError(); return anyType; } - if (operator === 58 /* PlusEqualsToken */) { + if (operator === 59 /* PlusEqualsToken */) { checkAssignmentOperator(resultType); } return resultType; - case 26 /* LessThanToken */: - case 28 /* GreaterThanToken */: - case 29 /* LessThanEqualsToken */: - case 30 /* GreaterThanEqualsToken */: + case 27 /* LessThanToken */: + case 29 /* GreaterThanToken */: + case 30 /* LessThanEqualsToken */: + case 31 /* GreaterThanEqualsToken */: if (checkForDisallowedESSymbolOperand(operator)) { - leftType = getBaseTypeOfLiteralType(leftType); - rightType = getBaseTypeOfLiteralType(rightType); + leftType = getBaseTypeOfLiteralType(checkNonNullType(leftType, left)); + rightType = getBaseTypeOfLiteralType(checkNonNullType(rightType, right)); if (!isTypeComparableTo(leftType, rightType) && !isTypeComparableTo(rightType, leftType)) { reportOperatorError(); } } return booleanType; - case 31 /* EqualsEqualsToken */: - case 32 /* ExclamationEqualsToken */: - case 33 /* EqualsEqualsEqualsToken */: - case 34 /* ExclamationEqualsEqualsToken */: + case 32 /* EqualsEqualsToken */: + case 33 /* ExclamationEqualsToken */: + case 34 /* EqualsEqualsEqualsToken */: + case 35 /* ExclamationEqualsEqualsToken */: var leftIsLiteral = isLiteralType(leftType); var rightIsLiteral = isLiteralType(rightType); if (!leftIsLiteral || !rightIsLiteral) { @@ -37896,27 +40942,30 @@ var ts; reportOperatorError(); } return booleanType; - case 92 /* InstanceOfKeyword */: + case 93 /* InstanceOfKeyword */: return checkInstanceOfExpression(left, right, leftType, rightType); - case 91 /* InKeyword */: + case 92 /* InKeyword */: return checkInExpression(left, right, leftType, rightType); - case 52 /* AmpersandAmpersandToken */: + case 53 /* AmpersandAmpersandToken */: return getTypeFacts(leftType) & 1048576 /* Truthy */ ? includeFalsyTypes(rightType, getFalsyFlags(strictNullChecks ? leftType : getBaseTypeOfLiteralType(rightType))) : leftType; - case 53 /* BarBarToken */: + case 54 /* BarBarToken */: return getTypeFacts(leftType) & 2097152 /* Falsy */ ? getBestChoiceType(removeDefinitelyFalsyTypes(leftType), rightType) : leftType; - case 57 /* EqualsToken */: + case 58 /* EqualsToken */: checkAssignmentOperator(rightType); return getRegularTypeOfObjectLiteral(rightType); - case 25 /* CommaToken */: - if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left)) { + case 26 /* CommaToken */: + if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left) && !isEvalNode(right)) { error(left, ts.Diagnostics.Left_side_of_comma_operator_is_unused_and_has_no_side_effects); } return rightType; } + function isEvalNode(node) { + return node.kind === 71 /* Identifier */ && node.text === "eval"; + } // Return true if there was no error, false if there was an error. function checkForDisallowedESSymbolOperand(operator) { var offendingSymbolOperand = maybeTypeOfKind(leftType, 512 /* ESSymbol */) ? left : @@ -37930,21 +40979,21 @@ var ts; } function getSuggestedBooleanOperator(operator) { switch (operator) { - case 48 /* BarToken */: - case 68 /* BarEqualsToken */: - return 53 /* BarBarToken */; - case 49 /* CaretToken */: - case 69 /* CaretEqualsToken */: - return 34 /* ExclamationEqualsEqualsToken */; - case 47 /* AmpersandToken */: - case 67 /* AmpersandEqualsToken */: - return 52 /* AmpersandAmpersandToken */; + case 49 /* BarToken */: + case 69 /* BarEqualsToken */: + return 54 /* BarBarToken */; + case 50 /* CaretToken */: + case 70 /* CaretEqualsToken */: + return 35 /* ExclamationEqualsEqualsToken */; + case 48 /* AmpersandToken */: + case 68 /* AmpersandEqualsToken */: + return 53 /* AmpersandAmpersandToken */; default: return undefined; } } function checkAssignmentOperator(valueType) { - if (produceDiagnostics && operator >= 57 /* FirstAssignment */ && operator <= 69 /* LastAssignment */) { + if (produceDiagnostics && operator >= 58 /* FirstAssignment */ && operator <= 70 /* LastAssignment */) { // TypeScript 1.0 spec (April 2014): 4.17 // An assignment of the form // VarExpr = ValueExpr @@ -37990,23 +41039,43 @@ var ts; 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. - if (func && func.asteriskToken) { + 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 < 5 /* 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 */); + } + } + if (functionFlags & 1 /* Generator */) { var expressionType = checkExpressionCached(node.expression, /*contextualMapper*/ undefined); var expressionElementType = void 0; var nodeIsYieldStar = !!node.asteriskToken; if (nodeIsYieldStar) { - expressionElementType = checkElementTypeOfIterable(expressionType, node.expression); + 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. if (func.type) { - var signatureElementType = getElementTypeOfIterableIterator(getTypeFromTypeNode(func.type)) || anyType; + var signatureElementType = getIteratedTypeOfGenerator(getTypeFromTypeNode(func.type), (functionFlags & 2 /* Async */) !== 0) || anyType; if (nodeIsYieldStar) { - checkTypeAssignableTo(expressionElementType, signatureElementType, node.expression, /*headMessage*/ undefined); + 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(expressionType, signatureElementType, node.expression, /*headMessage*/ undefined); + 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); } } } @@ -38014,10 +41083,10 @@ var ts; // Both yield and yield* expressions have type 'any' return anyType; } - function checkConditionalExpression(node, contextualMapper) { + function checkConditionalExpression(node, checkMode) { checkExpression(node.condition); - var type1 = checkExpression(node.whenTrue, contextualMapper); - var type2 = checkExpression(node.whenFalse, contextualMapper); + var type1 = checkExpression(node.whenTrue, checkMode); + var type2 = checkExpression(node.whenFalse, checkMode); return getBestChoiceType(type1, type2); } function checkLiteralExpression(node) { @@ -38029,9 +41098,9 @@ var ts; return getFreshTypeOfLiteralType(getLiteralTypeForText(32 /* StringLiteral */, node.text)); case 8 /* NumericLiteral */: return getFreshTypeOfLiteralType(getLiteralTypeForText(64 /* NumberLiteral */, node.text)); - case 100 /* TrueKeyword */: + case 101 /* TrueKeyword */: return trueType; - case 85 /* FalseKeyword */: + case 86 /* FalseKeyword */: return falseType; } } @@ -38048,12 +41117,17 @@ var ts; } function checkExpressionWithContextualType(node, contextualType, contextualMapper) { var saveContextualType = node.contextualType; + var saveContextualMapper = node.contextualMapper; node.contextualType = contextualType; - var result = checkExpression(node, contextualMapper); + node.contextualMapper = contextualMapper; + var checkMode = contextualMapper === identityMapper ? 1 /* SkipContextSensitive */ : + contextualMapper ? 2 /* Inferential */ : 0 /* Normal */; + var result = checkExpression(node, checkMode); node.contextualType = saveContextualType; + node.contextualMapper = saveContextualMapper; return result; } - function checkExpressionCached(node, contextualMapper) { + function checkExpressionCached(node, checkMode) { var links = getNodeLinks(node); if (!links.resolvedType) { // When computing a type that we're going to cache, we need to ignore any ongoing control flow @@ -38061,17 +41135,17 @@ var ts; // to the top of the stack ensures all transient types are computed from a known point. var saveFlowLoopStart = flowLoopStart; flowLoopStart = flowLoopCount; - links.resolvedType = checkExpression(node, contextualMapper); + links.resolvedType = checkExpression(node, checkMode); flowLoopStart = saveFlowLoopStart; } return links.resolvedType; } function isTypeAssertion(node) { node = ts.skipParentheses(node); - return node.kind === 182 /* TypeAssertionExpression */ || node.kind === 200 /* AsExpression */; + return node.kind === 184 /* TypeAssertionExpression */ || node.kind === 202 /* AsExpression */; } function checkDeclarationInitializer(declaration) { - var type = checkExpressionCached(declaration.initializer); + var type = getTypeOfExpression(declaration.initializer, /*cache*/ true); return ts.getCombinedNodeFlags(declaration) & 2 /* Const */ || ts.getCombinedModifierFlags(declaration) & 64 /* Readonly */ && !ts.isParameterPropertyDeclaration(declaration) || isTypeAssertion(declaration.initializer) ? type : getWidenedLiteralType(type); @@ -38079,65 +41153,69 @@ var ts; function isLiteralContextualType(contextualType) { if (contextualType) { if (contextualType.flags & 540672 /* TypeVariable */) { - var apparentType = getApparentTypeOfTypeVariable(contextualType); + var constraint = getBaseConstraintOfType(contextualType) || emptyObjectType; // If the type parameter is constrained to the base primitive type we're checking for, // consider this a literal context. For example, given a type parameter 'T extends string', // this causes us to infer string literal types for T. - if (apparentType.flags & (2 /* String */ | 4 /* Number */ | 8 /* Boolean */ | 16 /* Enum */)) { + if (constraint.flags & (2 /* String */ | 4 /* Number */ | 8 /* Boolean */ | 16 /* Enum */)) { return true; } - contextualType = apparentType; + contextualType = constraint; } return maybeTypeOfKind(contextualType, (480 /* Literal */ | 262144 /* Index */)); } return false; } - function checkExpressionForMutableLocation(node, contextualMapper) { - var type = checkExpression(node, contextualMapper); + function checkExpressionForMutableLocation(node, checkMode) { + var type = checkExpression(node, checkMode); return isTypeAssertion(node) || isLiteralContextualType(getContextualType(node)) ? type : getWidenedLiteralType(type); } - function checkPropertyAssignment(node, contextualMapper) { + function checkPropertyAssignment(node, checkMode) { // 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 === 142 /* ComputedPropertyName */) { + if (node.name.kind === 144 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } - return checkExpressionForMutableLocation(node.initializer, contextualMapper); + return checkExpressionForMutableLocation(node.initializer, checkMode); } - function checkObjectLiteralMethod(node, contextualMapper) { + function checkObjectLiteralMethod(node, checkMode) { // Grammar checking checkGrammarMethod(node); // 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 === 142 /* ComputedPropertyName */) { + if (node.name.kind === 144 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } - var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); - return instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, contextualMapper); + var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); + return instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, checkMode); } - function instantiateTypeWithSingleGenericCallSignature(node, type, contextualMapper) { - if (isInferentialContext(contextualMapper)) { + function instantiateTypeWithSingleGenericCallSignature(node, type, checkMode) { + if (checkMode === 2 /* Inferential */) { var signature = getSingleCallSignature(type); if (signature && signature.typeParameters) { var contextualType = getApparentTypeOfContextualType(node); if (contextualType) { var contextualSignature = getSingleCallSignature(contextualType); if (contextualSignature && !contextualSignature.typeParameters) { - return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper)); + return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, getContextualMapper(node))); } } } } return type; } - // Returns the type of an expression. Unlike checkExpression, this function is simply concerned - // with computing the type and may not fully check all contained sub-expressions for errors. - function getTypeOfExpression(node) { + /** + * Returns the type of an expression. Unlike checkExpression, this function is simply concerned + * with computing the type and may not fully check all contained sub-expressions for errors. + * A cache argument of true indicates that if the function performs a full type check, it is ok + * to cache the result. + */ + 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 === 179 /* CallExpression */ && node.expression.kind !== 96 /* SuperKeyword */) { + if (node.kind === 181 /* CallExpression */ && node.expression.kind !== 97 /* SuperKeyword */ && !ts.isRequireCall(node, /*checkArgumentIsStringLiteral*/ true)) { var funcType = checkNonNullExpression(node.expression); var signature = getSingleCallSignature(funcType); if (signature && !signature.typeParameters) { @@ -38147,7 +41225,21 @@ var ts; // Otherwise simply call checkExpression. Ideally, the entire family of checkXXX functions // should have a parameter that indicates whether full error checking is required such that // we can perform the optimizations locally. - return checkExpression(node); + return cache ? checkExpressionCached(node) : checkExpression(node); + } + /** + * Returns the type of an expression. Unlike checkExpression, this function is simply concerned + * with computing the type and may not fully check all contained sub-expressions for errors. + * It is intended for uses where you know there is no contextual type, + * and requesting the contextual type might cause a circularity or other bad behaviour. + * It sets the contextual type of the node to any before calling getTypeOfExpression. + */ + function getContextFreeTypeOfExpression(node) { + var saveContextualType = node.contextualType; + node.contextualType = anyType; + var type = getTypeOfExpression(node); + node.contextualType = saveContextualType; + return type; } // Checks an expression and returns its type. The contextualMapper parameter serves two purposes: When // contextualMapper is not undefined and not equal to the identityMapper function object it indicates that the @@ -38156,104 +41248,108 @@ var ts; // object, it serves as an indicator that all contained function and arrow expressions should be considered to // have the wildcard function type; this form of type check is used during overload resolution to exclude // contextually typed function and arrow expressions in the initial phase. - function checkExpression(node, contextualMapper) { + function checkExpression(node, checkMode) { var type; - if (node.kind === 141 /* QualifiedName */) { + if (node.kind === 143 /* QualifiedName */) { type = checkQualifiedName(node); } else { - var uninstantiatedType = checkExpressionWorker(node, contextualMapper); - type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, contextualMapper); + var uninstantiatedType = checkExpressionWorker(node, checkMode); + type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, checkMode); } if (isConstEnumObjectType(type)) { // enum object type for const enums are only permitted in: // - 'left' in property access // - 'object' in indexed access // - target in rhs of import statement - var ok = (node.parent.kind === 177 /* PropertyAccessExpression */ && node.parent.expression === node) || - (node.parent.kind === 178 /* ElementAccessExpression */ && node.parent.expression === node) || - ((node.kind === 70 /* Identifier */ || node.kind === 141 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node)); + var ok = (node.parent.kind === 179 /* PropertyAccessExpression */ && node.parent.expression === node) || + (node.parent.kind === 180 /* ElementAccessExpression */ && node.parent.expression === node) || + ((node.kind === 71 /* Identifier */ || node.kind === 143 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(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); } } return type; } - function checkExpressionWorker(node, contextualMapper) { + function checkExpressionWorker(node, checkMode) { switch (node.kind) { - case 70 /* Identifier */: + case 71 /* Identifier */: return checkIdentifier(node); - case 98 /* ThisKeyword */: + case 99 /* ThisKeyword */: return checkThisExpression(node); - case 96 /* SuperKeyword */: + case 97 /* SuperKeyword */: return checkSuperExpression(node); - case 94 /* NullKeyword */: + case 95 /* NullKeyword */: return nullWideningType; case 9 /* StringLiteral */: case 8 /* NumericLiteral */: - case 100 /* TrueKeyword */: - case 85 /* FalseKeyword */: + case 101 /* TrueKeyword */: + case 86 /* FalseKeyword */: return checkLiteralExpression(node); - case 194 /* TemplateExpression */: + case 196 /* TemplateExpression */: return checkTemplateExpression(node); - case 12 /* NoSubstitutionTemplateLiteral */: + case 13 /* NoSubstitutionTemplateLiteral */: return stringType; - case 11 /* RegularExpressionLiteral */: + case 12 /* RegularExpressionLiteral */: return globalRegExpType; - case 175 /* ArrayLiteralExpression */: - return checkArrayLiteral(node, contextualMapper); - case 176 /* ObjectLiteralExpression */: - return checkObjectLiteral(node, contextualMapper); - case 177 /* PropertyAccessExpression */: + case 177 /* ArrayLiteralExpression */: + return checkArrayLiteral(node, checkMode); + case 178 /* ObjectLiteralExpression */: + return checkObjectLiteral(node, checkMode); + case 179 /* PropertyAccessExpression */: return checkPropertyAccessExpression(node); - case 178 /* ElementAccessExpression */: + case 180 /* ElementAccessExpression */: return checkIndexedAccess(node); - case 179 /* CallExpression */: - case 180 /* NewExpression */: + case 181 /* CallExpression */: + case 182 /* NewExpression */: return checkCallExpression(node); - case 181 /* TaggedTemplateExpression */: + case 183 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 183 /* ParenthesizedExpression */: - return checkExpression(node.expression, contextualMapper); - case 197 /* ClassExpression */: + case 185 /* ParenthesizedExpression */: + return checkExpression(node.expression, checkMode); + case 199 /* ClassExpression */: return checkClassExpression(node); - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); - case 187 /* TypeOfExpression */: + case 186 /* FunctionExpression */: + case 187 /* ArrowFunction */: + return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); + case 189 /* TypeOfExpression */: return checkTypeOfExpression(node); - case 182 /* TypeAssertionExpression */: - case 200 /* AsExpression */: + case 184 /* TypeAssertionExpression */: + case 202 /* AsExpression */: return checkAssertion(node); - case 201 /* NonNullExpression */: + case 203 /* NonNullExpression */: return checkNonNullAssertion(node); - case 186 /* DeleteExpression */: + case 204 /* MetaProperty */: + return checkMetaProperty(node); + case 188 /* DeleteExpression */: return checkDeleteExpression(node); - case 188 /* VoidExpression */: + case 190 /* VoidExpression */: return checkVoidExpression(node); - case 189 /* AwaitExpression */: + case 191 /* AwaitExpression */: return checkAwaitExpression(node); - case 190 /* PrefixUnaryExpression */: + case 192 /* PrefixUnaryExpression */: return checkPrefixUnaryExpression(node); - case 191 /* PostfixUnaryExpression */: + case 193 /* PostfixUnaryExpression */: return checkPostfixUnaryExpression(node); - case 192 /* BinaryExpression */: - return checkBinaryExpression(node, contextualMapper); - case 193 /* ConditionalExpression */: - return checkConditionalExpression(node, contextualMapper); - case 196 /* SpreadElement */: - return checkSpreadExpression(node, contextualMapper); - case 198 /* OmittedExpression */: + case 194 /* BinaryExpression */: + return checkBinaryExpression(node, checkMode); + case 195 /* ConditionalExpression */: + return checkConditionalExpression(node, checkMode); + case 198 /* SpreadElement */: + return checkSpreadExpression(node, checkMode); + case 200 /* OmittedExpression */: return undefinedWideningType; - case 195 /* YieldExpression */: + case 197 /* YieldExpression */: return checkYieldExpression(node); - case 252 /* JsxExpression */: - return checkJsxExpression(node); - case 246 /* JsxElement */: + case 256 /* JsxExpression */: + return checkJsxExpression(node, checkMode); + case 249 /* JsxElement */: return checkJsxElement(node); - case 247 /* JsxSelfClosingElement */: + case 250 /* JsxSelfClosingElement */: return checkJsxSelfClosingElement(node); - case 248 /* JsxOpeningElement */: + case 254 /* JsxAttributes */: + return checkJsxAttributes(node, checkMode); + case 251 /* JsxOpeningElement */: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return unknownType; @@ -38265,7 +41361,16 @@ var ts; grammarErrorOnFirstToken(node.expression, ts.Diagnostics.Type_expected); } checkSourceElement(node.constraint); - getConstraintOfTypeParameter(getDeclaredTypeOfTypeParameter(getSymbolOfNode(node))); + checkSourceElement(node.default); + var typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfNode(node)); + if (!hasNonCircularBaseConstraint(typeParameter)) { + error(node.constraint, ts.Diagnostics.Type_parameter_0_has_a_circular_constraint, typeToString(typeParameter)); + } + var constraintType = getConstraintOfTypeParameter(typeParameter); + var defaultType = getDefaultFromTypeParameter(typeParameter); + if (constraintType && defaultType) { + checkTypeAssignableTo(defaultType, getTypeWithThisArgument(constraintType, defaultType), node.default, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + } if (produceDiagnostics) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_parameter_name_cannot_be_0); } @@ -38281,7 +41386,7 @@ var ts; var func = ts.getContainingFunction(node); if (ts.getModifierFlags(node) & 92 /* ParameterPropertyModifier */) { func = ts.getContainingFunction(node); - if (!(func.kind === 150 /* Constructor */ && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 152 /* Constructor */ && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } } @@ -38292,7 +41397,7 @@ var ts; if (ts.indexOf(func.parameters, node) !== 0) { error(node, ts.Diagnostics.A_this_parameter_must_be_the_first_parameter); } - if (func.kind === 150 /* Constructor */ || func.kind === 154 /* ConstructSignature */ || func.kind === 159 /* ConstructorType */) { + if (func.kind === 152 /* Constructor */ || func.kind === 156 /* ConstructSignature */ || func.kind === 161 /* ConstructorType */) { error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter); } } @@ -38302,19 +41407,11 @@ var ts; error(node, ts.Diagnostics.A_rest_parameter_must_be_of_an_array_type); } } - function isSyntacticallyValidGenerator(node) { - if (!node.asteriskToken || !node.body) { - return false; - } - return node.kind === 149 /* MethodDeclaration */ || - node.kind === 225 /* FunctionDeclaration */ || - node.kind === 184 /* FunctionExpression */; - } function getTypePredicateParameterIndex(parameterList, parameter) { if (parameterList) { for (var i = 0; i < parameterList.length; i++) { var param = parameterList[i]; - if (param.name.kind === 70 /* Identifier */ && + if (param.name.kind === 71 /* Identifier */ && param.name.text === parameter.text) { return i; } @@ -38343,7 +41440,7 @@ var ts; error(parameterName, ts.Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter); } else { - var leadingError = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type); + var leadingError = ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type); checkTypeAssignableTo(typePredicate.type, getTypeOfNode(parent.parameters[typePredicate.parameterIndex]), node.type, /*headMessage*/ undefined, leadingError); } @@ -38351,9 +41448,9 @@ var ts; else if (parameterName) { var hasReportedError = false; for (var _i = 0, _a = parent.parameters; _i < _a.length; _i++) { - var name_21 = _a[_i].name; - if (ts.isBindingPattern(name_21) && - checkIfTypePredicateVariableIsDeclaredInBindingPattern(name_21, parameterName, typePredicate.parameterName)) { + var name = _a[_i].name; + if (ts.isBindingPattern(name) && + checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, parameterName, typePredicate.parameterName)) { hasReportedError = true; break; } @@ -38366,16 +41463,16 @@ var ts; } function getTypePredicateParent(node) { switch (node.parent.kind) { - case 185 /* ArrowFunction */: - case 153 /* CallSignature */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 158 /* FunctionType */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - var parent_10 = node.parent; - if (node === parent_10.type) { - return parent_10; + case 187 /* ArrowFunction */: + case 155 /* CallSignature */: + case 228 /* FunctionDeclaration */: + case 186 /* FunctionExpression */: + case 160 /* FunctionType */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: + var parent = node.parent; + if (node === parent.type) { + return parent; } } } @@ -38385,15 +41482,15 @@ var ts; if (ts.isOmittedExpression(element)) { continue; } - var name_22 = element.name; - if (name_22.kind === 70 /* Identifier */ && - name_22.text === predicateVariableName) { + var name = element.name; + if (name.kind === 71 /* Identifier */ && + name.text === predicateVariableName) { error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); return true; } - else if (name_22.kind === 173 /* ArrayBindingPattern */ || - name_22.kind === 172 /* ObjectBindingPattern */) { - if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name_22, predicateVariableNode, predicateVariableName)) { + else if (name.kind === 175 /* ArrayBindingPattern */ || + name.kind === 174 /* ObjectBindingPattern */) { + if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) { return true; } } @@ -38401,17 +41498,27 @@ var ts; } function checkSignatureDeclaration(node) { // Grammar checking - if (node.kind === 155 /* IndexSignature */) { + if (node.kind === 157 /* IndexSignature */) { checkGrammarIndexSignature(node); } - else if (node.kind === 158 /* FunctionType */ || node.kind === 225 /* FunctionDeclaration */ || node.kind === 159 /* ConstructorType */ || - node.kind === 153 /* CallSignature */ || node.kind === 150 /* Constructor */ || - node.kind === 154 /* ConstructSignature */) { + else if (node.kind === 160 /* FunctionType */ || node.kind === 228 /* FunctionDeclaration */ || node.kind === 161 /* ConstructorType */ || + node.kind === 155 /* CallSignature */ || node.kind === 152 /* Constructor */ || + node.kind === 156 /* ConstructSignature */) { checkGrammarFunctionLikeDeclaration(node); } - if (ts.isAsyncFunctionLike(node) && languageVersion < 4 /* ES2017 */) { - checkExternalEmitHelpers(node, 64 /* Awaiter */); - if (languageVersion < 2 /* ES2015 */) { + var functionFlags = ts.getFunctionFlags(node); + if (!(functionFlags & 4 /* Invalid */)) { + // Async generators prior to ESNext require the __await and __asyncGenerator helpers + if ((functionFlags & 3 /* AsyncGenerator */) === 3 /* AsyncGenerator */ && languageVersion < 5 /* ESNext */) { + checkExternalEmitHelpers(node, 6144 /* AsyncGeneratorIncludes */); + } + // Async functions prior to ES2017 require the __awaiter helper + if ((functionFlags & 3 /* AsyncGenerator */) === 2 /* Async */ && languageVersion < 4 /* ES2017 */) { + checkExternalEmitHelpers(node, 64 /* Awaiter */); + } + // Generator functions, Async functions, and Async Generator functions prior to + // ES2015 require the __generator helper + if ((functionFlags & 3 /* AsyncGenerator */) !== 0 /* Normal */ && languageVersion < 2 /* ES2015 */) { checkExternalEmitHelpers(node, 128 /* Generator */); } } @@ -38422,25 +41529,28 @@ var ts; } if (produceDiagnostics) { checkCollisionWithArgumentsInGeneratedCode(node); - if (compilerOptions.noImplicitAny && !node.type) { + if (noImplicitAny && !node.type) { switch (node.kind) { - case 154 /* ConstructSignature */: + case 156 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 153 /* CallSignature */: + case 155 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } } if (node.type) { - if (languageVersion >= 2 /* ES2015 */ && isSyntacticallyValidGenerator(node)) { + var functionFlags_1 = ts.getFunctionFlags(node); + if ((functionFlags_1 & (4 /* Invalid */ | 1 /* Generator */)) === 1 /* Generator */) { var returnType = getTypeFromTypeNode(node.type); if (returnType === voidType) { error(node.type, ts.Diagnostics.A_generator_cannot_have_a_void_type_annotation); } else { - var generatorElementType = getElementTypeOfIterableIterator(returnType) || anyType; - var iterableIteratorInstantiation = createIterableIteratorType(generatorElementType); + var generatorElementType = getIteratedTypeOfGenerator(returnType, (functionFlags_1 & 2 /* Async */) !== 0) || anyType; + var iterableIteratorInstantiation = functionFlags_1 & 2 /* Async */ + ? createAsyncIterableIteratorType(generatorElementType) // AsyncGenerator function + : createIterableIteratorType(generatorElementType); // Generator function // Naively, one could check that IterableIterator is assignable to the return type annotation. // However, that would not catch the error in the following case. // @@ -38450,7 +41560,7 @@ var ts; checkTypeAssignableTo(iterableIteratorInstantiation, returnType, node.type); } } - else if (ts.isAsyncFunctionLike(node)) { + else if ((functionFlags_1 & 3 /* AsyncGenerator */) === 2 /* Async */) { checkAsyncFunctionReturnType(node); } } @@ -38460,17 +41570,18 @@ var ts; } } function checkClassForDuplicateDeclarations(node) { - var Accessor; - (function (Accessor) { - Accessor[Accessor["Getter"] = 1] = "Getter"; - Accessor[Accessor["Setter"] = 2] = "Setter"; - Accessor[Accessor["Property"] = 3] = "Property"; - })(Accessor || (Accessor = {})); + var Declaration; + (function (Declaration) { + Declaration[Declaration["Getter"] = 1] = "Getter"; + Declaration[Declaration["Setter"] = 2] = "Setter"; + Declaration[Declaration["Method"] = 4] = "Method"; + Declaration[Declaration["Property"] = 3] = "Property"; + })(Declaration || (Declaration = {})); var instanceNames = ts.createMap(); var staticNames = ts.createMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 150 /* Constructor */) { + if (member.kind === 152 /* Constructor */) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var param = _c[_b]; if (ts.isParameterPropertyDeclaration(param)) { @@ -38479,36 +41590,76 @@ var ts; } } else { - var isStatic = ts.forEach(member.modifiers, function (m) { return m.kind === 114 /* StaticKeyword */; }); + var isStatic = ts.getModifierFlags(member) & 32 /* Static */; var names = isStatic ? staticNames : instanceNames; var memberName = member.name && ts.getPropertyNameForPropertyNameNode(member.name); if (memberName) { switch (member.kind) { - case 151 /* GetAccessor */: + case 153 /* GetAccessor */: addName(names, member.name, memberName, 1 /* Getter */); break; - case 152 /* SetAccessor */: + case 154 /* SetAccessor */: addName(names, member.name, memberName, 2 /* Setter */); break; - case 147 /* PropertyDeclaration */: + case 149 /* PropertyDeclaration */: addName(names, member.name, memberName, 3 /* Property */); break; + case 151 /* MethodDeclaration */: + addName(names, member.name, memberName, 4 /* Method */); + break; } } } } function addName(names, location, name, meaning) { - var prev = names[name]; + var prev = names.get(name); if (prev) { - if (prev & meaning) { + if (prev & 4 /* Method */) { + if (meaning !== 4 /* Method */) { + error(location, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(location)); + } + } + else if (prev & meaning) { error(location, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(location)); } else { - names[name] = prev | meaning; + names.set(name, prev | meaning); } } else { - names[name] = meaning; + names.set(name, meaning); + } + } + } + /** + * Static members being set on a constructor function may conflict with built-in properties + * of Function. Esp. in ECMAScript 5 there are non-configurable and non-writable + * built-in properties. This check issues a transpile error when a class has a static + * member with the same name as a non-writable built-in property. + * + * @see http://www.ecma-international.org/ecma-262/5.1/#sec-15.3.3 + * @see http://www.ecma-international.org/ecma-262/5.1/#sec-15.3.5 + * @see http://www.ecma-international.org/ecma-262/6.0/#sec-properties-of-the-function-constructor + * @see http://www.ecma-international.org/ecma-262/6.0/#sec-function-instances + */ + function checkClassForStaticPropertyNameConflicts(node) { + for (var _i = 0, _a = node.members; _i < _a.length; _i++) { + var member = _a[_i]; + var memberNameNode = member.name; + var isStatic = ts.getModifierFlags(member) & 32 /* Static */; + if (isStatic && memberNameNode) { + var memberName = ts.getPropertyNameForPropertyNameNode(memberNameNode); + switch (memberName) { + case "name": + case "length": + case "caller": + case "arguments": + case "prototype": + var message = ts.Diagnostics.Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1; + var className = getNameOfSymbol(getSymbolOfNode(node)); + error(memberNameNode, message, memberName, className); + break; + } } } } @@ -38516,29 +41667,29 @@ var ts; var names = ts.createMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind == 146 /* PropertySignature */) { + if (member.kind === 148 /* PropertySignature */) { var memberName = void 0; switch (member.name.kind) { case 9 /* StringLiteral */: case 8 /* NumericLiteral */: - case 70 /* Identifier */: + case 71 /* Identifier */: memberName = member.name.text; break; default: continue; } - if (names[memberName]) { - error(member.symbol.valueDeclaration.name, ts.Diagnostics.Duplicate_identifier_0, memberName); + if (names.get(memberName)) { + error(ts.getNameOfDeclaration(member.symbol.valueDeclaration), ts.Diagnostics.Duplicate_identifier_0, memberName); error(member.name, ts.Diagnostics.Duplicate_identifier_0, memberName); } else { - names[memberName] = true; + names.set(memberName, true); } } } } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 227 /* InterfaceDeclaration */) { + if (node.kind === 230 /* 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 @@ -38558,7 +41709,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 134 /* StringKeyword */: + case 136 /* StringKeyword */: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -38566,7 +41717,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 132 /* NumberKeyword */: + case 133 /* NumberKeyword */: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -38616,7 +41767,8 @@ var ts; return; } function containsSuperCallAsComputedPropertyName(n) { - return n.name && containsSuperCall(n.name); + var name = ts.getNameOfDeclaration(n); + return name && containsSuperCall(name); } function containsSuperCall(n) { if (ts.isSuperCall(n)) { @@ -38631,15 +41783,15 @@ var ts; return ts.forEachChild(n, containsSuperCall); } function markThisReferencesAsErrors(n) { - if (n.kind === 98 /* ThisKeyword */) { + if (n.kind === 99 /* ThisKeyword */) { error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); } - else if (n.kind !== 184 /* FunctionExpression */ && n.kind !== 225 /* FunctionDeclaration */) { + else if (n.kind !== 186 /* FunctionExpression */ && n.kind !== 228 /* FunctionDeclaration */) { ts.forEachChild(n, markThisReferencesAsErrors); } } function isInstancePropertyWithInitializer(n) { - return n.kind === 147 /* PropertyDeclaration */ && + return n.kind === 149 /* PropertyDeclaration */ && !(ts.getModifierFlags(n) & 32 /* Static */) && !!n.initializer; } @@ -38669,7 +41821,7 @@ var ts; var superCallStatement = void 0; for (var _i = 0, statements_3 = statements; _i < statements_3.length; _i++) { var statement = statements_3[_i]; - if (statement.kind === 207 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { + if (statement.kind === 210 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { superCallStatement = statement; break; } @@ -38693,7 +41845,7 @@ var ts; checkGrammarFunctionLikeDeclaration(node) || checkGrammarAccessor(node) || checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 151 /* GetAccessor */) { + if (node.kind === 153 /* GetAccessor */) { if (!ts.isInAmbientContext(node) && 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); @@ -38703,13 +41855,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 === 142 /* ComputedPropertyName */) { + if (node.name.kind === 144 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } if (!ts.hasDynamicName(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 === 151 /* GetAccessor */ ? 152 /* SetAccessor */ : 151 /* GetAccessor */; + var otherKind = node.kind === 153 /* GetAccessor */ ? 154 /* SetAccessor */ : 153 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(node.symbol, otherKind); if (otherAccessor) { if ((ts.getModifierFlags(node) & 28 /* AccessibilityModifier */) !== (ts.getModifierFlags(otherAccessor) & 28 /* AccessibilityModifier */)) { @@ -38725,17 +41877,12 @@ var ts; } } var returnType = getTypeOfAccessors(getSymbolOfNode(node)); - if (node.kind === 151 /* GetAccessor */) { + if (node.kind === 153 /* GetAccessor */) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); } } - if (node.parent.kind !== 176 /* ObjectLiteralExpression */) { - checkSourceElement(node.body); - registerForUnusedIdentifiersCheck(node); - } - else { - checkNodeDeferred(node); - } + checkSourceElement(node.body); + registerForUnusedIdentifiersCheck(node); } function checkAccessorDeclarationTypesIdentical(first, second, getAnnotatedType, message) { var firstType = getAnnotatedType(first); @@ -38744,14 +41891,11 @@ var ts; error(first, message); } } - function checkAccessorDeferred(node) { - checkSourceElement(node.body); - registerForUnusedIdentifiersCheck(node); - } function checkMissingDeclaration(node) { checkDecorators(node); } function checkTypeArgumentConstraints(typeParameters, typeArgumentNodes) { + var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); var typeArguments; var mapper; var result = true; @@ -38759,7 +41903,7 @@ var ts; var constraint = getConstraintOfTypeParameter(typeParameters[i]); if (constraint) { if (!typeArguments) { - typeArguments = ts.map(typeArgumentNodes, getTypeFromTypeNode); + typeArguments = fillMissingTypeArguments(ts.map(typeArgumentNodes, getTypeFromTypeNode), typeParameters, minTypeArgumentCount); mapper = createTypeMapper(typeParameters, typeArguments); } var typeArgument = typeArguments[i]; @@ -38812,16 +41956,36 @@ var ts; function checkUnionOrIntersectionType(node) { ts.forEach(node.types, checkSourceElement); } + function checkIndexedAccessIndexType(type, accessNode) { + if (!(type.flags & 524288 /* IndexedAccess */)) { + return type; + } + // Check if the index type is assignable to 'keyof T' for the object type. + var objectType = type.objectType; + var indexType = type.indexType; + if (isTypeAssignableTo(indexType, getIndexType(objectType))) { + return type; + } + // Check if we're indexing with a numeric type and the object type is a generic + // type with a constraint that has a numeric index signature. + if (maybeTypeOfKind(objectType, 540672 /* TypeVariable */) && isTypeOfKind(indexType, 340 /* NumberLike */)) { + var constraint = getBaseConstraintOfType(objectType); + if (constraint && getIndexInfoOfType(constraint, 1 /* Number */)) { + return type; + } + } + error(accessNode, ts.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(objectType)); + return type; + } function checkIndexedAccessType(node) { - getTypeFromIndexedAccessTypeNode(node); + checkIndexedAccessIndexType(getTypeFromIndexedAccessTypeNode(node), node); } function checkMappedType(node) { checkSourceElement(node.typeParameter); checkSourceElement(node.type); var type = getTypeFromMappedTypeNode(node); var constraintType = getConstraintTypeFromMappedType(type); - var keyType = constraintType.flags & 540672 /* TypeVariable */ ? getApparentTypeOfTypeVariable(constraintType) : constraintType; - checkTypeAssignableTo(keyType, stringType, node.typeParameter.constraint); + checkTypeAssignableTo(constraintType, stringType, node.typeParameter.constraint); } function isPrivateWithinAmbient(node) { return (ts.getModifierFlags(node) & 8 /* Private */) && ts.isInAmbientContext(node); @@ -38830,9 +41994,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 !== 227 /* InterfaceDeclaration */ && - n.parent.kind !== 226 /* ClassDeclaration */ && - n.parent.kind !== 197 /* ClassExpression */ && + if (n.parent.kind !== 230 /* InterfaceDeclaration */ && + n.parent.kind !== 229 /* ClassDeclaration */ && + n.parent.kind !== 199 /* ClassExpression */ && ts.isInAmbientContext(n)) { if (!(flags & 2 /* Ambient */)) { // It is nested in an ambient context, which means it is automatically exported @@ -38864,16 +42028,16 @@ var ts; ts.forEach(overloads, function (o) { var deviation = getEffectiveDeclarationFlags(o, flagsToCheck) ^ canonicalFlags_1; if (deviation & 1 /* Export */) { - error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_exported_or_non_exported); + error(ts.getNameOfDeclaration(o), ts.Diagnostics.Overload_signatures_must_all_be_exported_or_non_exported); } else if (deviation & 2 /* Ambient */) { - error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_ambient_or_non_ambient); + error(ts.getNameOfDeclaration(o), ts.Diagnostics.Overload_signatures_must_all_be_ambient_or_non_ambient); } else if (deviation & (8 /* Private */ | 16 /* Protected */)) { - error(o.name || o, ts.Diagnostics.Overload_signatures_must_all_be_public_private_or_protected); + error(ts.getNameOfDeclaration(o) || o, ts.Diagnostics.Overload_signatures_must_all_be_public_private_or_protected); } else if (deviation & 128 /* Abstract */) { - error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_abstract_or_non_abstract); + error(ts.getNameOfDeclaration(o), ts.Diagnostics.Overload_signatures_must_all_be_abstract_or_non_abstract); } }); } @@ -38884,7 +42048,7 @@ var ts; ts.forEach(overloads, function (o) { var deviation = ts.hasQuestionToken(o) !== canonicalHasQuestionToken_1; if (deviation) { - error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_optional_or_required); + error(ts.getNameOfDeclaration(o), ts.Diagnostics.Overload_signatures_must_all_be_optional_or_required); } }); } @@ -38920,7 +42084,7 @@ var ts; var errorNode_1 = subsequentNode.name || subsequentNode; // TODO(jfreeman): These are methods, so handle computed name case if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { - var reportError = (node.kind === 149 /* MethodDeclaration */ || node.kind === 148 /* MethodSignature */) && + var reportError = (node.kind === 151 /* MethodDeclaration */ || node.kind === 150 /* MethodSignature */) && (ts.getModifierFlags(node) & 32 /* Static */) !== (ts.getModifierFlags(subsequentNode) & 32 /* Static */); // we can get here in two cases // 1. mixed static and instance class members @@ -38955,11 +42119,11 @@ var ts; } var duplicateFunctionDeclaration = false; var multipleConstructorImplementation = false; - for (var _i = 0, declarations_4 = declarations; _i < declarations_4.length; _i++) { - var current = declarations_4[_i]; + for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { + var current = declarations_5[_i]; var node = current; var inAmbientContext = ts.isInAmbientContext(node); - var inAmbientContextOrInterface = node.parent.kind === 227 /* InterfaceDeclaration */ || node.parent.kind === 161 /* TypeLiteral */ || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 230 /* InterfaceDeclaration */ || node.parent.kind === 163 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { // check if declarations are consecutive only if they are non-ambient // 1. ambient declarations can be interleaved @@ -38970,7 +42134,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 === 225 /* FunctionDeclaration */ || node.kind === 149 /* MethodDeclaration */ || node.kind === 148 /* MethodSignature */ || node.kind === 150 /* Constructor */) { + if (node.kind === 228 /* FunctionDeclaration */ || node.kind === 151 /* MethodDeclaration */ || node.kind === 150 /* MethodSignature */ || node.kind === 152 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -39008,7 +42172,7 @@ var ts; } if (duplicateFunctionDeclaration) { ts.forEach(declarations, function (declaration) { - error(declaration.name, ts.Diagnostics.Duplicate_function_implementation); + error(ts.getNameOfDeclaration(declaration), ts.Diagnostics.Duplicate_function_implementation); }); } // Abstract methods can't have an implementation -- in particular, they don't need one. @@ -39022,8 +42186,8 @@ var ts; if (bodyDeclaration) { var signatures = getSignaturesOfSymbol(symbol); var bodySignature = getSignatureFromDeclaration(bodyDeclaration); - for (var _a = 0, signatures_3 = signatures; _a < signatures_3.length; _a++) { - var signature = signatures_3[_a]; + for (var _a = 0, signatures_5 = signatures; _a < signatures_5.length; _a++) { + var signature = signatures_5[_a]; if (!isImplementationCompatibleWithOverload(bodySignature, signature)) { error(signature.declaration, ts.Diagnostics.Overload_signature_is_not_compatible_with_function_implementation); break; @@ -39081,27 +42245,28 @@ var ts; for (var _b = 0, _c = symbol.declarations; _b < _c.length; _b++) { var d = _c[_b]; var declarationSpaces = getDeclarationSpaces(d); + var name = ts.getNameOfDeclaration(d); // Only error on the declarations that contributed to the intersecting spaces. if (declarationSpaces & commonDeclarationSpacesForDefaultAndNonDefault) { - error(d.name, ts.Diagnostics.Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead, ts.declarationNameToString(d.name)); + error(name, ts.Diagnostics.Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead, ts.declarationNameToString(name)); } else if (declarationSpaces & commonDeclarationSpacesForExportsAndLocals) { - error(d.name, ts.Diagnostics.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local, ts.declarationNameToString(d.name)); + error(name, ts.Diagnostics.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local, ts.declarationNameToString(name)); } } } function getDeclarationSpaces(d) { switch (d.kind) { - case 227 /* InterfaceDeclaration */: + case 230 /* InterfaceDeclaration */: return 2097152 /* ExportType */; - case 230 /* ModuleDeclaration */: + case 233 /* ModuleDeclaration */: return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4194304 /* ExportNamespace */ | 1048576 /* ExportValue */ : 4194304 /* ExportNamespace */; - case 226 /* ClassDeclaration */: - case 229 /* EnumDeclaration */: + case 229 /* ClassDeclaration */: + case 232 /* EnumDeclaration */: return 2097152 /* ExportType */ | 1048576 /* ExportValue */; - case 234 /* ImportEqualsDeclaration */: + case 237 /* ImportEqualsDeclaration */: var result_3 = 0; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result_3 |= getDeclarationSpaces(d); }); @@ -39111,25 +42276,16 @@ var ts; } } } - function checkNonThenableType(type, location, message) { - type = getWidenedType(type); - if (!isTypeAny(type) && !isTypeNever(type) && isTypeAssignableTo(type, getGlobalThenableType())) { - if (location) { - if (!message) { - message = ts.Diagnostics.Operand_for_await_does_not_have_a_valid_callable_then_member; - } - error(location, message); - } - return unknownType; - } - return type; + function getAwaitedTypeOfPromise(type, errorNode, diagnosticMessage) { + var promisedType = getPromisedTypeOfPromise(type, errorNode); + return promisedType && getAwaitedType(promisedType, errorNode, diagnosticMessage); } /** - * Gets the "promised type" of a promise. - * @param type The type of the promise. - * @remarks The "promised type" of a type is the type of the "value" parameter of the "onfulfilled" callback. - */ - function getPromisedType(promise) { + * Gets the "promised type" of a promise. + * @param type The type of the promise. + * @remarks The "promised type" of a type is the type of the "value" parameter of the "onfulfilled" callback. + */ + function getPromisedTypeOfPromise(promise, errorNode) { // // { // promise // then( // thenFunction @@ -39142,22 +42298,22 @@ var ts; if (isTypeAny(promise)) { return undefined; } - if (getObjectFlags(promise) & 4 /* Reference */) { - if (promise.target === tryGetGlobalPromiseType() - || promise.target === getGlobalPromiseLikeType()) { - return promise.typeArguments[0]; - } + var typeAsPromise = promise; + if (typeAsPromise.promisedTypeOfPromise) { + return typeAsPromise.promisedTypeOfPromise; } - var globalPromiseLikeType = getInstantiatedGlobalPromiseLikeType(); - if (globalPromiseLikeType === emptyObjectType || !isTypeAssignableTo(promise, globalPromiseLikeType)) { - return undefined; + if (isReferenceToType(promise, getGlobalPromiseType(/*reportErrors*/ false))) { + return typeAsPromise.promisedTypeOfPromise = promise.typeArguments[0]; } var thenFunction = getTypeOfPropertyOfType(promise, "then"); - if (!thenFunction || isTypeAny(thenFunction)) { + if (isTypeAny(thenFunction)) { return undefined; } - var thenSignatures = getSignaturesOfType(thenFunction, 0 /* Call */); + var thenSignatures = thenFunction ? getSignaturesOfType(thenFunction, 0 /* Call */) : emptyArray; if (thenSignatures.length === 0) { + if (errorNode) { + error(errorNode, ts.Diagnostics.A_promise_must_have_a_then_method); + } return undefined; } var onfulfilledParameterType = getTypeWithFacts(getUnionType(ts.map(thenSignatures, getTypeOfFirstParameterOfSignature)), 524288 /* NEUndefinedOrNull */); @@ -39166,103 +42322,116 @@ var ts; } var onfulfilledParameterSignatures = getSignaturesOfType(onfulfilledParameterType, 0 /* Call */); if (onfulfilledParameterSignatures.length === 0) { + if (errorNode) { + error(errorNode, ts.Diagnostics.The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback); + } return undefined; } - return getUnionType(ts.map(onfulfilledParameterSignatures, getTypeOfFirstParameterOfSignature), /*subtypeReduction*/ true); - } - function getTypeOfFirstParameterOfSignature(signature) { - return signature.parameters.length > 0 ? getTypeAtPosition(signature, 0) : neverType; + return typeAsPromise.promisedTypeOfPromise = getUnionType(ts.map(onfulfilledParameterSignatures, getTypeOfFirstParameterOfSignature), /*subtypeReduction*/ true); } /** - * Gets the "awaited type" of a type. - * @param type The type to await. - * @remarks The "awaited type" of an expression is its "promised type" if the expression is a - * Promise-like type; otherwise, it is the type of the expression. This is used to reflect - * The runtime behavior of the `await` keyword. - */ - function getAwaitedType(type) { - return checkAwaitedType(type, /*location*/ undefined, /*message*/ undefined); + * Gets the "awaited type" of a type. + * @param type The type to await. + * @remarks The "awaited type" of an expression is its "promised type" if the expression is a + * Promise-like type; otherwise, it is the type of the expression. This is used to reflect + * The runtime behavior of the `await` keyword. + */ + function checkAwaitedType(type, errorNode, diagnosticMessage) { + return getAwaitedType(type, errorNode, diagnosticMessage) || unknownType; } - function checkAwaitedType(type, location, message) { - return checkAwaitedTypeWorker(type); - function checkAwaitedTypeWorker(type) { - if (type.flags & 65536 /* Union */) { - var types = []; - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var constituentType = _a[_i]; - types.push(checkAwaitedTypeWorker(constituentType)); - } - return getUnionType(types, /*subtypeReduction*/ true); - } - else { - var promisedType = getPromisedType(type); - if (promisedType === undefined) { - // The type was not a PromiseLike, so it could not be unwrapped any further. - // As long as the type does not have a callable "then" property, it is - // safe to return the type; otherwise, an error will have been reported in - // the call to checkNonThenableType and we will return unknownType. - // - // An example of a non-promise "thenable" might be: - // - // await { then(): void {} } - // - // The "thenable" does not match the minimal definition for a PromiseLike. When - // a Promise/A+-compatible or ES6 promise tries to adopt this value, the promise - // will never settle. We treat this as an error to help flag an early indicator - // of a runtime problem. If the user wants to return this value from an async - // function, they would need to wrap it in some other value. If they want it to - // be treated as a promise, they can cast to . - return checkNonThenableType(type, location, message); - } - else { - if (type.id === promisedType.id || ts.indexOf(awaitedTypeStack, promisedType.id) >= 0) { - // We have a bad actor in the form of a promise whose promised type is - // the same promise type, or a mutually recursive promise. Return the - // unknown type as we cannot guess the shape. If this were the actual - // case in the JavaScript, this Promise would never resolve. - // - // An example of a bad actor with a singly-recursive promise type might - // be: - // - // interface BadPromise { - // then( - // onfulfilled: (value: BadPromise) => any, - // onrejected: (error: any) => any): BadPromise; - // } - // - // The above interface will pass the PromiseLike check, and return a - // promised type of `BadPromise`. Since this is a self reference, we - // don't want to keep recursing ad infinitum. - // - // An example of a bad actor in the form of a mutually-recursive - // promise type might be: - // - // interface BadPromiseA { - // then( - // onfulfilled: (value: BadPromiseB) => any, - // onrejected: (error: any) => any): BadPromiseB; - // } - // - // interface BadPromiseB { - // then( - // onfulfilled: (value: BadPromiseA) => any, - // onrejected: (error: any) => any): BadPromiseA; - // } - // - if (location) { - error(location, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method, symbolToString(type.symbol)); - } - return unknownType; - } - // Keep track of the type we're about to unwrap to avoid bad recursive promise types. - // See the comments above for more information. - awaitedTypeStack.push(type.id); - var awaitedType = checkAwaitedTypeWorker(promisedType); - awaitedTypeStack.pop(); - return awaitedType; - } - } + function getAwaitedType(type, errorNode, diagnosticMessage) { + var typeAsAwaitable = type; + if (typeAsAwaitable.awaitedTypeOfType) { + return typeAsAwaitable.awaitedTypeOfType; } + if (isTypeAny(type)) { + return typeAsAwaitable.awaitedTypeOfType = type; + } + if (type.flags & 65536 /* Union */) { + var types = void 0; + for (var _i = 0, _a = type.types; _i < _a.length; _i++) { + var constituentType = _a[_i]; + types = ts.append(types, getAwaitedType(constituentType, errorNode, diagnosticMessage)); + } + if (!types) { + return undefined; + } + return typeAsAwaitable.awaitedTypeOfType = getUnionType(types, /*subtypeReduction*/ true); + } + var promisedType = getPromisedTypeOfPromise(type); + if (promisedType) { + if (type.id === promisedType.id || ts.indexOf(awaitedTypeStack, promisedType.id) >= 0) { + // Verify that we don't have a bad actor in the form of a promise whose + // promised type is the same as the promise type, or a mutually recursive + // promise. If so, we return undefined as we cannot guess the shape. If this + // were the actual case in the JavaScript, this Promise would never resolve. + // + // An example of a bad actor with a singly-recursive promise type might + // be: + // + // interface BadPromise { + // then( + // onfulfilled: (value: BadPromise) => any, + // onrejected: (error: any) => any): BadPromise; + // } + // The above interface will pass the PromiseLike check, and return a + // promised type of `BadPromise`. Since this is a self reference, we + // don't want to keep recursing ad infinitum. + // + // An example of a bad actor in the form of a mutually-recursive + // promise type might be: + // + // interface BadPromiseA { + // then( + // onfulfilled: (value: BadPromiseB) => any, + // onrejected: (error: any) => any): BadPromiseB; + // } + // + // interface BadPromiseB { + // then( + // onfulfilled: (value: BadPromiseA) => any, + // onrejected: (error: any) => any): BadPromiseA; + // } + // + if (errorNode) { + error(errorNode, ts.Diagnostics.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method); + } + return undefined; + } + // Keep track of the type we're about to unwrap to avoid bad recursive promise types. + // See the comments above for more information. + awaitedTypeStack.push(type.id); + var awaitedType = getAwaitedType(promisedType, errorNode, diagnosticMessage); + awaitedTypeStack.pop(); + if (!awaitedType) { + return undefined; + } + return typeAsAwaitable.awaitedTypeOfType = awaitedType; + } + // The type was not a promise, so it could not be unwrapped any further. + // As long as the type does not have a callable "then" property, it is + // safe to return the type; otherwise, an error will be reported in + // the call to getNonThenableType and we will return undefined. + // + // An example of a non-promise "thenable" might be: + // + // await { then(): void {} } + // + // The "thenable" does not match the minimal definition for a promise. When + // a Promise/A+-compatible or ES6 promise tries to adopt this value, the promise + // will never settle. We treat this as an error to help flag an early indicator + // of a runtime problem. If the user wants to return this value from an async + // function, they would need to wrap it in some other value. If they want it to + // be treated as a promise, they can cast to . + var thenFunction = getTypeOfPropertyOfType(type, "then"); + if (thenFunction && getSignaturesOfType(thenFunction, 0 /* Call */).length > 0) { + if (errorNode) { + ts.Debug.assert(!!diagnosticMessage); + error(errorNode, diagnosticMessage); + } + return undefined; + } + return typeAsAwaitable.awaitedTypeOfType = type; } /** * Checks the return type of an async function to ensure it is a compatible @@ -39307,8 +42476,8 @@ var ts; if (returnType === unknownType) { return unknownType; } - var globalPromiseType = getGlobalPromiseType(); - if (globalPromiseType !== emptyGenericType && globalPromiseType !== getTargetType(returnType)) { + var globalPromiseType = getGlobalPromiseType(/*reportErrors*/ true); + if (globalPromiseType !== emptyGenericType && !isReferenceToType(returnType, globalPromiseType)) { // The promise type was not a valid type reference to the global promise type, so we // report an error and return the unknown type. error(node.type, ts.Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type); @@ -39329,10 +42498,15 @@ var ts; var promiseConstructorSymbol = resolveEntityName(promiseConstructorName, 107455 /* Value */, /*ignoreErrors*/ true); var promiseConstructorType = promiseConstructorSymbol ? getTypeOfSymbol(promiseConstructorSymbol) : unknownType; if (promiseConstructorType === unknownType) { - error(node.type, 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, ts.entityNameToString(promiseConstructorName)); + if (promiseConstructorName.kind === 71 /* Identifier */ && promiseConstructorName.text === "Promise" && getTargetType(returnType) === getGlobalPromiseType(/*reportErrors*/ false)) { + error(node.type, ts.Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option); + } + else { + error(node.type, 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, ts.entityNameToString(promiseConstructorName)); + } return unknownType; } - var globalPromiseConstructorLikeType = getGlobalPromiseConstructorLikeType(); + var globalPromiseConstructorLikeType = getGlobalPromiseConstructorLikeType(/*reportErrors*/ true); if (globalPromiseConstructorLikeType === emptyObjectType) { // If we couldn't resolve the global PromiseConstructorLike type we cannot verify // compatibility with __awaiter. @@ -39351,7 +42525,7 @@ var ts; } } // Get and return the awaited type of the return type. - return checkAwaitedType(returnType, node, ts.Diagnostics.An_async_function_or_method_must_have_a_valid_awaitable_return_type); + return checkAwaitedType(returnType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); } /** Check a decorator */ function checkDecorator(node) { @@ -39364,22 +42538,22 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 226 /* ClassDeclaration */: + case 229 /* ClassDeclaration */: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); break; - case 144 /* Parameter */: + case 146 /* 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 147 /* PropertyDeclaration */: + case 149 /* 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 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 151 /* MethodDeclaration */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: var methodType = getTypeOfNode(node.parent); var descriptorType = createTypedPropertyDescriptorType(methodType); expectedReturnType = getUnionType([descriptorType, voidType]); @@ -39394,7 +42568,7 @@ var ts; function markTypeNodeAsReferenced(node) { var typeName = node && ts.getEntityNameFromTypeNode(node); var rootName = typeName && getFirstIdentifier(typeName); - var rootSymbol = rootName && resolveName(rootName, rootName.text, (typeName.kind === 70 /* Identifier */ ? 793064 /* Type */ : 1920 /* Namespace */) | 8388608 /* Alias */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined); + var rootSymbol = rootName && resolveName(rootName, rootName.text, (typeName.kind === 71 /* Identifier */ ? 793064 /* Type */ : 1920 /* Namespace */) | 8388608 /* Alias */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined); if (rootSymbol && rootSymbol.flags & 8388608 /* Alias */ && symbolIsValue(rootSymbol) @@ -39420,14 +42594,14 @@ var ts; } var firstDecorator = node.decorators[0]; checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */); - if (node.kind === 144 /* Parameter */) { + if (node.kind === 146 /* 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 226 /* ClassDeclaration */: + case 229 /* ClassDeclaration */: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) { @@ -39436,19 +42610,19 @@ var ts; } } break; - case 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 151 /* MethodDeclaration */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; markTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } markTypeNodeAsReferenced(node.type); break; - case 147 /* PropertyDeclaration */: + case 149 /* PropertyDeclaration */: markTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); break; - case 144 /* Parameter */: + case 146 /* Parameter */: markTypeNodeAsReferenced(node.type); break; } @@ -39460,6 +42634,7 @@ var ts; checkFunctionOrMethodDeclaration(node) || checkGrammarForGenerator(node); checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithCapturedNewTargetVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name); } @@ -39467,11 +42642,11 @@ var ts; function checkFunctionOrMethodDeclaration(node) { checkDecorators(node); checkSignatureDeclaration(node); - var isAsync = ts.isAsyncFunctionLike(node); + var functionFlags = ts.getFunctionFlags(node); // 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 === 142 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 144 /* ComputedPropertyName */) { // This check will account for methods in class/interface declarations, // as well as accessors in classes/object literals checkComputedPropertyName(node.name); @@ -39502,17 +42677,19 @@ var ts; } } checkSourceElement(node.body); - if (!node.asteriskToken) { - var returnOrPromisedType = node.type && (isAsync ? checkAsyncFunctionReturnType(node) : getTypeFromTypeNode(node.type)); + if ((functionFlags & 1 /* Generator */) === 0) { + var returnOrPromisedType = node.type && (functionFlags & 2 /* Async */ + ? checkAsyncFunctionReturnType(node) // Async function + : getTypeFromTypeNode(node.type)); // normal function checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnOrPromisedType); } if (produceDiagnostics && !node.type) { // 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 (compilerOptions.noImplicitAny && ts.nodeIsMissing(node.body) && !isPrivateWithinAmbient(node)) { + if (noImplicitAny && ts.nodeIsMissing(node.body) && !isPrivateWithinAmbient(node)) { reportImplicitAnyError(node, anyType); } - if (node.asteriskToken && ts.nodeIsPresent(node.body)) { + if (functionFlags & 1 /* Generator */ && ts.nodeIsPresent(node.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. @@ -39531,72 +42708,68 @@ var ts; for (var _i = 0, deferredUnusedIdentifierNodes_1 = deferredUnusedIdentifierNodes; _i < deferredUnusedIdentifierNodes_1.length; _i++) { var node = deferredUnusedIdentifierNodes_1[_i]; switch (node.kind) { - case 261 /* SourceFile */: - case 230 /* ModuleDeclaration */: + case 265 /* SourceFile */: + case 233 /* ModuleDeclaration */: checkUnusedModuleMembers(node); break; - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: + case 229 /* ClassDeclaration */: + case 199 /* ClassExpression */: checkUnusedClassMembers(node); checkUnusedTypeParameters(node); break; - case 227 /* InterfaceDeclaration */: + case 230 /* InterfaceDeclaration */: checkUnusedTypeParameters(node); break; - case 204 /* Block */: - case 232 /* CaseBlock */: - case 211 /* ForStatement */: - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: + case 207 /* Block */: + case 235 /* CaseBlock */: + case 214 /* ForStatement */: + case 215 /* ForInStatement */: + case 216 /* ForOfStatement */: checkUnusedLocalsAndParameters(node); break; - case 150 /* Constructor */: - case 184 /* FunctionExpression */: - case 225 /* FunctionDeclaration */: - case 185 /* ArrowFunction */: - case 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 152 /* Constructor */: + case 186 /* FunctionExpression */: + case 228 /* FunctionDeclaration */: + case 187 /* ArrowFunction */: + case 151 /* MethodDeclaration */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: if (node.body) { checkUnusedLocalsAndParameters(node); } checkUnusedTypeParameters(node); break; - case 148 /* MethodSignature */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: - case 158 /* FunctionType */: - case 159 /* ConstructorType */: + case 150 /* MethodSignature */: + case 155 /* CallSignature */: + case 156 /* ConstructSignature */: + case 157 /* IndexSignature */: + case 160 /* FunctionType */: + case 161 /* ConstructorType */: checkUnusedTypeParameters(node); break; } - ; } } } function checkUnusedLocalsAndParameters(node) { - if (node.parent.kind !== 227 /* InterfaceDeclaration */ && noUnusedIdentifiers && !ts.isInAmbientContext(node)) { - var _loop_2 = function (key) { - var local = node.locals[key]; + if (node.parent.kind !== 230 /* InterfaceDeclaration */ && noUnusedIdentifiers && !ts.isInAmbientContext(node)) { + node.locals.forEach(function (local) { if (!local.isReferenced) { - if (local.valueDeclaration && ts.getRootDeclaration(local.valueDeclaration).kind === 144 /* Parameter */) { + if (local.valueDeclaration && ts.getRootDeclaration(local.valueDeclaration).kind === 146 /* Parameter */) { var parameter = ts.getRootDeclaration(local.valueDeclaration); + var name = ts.getNameOfDeclaration(local.valueDeclaration); if (compilerOptions.noUnusedParameters && !ts.isParameterPropertyDeclaration(parameter) && !ts.parameterIsThisKeyword(parameter) && - !parameterNameStartsWithUnderscore(local.valueDeclaration.name)) { - error(local.valueDeclaration.name, ts.Diagnostics._0_is_declared_but_never_used, local.name); + !parameterNameStartsWithUnderscore(name)) { + error(name, ts.Diagnostics._0_is_declared_but_never_used, local.name); } } else if (compilerOptions.noUnusedLocals) { - ts.forEach(local.declarations, function (d) { return errorUnusedLocal(d.name || d, local.name); }); + ts.forEach(local.declarations, function (d) { return errorUnusedLocal(ts.getNameOfDeclaration(d) || d, local.name); }); } } - }; - for (var key in node.locals) { - _loop_2(key); - } + }); } } function isRemovedPropertyFromObjectSpread(node) { @@ -39609,13 +42782,13 @@ var ts; function errorUnusedLocal(node, name) { if (isIdentifierThatStartsWithUnderScore(node)) { var declaration = ts.getRootDeclaration(node.parent); - if (declaration.kind === 223 /* VariableDeclaration */ && - (declaration.parent.parent.kind === 212 /* ForInStatement */ || - declaration.parent.parent.kind === 213 /* ForOfStatement */)) { + if (declaration.kind === 226 /* VariableDeclaration */ && + (declaration.parent.parent.kind === 215 /* ForInStatement */ || + declaration.parent.parent.kind === 216 /* ForOfStatement */)) { return; } } - if (!isRemovedPropertyFromObjectSpread(node.kind === 70 /* Identifier */ ? node.parent : node)) { + if (!isRemovedPropertyFromObjectSpread(node.kind === 71 /* Identifier */ ? node.parent : node)) { error(node, ts.Diagnostics._0_is_declared_but_never_used, name); } } @@ -39623,19 +42796,19 @@ var ts; return parameterName && isIdentifierThatStartsWithUnderScore(parameterName); } function isIdentifierThatStartsWithUnderScore(node) { - return node.kind === 70 /* Identifier */ && node.text.charCodeAt(0) === 95 /* _ */; + return node.kind === 71 /* Identifier */ && node.text.charCodeAt(0) === 95 /* _ */; } function checkUnusedClassMembers(node) { if (compilerOptions.noUnusedLocals && !ts.isInAmbientContext(node)) { if (node.members) { for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 149 /* MethodDeclaration */ || member.kind === 147 /* PropertyDeclaration */) { + if (member.kind === 151 /* MethodDeclaration */ || member.kind === 149 /* PropertyDeclaration */) { if (!member.symbol.isReferenced && ts.getModifierFlags(member) & 8 /* Private */) { error(member.name, ts.Diagnostics._0_is_declared_but_never_used, member.symbol.name); } } - else if (member.kind === 150 /* Constructor */) { + else if (member.kind === 152 /* Constructor */) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; if (!parameter.symbol.isReferenced && ts.getModifierFlags(parameter) & 8 /* Private */) { @@ -39668,22 +42841,21 @@ var ts; } function checkUnusedModuleMembers(node) { if (compilerOptions.noUnusedLocals && !ts.isInAmbientContext(node)) { - for (var key in node.locals) { - var local = node.locals[key]; + 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.name, local.name); + errorUnusedLocal(ts.getNameOfDeclaration(declaration), local.name); } } } - } + }); } } function checkBlock(node) { // Grammar checking for SyntaxKind.Block - if (node.kind === 204 /* Block */) { + if (node.kind === 207 /* Block */) { checkGrammarStatementInAmbientContext(node); } ts.forEach(node.statements, checkSourceElement); @@ -39706,12 +42878,12 @@ var ts; if (!(identifier && identifier.text === name)) { return false; } - if (node.kind === 147 /* PropertyDeclaration */ || - node.kind === 146 /* PropertySignature */ || - node.kind === 149 /* MethodDeclaration */ || - node.kind === 148 /* MethodSignature */ || - node.kind === 151 /* GetAccessor */ || - node.kind === 152 /* SetAccessor */) { + if (node.kind === 149 /* PropertyDeclaration */ || + node.kind === 148 /* PropertySignature */ || + node.kind === 151 /* MethodDeclaration */ || + node.kind === 150 /* MethodSignature */ || + node.kind === 153 /* GetAccessor */ || + node.kind === 154 /* SetAccessor */) { // it is ok to have member named '_super' or '_this' - member access is always qualified return false; } @@ -39720,7 +42892,7 @@ var ts; return false; } var root = ts.getRootDeclaration(node); - if (root.kind === 144 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 146 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { // just an overload - no codegen impact return false; } @@ -39731,22 +42903,39 @@ var ts; potentialThisCollisions.push(node); } } + function checkCollisionWithCapturedNewTargetVariable(node, name) { + if (needCollisionCheckForIdentifier(node, name, "_newTarget")) { + potentialNewTargetCollisions.push(node); + } + } // this function will run after checking the source file so 'CaptureThis' is correct for all nodes function checkIfThisIsCapturedInEnclosingScope(node) { - var current = node; - while (current) { + ts.findAncestor(node, function (current) { if (getNodeCheckFlags(current) & 4 /* CaptureThis */) { - var isDeclaration_1 = node.kind !== 70 /* Identifier */; + var isDeclaration_1 = node.kind !== 71 /* Identifier */; if (isDeclaration_1) { - error(node.name, ts.Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference); + error(ts.getNameOfDeclaration(node), ts.Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference); } else { error(node, ts.Diagnostics.Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference); } - return; + return true; } - current = current.parent; - } + }); + } + function checkIfNewTargetIsCapturedInEnclosingScope(node) { + ts.findAncestor(node, function (current) { + if (getNodeCheckFlags(current) & 8 /* CaptureNewTarget */) { + var isDeclaration_2 = node.kind !== 71 /* Identifier */; + if (isDeclaration_2) { + error(ts.getNameOfDeclaration(node), ts.Diagnostics.Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference); + } + else { + error(node, ts.Diagnostics.Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference); + } + return true; + } + }); } function checkCollisionWithCapturedSuperVariable(node, name) { if (!needCollisionCheckForIdentifier(node, name, "_super")) { @@ -39759,8 +42948,8 @@ var ts; return; } if (ts.getClassExtendsHeritageClauseElement(enclosingClass)) { - var isDeclaration_2 = node.kind !== 70 /* Identifier */; - if (isDeclaration_2) { + var isDeclaration_3 = node.kind !== 71 /* Identifier */; + if (isDeclaration_3) { error(node, ts.Diagnostics.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference); } else { @@ -39777,12 +42966,12 @@ var ts; return; } // Uninstantiated modules shouldnt do this check - if (node.kind === 230 /* ModuleDeclaration */ && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { + if (node.kind === 233 /* ModuleDeclaration */ && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return; } // 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 === 261 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 265 /* 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)); } @@ -39792,12 +42981,12 @@ var ts; return; } // Uninstantiated modules shouldnt do this check - if (node.kind === 230 /* ModuleDeclaration */ && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { + if (node.kind === 233 /* ModuleDeclaration */ && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return; } // 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 === 261 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 1024 /* HasAsyncFunctions */) { + if (parent.kind === 265 /* 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)); } @@ -39832,7 +43021,7 @@ 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 === 223 /* VariableDeclaration */ && !node.initializer) { + if (node.kind === 226 /* VariableDeclaration */ && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -39842,24 +43031,24 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3 /* BlockScoped */) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 224 /* VariableDeclarationList */); - var container = varDeclList.parent.kind === 205 /* VariableStatement */ && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 227 /* VariableDeclarationList */); + var container = varDeclList.parent.kind === 208 /* 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 === 204 /* Block */ && ts.isFunctionLike(container.parent) || - container.kind === 231 /* ModuleBlock */ || - container.kind === 230 /* ModuleDeclaration */ || - container.kind === 261 /* SourceFile */); + (container.kind === 207 /* Block */ && ts.isFunctionLike(container.parent) || + container.kind === 234 /* ModuleBlock */ || + container.kind === 233 /* ModuleDeclaration */ || + container.kind === 265 /* 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 // since LHS will be block scoped name instead of function scoped if (!namesShareScope) { - var name_23 = symbolToString(localDeclarationSymbol); - error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name_23, name_23); + var name = symbolToString(localDeclarationSymbol); + error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name, name); } } } @@ -39867,7 +43056,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 !== 144 /* Parameter */) { + if (ts.getRootDeclaration(node).kind !== 146 /* Parameter */) { return; } var func = ts.getContainingFunction(node); @@ -39878,11 +43067,11 @@ var ts; // skip declaration names (i.e. in object literal expressions) return; } - if (n.kind === 177 /* PropertyAccessExpression */) { + if (n.kind === 179 /* PropertyAccessExpression */) { // skip property names in property access expression return visit(n.expression); } - else if (n.kind === 70 /* Identifier */) { + 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.text, 107455 /* Value */ | 8388608 /* Alias */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined); @@ -39897,28 +43086,28 @@ 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 === 144 /* Parameter */ || - symbol.valueDeclaration.kind === 174 /* BindingElement */) { + if (symbol.valueDeclaration.kind === 146 /* Parameter */ || + symbol.valueDeclaration.kind === 176 /* 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) { return; } // - parameter is wrapped in function-like entity - var current = n; - while (current !== node.initializer) { - if (ts.isFunctionLike(current.parent)) { - return; + if (ts.findAncestor(n, function (current) { + if (current === node.initializer) { + return "quit"; } - // computed property names/initializers in instance property declaration of class like entities - // are executed in constructor and thus deferred - if (current.parent.kind === 147 /* PropertyDeclaration */ && - !(ts.hasModifier(current.parent, 32 /* Static */)) && - ts.isClassLike(current.parent.parent)) { - return; - } - current = current.parent; + 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 === 149 /* PropertyDeclaration */ && + !(ts.hasModifier(current.parent, 32 /* Static */)) && + ts.isClassLike(current.parent.parent)); + })) { + return; } + // fall through to report error } error(n, ts.Diagnostics.Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it, ts.declarationNameToString(node.name), ts.declarationNameToString(n)); } @@ -39939,43 +43128,46 @@ 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 === 142 /* ComputedPropertyName */) { + if (node.name.kind === 144 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } - if (node.kind === 174 /* BindingElement */) { - if (node.parent.kind === 172 /* ObjectBindingPattern */ && languageVersion < 5 /* ESNext */ && !ts.isInAmbientContext(node)) { + if (node.kind === 176 /* BindingElement */) { + if (node.parent.kind === 174 /* ObjectBindingPattern */ && languageVersion < 5 /* ESNext */) { checkExternalEmitHelpers(node, 4 /* Rest */); } // check computed properties inside property names of binding elements - if (node.propertyName && node.propertyName.kind === 142 /* ComputedPropertyName */) { + if (node.propertyName && node.propertyName.kind === 144 /* ComputedPropertyName */) { checkComputedPropertyName(node.propertyName); } // check private/protected variable access - var parent_11 = node.parent.parent; - var parentType = getTypeForBindingElementParent(parent_11); - var name_24 = node.propertyName || node.name; - var property = getPropertyOfType(parentType, ts.getTextOfPropertyName(name_24)); + var parent = node.parent.parent; + var parentType = getTypeForBindingElementParent(parent); + var name = node.propertyName || node.name; + var property = getPropertyOfType(parentType, ts.getTextOfPropertyName(name)); markPropertyAsReferenced(property); - if (parent_11.initializer && property && getParentOfSymbol(property)) { - checkClassPropertyAccess(parent_11, parent_11.initializer, parentType, property); + 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 === 175 /* 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 === 144 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && ts.getRootDeclaration(node).kind === 146 /* 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 !== 212 /* ForInStatement */) { + if (node.initializer && node.parent.parent.kind !== 215 /* ForInStatement */) { checkTypeAssignableTo(checkExpressionCached(node.initializer), getWidenedTypeForVariableLikeDeclaration(node), node, /*headMessage*/ undefined); checkParameterInitializer(node); } @@ -39986,7 +43178,7 @@ 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 !== 212 /* ForInStatement */) { + if (node.initializer && node.parent.parent.kind !== 215 /* ForInStatement */) { checkTypeAssignableTo(checkExpressionCached(node.initializer), type, node, /*headMessage*/ undefined); checkParameterInitializer(node); } @@ -40002,25 +43194,26 @@ var ts; checkTypeAssignableTo(checkExpressionCached(node.initializer), declarationType, node, /*headMessage*/ undefined); } if (!areDeclarationFlagsIdentical(node, symbol.valueDeclaration)) { - error(symbol.valueDeclaration.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name)); + error(ts.getNameOfDeclaration(symbol.valueDeclaration), ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name)); error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name)); } } - if (node.kind !== 147 /* PropertyDeclaration */ && node.kind !== 146 /* PropertySignature */) { + if (node.kind !== 149 /* PropertyDeclaration */ && node.kind !== 148 /* PropertySignature */) { // We know we don't have a binding pattern or computed name here checkExportsOnMergedDeclarations(node); - if (node.kind === 223 /* VariableDeclaration */ || node.kind === 174 /* BindingElement */) { + if (node.kind === 226 /* VariableDeclaration */ || node.kind === 176 /* BindingElement */) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithCapturedNewTargetVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name); } } function areDeclarationFlagsIdentical(left, right) { - if ((left.kind === 144 /* Parameter */ && right.kind === 223 /* VariableDeclaration */) || - (left.kind === 223 /* VariableDeclaration */ && right.kind === 144 /* Parameter */)) { + if ((left.kind === 146 /* Parameter */ && right.kind === 226 /* VariableDeclaration */) || + (left.kind === 226 /* VariableDeclaration */ && right.kind === 146 /* Parameter */)) { // Differences in optionality between parameters and variables are allowed. return true; } @@ -40050,8 +43243,8 @@ var ts; } 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 === 176 /* ObjectLiteralExpression */) { - if (ts.isAsyncFunctionLike(node)) { + if (node.modifiers && node.parent.kind === 178 /* ObjectLiteralExpression */) { + if (ts.getFunctionFlags(node) & 2 /* Async */) { if (node.modifiers.length > 1) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); } @@ -40071,7 +43264,7 @@ var ts; checkGrammarStatementInAmbientContext(node); checkExpression(node.expression); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 206 /* EmptyStatement */) { + if (node.thenStatement.kind === 209 /* EmptyStatement */) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -40091,12 +43284,12 @@ var ts; function checkForStatement(node) { // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 224 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 227 /* VariableDeclarationList */) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 224 /* VariableDeclarationList */) { + if (node.initializer.kind === 227 /* VariableDeclarationList */) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -40114,19 +43307,32 @@ var ts; } function checkForOfStatement(node) { checkGrammarForInOrForOfStatement(node); + if (node.kind === 216 /* ForOfStatement */) { + if (node.awaitModifier) { + var functionFlags = ts.getFunctionFlags(ts.getContainingFunction(node)); + if ((functionFlags & (4 /* Invalid */ | 2 /* Async */)) === 2 /* Async */ && languageVersion < 5 /* ESNext */) { + // for..await..of in an async function or async generator function prior to ESNext requires the __asyncValues helper + checkExternalEmitHelpers(node, 16384 /* ForAwaitOfIncludes */); + } + } + else if (compilerOptions.downlevelIteration && languageVersion < 2 /* ES2015 */) { + // for..of prior to ES2015 requires the __values helper when downlevelIteration is enabled + checkExternalEmitHelpers(node, 256 /* ForOfIncludes */); + } + } // Check the LHS and RHS // If the LHS is a declaration, just check it as a variable declaration, which will in turn check the RHS // 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 === 224 /* VariableDeclarationList */) { + if (node.initializer.kind === 227 /* VariableDeclarationList */) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; - var iteratedType = checkRightHandSideOfForOf(node.expression); + var iteratedType = checkRightHandSideOfForOf(node.expression, node.awaitModifier); // There may be a destructuring assignment on the left side - if (varExpr.kind === 175 /* ArrayLiteralExpression */ || varExpr.kind === 176 /* ObjectLiteralExpression */) { + if (varExpr.kind === 177 /* ArrayLiteralExpression */ || varExpr.kind === 178 /* 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. @@ -40158,7 +43364,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 === 224 /* VariableDeclarationList */) { + if (node.initializer.kind === 227 /* 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); @@ -40172,7 +43378,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 === 175 /* ArrayLiteralExpression */ || varExpr.kind === 176 /* ObjectLiteralExpression */) { + if (varExpr.kind === 177 /* ArrayLiteralExpression */ || varExpr.kind === 178 /* 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)) { @@ -40185,7 +43391,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 (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, 32768 /* Object */ | 540672 /* TypeVariable */)) { + if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, 32768 /* Object */ | 540672 /* TypeVariable */ | 16777216 /* NonPrimitive */)) { 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); @@ -40201,52 +43407,113 @@ var ts; checkVariableDeclaration(decl); } } - function checkRightHandSideOfForOf(rhsExpression) { + function checkRightHandSideOfForOf(rhsExpression, awaitModifier) { var expressionType = checkNonNullExpression(rhsExpression); - return checkIteratedTypeOrElementType(expressionType, rhsExpression, /*allowStringInput*/ true); + return checkIteratedTypeOrElementType(expressionType, rhsExpression, /*allowStringInput*/ true, awaitModifier !== undefined); } - function checkIteratedTypeOrElementType(inputType, errorNode, allowStringInput) { + function checkIteratedTypeOrElementType(inputType, errorNode, allowStringInput, allowAsyncIterable) { if (isTypeAny(inputType)) { return inputType; } - if (languageVersion >= 2 /* ES2015 */) { - return checkElementTypeOfIterable(inputType, errorNode); - } - if (allowStringInput) { - return checkElementTypeOfArrayOrString(inputType, errorNode); - } - if (isArrayLikeType(inputType)) { - var indexType = getIndexTypeOfType(inputType, 1 /* Number */); - if (indexType) { - return indexType; - } - } - if (errorNode) { - error(errorNode, ts.Diagnostics.Type_0_is_not_an_array_type, typeToString(inputType)); - } - return unknownType; + return getIteratedTypeOrElementType(inputType, errorNode, allowStringInput, allowAsyncIterable, /*checkAssignability*/ true) || anyType; } /** - * When errorNode is undefined, it means we should not report any errors. + * When consuming an iterable type in a for..of, spread, or iterator destructuring assignment + * we want to get the iterated type of an iterable for ES2015 or later, or the iterated type + * of a iterable (if defined globally) or element type of an array like for ES2015 or earlier. */ - function checkElementTypeOfIterable(iterable, errorNode) { - var elementType = getElementTypeOfIterable(iterable, errorNode); - // Now even though we have extracted the iteratedType, we will have to validate that the type - // passed in is actually an Iterable. - if (errorNode && elementType) { - checkTypeAssignableTo(iterable, createIterableType(elementType), errorNode); + function getIteratedTypeOrElementType(inputType, errorNode, allowStringInput, allowAsyncIterable, checkAssignability) { + var uplevelIteration = languageVersion >= 2 /* ES2015 */; + var downlevelIteration = !uplevelIteration && compilerOptions.downlevelIteration; + // Get the iterated type of an `Iterable` or `IterableIterator` only in ES2015 + // or higher, when inside of an async generator or for-await-if, or when + // downlevelIteration is requested. + if (uplevelIteration || downlevelIteration || allowAsyncIterable) { + // We only report errors for an invalid iterable type in ES2015 or higher. + var iteratedType = getIteratedTypeOfIterable(inputType, uplevelIteration ? errorNode : undefined, allowAsyncIterable, allowAsyncIterable, checkAssignability); + if (iteratedType || uplevelIteration) { + return iteratedType; + } } - return elementType || anyType; + var arrayType = inputType; + var reportedError = false; + var hasStringConstituent = false; + // If strings are permitted, remove any string-like constituents from the array type. + // This allows us to find other non-string element types from an array unioned with + // a string. + if (allowStringInput) { + if (arrayType.flags & 65536 /* Union */) { + // After we remove all types that are StringLike, we will know if there was a string constituent + // based on whether the result of filter is a new array. + var arrayTypes = inputType.types; + var filteredTypes = ts.filter(arrayTypes, function (t) { return !(t.flags & 262178 /* StringLike */); }); + if (filteredTypes !== arrayTypes) { + arrayType = getUnionType(filteredTypes, /*subtypeReduction*/ true); + } + } + else if (arrayType.flags & 262178 /* StringLike */) { + arrayType = neverType; + } + hasStringConstituent = arrayType !== inputType; + if (hasStringConstituent) { + if (languageVersion < 1 /* ES5 */) { + if (errorNode) { + error(errorNode, ts.Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher); + reportedError = true; + } + } + // Now that we've removed all the StringLike types, if no constituents remain, then the entire + // arrayOrStringType was a string. + if (arrayType.flags & 8192 /* Never */) { + return stringType; + } + } + } + if (!isArrayLikeType(arrayType)) { + if (errorNode && !reportedError) { + // Which error we report depends on whether we allow strings or if there was a + // string constituent. For example, if the input type is number | string, we + // want to say that number is not an array type. But if the input was just + // number and string input is allowed, we want to say that number is not an + // array type or a string type. + var diagnostic = !allowStringInput || hasStringConstituent + ? downlevelIteration + ? ts.Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator + : ts.Diagnostics.Type_0_is_not_an_array_type + : downlevelIteration + ? ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator + : ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type; + error(errorNode, diagnostic, typeToString(arrayType)); + } + return hasStringConstituent ? stringType : undefined; + } + var arrayElementType = getIndexTypeOfType(arrayType, 1 /* Number */); + if (hasStringConstituent && arrayElementType) { + // This is just an optimization for the case where arrayOrStringType is string | string[] + if (arrayElementType.flags & 262178 /* StringLike */) { + return stringType; + } + return getUnionType([arrayElementType, stringType], /*subtypeReduction*/ true); + } + return arrayElementType; } /** * We want to treat type as an iterable, and get the type it is an iterable of. The iterable * must have the following structure (annotated with the names of the variables below): * - * { // iterable - * [Symbol.iterator]: { // iteratorFunction - * (): Iterator + * { // iterable + * [Symbol.iterator]: { // iteratorMethod + * (): Iterator + * } + * } + * + * For an async iterable, we expect the following structure: + * + * { // iterable + * [Symbol.asyncIterator]: { // iteratorMethod + * (): AsyncIterator + * } * } - * } * * T is the type we are after. At every level that involves analyzing return types * of signatures, we union the return types of all the signatures. @@ -40258,166 +43525,170 @@ var ts; * caller requested it. Then the caller can decide what to do in the case where there is no iterated * type. This is different from returning anyType, because that would signify that we have matched the * whole pattern and that T (above) is 'any'. + * + * For a **for-of** statement, `yield*` (in a normal generator), spread, array + * destructuring, or normal generator we will only ever look for a `[Symbol.iterator]()` + * method. + * + * For an async generator we will only ever look at the `[Symbol.asyncIterator]()` method. + * + * For a **for-await-of** statement or a `yield*` in an async generator we will look for + * the `[Symbol.asyncIterator]()` method first, and then the `[Symbol.iterator]()` method. */ - function getElementTypeOfIterable(type, errorNode) { + function getIteratedTypeOfIterable(type, errorNode, isAsyncIterable, allowNonAsyncIterables, checkAssignability) { if (isTypeAny(type)) { return undefined; } var typeAsIterable = type; - if (!typeAsIterable.iterableElementType) { - // As an optimization, if the type is instantiated directly using the globalIterableType (Iterable), - // then just grab its type argument. - if ((getObjectFlags(type) & 4 /* Reference */) && type.target === getGlobalIterableType()) { - typeAsIterable.iterableElementType = type.typeArguments[0]; - } - else { - var iteratorFunction = getTypeOfPropertyOfType(type, ts.getPropertyNameForKnownSymbolName("iterator")); - if (isTypeAny(iteratorFunction)) { - return undefined; - } - var iteratorFunctionSignatures = iteratorFunction ? getSignaturesOfType(iteratorFunction, 0 /* Call */) : emptyArray; - if (iteratorFunctionSignatures.length === 0) { - if (errorNode) { - error(errorNode, ts.Diagnostics.Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator); - } - return undefined; - } - typeAsIterable.iterableElementType = getElementTypeOfIterator(getUnionType(ts.map(iteratorFunctionSignatures, getReturnTypeOfSignature), /*subtypeReduction*/ true), errorNode); + if (isAsyncIterable ? typeAsIterable.iteratedTypeOfAsyncIterable : typeAsIterable.iteratedTypeOfIterable) { + return isAsyncIterable ? typeAsIterable.iteratedTypeOfAsyncIterable : typeAsIterable.iteratedTypeOfIterable; + } + if (isAsyncIterable) { + // As an optimization, if the type is an instantiation of the global `AsyncIterable` + // or the global `AsyncIterableIterator` then just grab its type argument. + if (isReferenceToType(type, getGlobalAsyncIterableType(/*reportErrors*/ false)) || + isReferenceToType(type, getGlobalAsyncIterableIteratorType(/*reportErrors*/ false))) { + return typeAsIterable.iteratedTypeOfAsyncIterable = type.typeArguments[0]; } } - return typeAsIterable.iterableElementType; + if (!isAsyncIterable || allowNonAsyncIterables) { + // As an optimization, if the type is an instantiation of the global `Iterable` or + // `IterableIterator` then just grab its type argument. + if (isReferenceToType(type, getGlobalIterableType(/*reportErrors*/ false)) || + isReferenceToType(type, getGlobalIterableIteratorType(/*reportErrors*/ false))) { + return isAsyncIterable + ? typeAsIterable.iteratedTypeOfAsyncIterable = type.typeArguments[0] + : typeAsIterable.iteratedTypeOfIterable = type.typeArguments[0]; + } + } + var iteratorMethodSignatures; + var isNonAsyncIterable = false; + if (isAsyncIterable) { + var iteratorMethod = getTypeOfPropertyOfType(type, ts.getPropertyNameForKnownSymbolName("asyncIterator")); + if (isTypeAny(iteratorMethod)) { + return undefined; + } + iteratorMethodSignatures = iteratorMethod && getSignaturesOfType(iteratorMethod, 0 /* Call */); + } + if (!isAsyncIterable || (allowNonAsyncIterables && !ts.some(iteratorMethodSignatures))) { + var iteratorMethod = getTypeOfPropertyOfType(type, ts.getPropertyNameForKnownSymbolName("iterator")); + if (isTypeAny(iteratorMethod)) { + return undefined; + } + iteratorMethodSignatures = iteratorMethod && getSignaturesOfType(iteratorMethod, 0 /* Call */); + isNonAsyncIterable = true; + } + if (ts.some(iteratorMethodSignatures)) { + var iteratorMethodReturnType = getUnionType(ts.map(iteratorMethodSignatures, getReturnTypeOfSignature), /*subtypeReduction*/ true); + var iteratedType = getIteratedTypeOfIterator(iteratorMethodReturnType, errorNode, /*isAsyncIterator*/ !isNonAsyncIterable); + if (checkAssignability && errorNode && iteratedType) { + // If `checkAssignability` was specified, we were called from + // `checkIteratedTypeOrElementType`. As such, we need to validate that + // the type passed in is actually an Iterable. + checkTypeAssignableTo(type, isNonAsyncIterable + ? createIterableType(iteratedType) + : createAsyncIterableType(iteratedType), errorNode); + } + return isAsyncIterable + ? typeAsIterable.iteratedTypeOfAsyncIterable = iteratedType + : typeAsIterable.iteratedTypeOfIterable = iteratedType; + } + if (errorNode) { + error(errorNode, isAsyncIterable + ? ts.Diagnostics.Type_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator + : ts.Diagnostics.Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator); + } + return undefined; } /** - * This function has very similar logic as getElementTypeOfIterable, except that it operates on + * This function has very similar logic as getIteratedTypeOfIterable, except that it operates on * Iterators instead of Iterables. Here is the structure: * * { // iterator - * next: { // iteratorNextFunction - * (): { // iteratorNextResult - * value: T // iteratorNextValue + * next: { // nextMethod + * (): { // nextResult + * value: T // nextValue * } * } * } * + * For an async iterator, we expect the following structure: + * + * { // iterator + * next: { // nextMethod + * (): PromiseLike<{ // nextResult + * value: T // nextValue + * }> + * } + * } */ - function getElementTypeOfIterator(type, errorNode) { + function getIteratedTypeOfIterator(type, errorNode, isAsyncIterator) { if (isTypeAny(type)) { return undefined; } var typeAsIterator = type; - if (!typeAsIterator.iteratorElementType) { - // As an optimization, if the type is instantiated directly using the globalIteratorType (Iterator), - // then just grab its type argument. - if ((getObjectFlags(type) & 4 /* Reference */) && type.target === getGlobalIteratorType()) { - typeAsIterator.iteratorElementType = type.typeArguments[0]; - } - else { - var iteratorNextFunction = getTypeOfPropertyOfType(type, "next"); - if (isTypeAny(iteratorNextFunction)) { - return undefined; - } - var iteratorNextFunctionSignatures = iteratorNextFunction ? getSignaturesOfType(iteratorNextFunction, 0 /* Call */) : emptyArray; - if (iteratorNextFunctionSignatures.length === 0) { - if (errorNode) { - error(errorNode, ts.Diagnostics.An_iterator_must_have_a_next_method); - } - return undefined; - } - var iteratorNextResult = getUnionType(ts.map(iteratorNextFunctionSignatures, getReturnTypeOfSignature), /*subtypeReduction*/ true); - if (isTypeAny(iteratorNextResult)) { - return undefined; - } - var iteratorNextValue = getTypeOfPropertyOfType(iteratorNextResult, "value"); - if (!iteratorNextValue) { - if (errorNode) { - error(errorNode, ts.Diagnostics.The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property); - } - return undefined; - } - typeAsIterator.iteratorElementType = iteratorNextValue; - } + if (isAsyncIterator ? typeAsIterator.iteratedTypeOfAsyncIterator : typeAsIterator.iteratedTypeOfIterator) { + return isAsyncIterator ? typeAsIterator.iteratedTypeOfAsyncIterator : typeAsIterator.iteratedTypeOfIterator; } - return typeAsIterator.iteratorElementType; - } - function getElementTypeOfIterableIterator(type) { - if (isTypeAny(type)) { + // As an optimization, if the type is an instantiation of the global `Iterator` (for + // a non-async iterator) or the global `AsyncIterator` (for an async-iterator) then + // just grab its type argument. + var getIteratorType = isAsyncIterator ? getGlobalAsyncIteratorType : getGlobalIteratorType; + if (isReferenceToType(type, getIteratorType(/*reportErrors*/ false))) { + return isAsyncIterator + ? typeAsIterator.iteratedTypeOfAsyncIterator = type.typeArguments[0] + : typeAsIterator.iteratedTypeOfIterator = type.typeArguments[0]; + } + // Both async and non-async iterators must have a `next` method. + var nextMethod = getTypeOfPropertyOfType(type, "next"); + if (isTypeAny(nextMethod)) { return undefined; } - // As an optimization, if the type is instantiated directly using the globalIterableIteratorType (IterableIterator), - // then just grab its type argument. - if ((getObjectFlags(type) & 4 /* Reference */) && type.target === getGlobalIterableIteratorType()) { - return type.typeArguments[0]; + var nextMethodSignatures = nextMethod ? getSignaturesOfType(nextMethod, 0 /* Call */) : emptyArray; + if (nextMethodSignatures.length === 0) { + if (errorNode) { + error(errorNode, isAsyncIterator + ? ts.Diagnostics.An_async_iterator_must_have_a_next_method + : ts.Diagnostics.An_iterator_must_have_a_next_method); + } + return undefined; } - return getElementTypeOfIterable(type, /*errorNode*/ undefined) || - getElementTypeOfIterator(type, /*errorNode*/ undefined); + var nextResult = getUnionType(ts.map(nextMethodSignatures, getReturnTypeOfSignature), /*subtypeReduction*/ true); + if (isTypeAny(nextResult)) { + return undefined; + } + // For an async iterator, we must get the awaited type of the return type. + if (isAsyncIterator) { + nextResult = getAwaitedTypeOfPromise(nextResult, errorNode, ts.Diagnostics.The_type_returned_by_the_next_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property); + if (isTypeAny(nextResult)) { + return undefined; + } + } + var nextValue = nextResult && getTypeOfPropertyOfType(nextResult, "value"); + if (!nextValue) { + if (errorNode) { + error(errorNode, isAsyncIterator + ? ts.Diagnostics.The_type_returned_by_the_next_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property + : ts.Diagnostics.The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property); + } + return undefined; + } + return isAsyncIterator + ? typeAsIterator.iteratedTypeOfAsyncIterator = nextValue + : typeAsIterator.iteratedTypeOfIterator = nextValue; } /** - * This function does the following steps: - * 1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents. - * 2. Take the element types of the array constituents. - * 3. Return the union of the element types, and string if there was a string constituent. - * - * For example: - * string -> string - * number[] -> number - * string[] | number[] -> string | number - * string | number[] -> string | number - * string | string[] | number[] -> string | number - * - * It also errors if: - * 1. Some constituent is neither a string nor an array. - * 2. Some constituent is a string and target is less than ES5 (because in ES3 string is not indexable). + * A generator may have a return type of `Iterator`, `Iterable`, or + * `IterableIterator`. An async generator may have a return type of `AsyncIterator`, + * `AsyncIterable`, or `AsyncIterableIterator`. This function can be used to extract + * the iterated type from this return type for contextual typing and verifying signatures. */ - function checkElementTypeOfArrayOrString(arrayOrStringType, errorNode) { - ts.Debug.assert(languageVersion < 2 /* ES2015 */); - var arrayType = arrayOrStringType; - if (arrayOrStringType.flags & 65536 /* Union */) { - // After we remove all types that are StringLike, we will know if there was a string constituent - // based on whether the result of filter is a new array. - var arrayTypes = arrayOrStringType.types; - var filteredTypes = ts.filter(arrayTypes, function (t) { return !(t.flags & 262178 /* StringLike */); }); - if (filteredTypes !== arrayTypes) { - arrayType = getUnionType(filteredTypes, /*subtypeReduction*/ true); - } + function getIteratedTypeOfGenerator(returnType, isAsyncGenerator) { + if (isTypeAny(returnType)) { + return undefined; } - else if (arrayOrStringType.flags & 262178 /* StringLike */) { - arrayType = neverType; - } - var hasStringConstituent = arrayOrStringType !== arrayType; - var reportedError = false; - if (hasStringConstituent) { - if (languageVersion < 1 /* ES5 */) { - error(errorNode, ts.Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher); - reportedError = true; - } - // Now that we've removed all the StringLike types, if no constituents remain, then the entire - // arrayOrStringType was a string. - if (arrayType.flags & 8192 /* Never */) { - return stringType; - } - } - if (!isArrayLikeType(arrayType)) { - if (!reportedError) { - // Which error we report depends on whether there was a string constituent. For example, - // if the input type is number | string, we want to say that number is not an array type. - // But if the input was just number, we want to say that number is not an array type - // or a string type. - var diagnostic = hasStringConstituent - ? ts.Diagnostics.Type_0_is_not_an_array_type - : ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type; - error(errorNode, diagnostic, typeToString(arrayType)); - } - return hasStringConstituent ? stringType : unknownType; - } - var arrayElementType = getIndexTypeOfType(arrayType, 1 /* Number */) || unknownType; - if (hasStringConstituent) { - // This is just an optimization for the case where arrayOrStringType is string | string[] - if (arrayElementType.flags & 262178 /* StringLike */) { - return stringType; - } - return getUnionType([arrayElementType, stringType], /*subtypeReduction*/ true); - } - return arrayElementType; + return getIteratedTypeOfIterable(returnType, /*errorNode*/ undefined, isAsyncGenerator, /*allowNonAsyncIterables*/ false, /*checkAssignability*/ false) + || getIteratedTypeOfIterator(returnType, /*errorNode*/ undefined, isAsyncGenerator); } function checkBreakOrContinueStatement(node) { // Grammar checking @@ -40425,10 +43696,12 @@ var ts; // TODO: Check that target label is valid } function isGetAccessorWithAnnotatedSetAccessor(node) { - return !!(node.kind === 151 /* GetAccessor */ && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 152 /* SetAccessor */))); + return !!(node.kind === 153 /* GetAccessor */ && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 154 /* SetAccessor */))); } function isUnwrappedReturnTypeVoidOrAny(func, returnType) { - var unwrappedReturnType = ts.isAsyncFunctionLike(func) ? getPromisedType(returnType) : returnType; + var unwrappedReturnType = (ts.getFunctionFlags(func) & 3 /* AsyncGenerator */) === 2 /* Async */ + ? getPromisedTypeOfPromise(returnType) // Async function + : returnType; // AsyncGenerator function, Generator function, or normal function return unwrappedReturnType && maybeTypeOfKind(unwrappedReturnType, 1024 /* Void */ | 1 /* Any */); } function checkReturnStatement(node) { @@ -40445,40 +43718,41 @@ var ts; var returnType = getReturnTypeOfSignature(signature); if (strictNullChecks || node.expression || returnType.flags & 8192 /* Never */) { var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (func.asteriskToken) { + var functionFlags = ts.getFunctionFlags(func); + if (functionFlags & 1 /* Generator */) { // 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 expressions of generators when return type tracking is added // for generators. return; } - if (func.kind === 152 /* SetAccessor */) { + if (func.kind === 154 /* SetAccessor */) { if (node.expression) { - error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value); + error(node, ts.Diagnostics.Setters_cannot_return_a_value); } } - else if (func.kind === 150 /* Constructor */) { - if (node.expression && !checkTypeAssignableTo(exprType, returnType, node.expression)) { - error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); + else if (func.kind === 152 /* 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 (func.type || isGetAccessorWithAnnotatedSetAccessor(func)) { - if (ts.isAsyncFunctionLike(func)) { - var promisedType = getPromisedType(returnType); - var awaitedType = checkAwaitedType(exprType, node.expression || node, ts.Diagnostics.Return_expression_in_async_function_does_not_have_a_valid_callable_then_member); + if (functionFlags & 2 /* Async */) { + 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) { // If the function has a return type, but promisedType is // undefined, an error will be reported in checkAsyncFunctionReturnType // so we don't need to report one here. - checkTypeAssignableTo(awaitedType, promisedType, node.expression || node); + checkTypeAssignableTo(awaitedType, promisedType, node); } } else { - checkTypeAssignableTo(exprType, returnType, node.expression || node); + checkTypeAssignableTo(exprType, returnType, node); } } } - else if (func.kind !== 150 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { + else if (func.kind !== 152 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { // 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); } @@ -40508,7 +43782,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 === 254 /* DefaultClause */ && !hasDuplicateDefaultClause) { + if (clause.kind === 258 /* DefaultClause */ && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -40520,7 +43794,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 253 /* CaseClause */) { + if (produceDiagnostics && clause.kind === 257 /* CaseClause */) { var caseClause = clause; // TypeScript 1.0 spec (April 2014): 5.9 // In a 'switch' statement, each 'case' expression must be of a type that is comparable @@ -40546,18 +43820,16 @@ var ts; function checkLabeledStatement(node) { // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { - var current = node.parent; - while (current) { + ts.findAncestor(node.parent, function (current) { if (ts.isFunctionLike(current)) { - break; + return "quit"; } - if (current.kind === 219 /* LabeledStatement */ && current.label.text === node.label.text) { + if (current.kind === 222 /* LabeledStatement */ && current.label.text === node.label.text) { var sourceFile = ts.getSourceFileOfNode(node); grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNodeFromSourceText(sourceFile.text, node.label)); - break; + return true; } - current = current.parent; - } + }); } // ensure that label is unique checkSourceElement(node.statement); @@ -40588,14 +43860,14 @@ var ts; grammarErrorOnFirstToken(catchClause.variableDeclaration.initializer, ts.Diagnostics.Catch_clause_variable_cannot_have_an_initializer); } else { - var blockLocals = catchClause.block.locals; - if (blockLocals) { - for (var caughtName in catchClause.locals) { - var blockLocal = blockLocals[caughtName]; + var blockLocals_1 = catchClause.block.locals; + if (blockLocals_1) { + ts.forEachKey(catchClause.locals, function (caughtName) { + var blockLocal = blockLocals_1.get(caughtName); if (blockLocal && (blockLocal.flags & 2 /* BlockScopedVariable */) !== 0) { grammarErrorOnNode(blockLocal.valueDeclaration, ts.Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause, caughtName); } - } + }); } } } @@ -40647,15 +43919,19 @@ var ts; if (!indexType) { return; } + var propDeclaration = prop.valueDeclaration; // index is numeric and property name is not valid numeric literal - if (indexKind === 1 /* Number */ && !isNumericName(prop.valueDeclaration.name)) { + if (indexKind === 1 /* Number */ && !(propDeclaration ? isNumericName(ts.getNameOfDeclaration(propDeclaration)) : isNumericLiteralName(prop.name))) { return; } // perform property check if property or indexer is declared in 'type' - // this allows to rule out cases when both property and indexer are inherited from the base class + // this allows us to rule out cases when both property and indexer are inherited from the base class var errorNode; - if (prop.valueDeclaration.name.kind === 142 /* ComputedPropertyName */ || prop.parent === containingType.symbol) { - errorNode = prop.valueDeclaration; + if (propDeclaration && + (propDeclaration.kind === 194 /* BinaryExpression */ || + ts.getNameOfDeclaration(propDeclaration).kind === 144 /* ComputedPropertyName */ || + prop.parent === containingType.symbol)) { + errorNode = propDeclaration; } else if (indexDeclaration) { errorNode = indexDeclaration; @@ -40685,16 +43961,26 @@ var ts; case "string": case "symbol": case "void": + case "object": error(name, message, name.text); } } - /** Check each type parameter and check that type parameters have no duplicate type parameter declarations */ + /** + * Check each type parameter and check that type parameters have no duplicate type parameter declarations + */ function checkTypeParameters(typeParameterDeclarations) { if (typeParameterDeclarations) { - for (var i = 0, n = typeParameterDeclarations.length; i < n; i++) { + var seenDefault = false; + for (var i = 0; i < typeParameterDeclarations.length; i++) { var node = typeParameterDeclarations[i]; checkTypeParameter(node); if (produceDiagnostics) { + if (node.default) { + seenDefault = true; + } + else if (seenDefault) { + error(node, ts.Diagnostics.Required_type_parameters_may_not_follow_optional_type_parameters); + } for (var j = 0; j < i; j++) { if (typeParameterDeclarations[j].symbol === node.symbol) { error(node.name, ts.Diagnostics.Duplicate_identifier_0, ts.declarationNameToString(node.name)); @@ -40705,23 +43991,65 @@ var ts; } } /** Check that type parameter lists are identical across multiple declarations */ - function checkTypeParameterListsIdentical(node, symbol) { + function checkTypeParameterListsIdentical(symbol) { if (symbol.declarations.length === 1) { return; } - var firstDecl; - for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { - var declaration = _a[_i]; - if (declaration.kind === 226 /* ClassDeclaration */ || declaration.kind === 227 /* InterfaceDeclaration */) { - if (!firstDecl) { - firstDecl = declaration; - } - else if (!areTypeParametersIdentical(firstDecl.typeParameters, node.typeParameters)) { - error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_type_parameters, node.name.text); + var links = getSymbolLinks(symbol); + if (!links.typeParametersChecked) { + links.typeParametersChecked = true; + var declarations = getClassOrInterfaceDeclarationsOfSymbol(symbol); + if (declarations.length <= 1) { + return; + } + var type = getDeclaredTypeOfSymbol(symbol); + if (!areTypeParametersIdentical(declarations, type.localTypeParameters)) { + // Report an error on every conflicting declaration. + var name = symbolToString(symbol); + for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) { + var declaration = declarations_6[_i]; + error(declaration.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_type_parameters, name); } } } } + function areTypeParametersIdentical(declarations, typeParameters) { + var maxTypeArgumentCount = ts.length(typeParameters); + var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); + for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) { + var declaration = declarations_7[_i]; + // If this declaration has too few or too many type parameters, we report an error + var numTypeParameters = ts.length(declaration.typeParameters); + if (numTypeParameters < minTypeArgumentCount || numTypeParameters > maxTypeArgumentCount) { + return false; + } + for (var i = 0; i < numTypeParameters; i++) { + var source = declaration.typeParameters[i]; + var target = typeParameters[i]; + // If the type parameter node does not have the same as the resolved type + // parameter at this position, we report an error. + if (source.name.text !== target.symbol.name) { + return false; + } + // If the type parameter node does not have an identical constraint as the resolved + // type parameter at this position, we report an error. + var sourceConstraint = source.constraint && getTypeFromTypeNode(source.constraint); + var targetConstraint = getConstraintFromTypeParameter(target); + if ((sourceConstraint || targetConstraint) && + (!sourceConstraint || !targetConstraint || !isTypeIdenticalTo(sourceConstraint, targetConstraint))) { + return false; + } + // If the type parameter node has a default and it is not identical to the default + // for the type parameter at this position, we report an error. + var sourceDefault = source.default && getTypeFromTypeNode(source.default); + var targetDefault = getDefaultFromTypeParameter(target); + if (sourceDefault && targetDefault && !isTypeIdenticalTo(sourceDefault, targetDefault)) { + return false; + } + } + } + return true; + } function checkClassExpression(node) { checkClassLikeDeclaration(node); checkNodeDeferred(node); @@ -40740,11 +44068,12 @@ var ts; registerForUnusedIdentifiersCheck(node); } function checkClassLikeDeclaration(node) { - checkGrammarClassDeclarationHeritageClauses(node); + checkGrammarClassLikeDeclaration(node); checkDecorators(node); if (node.name) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Class_name_cannot_be_0); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithCapturedNewTargetVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name); } @@ -40754,22 +44083,27 @@ var ts; var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); var staticType = getTypeOfSymbol(symbol); - checkTypeParameterListsIdentical(node, symbol); + checkTypeParameterListsIdentical(symbol); checkClassForDuplicateDeclarations(node); + // Only check for reserved static identifiers on non-ambient context. + if (!ts.isInAmbientContext(node)) { + checkClassForStaticPropertyNameConflicts(node); + } var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { - if (languageVersion < 2 /* ES2015 */ && !ts.isInAmbientContext(node)) { + if (languageVersion < 2 /* ES2015 */) { checkExternalEmitHelpers(baseTypeNode.parent, 1 /* Extends */); } var baseTypes = getBaseTypes(type); if (baseTypes.length && produceDiagnostics) { var baseType_1 = baseTypes[0]; - var staticBaseType = getBaseConstructorTypeOfClass(type); + var baseConstructorType = getBaseConstructorTypeOfClass(type); + var staticBaseType = getApparentType(baseConstructorType); checkBaseTypeAccessibility(staticBaseType, baseTypeNode); checkSourceElement(baseTypeNode.expression); if (baseTypeNode.typeArguments) { ts.forEach(baseTypeNode.typeArguments, checkSourceElement); - for (var _i = 0, _a = getConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments); _i < _a.length; _i++) { + for (var _i = 0, _a = getConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments, baseTypeNode); _i < _a.length; _i++) { var constructor = _a[_i]; if (!checkTypeArgumentConstraints(constructor.typeParameters, baseTypeNode.typeArguments)) { break; @@ -40778,19 +44112,15 @@ var ts; } checkTypeAssignableTo(typeWithThis, getTypeWithThisArgument(baseType_1, type.thisType), node.name || node, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); checkTypeAssignableTo(staticType, getTypeWithoutSignatures(staticBaseType), node.name || node, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); - if (baseType_1.symbol.valueDeclaration && - !ts.isInAmbientContext(baseType_1.symbol.valueDeclaration) && - baseType_1.symbol.valueDeclaration.kind === 226 /* ClassDeclaration */) { - if (!isBlockScopedNameDeclaredBeforeUse(baseType_1.symbol.valueDeclaration, node)) { - error(baseTypeNode, ts.Diagnostics.A_class_must_be_declared_after_its_base_class); - } + if (baseConstructorType.flags & 540672 /* TypeVariable */ && !isMixinConstructorType(staticType)) { + error(node.name || node, ts.Diagnostics.A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any); } - if (!(staticBaseType.symbol && staticBaseType.symbol.flags & 32 /* Class */)) { + if (!(staticBaseType.symbol && staticBaseType.symbol.flags & 32 /* Class */) && !(baseConstructorType.flags & 540672 /* TypeVariable */)) { // When the static base type is a "class-like" constructor function (but not actually a class), we verify // that all instantiated base constructor signatures return the same type. We can simply compare the type // references (as opposed to checking the structure of the types) because elsewhere we have already checked // that the base type is a class or interface type (and not, for example, an anonymous object type). - var constructors = getInstantiatedConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments); + var constructors = getInstantiatedConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments, baseTypeNode); if (ts.forEach(constructors, function (sig) { return getReturnTypeOfSignature(sig) !== baseType_1; })) { error(baseTypeNode.expression, ts.Diagnostics.Base_constructors_must_all_have_the_same_return_type); } @@ -40809,8 +44139,7 @@ var ts; if (produceDiagnostics) { var t = getTypeFromTypeNode(typeRefNode); if (t !== unknownType) { - var declaredType = getObjectFlags(t) & 4 /* Reference */ ? t.target : t; - if (getObjectFlags(declaredType) & 3 /* ClassOrInterface */) { + if (isValidBaseType(t)) { checkTypeAssignableTo(typeWithThis, getTypeWithThisArgument(t, type.thisType), node.name || node, ts.Diagnostics.Class_0_incorrectly_implements_interface_1); } else { @@ -40840,11 +44169,16 @@ var ts; function getTargetSymbol(s) { // if symbol is instantiated its flags are not copied from the 'target' // so we'll need to get back original 'target' symbol to work with correct set of flags - return s.flags & 16777216 /* Instantiated */ ? getSymbolLinks(s).target : s; + return getCheckFlags(s) & 1 /* Instantiated */ ? s.target : s; } function getClassLikeDeclarationOfSymbol(symbol) { return ts.forEach(symbol.declarations, function (d) { return ts.isClassLike(d) ? d : undefined; }); } + function getClassOrInterfaceDeclarationsOfSymbol(symbol) { + return ts.filter(symbol.declarations, function (d) { + return d.kind === 229 /* ClassDeclaration */ || d.kind === 230 /* InterfaceDeclaration */; + }); + } function checkKindsOfPropertyMemberOverrides(type, baseType) { // TypeScript 1.0 spec (April 2014): 8.2.3 // A derived class inherits all members from its base class it doesn't override. @@ -40860,11 +44194,11 @@ var ts; // Base class instance member variables and accessors can be overridden by // derived class instance member variables and accessors, but not by other kinds of members. // NOTE: assignability is checked in checkClassDeclaration - var baseProperties = getPropertiesOfObjectType(baseType); + var baseProperties = getPropertiesOfType(baseType); for (var _i = 0, baseProperties_1 = baseProperties; _i < baseProperties_1.length; _i++) { var baseProperty = baseProperties_1[_i]; var base = getTargetSymbol(baseProperty); - if (base.flags & 134217728 /* Prototype */) { + if (base.flags & 16777216 /* Prototype */) { continue; } var derived = getTargetSymbol(getPropertyOfObjectType(type, base.name)); @@ -40881,7 +44215,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.getModifierFlags(derivedClassDecl) & 128 /* Abstract */))) { - if (derivedClassDecl.kind === 197 /* ClassExpression */) { + if (derivedClassDecl.kind === 199 /* ClassExpression */) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -40892,7 +44226,7 @@ var ts; else { // derived overrides base. var derivedDeclarationFlags = getDeclarationModifierFlagsFromSymbol(derived); - if ((baseDeclarationFlags & 8 /* Private */) || (derivedDeclarationFlags & 8 /* Private */)) { + if (baseDeclarationFlags & 8 /* Private */ || derivedDeclarationFlags & 8 /* Private */) { // either base or derived property is private - not override, skip it continue; } @@ -40900,64 +44234,32 @@ var ts; // value of 'static' is not the same for properties - not override, skip it continue; } - if ((base.flags & derived.flags & 8192 /* Method */) || ((base.flags & 98308 /* PropertyOrAccessor */) && (derived.flags & 98308 /* PropertyOrAccessor */))) { + if (isMethodLike(base) && isMethodLike(derived) || base.flags & 98308 /* PropertyOrAccessor */ && derived.flags & 98308 /* PropertyOrAccessor */) { // method is overridden with method or property/accessor is overridden with property/accessor - correct case continue; } var errorMessage = void 0; - if (base.flags & 8192 /* Method */) { + if (isMethodLike(base)) { if (derived.flags & 98304 /* Accessor */) { errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor; } else { - ts.Debug.assert((derived.flags & 4 /* Property */) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property; } } else if (base.flags & 4 /* Property */) { - ts.Debug.assert((derived.flags & 8192 /* Method */) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function; } else { - ts.Debug.assert((base.flags & 98304 /* Accessor */) !== 0); - ts.Debug.assert((derived.flags & 8192 /* Method */) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function; } - error(derived.valueDeclaration.name, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type)); + error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type)); } } } } function isAccessor(kind) { - return kind === 151 /* GetAccessor */ || kind === 152 /* SetAccessor */; - } - function areTypeParametersIdentical(list1, list2) { - if (!list1 && !list2) { - return true; - } - if (!list1 || !list2 || list1.length !== list2.length) { - return false; - } - // TypeScript 1.0 spec (April 2014): - // When a generic interface has multiple declarations, all declarations must have identical type parameter - // lists, i.e. identical type parameter names with identical constraints in identical order. - for (var i = 0, len = list1.length; i < len; i++) { - var tp1 = list1[i]; - var tp2 = list2[i]; - if (tp1.name.text !== tp2.name.text) { - return false; - } - if (!tp1.constraint && !tp2.constraint) { - continue; - } - if (!tp1.constraint || !tp2.constraint) { - return false; - } - if (!isTypeIdenticalTo(getTypeFromTypeNode(tp1.constraint), getTypeFromTypeNode(tp2.constraint))) { - return false; - } - } - return true; + return kind === 153 /* GetAccessor */ || kind === 154 /* SetAccessor */; } function checkInheritedPropertiesAreIdentical(type, typeNode) { var baseTypes = getBaseTypes(type); @@ -40965,16 +44267,16 @@ var ts; return true; } var seen = ts.createMap(); - ts.forEach(resolveDeclaredMembers(type).declaredProperties, function (p) { seen[p.name] = { prop: p, containingType: type }; }); + ts.forEach(resolveDeclaredMembers(type).declaredProperties, function (p) { seen.set(p.name, { prop: p, containingType: type }); }); var ok = true; for (var _i = 0, baseTypes_2 = baseTypes; _i < baseTypes_2.length; _i++) { var base = baseTypes_2[_i]; - var properties = getPropertiesOfObjectType(getTypeWithThisArgument(base, type.thisType)); - for (var _a = 0, properties_7 = properties; _a < properties_7.length; _a++) { - var prop = properties_7[_a]; - var existing = seen[prop.name]; + var properties = getPropertiesOfType(getTypeWithThisArgument(base, type.thisType)); + for (var _a = 0, properties_8 = properties; _a < properties_8.length; _a++) { + var prop = properties_8[_a]; + var existing = seen.get(prop.name); if (!existing) { - seen[prop.name] = { prop: prop, containingType: base }; + seen.set(prop.name, { prop: prop, containingType: base }); } else { var isInheritedProperty = existing.containingType !== type; @@ -40982,7 +44284,7 @@ var ts; ok = false; var typeName1 = typeToString(existing.containingType); var typeName2 = typeToString(base); - var errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Named_property_0_of_types_1_and_2_are_not_identical, symbolToString(prop), typeName1, typeName2); + var errorInfo = ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Named_property_0_of_types_1_and_2_are_not_identical, symbolToString(prop), typeName1, typeName2); errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2, typeToString(type), typeName1, typeName2); diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(typeNode, errorInfo)); } @@ -40999,9 +44301,9 @@ var ts; checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - checkTypeParameterListsIdentical(node, symbol); + checkTypeParameterListsIdentical(symbol); // Only check this symbol once - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 227 /* InterfaceDeclaration */); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 230 /* InterfaceDeclaration */); if (node === firstInterfaceDecl) { var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); @@ -41108,18 +44410,18 @@ var ts; return value; function evalConstant(e) { switch (e.kind) { - case 190 /* PrefixUnaryExpression */: + case 192 /* PrefixUnaryExpression */: var value_1 = evalConstant(e.operand); if (value_1 === undefined) { return undefined; } switch (e.operator) { - case 36 /* PlusToken */: return value_1; - case 37 /* MinusToken */: return -value_1; - case 51 /* TildeToken */: return ~value_1; + case 37 /* PlusToken */: return value_1; + case 38 /* MinusToken */: return -value_1; + case 52 /* TildeToken */: return ~value_1; } return undefined; - case 192 /* BinaryExpression */: + case 194 /* BinaryExpression */: var left = evalConstant(e.left); if (left === undefined) { return undefined; @@ -41129,31 +44431,32 @@ var ts; return undefined; } switch (e.operatorToken.kind) { - case 48 /* BarToken */: return left | right; - case 47 /* AmpersandToken */: return left & right; - case 45 /* GreaterThanGreaterThanToken */: return left >> right; - case 46 /* GreaterThanGreaterThanGreaterThanToken */: return left >>> right; - case 44 /* LessThanLessThanToken */: return left << right; - case 49 /* CaretToken */: return left ^ right; - case 38 /* AsteriskToken */: return left * right; - case 40 /* SlashToken */: return left / right; - case 36 /* PlusToken */: return left + right; - case 37 /* MinusToken */: return left - right; - case 41 /* PercentToken */: return left % right; + case 49 /* BarToken */: return left | right; + case 48 /* AmpersandToken */: return left & right; + case 46 /* GreaterThanGreaterThanToken */: return left >> right; + case 47 /* GreaterThanGreaterThanGreaterThanToken */: return left >>> right; + case 45 /* LessThanLessThanToken */: return left << right; + case 50 /* CaretToken */: return left ^ right; + case 39 /* AsteriskToken */: return left * right; + case 41 /* SlashToken */: return left / right; + case 37 /* PlusToken */: return left + right; + case 38 /* MinusToken */: return left - right; + case 42 /* PercentToken */: return left % right; } return undefined; case 8 /* NumericLiteral */: + checkGrammarNumericLiteral(e); return +e.text; - case 183 /* ParenthesizedExpression */: + case 185 /* ParenthesizedExpression */: return evalConstant(e.expression); - case 70 /* Identifier */: - case 178 /* ElementAccessExpression */: - case 177 /* PropertyAccessExpression */: + case 71 /* Identifier */: + case 180 /* ElementAccessExpression */: + case 179 /* PropertyAccessExpression */: var member = initializer.parent; var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); var enumType_1; var propertyName = void 0; - if (e.kind === 70 /* Identifier */) { + if (e.kind === 71 /* Identifier */) { // unqualified names can refer to member that reside in different declaration of the enum so just doing name resolution won't work. // instead pick current enum type and later try to fetch member from the type enumType_1 = currentType; @@ -41161,7 +44464,7 @@ var ts; } else { var expression = void 0; - if (e.kind === 178 /* ElementAccessExpression */) { + if (e.kind === 180 /* ElementAccessExpression */) { if (e.argumentExpression === undefined || e.argumentExpression.kind !== 9 /* StringLiteral */) { return undefined; @@ -41176,10 +44479,10 @@ var ts; // expression part in ElementAccess\PropertyAccess should be either identifier or dottedName var current = expression; while (current) { - if (current.kind === 70 /* Identifier */) { + if (current.kind === 71 /* Identifier */) { break; } - else if (current.kind === 177 /* PropertyAccessExpression */) { + else if (current.kind === 179 /* PropertyAccessExpression */) { current = current.expression; } else { @@ -41223,6 +44526,7 @@ var ts; checkGrammarDecorators(node) || checkGrammarModifiers(node); checkTypeNameIsReserved(node.name, ts.Diagnostics.Enum_name_cannot_be_0); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithCapturedNewTargetVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name); checkExportsOnMergedDeclarations(node); @@ -41244,14 +44548,14 @@ var ts; // check that const is placed\omitted on all enum declarations ts.forEach(enumSymbol.declarations, function (decl) { if (ts.isConstEnumDeclaration(decl) !== enumIsConst) { - error(decl.name, ts.Diagnostics.Enum_declarations_must_all_be_const_or_non_const); + error(ts.getNameOfDeclaration(decl), ts.Diagnostics.Enum_declarations_must_all_be_const_or_non_const); } }); } 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 !== 229 /* EnumDeclaration */) { + if (declaration.kind !== 232 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -41272,10 +44576,10 @@ var ts; } function getFirstNonAmbientClassOrFunctionDeclaration(symbol) { var declarations = symbol.declarations; - for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { - var declaration = declarations_5[_i]; - if ((declaration.kind === 226 /* ClassDeclaration */ || - (declaration.kind === 225 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && + for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { + var declaration = declarations_8[_i]; + if ((declaration.kind === 229 /* ClassDeclaration */ || + (declaration.kind === 228 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { return declaration; } @@ -41339,7 +44643,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, 226 /* ClassDeclaration */); + var mergedClass = ts.getDeclarationOfKind(symbol, 229 /* ClassDeclaration */); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768 /* LexicalModuleMergesWithClass */; @@ -41352,7 +44656,7 @@ var ts; // We can detect if augmentation was applied using following rules: // - augmentation for a global scope is always applied // - 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 /* Merged */); + var checkBody = isGlobalAugmentation || (getSymbolOfNode(node).flags & 134217728 /* 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++) { @@ -41390,39 +44694,39 @@ var ts; } function checkModuleAugmentationElement(node, isGlobalAugmentation) { switch (node.kind) { - case 205 /* VariableStatement */: + case 208 /* 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 240 /* ExportAssignment */: - case 241 /* ExportDeclaration */: + case 243 /* ExportAssignment */: + case 244 /* ExportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); break; - case 234 /* ImportEqualsDeclaration */: - case 235 /* ImportDeclaration */: + case 237 /* ImportEqualsDeclaration */: + case 238 /* ImportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); break; - case 174 /* BindingElement */: - case 223 /* VariableDeclaration */: - var name_25 = node.name; - if (ts.isBindingPattern(name_25)) { - for (var _b = 0, _c = name_25.elements; _b < _c.length; _b++) { + case 176 /* BindingElement */: + case 226 /* VariableDeclaration */: + var name = node.name; + if (ts.isBindingPattern(name)) { + for (var _b = 0, _c = name.elements; _b < _c.length; _b++) { var el = _c[_b]; // mark individual names in binding pattern checkModuleAugmentationElement(el, isGlobalAugmentation); } break; } - // fallthrough - case 226 /* ClassDeclaration */: - case 229 /* EnumDeclaration */: - case 225 /* FunctionDeclaration */: - case 227 /* InterfaceDeclaration */: - case 230 /* ModuleDeclaration */: - case 228 /* TypeAliasDeclaration */: + // falls through + case 229 /* ClassDeclaration */: + case 232 /* EnumDeclaration */: + case 228 /* FunctionDeclaration */: + case 230 /* InterfaceDeclaration */: + case 233 /* ModuleDeclaration */: + case 231 /* TypeAliasDeclaration */: if (isGlobalAugmentation) { return; } @@ -41432,7 +44736,7 @@ var ts; // this is done it two steps // 1. quick check - if symbol for node is not merged - this is local symbol to this augmentation - report error // 2. main check - report error if value declaration of the parent symbol is module augmentation) - var reportError = !(symbol.flags & 33554432 /* Merged */); + var reportError = !(symbol.flags & 134217728 /* Transient */); if (!reportError) { // symbol should not originate in augmentation reportError = ts.isExternalModuleAugmentation(symbol.parent.declarations[0]); @@ -41443,17 +44747,17 @@ var ts; } function getFirstIdentifier(node) { switch (node.kind) { - case 70 /* Identifier */: + case 71 /* Identifier */: return node; - case 141 /* QualifiedName */: + case 143 /* QualifiedName */: do { node = node.left; - } while (node.kind !== 70 /* Identifier */); + } while (node.kind !== 71 /* Identifier */); return node; - case 177 /* PropertyAccessExpression */: + case 179 /* PropertyAccessExpression */: do { node = node.expression; - } while (node.kind !== 70 /* Identifier */); + } while (node.kind !== 71 /* Identifier */); return node; } } @@ -41463,9 +44767,9 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 231 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 261 /* SourceFile */ && !inAmbientExternalModule) { - error(moduleName, node.kind === 241 /* ExportDeclaration */ ? + var inAmbientExternalModule = node.parent.kind === 234 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 265 /* SourceFile */ && !inAmbientExternalModule) { + error(moduleName, node.kind === 244 /* ExportDeclaration */ ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; @@ -41498,7 +44802,7 @@ var ts; (symbol.flags & 793064 /* Type */ ? 793064 /* Type */ : 0) | (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 243 /* ExportSpecifier */ ? + var message = node.kind === 246 /* 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)); @@ -41526,7 +44830,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 237 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 240 /* NamespaceImport */) { checkImportBinding(importClause.namedBindings); } else { @@ -41583,8 +44887,10 @@ var ts; // export { x, y } // export { x, y } from "foo" ts.forEach(node.exportClause.elements, checkExportSpecifier); - var inAmbientExternalModule = node.parent.kind === 231 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 261 /* SourceFile */ && !inAmbientExternalModule) { + var inAmbientExternalModule = node.parent.kind === 234 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 234 /* ModuleBlock */ && + !node.moduleSpecifier && ts.isInAmbientContext(node); + if (node.parent.kind !== 265 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -41598,7 +44904,7 @@ var ts; } } function checkGrammarModuleElementContext(node, errorMessage) { - var isInAppropriateContext = node.parent.kind === 261 /* SourceFile */ || node.parent.kind === 231 /* ModuleBlock */ || node.parent.kind === 230 /* ModuleDeclaration */; + var isInAppropriateContext = node.parent.kind === 265 /* SourceFile */ || node.parent.kind === 234 /* ModuleBlock */ || node.parent.kind === 233 /* ModuleDeclaration */; if (!isInAppropriateContext) { grammarErrorOnFirstToken(node, errorMessage); } @@ -41624,16 +44930,21 @@ 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 === 261 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 230 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { - error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); + var container = node.parent.kind === 265 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 233 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + if (node.isExportEquals) { + error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); + } + else { + error(node, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); + } return; } // Grammar checking if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.getModifierFlags(node) !== 0) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_assignment_cannot_have_modifiers); } - if (node.expression.kind === 70 /* Identifier */) { + if (node.expression.kind === 71 /* Identifier */) { markExportAsReferenced(node); } else { @@ -41652,18 +44963,13 @@ var ts; } } function hasExportedMembers(moduleSymbol) { - for (var id in moduleSymbol.exports) { - if (id !== "export=") { - return true; - } - } - return false; + return ts.forEachEntry(moduleSymbol.exports, function (_, id) { return id !== "export="; }); } function checkExternalModuleExports(node) { var moduleSymbol = getSymbolOfNode(node); var links = getSymbolLinks(moduleSymbol); if (!links.exportsChecked) { - var exportEqualsSymbol = moduleSymbol.exports["export="]; + var exportEqualsSymbol = moduleSymbol.exports.get("export="); if (exportEqualsSymbol && hasExportedMembers(moduleSymbol)) { var declaration = getDeclarationOfAliasSymbol(exportEqualsSymbol) || exportEqualsSymbol.valueDeclaration; if (!isTopLevelInExternalModuleAugmentation(declaration)) { @@ -41672,35 +44978,35 @@ var ts; } // Checks for export * conflicts var exports = getExportsOfModule(moduleSymbol); - for (var id in exports) { + exports && exports.forEach(function (_a, id) { + var declarations = _a.declarations, flags = _a.flags; if (id === "__export") { - continue; + return; } - var _a = exports[id], declarations = _a.declarations, flags = _a.flags; // ECMA262: 15.2.1.1 It is a Syntax Error if the ExportedNames of ModuleItemList contains any duplicate entries. // (TS Exceptions: namespaces, function overloads, enums, and interfaces) if (flags & (1920 /* Namespace */ | 64 /* Interface */ | 384 /* Enum */)) { - continue; + return; } var exportedDeclarationsCount = ts.countWhere(declarations, isNotOverload); if (flags & 524288 /* TypeAlias */ && exportedDeclarationsCount <= 2) { // it is legal to merge type alias with other values // so count should be either 1 (just type alias) or 2 (type alias + merged value) - continue; + return; } if (exportedDeclarationsCount > 1) { - for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) { - var declaration = declarations_6[_i]; + for (var _i = 0, declarations_9 = declarations; _i < declarations_9.length; _i++) { + var declaration = declarations_9[_i]; if (isNotOverload(declaration)) { diagnostics.add(ts.createDiagnosticForNode(declaration, ts.Diagnostics.Cannot_redeclare_exported_variable_0, id)); } } } - } + }); links.exportsChecked = true; } function isNotOverload(declaration) { - return (declaration.kind !== 225 /* FunctionDeclaration */ && declaration.kind !== 149 /* MethodDeclaration */) || + return (declaration.kind !== 228 /* FunctionDeclaration */ && declaration.kind !== 151 /* MethodDeclaration */) || !!declaration.body; } } @@ -41713,123 +45019,123 @@ 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 230 /* ModuleDeclaration */: - case 226 /* ClassDeclaration */: - case 227 /* InterfaceDeclaration */: - case 225 /* FunctionDeclaration */: + case 233 /* ModuleDeclaration */: + case 229 /* ClassDeclaration */: + case 230 /* InterfaceDeclaration */: + case 228 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } switch (kind) { - case 143 /* TypeParameter */: + case 145 /* TypeParameter */: return checkTypeParameter(node); - case 144 /* Parameter */: + case 146 /* Parameter */: return checkParameter(node); - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: + case 149 /* PropertyDeclaration */: + case 148 /* PropertySignature */: return checkPropertyDeclaration(node); - case 158 /* FunctionType */: - case 159 /* ConstructorType */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: + case 160 /* FunctionType */: + case 161 /* ConstructorType */: + case 155 /* CallSignature */: + case 156 /* ConstructSignature */: return checkSignatureDeclaration(node); - case 155 /* IndexSignature */: + case 157 /* IndexSignature */: return checkSignatureDeclaration(node); - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: return checkMethodDeclaration(node); - case 150 /* Constructor */: + case 152 /* Constructor */: return checkConstructorDeclaration(node); - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: return checkAccessorDeclaration(node); - case 157 /* TypeReference */: + case 159 /* TypeReference */: return checkTypeReferenceNode(node); - case 156 /* TypePredicate */: + case 158 /* TypePredicate */: return checkTypePredicate(node); - case 160 /* TypeQuery */: + case 162 /* TypeQuery */: return checkTypeQuery(node); - case 161 /* TypeLiteral */: + case 163 /* TypeLiteral */: return checkTypeLiteral(node); - case 162 /* ArrayType */: + case 164 /* ArrayType */: return checkArrayType(node); - case 163 /* TupleType */: + case 165 /* TupleType */: return checkTupleType(node); - case 164 /* UnionType */: - case 165 /* IntersectionType */: + case 166 /* UnionType */: + case 167 /* IntersectionType */: return checkUnionOrIntersectionType(node); - case 166 /* ParenthesizedType */: - case 168 /* TypeOperator */: + case 168 /* ParenthesizedType */: + case 170 /* TypeOperator */: return checkSourceElement(node.type); - case 169 /* IndexedAccessType */: + case 171 /* IndexedAccessType */: return checkIndexedAccessType(node); - case 170 /* MappedType */: + case 172 /* MappedType */: return checkMappedType(node); - case 225 /* FunctionDeclaration */: + case 228 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 204 /* Block */: - case 231 /* ModuleBlock */: + case 207 /* Block */: + case 234 /* ModuleBlock */: return checkBlock(node); - case 205 /* VariableStatement */: + case 208 /* VariableStatement */: return checkVariableStatement(node); - case 207 /* ExpressionStatement */: + case 210 /* ExpressionStatement */: return checkExpressionStatement(node); - case 208 /* IfStatement */: + case 211 /* IfStatement */: return checkIfStatement(node); - case 209 /* DoStatement */: + case 212 /* DoStatement */: return checkDoStatement(node); - case 210 /* WhileStatement */: + case 213 /* WhileStatement */: return checkWhileStatement(node); - case 211 /* ForStatement */: + case 214 /* ForStatement */: return checkForStatement(node); - case 212 /* ForInStatement */: + case 215 /* ForInStatement */: return checkForInStatement(node); - case 213 /* ForOfStatement */: + case 216 /* ForOfStatement */: return checkForOfStatement(node); - case 214 /* ContinueStatement */: - case 215 /* BreakStatement */: + case 217 /* ContinueStatement */: + case 218 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 216 /* ReturnStatement */: + case 219 /* ReturnStatement */: return checkReturnStatement(node); - case 217 /* WithStatement */: + case 220 /* WithStatement */: return checkWithStatement(node); - case 218 /* SwitchStatement */: + case 221 /* SwitchStatement */: return checkSwitchStatement(node); - case 219 /* LabeledStatement */: + case 222 /* LabeledStatement */: return checkLabeledStatement(node); - case 220 /* ThrowStatement */: + case 223 /* ThrowStatement */: return checkThrowStatement(node); - case 221 /* TryStatement */: + case 224 /* TryStatement */: return checkTryStatement(node); - case 223 /* VariableDeclaration */: + case 226 /* VariableDeclaration */: return checkVariableDeclaration(node); - case 174 /* BindingElement */: + case 176 /* BindingElement */: return checkBindingElement(node); - case 226 /* ClassDeclaration */: + case 229 /* ClassDeclaration */: return checkClassDeclaration(node); - case 227 /* InterfaceDeclaration */: + case 230 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 228 /* TypeAliasDeclaration */: + case 231 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 229 /* EnumDeclaration */: + case 232 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 230 /* ModuleDeclaration */: + case 233 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 235 /* ImportDeclaration */: + case 238 /* ImportDeclaration */: return checkImportDeclaration(node); - case 234 /* ImportEqualsDeclaration */: + case 237 /* ImportEqualsDeclaration */: return checkImportEqualsDeclaration(node); - case 241 /* ExportDeclaration */: + case 244 /* ExportDeclaration */: return checkExportDeclaration(node); - case 240 /* ExportAssignment */: + case 243 /* ExportAssignment */: return checkExportAssignment(node); - case 206 /* EmptyStatement */: + case 209 /* EmptyStatement */: checkGrammarStatementInAmbientContext(node); return; - case 222 /* DebuggerStatement */: + case 225 /* DebuggerStatement */: checkGrammarStatementInAmbientContext(node); return; - case 244 /* MissingDeclaration */: + case 247 /* MissingDeclaration */: return checkMissingDeclaration(node); } } @@ -41851,17 +45157,17 @@ var ts; for (var _i = 0, deferredNodes_1 = deferredNodes; _i < deferredNodes_1.length; _i++) { var node = deferredNodes_1[_i]; switch (node.kind) { - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 186 /* FunctionExpression */: + case 187 /* ArrowFunction */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - checkAccessorDeferred(node); + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + checkAccessorDeclaration(node); break; - case 197 /* ClassExpression */: + case 199 /* ClassExpression */: checkClassExpressionDeferred(node); break; } @@ -41886,6 +45192,7 @@ var ts; // Grammar checking checkGrammarSourceFile(node); potentialThisCollisions.length = 0; + potentialNewTargetCollisions.length = 0; deferredNodes = []; deferredUnusedIdentifierNodes = produceDiagnostics && noUnusedIdentifiers ? [] : undefined; ts.forEach(node.statements, checkSourceElement); @@ -41905,6 +45212,10 @@ var ts; ts.forEach(potentialThisCollisions, checkIfThisIsCapturedInEnclosingScope); potentialThisCollisions.length = 0; } + if (potentialNewTargetCollisions.length) { + ts.forEach(potentialNewTargetCollisions, checkIfNewTargetIsCapturedInEnclosingScope); + potentialNewTargetCollisions.length = 0; + } links.flags |= 1 /* TypeChecked */; } } @@ -41962,7 +45273,7 @@ var ts; function isInsideWithStatementBody(node) { if (node) { while (node.parent) { - if (node.parent.kind === 217 /* WithStatement */ && node.parent.statement === node) { + if (node.parent.kind === 220 /* WithStatement */ && node.parent.statement === node) { return true; } node = node.parent; @@ -41971,12 +45282,12 @@ var ts; return false; } function getSymbolsInScope(location, meaning) { - var symbols = ts.createMap(); - var memberFlags = 0 /* None */; if (isInsideWithStatementBody(location)) { // We cannot answer semantic questions within a with block, do not proceed any further return []; } + var symbols = ts.createMap(); + var memberFlags = 0 /* None */; populateSymbols(); return symbolsToArray(symbols); function populateSymbols() { @@ -41985,25 +45296,27 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 261 /* SourceFile */: + case 265 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) { break; } - case 230 /* ModuleDeclaration */: + // falls through + case 233 /* ModuleDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8914931 /* ModuleMember */); break; - case 229 /* EnumDeclaration */: + case 232 /* EnumDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 197 /* ClassExpression */: + case 199 /* ClassExpression */: var className = location.name; if (className) { copySymbol(location.symbol, meaning); } - // fall through; this fall-through is necessary because we would like to handle + // 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 226 /* ClassDeclaration */: - case 227 /* InterfaceDeclaration */: + case 229 /* ClassDeclaration */: + case 230 /* 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. @@ -42012,7 +45325,7 @@ var ts; copySymbols(getSymbolOfNode(location).members, meaning & 793064 /* Type */); } break; - case 184 /* FunctionExpression */: + case 186 /* FunctionExpression */: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -42040,49 +45353,48 @@ var ts; // We will copy all symbol regardless of its reserved name because // symbolsToArray will check whether the key is a reserved name and // it will not copy symbol with reserved name to the array - if (!symbols[id]) { - symbols[id] = symbol; + if (!symbols.has(id)) { + symbols.set(id, symbol); } } } function copySymbols(source, meaning) { if (meaning) { - for (var id in source) { - var symbol = source[id]; + source.forEach(function (symbol) { copySymbol(symbol, meaning); - } + }); } } } function isTypeDeclarationName(name) { - return name.kind === 70 /* Identifier */ && + return name.kind === 71 /* Identifier */ && isTypeDeclaration(name.parent) && name.parent.name === name; } function isTypeDeclaration(node) { switch (node.kind) { - case 143 /* TypeParameter */: - case 226 /* ClassDeclaration */: - case 227 /* InterfaceDeclaration */: - case 228 /* TypeAliasDeclaration */: - case 229 /* EnumDeclaration */: + case 145 /* TypeParameter */: + case 229 /* ClassDeclaration */: + case 230 /* InterfaceDeclaration */: + case 231 /* TypeAliasDeclaration */: + case 232 /* 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 === 141 /* QualifiedName */) { + while (node.parent && node.parent.kind === 143 /* QualifiedName */) { node = node.parent; } - return node.parent && (node.parent.kind === 157 /* TypeReference */ || node.parent.kind === 272 /* JSDocTypeReference */); + return node.parent && (node.parent.kind === 159 /* TypeReference */ || node.parent.kind === 277 /* JSDocTypeReference */); } function isHeritageClauseElementIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 177 /* PropertyAccessExpression */) { + while (node.parent && node.parent.kind === 179 /* PropertyAccessExpression */) { node = node.parent; } - return node.parent && node.parent.kind === 199 /* ExpressionWithTypeArguments */; + return node.parent && node.parent.kind === 201 /* ExpressionWithTypeArguments */; } function forEachEnclosingClass(node, callback) { var result; @@ -42099,13 +45411,13 @@ var ts; return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; }); } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 141 /* QualifiedName */) { + while (nodeOnRightSide.parent.kind === 143 /* QualifiedName */) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 234 /* ImportEqualsDeclaration */) { + if (nodeOnRightSide.parent.kind === 237 /* ImportEqualsDeclaration */) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 240 /* ExportAssignment */) { + if (nodeOnRightSide.parent.kind === 243 /* ExportAssignment */) { return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent; } return undefined; @@ -42113,29 +45425,38 @@ var ts; function isInRightSideOfImportOrExportAssignment(node) { return getLeftSideOfImportEqualsOrExportAssignment(node) !== undefined; } + function getSpecialPropertyAssignmentSymbolFromEntityName(entityName) { + var specialPropertyAssignmentKind = ts.getSpecialPropertyAssignmentKind(entityName.parent.parent); + switch (specialPropertyAssignmentKind) { + case 1 /* ExportsProperty */: + case 3 /* PrototypeProperty */: + return getSymbolOfNode(entityName.parent); + case 4 /* ThisProperty */: + case 2 /* ModuleExports */: + case 5 /* Property */: + return getSymbolOfNode(entityName.parent.parent); + } + } function getSymbolOfEntityNameOrPropertyAccessExpression(entityName) { if (ts.isDeclarationName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (ts.isInJavaScriptFile(entityName) && entityName.parent.kind === 177 /* PropertyAccessExpression */) { - var specialPropertyAssignmentKind = ts.getSpecialPropertyAssignmentKind(entityName.parent.parent); - switch (specialPropertyAssignmentKind) { - case 1 /* ExportsProperty */: - case 3 /* PrototypeProperty */: - return getSymbolOfNode(entityName.parent); - case 4 /* ThisProperty */: - case 2 /* ModuleExports */: - return getSymbolOfNode(entityName.parent.parent); - default: + if (ts.isInJavaScriptFile(entityName) && + entityName.parent.kind === 179 /* PropertyAccessExpression */ && + entityName.parent === entityName.parent.parent.left) { + // Check if this is a special property assignment + var specialPropertyAssignmentSymbol = getSpecialPropertyAssignmentSymbolFromEntityName(entityName); + if (specialPropertyAssignmentSymbol) { + return specialPropertyAssignmentSymbol; } } - if (entityName.parent.kind === 240 /* ExportAssignment */ && ts.isEntityNameExpression(entityName)) { + if (entityName.parent.kind === 243 /* ExportAssignment */ && ts.isEntityNameExpression(entityName)) { return resolveEntityName(entityName, /*all meanings*/ 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */ | 8388608 /* Alias */); } - if (entityName.kind !== 177 /* PropertyAccessExpression */ && isInRightSideOfImportOrExportAssignment(entityName)) { + if (entityName.kind !== 179 /* PropertyAccessExpression */ && isInRightSideOfImportOrExportAssignment(entityName)) { // Since we already checked for ExportAssignment, this really could only be an Import - var importEqualsDeclaration = ts.getAncestor(entityName, 234 /* ImportEqualsDeclaration */); + var importEqualsDeclaration = ts.getAncestor(entityName, 237 /* ImportEqualsDeclaration */); ts.Debug.assert(importEqualsDeclaration !== undefined); return getSymbolOfPartOfRightHandSideOfImportEquals(entityName, /*dontResolveAlias*/ true); } @@ -42145,7 +45466,7 @@ 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 === 199 /* ExpressionWithTypeArguments */) { + if (entityName.parent.kind === 201 /* ExpressionWithTypeArguments */) { meaning = 793064 /* Type */; // In a class 'extends' clause we are also looking for a value. if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) { @@ -42156,27 +45477,30 @@ var ts; meaning = 1920 /* Namespace */; } meaning |= 8388608 /* Alias */; - return resolveEntityName(entityName, meaning); + var entityNameSymbol = resolveEntityName(entityName, meaning); + if (entityNameSymbol) { + return entityNameSymbol; + } } - else if (ts.isPartOfExpression(entityName)) { + if (ts.isPartOfExpression(entityName)) { if (ts.nodeIsMissing(entityName)) { // Missing entity name. return undefined; } - if (entityName.kind === 70 /* Identifier */) { + if (entityName.kind === 71 /* Identifier */) { if (ts.isJSXTagName(entityName) && isJsxIntrinsicIdentifier(entityName)) { return getIntrinsicTagSymbol(entityName.parent); } return resolveEntityName(entityName, 107455 /* Value */, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (entityName.kind === 177 /* PropertyAccessExpression */) { + else if (entityName.kind === 179 /* PropertyAccessExpression */) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkPropertyAccessExpression(entityName); } return getNodeLinks(entityName).resolvedSymbol; } - else if (entityName.kind === 141 /* QualifiedName */) { + else if (entityName.kind === 143 /* QualifiedName */) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkQualifiedName(entityName); @@ -42185,20 +45509,20 @@ var ts; } } else if (isTypeReferenceIdentifier(entityName)) { - var meaning = (entityName.parent.kind === 157 /* TypeReference */ || entityName.parent.kind === 272 /* JSDocTypeReference */) ? 793064 /* Type */ : 1920 /* Namespace */; + var meaning = (entityName.parent.kind === 159 /* TypeReference */ || entityName.parent.kind === 277 /* JSDocTypeReference */) ? 793064 /* Type */ : 1920 /* Namespace */; return resolveEntityName(entityName, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (entityName.parent.kind === 250 /* JsxAttribute */) { + else if (entityName.parent.kind === 253 /* JsxAttribute */) { return getJsxAttributePropertySymbol(entityName.parent); } - if (entityName.parent.kind === 156 /* TypePredicate */) { + if (entityName.parent.kind === 158 /* TypePredicate */) { return resolveEntityName(entityName, /*meaning*/ 1 /* FunctionScopedVariable */); } // Do we want to return undefined here? return undefined; } function getSymbolAtLocation(node) { - if (node.kind === 261 /* SourceFile */) { + if (node.kind === 265 /* SourceFile */) { return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined; } if (isInsideWithStatementBody(node)) { @@ -42212,12 +45536,12 @@ var ts; else if (ts.isLiteralComputedPropertyDeclarationName(node)) { return getSymbolOfNode(node.parent.parent); } - if (node.kind === 70 /* Identifier */) { + if (node.kind === 71 /* Identifier */) { if (isInRightSideOfImportOrExportAssignment(node)) { return getSymbolOfEntityNameOrPropertyAccessExpression(node); } - else if (node.parent.kind === 174 /* BindingElement */ && - node.parent.parent.kind === 172 /* ObjectBindingPattern */ && + else if (node.parent.kind === 176 /* BindingElement */ && + node.parent.parent.kind === 174 /* ObjectBindingPattern */ && node === node.parent.propertyName) { var typeOfPattern = getTypeOfNode(node.parent.parent); var propertyDeclaration = typeOfPattern && getPropertyOfType(typeOfPattern, node.text); @@ -42227,11 +45551,11 @@ var ts; } } switch (node.kind) { - case 70 /* Identifier */: - case 177 /* PropertyAccessExpression */: - case 141 /* QualifiedName */: + case 71 /* Identifier */: + case 179 /* PropertyAccessExpression */: + case 143 /* QualifiedName */: return getSymbolOfEntityNameOrPropertyAccessExpression(node); - case 98 /* ThisKeyword */: + case 99 /* ThisKeyword */: var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); if (ts.isFunctionLike(container)) { var sig = getSignatureFromDeclaration(container); @@ -42239,16 +45563,16 @@ var ts; return sig.thisParameter; } } - // fallthrough - case 96 /* SuperKeyword */: + // falls through + case 97 /* SuperKeyword */: var type = ts.isPartOfExpression(node) ? getTypeOfExpression(node) : getTypeFromTypeNode(node); return type.symbol; - case 167 /* ThisType */: + case 169 /* ThisType */: return getTypeFromTypeNode(node).symbol; - case 122 /* ConstructorKeyword */: + 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 === 150 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 152 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; @@ -42256,17 +45580,17 @@ var ts; // External module name in an import declaration if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 235 /* ImportDeclaration */ || node.parent.kind === 241 /* ExportDeclaration */) && + ((node.parent.kind === 238 /* ImportDeclaration */ || node.parent.kind === 244 /* ExportDeclaration */) && node.parent.moduleSpecifier === node)) { return resolveExternalModuleName(node, node); } if (ts.isInJavaScriptFile(node) && ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteral*/ false)) { return resolveExternalModuleName(node, node); } - // Fall through + // falls through case 8 /* NumericLiteral */: // index access - if (node.parent.kind === 178 /* ElementAccessExpression */ && node.parent.argumentExpression === node) { + if (node.parent.kind === 180 /* ElementAccessExpression */ && node.parent.argumentExpression === node) { var objectType = getTypeOfExpression(node.parent.expression); if (objectType === unknownType) return undefined; @@ -42283,7 +45607,7 @@ 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 === 258 /* ShorthandPropertyAssignment */) { + if (location && location.kind === 262 /* ShorthandPropertyAssignment */) { return resolveEntityName(location.name, 107455 /* Value */ | 8388608 /* Alias */); } return undefined; @@ -42300,7 +45624,13 @@ var ts; return unknownType; } if (ts.isPartOfTypeNode(node)) { - return getTypeFromTypeNode(node); + var typeFromTypeNode = getTypeFromTypeNode(node); + if (typeFromTypeNode && ts.isExpressionWithTypeArgumentsInClassImplementsClause(node)) { + var containingClass = ts.getContainingClass(node); + var classType = getTypeOfNode(containingClass); + typeFromTypeNode = getTypeWithThisArgument(typeFromTypeNode, classType.thisType); + } + return typeFromTypeNode; } if (ts.isPartOfExpression(node)) { return getRegularTypeOfExpression(node); @@ -42308,7 +45638,10 @@ var ts; if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(node)) { // A SyntaxKind.ExpressionWithTypeArguments is considered a type node, except when it occurs in the // extends clause of a class. We handle that case here. - return getBaseTypes(getDeclaredTypeOfSymbol(getSymbolOfNode(node.parent.parent)))[0]; + var classNode = ts.getContainingClass(node); + var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(classNode)); + var baseType = getBaseTypes(classType)[0]; + return baseType && getTypeWithThisArgument(baseType, classType.thisType); } if (isTypeDeclaration(node)) { // In this case, we call getSymbolOfNode instead of getSymbolAtLocation because it is a declaration @@ -42345,31 +45678,31 @@ var ts; // [ a ] from // [a] = [ some array ...] function getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr) { - ts.Debug.assert(expr.kind === 176 /* ObjectLiteralExpression */ || expr.kind === 175 /* ArrayLiteralExpression */); + ts.Debug.assert(expr.kind === 178 /* ObjectLiteralExpression */ || expr.kind === 177 /* ArrayLiteralExpression */); // If this is from "for of" // for ( { a } of elems) { // } - if (expr.parent.kind === 213 /* ForOfStatement */) { - var iteratedType = checkRightHandSideOfForOf(expr.parent.expression); + if (expr.parent.kind === 216 /* 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 === 192 /* BinaryExpression */) { + if (expr.parent.kind === 194 /* 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 === 257 /* PropertyAssignment */) { + if (expr.parent.kind === 261 /* 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 === 175 /* ArrayLiteralExpression */); + ts.Debug.assert(expr.parent.kind === 177 /* ArrayLiteralExpression */); // [{ property1: p1, property2 }] = elems; var typeOfArrayLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent); - var elementType = checkIteratedTypeOrElementType(typeOfArrayLiteral || unknownType, expr.parent, /*allowStringInput*/ false) || unknownType; + var elementType = checkIteratedTypeOrElementType(typeOfArrayLiteral || unknownType, expr.parent, /*allowStringInput*/ false, /*allowAsyncIterable*/ false) || unknownType; return checkArrayLiteralDestructuringElementAssignment(expr.parent, typeOfArrayLiteral, ts.indexOf(expr.parent.elements, expr), elementType || unknownType); } // Gets the property symbol corresponding to the property in destructuring assignment @@ -42390,9 +45723,9 @@ var ts; return getRegularTypeOfLiteralType(getTypeOfExpression(expr)); } /** - * Gets either the static or instance type of a class element, based on - * whether the element is declared as "static". - */ + * Gets either the static or instance type of a class element, based on + * whether the element is declared as "static". + */ function getParentTypeOfClassElement(node) { var classSymbol = getSymbolOfNode(node.parent); return ts.getModifierFlags(node) & 32 /* Static */ @@ -42406,29 +45739,32 @@ var ts; var propsByName = createSymbolTable(getPropertiesOfType(type)); if (getSignaturesOfType(type, 0 /* Call */).length || getSignaturesOfType(type, 1 /* Construct */).length) { ts.forEach(getPropertiesOfType(globalFunctionType), function (p) { - if (!propsByName[p.name]) { - propsByName[p.name] = p; + if (!propsByName.has(p.name)) { + propsByName.set(p.name, p); } }); } return getNamedMembers(propsByName); } function getRootSymbols(symbol) { - if (symbol.flags & 268435456 /* SyntheticProperty */) { + if (getCheckFlags(symbol) & 6 /* Synthetic */) { var symbols_3 = []; - var name_26 = symbol.name; + var name_2 = symbol.name; ts.forEach(getSymbolLinks(symbol).containingType.types, function (t) { - var symbol = getPropertyOfType(t, name_26); + var symbol = getPropertyOfType(t, name_2); if (symbol) { symbols_3.push(symbol); } }); return symbols_3; } - else if (symbol.flags & 67108864 /* Transient */) { + else if (symbol.flags & 134217728 /* Transient */) { if (symbol.leftSpread) { var links = symbol; - return [links.leftSpread, links.rightSpread]; + return getRootSymbols(links.leftSpread).concat(getRootSymbols(links.rightSpread)); + } + if (symbol.syntheticOrigin) { + return getRootSymbols(symbol.syntheticOrigin); } var target = void 0; var next = symbol; @@ -42446,7 +45782,8 @@ var ts; if (!ts.isGeneratedIdentifier(node)) { node = ts.getParseTreeNode(node, ts.isIdentifier); if (node) { - return getReferencedValueSymbol(node) === argumentsSymbol; + var isPropertyName_1 = node.parent.kind === 179 /* PropertyAccessExpression */ && node.parent.name === node; + return !isPropertyName_1 && getReferencedValueSymbol(node) === argumentsSymbol; } } return false; @@ -42467,7 +45804,7 @@ var ts; // otherwise - check if at least one export is value symbolLinks.exportsSomeValue = hasExportAssignment ? !!(moduleSymbol.flags & 107455 /* Value */) - : ts.forEachProperty(getExportsOfModule(moduleSymbol), isValue); + : ts.forEachEntry(getExportsOfModule(moduleSymbol), isValue); } return symbolLinks.exportsSomeValue; function isValue(s) { @@ -42500,20 +45837,16 @@ var ts; } symbol = exportSymbol; } - var parentSymbol = getParentOfSymbol(symbol); - if (parentSymbol) { - if (parentSymbol.flags & 512 /* ValueModule */ && parentSymbol.valueDeclaration.kind === 261 /* SourceFile */) { - var symbolFile = parentSymbol.valueDeclaration; + var parentSymbol_1 = getParentOfSymbol(symbol); + if (parentSymbol_1) { + if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 265 /* 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. var symbolIsUmdExport = symbolFile !== referenceFile; return symbolIsUmdExport ? undefined : symbolFile; } - for (var n = node.parent; n; n = n.parent) { - if (ts.isModuleOrEnumDeclaration(n) && getSymbolOfNode(n) === parentSymbol) { - return n; - } - } + return ts.findAncestor(node.parent, function (n) { return ts.isModuleOrEnumDeclaration(n) && getSymbolOfNode(n) === parentSymbol_1; }); } } } @@ -42559,7 +45892,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 === 204 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); + var inLoopBodyBlock = container.kind === 207 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock)); } else { @@ -42599,24 +45932,19 @@ var ts; return false; } function isValueAliasDeclaration(node) { - node = ts.getParseTreeNode(node); - if (node === undefined) { - // A synthesized node comes from an emit transformation and is always a value. - return true; - } switch (node.kind) { - case 234 /* ImportEqualsDeclaration */: - case 236 /* ImportClause */: - case 237 /* NamespaceImport */: - case 239 /* ImportSpecifier */: - case 243 /* ExportSpecifier */: + case 237 /* ImportEqualsDeclaration */: + case 239 /* ImportClause */: + case 240 /* NamespaceImport */: + case 242 /* ImportSpecifier */: + case 246 /* ExportSpecifier */: return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol); - case 241 /* ExportDeclaration */: + case 244 /* ExportDeclaration */: var exportClause = node.exportClause; return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration); - case 240 /* ExportAssignment */: + case 243 /* ExportAssignment */: return node.expression - && node.expression.kind === 70 /* Identifier */ + && node.expression.kind === 71 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol) : true; } @@ -42624,7 +45952,7 @@ var ts; } function isTopLevelValueImportEqualsWithEntityName(node) { node = ts.getParseTreeNode(node, ts.isImportEqualsDeclaration); - if (node === undefined || node.parent.kind !== 261 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node === undefined || node.parent.kind !== 265 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { // parent is not source file or it is not reference to internal module return false; } @@ -42645,11 +45973,6 @@ var ts; return isConstEnumSymbol(s) || s.constEnumOnlyModule; } function isReferencedAliasDeclaration(node, checkChildren) { - node = ts.getParseTreeNode(node); - // Purely synthesized nodes are always emitted. - if (node === undefined) { - return true; - } if (ts.isAliasSymbolDeclaration(node)) { var symbol = getSymbolOfNode(node); if (symbol && getSymbolLinks(symbol).referenced) { @@ -42681,16 +46004,30 @@ var ts; } return false; } + function isRequiredInitializedParameter(parameter) { + return strictNullChecks && + !isOptionalParameter(parameter) && + parameter.initializer && + !(ts.getModifierFlags(parameter) & 92 /* ParameterPropertyModifier */); + } function getNodeCheckFlags(node) { - node = ts.getParseTreeNode(node); - return node ? getNodeLinks(node).flags : undefined; + return getNodeLinks(node).flags; } function getEnumMemberValue(node) { computeEnumMemberValues(node.parent); return getNodeLinks(node).enumMemberValue; } + function canHaveConstantValue(node) { + switch (node.kind) { + case 264 /* EnumMember */: + case 179 /* PropertyAccessExpression */: + case 180 /* ElementAccessExpression */: + return true; + } + return false; + } function getConstantValue(node) { - if (node.kind === 260 /* EnumMember */) { + if (node.kind === 264 /* EnumMember */) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -42708,16 +46045,18 @@ var ts; function getTypeReferenceSerializationKind(typeName, location) { // 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 globalPromiseSymbol = tryGetGlobalPromiseConstructorSymbol(); - if (globalPromiseSymbol && valueSymbol === globalPromiseSymbol) { - return ts.TypeReferenceSerializationKind.Promise; - } - var constructorType = valueSymbol ? getTypeOfSymbol(valueSymbol) : undefined; - if (constructorType && isConstructorType(constructorType)) { - return ts.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue; - } // 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); + if (valueSymbol && valueSymbol === typeSymbol) { + var globalPromiseSymbol = getGlobalPromiseConstructorSymbol(/*reportErrors*/ false); + if (globalPromiseSymbol && valueSymbol === globalPromiseSymbol) { + return ts.TypeReferenceSerializationKind.Promise; + } + var constructorType = getTypeOfSymbol(valueSymbol); + if (constructorType && isConstructorType(constructorType)) { + return ts.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue; + } + } // We might not be able to resolve type symbol so use unknown type in that case (eg error case) if (!typeSymbol) { return ts.TypeReferenceSerializationKind.ObjectType; @@ -42763,6 +46102,9 @@ var ts; var type = symbol && !(symbol.flags & (2048 /* TypeLiteral */ | 131072 /* Signature */)) ? getWidenedLiteralType(getTypeOfSymbol(symbol)) : unknownType; + if (flags & 4096 /* AddUndefined */) { + type = includeFalsyTypes(type, 2048 /* Undefined */); + } getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); } function writeReturnTypeOfSignatureDeclaration(signatureDeclaration, enclosingDeclaration, flags, writer) { @@ -42773,14 +46115,8 @@ var ts; var type = getWidenedType(getRegularTypeOfExpression(expr)); getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); } - function writeBaseConstructorTypeOfClass(node, enclosingDeclaration, flags, writer) { - var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(node)); - resolveBaseTypesOfClass(classType); - var baseType = classType.resolvedBaseTypes.length ? classType.resolvedBaseTypes[0] : unknownType; - getSymbolDisplayBuilder().buildTypeDisplay(baseType, writer, enclosingDeclaration, flags); - } function hasGlobalName(name) { - return !!globals[name]; + return globals.has(name); } function getReferencedValueSymbol(reference, startInDeclarationContainer) { var resolvedSymbol = getNodeLinks(reference).resolvedSymbol; @@ -42791,9 +46127,9 @@ var ts; if (startInDeclarationContainer) { // When resolving the name of a declaration as a value, we need to start resolution // at a point outside of the declaration. - var parent_12 = reference.parent; - if (ts.isDeclaration(parent_12) && reference === parent_12.name) { - location = getDeclarationContainer(parent_12); + var parent = reference.parent; + if (ts.isDeclaration(parent) && reference === parent.name) { + location = getDeclarationContainer(parent); } } return resolveName(location, reference.text, 107455 /* Value */ | 1048576 /* ExportValue */ | 8388608 /* Alias */, /*nodeNotFoundMessage*/ undefined, /*nameArg*/ undefined); @@ -42829,34 +46165,47 @@ var ts; if (resolvedTypeReferenceDirectives) { // populate reverse mapping: file path -> type reference directive that was resolved to this file fileToDirective = ts.createFileMap(); - for (var key in resolvedTypeReferenceDirectives) { - var resolvedDirective = resolvedTypeReferenceDirectives[key]; + resolvedTypeReferenceDirectives.forEach(function (resolvedDirective, key) { if (!resolvedDirective) { - continue; + return; } var file = host.getSourceFile(resolvedDirective.resolvedFileName); fileToDirective.set(file.path, key); - } + }); } return { getReferencedExportContainer: getReferencedExportContainer, getReferencedImportDeclaration: getReferencedImportDeclaration, getReferencedDeclarationWithCollidingName: getReferencedDeclarationWithCollidingName, isDeclarationWithCollidingName: isDeclarationWithCollidingName, - isValueAliasDeclaration: isValueAliasDeclaration, + isValueAliasDeclaration: function (node) { + node = ts.getParseTreeNode(node); + // Synthesized nodes are always treated like values. + return node ? isValueAliasDeclaration(node) : true; + }, hasGlobalName: hasGlobalName, - isReferencedAliasDeclaration: isReferencedAliasDeclaration, - getNodeCheckFlags: getNodeCheckFlags, + isReferencedAliasDeclaration: function (node, checkChildren) { + node = ts.getParseTreeNode(node); + // Synthesized nodes are always treated as referenced. + return node ? isReferencedAliasDeclaration(node, checkChildren) : true; + }, + getNodeCheckFlags: function (node) { + node = ts.getParseTreeNode(node); + return node ? getNodeCheckFlags(node) : undefined; + }, isTopLevelValueImportEqualsWithEntityName: isTopLevelValueImportEqualsWithEntityName, isDeclarationVisible: isDeclarationVisible, isImplementationOfOverload: isImplementationOfOverload, + isRequiredInitializedParameter: isRequiredInitializedParameter, writeTypeOfDeclaration: writeTypeOfDeclaration, writeReturnTypeOfSignatureDeclaration: writeReturnTypeOfSignatureDeclaration, writeTypeOfExpression: writeTypeOfExpression, - writeBaseConstructorTypeOfClass: writeBaseConstructorTypeOfClass, isSymbolAccessible: isSymbolAccessible, isEntityNameVisible: isEntityNameVisible, - getConstantValue: getConstantValue, + getConstantValue: function (node) { + node = ts.getParseTreeNode(node, canHaveConstantValue); + return node ? getConstantValue(node) : undefined; + }, collectLinkedAliases: collectLinkedAliases, getReferencedValueDeclaration: getReferencedValueDeclaration, getTypeReferenceSerializationKind: getTypeReferenceSerializationKind, @@ -42879,7 +46228,7 @@ 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 === 177 /* PropertyAccessExpression */) || (node.kind === 70 /* Identifier */ && isInTypeQuery(node)) + var meaning = (node.kind === 179 /* PropertyAccessExpression */) || (node.kind === 71 /* Identifier */ && isInTypeQuery(node)) ? 107455 /* Value */ | 1048576 /* ExportValue */ : 793064 /* Type */ | 1920 /* Namespace */; var symbol = resolveEntityName(node, meaning, /*ignoreErrors*/ true); @@ -42922,15 +46271,15 @@ var ts; // external modules cannot define or contribute to type declaration files var current = symbol; while (true) { - var parent_13 = getParentOfSymbol(current); - if (parent_13) { - current = parent_13; + var parent = getParentOfSymbol(current); + if (parent) { + current = parent; } else { break; } } - if (current.valueDeclaration && current.valueDeclaration.kind === 261 /* SourceFile */ && current.flags & 512 /* ValueModule */) { + if (current.valueDeclaration && current.valueDeclaration.kind === 265 /* SourceFile */ && current.flags & 512 /* ValueModule */) { return false; } // check that at least one declaration of top level symbol originates from type declaration file @@ -42950,7 +46299,7 @@ var ts; if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 261 /* SourceFile */); + return ts.getDeclarationOfKind(moduleSymbol, 265 /* SourceFile */); } function initializeTypeChecker() { // Bind all source files and propagate errors @@ -42974,11 +46323,11 @@ var ts; if (file.symbol && file.symbol.globalExports) { // Merge in UMD exports with first-in-wins semantics (see #9771) var source = file.symbol.globalExports; - for (var id in source) { - if (!(id in globals)) { - globals[id] = source[id]; + source.forEach(function (sourceSymbol, id) { + if (!globals.has(id)) { + globals.set(id, sourceSymbol); } - } + }); } } if (augmentations) { @@ -42995,63 +46344,35 @@ var ts; // Setup global builtins addToSymbolTable(globals, builtinGlobals, ts.Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0); getSymbolLinks(undefinedSymbol).type = undefinedWideningType; - getSymbolLinks(argumentsSymbol).type = getGlobalType("IArguments"); + getSymbolLinks(argumentsSymbol).type = getGlobalType("IArguments", /*arity*/ 0, /*reportErrors*/ true); getSymbolLinks(unknownSymbol).type = unknownType; // Initialize special types - globalArrayType = getGlobalType("Array", /*arity*/ 1); - globalObjectType = getGlobalType("Object"); - globalFunctionType = getGlobalType("Function"); - globalStringType = getGlobalType("String"); - globalNumberType = getGlobalType("Number"); - globalBooleanType = getGlobalType("Boolean"); - globalRegExpType = getGlobalType("RegExp"); - jsxElementType = getExportedTypeFromNamespace("JSX", JsxNames.Element); - getGlobalClassDecoratorType = ts.memoize(function () { return getGlobalType("ClassDecorator"); }); - getGlobalPropertyDecoratorType = ts.memoize(function () { return getGlobalType("PropertyDecorator"); }); - getGlobalMethodDecoratorType = ts.memoize(function () { return getGlobalType("MethodDecorator"); }); - getGlobalParameterDecoratorType = ts.memoize(function () { return getGlobalType("ParameterDecorator"); }); - getGlobalTypedPropertyDescriptorType = ts.memoize(function () { return getGlobalType("TypedPropertyDescriptor", /*arity*/ 1); }); - getGlobalESSymbolConstructorSymbol = ts.memoize(function () { return getGlobalValueSymbol("Symbol"); }); - getGlobalPromiseType = ts.memoize(function () { return getGlobalType("Promise", /*arity*/ 1); }); - tryGetGlobalPromiseType = ts.memoize(function () { return getGlobalSymbol("Promise", 793064 /* Type */, /*diagnostic*/ undefined) && getGlobalPromiseType(); }); - getGlobalPromiseLikeType = ts.memoize(function () { return getGlobalType("PromiseLike", /*arity*/ 1); }); - getInstantiatedGlobalPromiseLikeType = ts.memoize(createInstantiatedPromiseLikeType); - getGlobalPromiseConstructorSymbol = ts.memoize(function () { return getGlobalValueSymbol("Promise"); }); - tryGetGlobalPromiseConstructorSymbol = ts.memoize(function () { return getGlobalSymbol("Promise", 107455 /* Value */, /*diagnostic*/ undefined) && getGlobalPromiseConstructorSymbol(); }); - getGlobalPromiseConstructorLikeType = ts.memoize(function () { return getGlobalType("PromiseConstructorLike"); }); - getGlobalThenableType = ts.memoize(createThenableType); - getGlobalTemplateStringsArrayType = ts.memoize(function () { return getGlobalType("TemplateStringsArray"); }); - if (languageVersion >= 2 /* ES2015 */) { - getGlobalESSymbolType = ts.memoize(function () { return getGlobalType("Symbol"); }); - getGlobalIterableType = ts.memoize(function () { return getGlobalType("Iterable", /*arity*/ 1); }); - getGlobalIteratorType = ts.memoize(function () { return getGlobalType("Iterator", /*arity*/ 1); }); - getGlobalIterableIteratorType = ts.memoize(function () { return getGlobalType("IterableIterator", /*arity*/ 1); }); - } - else { - getGlobalESSymbolType = ts.memoize(function () { return emptyObjectType; }); - getGlobalIterableType = ts.memoize(function () { return emptyGenericType; }); - getGlobalIteratorType = ts.memoize(function () { return emptyGenericType; }); - getGlobalIterableIteratorType = ts.memoize(function () { return emptyGenericType; }); - } + globalArrayType = getGlobalType("Array", /*arity*/ 1, /*reportErrors*/ true); + globalObjectType = getGlobalType("Object", /*arity*/ 0, /*reportErrors*/ true); + globalFunctionType = getGlobalType("Function", /*arity*/ 0, /*reportErrors*/ true); + globalStringType = getGlobalType("String", /*arity*/ 0, /*reportErrors*/ true); + globalNumberType = getGlobalType("Number", /*arity*/ 0, /*reportErrors*/ true); + globalBooleanType = getGlobalType("Boolean", /*arity*/ 0, /*reportErrors*/ true); + globalRegExpType = getGlobalType("RegExp", /*arity*/ 0, /*reportErrors*/ true); anyArrayType = createArrayType(anyType); autoArrayType = createArrayType(autoType); - var symbol = getGlobalSymbol("ReadonlyArray", 793064 /* Type */, /*diagnostic*/ undefined); - globalReadonlyArrayType = symbol && getTypeOfGlobalSymbol(symbol, /*arity*/ 1); + globalReadonlyArrayType = getGlobalTypeOrUndefined("ReadonlyArray", /*arity*/ 1); anyReadonlyArrayType = globalReadonlyArrayType ? createTypeFromGenericGlobalType(globalReadonlyArrayType, [anyType]) : anyArrayType; + globalThisType = getGlobalTypeOrUndefined("ThisType", /*arity*/ 1); } function checkExternalEmitHelpers(location, helpers) { if ((requestedExternalEmitHelpers & helpers) !== helpers && compilerOptions.importHelpers) { var sourceFile = ts.getSourceFileOfNode(location); - if (ts.isEffectiveExternalModule(sourceFile, compilerOptions)) { + if (ts.isEffectiveExternalModule(sourceFile, compilerOptions) && !ts.isInAmbientContext(location)) { var helpersModule = resolveHelpersModule(sourceFile, location); if (helpersModule !== unknownSymbol) { var uncheckedHelpers = helpers & ~requestedExternalEmitHelpers; - for (var helper = 1 /* FirstEmitHelper */; helper <= 128 /* LastEmitHelper */; helper <<= 1) { + for (var helper = 1 /* FirstEmitHelper */; helper <= 16384 /* LastEmitHelper */; helper <<= 1) { if (uncheckedHelpers & helper) { - var name_27 = getHelperName(helper); - var symbol = getSymbol(helpersModule.exports, ts.escapeIdentifier(name_27), 107455 /* Value */); + var name = getHelperName(helper); + var symbol = getSymbol(helpersModule.exports, ts.escapeIdentifier(name), 107455 /* 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_27); + error(location, ts.Diagnostics.This_syntax_requires_an_imported_helper_named_1_but_module_0_has_no_exported_member_1, ts.externalHelpersModuleNameText, name); } } } @@ -43070,6 +46391,14 @@ var ts; case 32 /* Param */: return "__param"; case 64 /* Awaiter */: return "__awaiter"; case 128 /* Generator */: return "__generator"; + case 256 /* Values */: return "__values"; + case 512 /* Read */: return "__read"; + case 1024 /* Spread */: return "__spread"; + case 2048 /* Await */: return "__await"; + case 4096 /* AsyncGenerator */: return "__asyncGenerator"; + case 8192 /* AsyncDelegator */: return "__asyncDelegator"; + case 16384 /* AsyncValues */: return "__asyncValues"; + default: ts.Debug.fail("Unrecognized helper."); } } function resolveHelpersModule(node, errorNode) { @@ -43078,38 +46407,20 @@ var ts; } return externalHelpersModule; } - function createInstantiatedPromiseLikeType() { - var promiseLikeType = getGlobalPromiseLikeType(); - if (promiseLikeType !== emptyGenericType) { - return createTypeReference(promiseLikeType, [anyType]); - } - return emptyObjectType; - } - function createThenableType() { - // build the thenable type that is used to verify against a non-promise "thenable" operand to `await`. - var thenPropertySymbol = createSymbol(67108864 /* Transient */ | 4 /* Property */, "then"); - getSymbolLinks(thenPropertySymbol).type = globalFunctionType; - var thenableType = createObjectType(16 /* Anonymous */); - thenableType.properties = [thenPropertySymbol]; - thenableType.members = createSymbolTable(thenableType.properties); - thenableType.callSignatures = []; - thenableType.constructSignatures = []; - return thenableType; - } // GRAMMAR CHECKING function checkGrammarDecorators(node) { if (!node.decorators) { return false; } if (!ts.nodeCanBeDecorated(node)) { - if (node.kind === 149 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { + if (node.kind === 151 /* 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 === 151 /* GetAccessor */ || node.kind === 152 /* SetAccessor */) { + else if (node.kind === 153 /* GetAccessor */ || node.kind === 154 /* 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); @@ -43126,28 +46437,28 @@ var ts; var flags = 0 /* None */; for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; - if (modifier.kind !== 130 /* ReadonlyKeyword */) { - if (node.kind === 146 /* PropertySignature */ || node.kind === 148 /* MethodSignature */) { + if (modifier.kind !== 131 /* ReadonlyKeyword */) { + if (node.kind === 148 /* PropertySignature */ || node.kind === 150 /* MethodSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind)); } - if (node.kind === 155 /* IndexSignature */) { + if (node.kind === 157 /* IndexSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind)); } } switch (modifier.kind) { - case 75 /* ConstKeyword */: - if (node.kind !== 229 /* EnumDeclaration */ && node.parent.kind === 226 /* ClassDeclaration */) { - return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(75 /* ConstKeyword */)); + case 76 /* ConstKeyword */: + if (node.kind !== 232 /* EnumDeclaration */ && node.parent.kind === 229 /* ClassDeclaration */) { + return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(76 /* ConstKeyword */)); } break; - case 113 /* PublicKeyword */: - case 112 /* ProtectedKeyword */: - case 111 /* PrivateKeyword */: + case 114 /* PublicKeyword */: + case 113 /* ProtectedKeyword */: + case 112 /* PrivateKeyword */: var text = visibilityToString(ts.modifierToFlag(modifier.kind)); - if (modifier.kind === 112 /* ProtectedKeyword */) { + if (modifier.kind === 113 /* ProtectedKeyword */) { lastProtected = modifier; } - else if (modifier.kind === 111 /* PrivateKeyword */) { + else if (modifier.kind === 112 /* PrivateKeyword */) { lastPrivate = modifier; } if (flags & 28 /* AccessibilityModifier */) { @@ -43162,11 +46473,11 @@ 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 === 231 /* ModuleBlock */ || node.parent.kind === 261 /* SourceFile */) { + else if (node.parent.kind === 234 /* ModuleBlock */ || node.parent.kind === 265 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); } else if (flags & 128 /* Abstract */) { - if (modifier.kind === 111 /* PrivateKeyword */) { + if (modifier.kind === 112 /* PrivateKeyword */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, text, "abstract"); } else { @@ -43175,7 +46486,7 @@ var ts; } flags |= ts.modifierToFlag(modifier.kind); break; - case 114 /* StaticKeyword */: + case 115 /* StaticKeyword */: if (flags & 32 /* Static */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "static"); } @@ -43185,10 +46496,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 === 231 /* ModuleBlock */ || node.parent.kind === 261 /* SourceFile */) { + else if (node.parent.kind === 234 /* ModuleBlock */ || node.parent.kind === 265 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); } - else if (node.kind === 144 /* Parameter */) { + else if (node.kind === 146 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 128 /* Abstract */) { @@ -43197,18 +46508,18 @@ var ts; flags |= 32 /* Static */; lastStatic = modifier; break; - case 130 /* ReadonlyKeyword */: + case 131 /* ReadonlyKeyword */: if (flags & 64 /* Readonly */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly"); } - else if (node.kind !== 147 /* PropertyDeclaration */ && node.kind !== 146 /* PropertySignature */ && node.kind !== 155 /* IndexSignature */ && node.kind !== 144 /* Parameter */) { + else if (node.kind !== 149 /* PropertyDeclaration */ && node.kind !== 148 /* PropertySignature */ && node.kind !== 157 /* IndexSignature */ && node.kind !== 146 /* 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); } flags |= 64 /* Readonly */; lastReadonly = modifier; break; - case 83 /* ExportKeyword */: + case 84 /* ExportKeyword */: if (flags & 1 /* Export */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "export"); } @@ -43221,45 +46532,45 @@ 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 === 226 /* ClassDeclaration */) { + else if (node.parent.kind === 229 /* ClassDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 144 /* Parameter */) { + else if (node.kind === 146 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1 /* Export */; break; - case 123 /* DeclareKeyword */: + case 124 /* DeclareKeyword */: if (flags & 2 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "declare"); } 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 === 226 /* ClassDeclaration */) { + else if (node.parent.kind === 229 /* ClassDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 144 /* Parameter */) { + else if (node.kind === 146 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 231 /* ModuleBlock */) { + else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 234 /* ModuleBlock */) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } flags |= 2 /* Ambient */; lastDeclare = modifier; break; - case 116 /* AbstractKeyword */: + case 117 /* AbstractKeyword */: if (flags & 128 /* Abstract */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 226 /* ClassDeclaration */) { - if (node.kind !== 149 /* MethodDeclaration */ && - node.kind !== 147 /* PropertyDeclaration */ && - node.kind !== 151 /* GetAccessor */ && - node.kind !== 152 /* SetAccessor */) { + if (node.kind !== 229 /* ClassDeclaration */) { + if (node.kind !== 151 /* MethodDeclaration */ && + node.kind !== 149 /* PropertyDeclaration */ && + node.kind !== 153 /* GetAccessor */ && + node.kind !== 154 /* SetAccessor */) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 226 /* ClassDeclaration */ && ts.getModifierFlags(node.parent) & 128 /* Abstract */)) { + if (!(node.parent.kind === 229 /* ClassDeclaration */ && ts.getModifierFlags(node.parent) & 128 /* Abstract */)) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32 /* Static */) { @@ -43271,14 +46582,14 @@ var ts; } flags |= 128 /* Abstract */; break; - case 119 /* AsyncKeyword */: + case 120 /* AsyncKeyword */: if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "async"); } else if (flags & 2 /* Ambient */ || ts.isInAmbientContext(node.parent)) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.kind === 144 /* Parameter */) { + else if (node.kind === 146 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } flags |= 256 /* Async */; @@ -43286,7 +46597,7 @@ var ts; break; } } - if (node.kind === 150 /* Constructor */) { + if (node.kind === 152 /* Constructor */) { if (flags & 32 /* Static */) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -43301,13 +46612,13 @@ var ts; } return; } - else if ((node.kind === 235 /* ImportDeclaration */ || node.kind === 234 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { + else if ((node.kind === 238 /* ImportDeclaration */ || node.kind === 237 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 144 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { + else if (node.kind === 146 /* 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 === 144 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { + else if (node.kind === 146 /* 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 */) { @@ -43327,38 +46638,38 @@ var ts; } function shouldReportBadModifier(node) { switch (node.kind) { - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 150 /* Constructor */: - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 155 /* IndexSignature */: - case 230 /* ModuleDeclaration */: - case 235 /* ImportDeclaration */: - case 234 /* ImportEqualsDeclaration */: - case 241 /* ExportDeclaration */: - case 240 /* ExportAssignment */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - case 144 /* Parameter */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + case 152 /* Constructor */: + case 149 /* PropertyDeclaration */: + case 148 /* PropertySignature */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: + case 157 /* IndexSignature */: + case 233 /* ModuleDeclaration */: + case 238 /* ImportDeclaration */: + case 237 /* ImportEqualsDeclaration */: + case 244 /* ExportDeclaration */: + case 243 /* ExportAssignment */: + case 186 /* FunctionExpression */: + case 187 /* ArrowFunction */: + case 146 /* Parameter */: return false; default: - if (node.parent.kind === 231 /* ModuleBlock */ || node.parent.kind === 261 /* SourceFile */) { + if (node.parent.kind === 234 /* ModuleBlock */ || node.parent.kind === 265 /* SourceFile */) { return false; } switch (node.kind) { - case 225 /* FunctionDeclaration */: - return nodeHasAnyModifiersExcept(node, 119 /* AsyncKeyword */); - case 226 /* ClassDeclaration */: - return nodeHasAnyModifiersExcept(node, 116 /* AbstractKeyword */); - case 227 /* InterfaceDeclaration */: - case 205 /* VariableStatement */: - case 228 /* TypeAliasDeclaration */: + case 228 /* FunctionDeclaration */: + return nodeHasAnyModifiersExcept(node, 120 /* AsyncKeyword */); + case 229 /* ClassDeclaration */: + return nodeHasAnyModifiersExcept(node, 117 /* AbstractKeyword */); + case 230 /* InterfaceDeclaration */: + case 208 /* VariableStatement */: + case 231 /* TypeAliasDeclaration */: return true; - case 229 /* EnumDeclaration */: - return nodeHasAnyModifiersExcept(node, 75 /* ConstKeyword */); + case 232 /* EnumDeclaration */: + return nodeHasAnyModifiersExcept(node, 76 /* ConstKeyword */); default: ts.Debug.fail(); return false; @@ -43370,14 +46681,11 @@ var ts; } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { - case 149 /* MethodDeclaration */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - if (!node.asteriskToken) { - return false; - } - break; + case 151 /* MethodDeclaration */: + case 228 /* FunctionDeclaration */: + case 186 /* FunctionExpression */: + case 187 /* ArrowFunction */: + return false; } return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async"); } @@ -43435,8 +46743,12 @@ var ts; return checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarTypeParameterList(node.typeParameters, file) || checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file); } + function checkGrammarClassLikeDeclaration(node) { + var file = ts.getSourceFileOfNode(node); + return checkGrammarClassDeclarationHeritageClauses(node) || checkGrammarTypeParameterList(node.typeParameters, file); + } function checkGrammarArrowFunction(node, file) { - if (node.kind === 185 /* ArrowFunction */) { + if (node.kind === 187 /* ArrowFunction */) { var arrowFunction = node; var startLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line; var endLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line; @@ -43471,7 +46783,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 !== 134 /* StringKeyword */ && parameter.type.kind !== 132 /* NumberKeyword */) { + if (parameter.type.kind !== 136 /* StringKeyword */ && parameter.type.kind !== 133 /* NumberKeyword */) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); } if (!node.type) { @@ -43499,7 +46811,7 @@ var ts; var sourceFile = ts.getSourceFileOfNode(node); for (var _i = 0, args_4 = args; _i < args_4.length; _i++) { var arg = args_4[_i]; - if (arg.kind === 198 /* OmittedExpression */) { + if (arg.kind === 200 /* OmittedExpression */) { return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -43525,7 +46837,7 @@ var ts; if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && node.heritageClauses) { for (var _i = 0, _a = node.heritageClauses; _i < _a.length; _i++) { var heritageClause = _a[_i]; - if (heritageClause.token === 84 /* ExtendsKeyword */) { + if (heritageClause.token === 85 /* ExtendsKeyword */) { if (seenExtendsClause) { return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen); } @@ -43538,7 +46850,7 @@ var ts; seenExtendsClause = true; } else { - ts.Debug.assert(heritageClause.token === 107 /* ImplementsKeyword */); + ts.Debug.assert(heritageClause.token === 108 /* ImplementsKeyword */); if (seenImplementsClause) { return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.implements_clause_already_seen); } @@ -43554,14 +46866,14 @@ var ts; if (node.heritageClauses) { for (var _i = 0, _a = node.heritageClauses; _i < _a.length; _i++) { var heritageClause = _a[_i]; - if (heritageClause.token === 84 /* ExtendsKeyword */) { + if (heritageClause.token === 85 /* ExtendsKeyword */) { if (seenExtendsClause) { return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen); } seenExtendsClause = true; } else { - ts.Debug.assert(heritageClause.token === 107 /* ImplementsKeyword */); + ts.Debug.assert(heritageClause.token === 108 /* ImplementsKeyword */); return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.Interface_declaration_cannot_have_implements_clause); } // Grammar checking heritageClause inside class declaration @@ -43572,28 +46884,25 @@ var ts; } function checkGrammarComputedPropertyName(node) { // If node is not a computedPropertyName, just skip the grammar checking - if (node.kind !== 142 /* ComputedPropertyName */) { + if (node.kind !== 144 /* ComputedPropertyName */) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 192 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 25 /* CommaToken */) { + if (computedPropertyName.expression.kind === 194 /* 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 === 225 /* FunctionDeclaration */ || - node.kind === 184 /* FunctionExpression */ || - node.kind === 149 /* MethodDeclaration */); + ts.Debug.assert(node.kind === 228 /* FunctionDeclaration */ || + node.kind === 186 /* FunctionExpression */ || + node.kind === 151 /* MethodDeclaration */); if (ts.isInAmbientContext(node)) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } if (!node.body) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.An_overload_signature_cannot_be_declared_as_a_generator); } - if (languageVersion < 2 /* ES2015 */) { - return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_only_available_when_targeting_ECMAScript_2015_or_higher); - } } } function checkGrammarForInvalidQuestionMark(questionToken, message) { @@ -43609,15 +46918,15 @@ var ts; var GetOrSetAccessor = GetAccessor | SetAccessor; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 259 /* SpreadAssignment */) { + if (prop.kind === 263 /* SpreadAssignment */) { continue; } - var name_28 = prop.name; - if (name_28.kind === 142 /* ComputedPropertyName */) { + var name = prop.name; + if (name.kind === 144 /* ComputedPropertyName */) { // If the name is not a ComputedPropertyName, the grammar checking will skip it - checkGrammarComputedPropertyName(name_28); + checkGrammarComputedPropertyName(name); } - if (prop.kind === 258 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 262 /* 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); @@ -43626,7 +46935,7 @@ var ts; if (prop.modifiers) { for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) { var mod = _c[_b]; - if (mod.kind !== 119 /* AsyncKeyword */ || prop.kind !== 149 /* MethodDeclaration */) { + if (mod.kind !== 120 /* AsyncKeyword */ || prop.kind !== 151 /* MethodDeclaration */) { grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); } } @@ -43640,69 +46949,69 @@ var ts; // 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 = void 0; - if (prop.kind === 257 /* PropertyAssignment */ || prop.kind === 258 /* ShorthandPropertyAssignment */) { + if (prop.kind === 261 /* PropertyAssignment */ || prop.kind === 262 /* ShorthandPropertyAssignment */) { // Grammar checking for computedPropertyName and shorthandPropertyAssignment checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); - if (name_28.kind === 8 /* NumericLiteral */) { - checkGrammarNumericLiteral(name_28); + if (name.kind === 8 /* NumericLiteral */) { + checkGrammarNumericLiteral(name); } currentKind = Property; } - else if (prop.kind === 149 /* MethodDeclaration */) { + else if (prop.kind === 151 /* MethodDeclaration */) { currentKind = Property; } - else if (prop.kind === 151 /* GetAccessor */) { + else if (prop.kind === 153 /* GetAccessor */) { currentKind = GetAccessor; } - else if (prop.kind === 152 /* SetAccessor */) { + else if (prop.kind === 154 /* SetAccessor */) { currentKind = SetAccessor; } else { ts.Debug.fail("Unexpected syntax kind:" + prop.kind); } - var effectiveName = ts.getPropertyNameForPropertyNameNode(name_28); + var effectiveName = ts.getPropertyNameForPropertyNameNode(name); if (effectiveName === undefined) { continue; } - if (!seen[effectiveName]) { - seen[effectiveName] = currentKind; + var existingKind = seen.get(effectiveName); + if (!existingKind) { + seen.set(effectiveName, currentKind); } else { - var existingKind = seen[effectiveName]; if (currentKind === Property && existingKind === Property) { - grammarErrorOnNode(name_28, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name_28)); + grammarErrorOnNode(name, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name)); } else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { - seen[effectiveName] = currentKind | existingKind; + seen.set(effectiveName, currentKind | existingKind); } else { - return grammarErrorOnNode(name_28, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); + return grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); } } else { - return grammarErrorOnNode(name_28, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); + return grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); } } } } function checkGrammarJsxElement(node) { var seen = ts.createMap(); - for (var _i = 0, _a = node.attributes; _i < _a.length; _i++) { + for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 251 /* JsxSpreadAttribute */) { + if (attr.kind === 255 /* JsxSpreadAttribute */) { continue; } var jsxAttr = attr; - var name_29 = jsxAttr.name; - if (!seen[name_29.text]) { - seen[name_29.text] = true; + var name = jsxAttr.name; + if (!seen.get(name.text)) { + seen.set(name.text, true); } else { - return grammarErrorOnNode(name_29, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); + return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } var initializer = jsxAttr.initializer; - if (initializer && initializer.kind === 252 /* JsxExpression */ && !initializer.expression) { + if (initializer && initializer.kind === 256 /* JsxExpression */ && !initializer.expression) { return grammarErrorOnNode(jsxAttr.initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } @@ -43711,7 +47020,12 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.initializer.kind === 224 /* VariableDeclarationList */) { + if (forInOrOfStatement.kind === 216 /* 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 === 227 /* VariableDeclarationList */) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { var declarations = variableList.declarations; @@ -43726,20 +47040,20 @@ var ts; return false; } if (declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 212 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 215 /* 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 === 212 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 215 /* 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 === 212 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 215 /* 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); @@ -43766,11 +47080,11 @@ var ts; return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } else if (!doesAccessorHaveCorrectParameterCount(accessor)) { - return grammarErrorOnNode(accessor.name, kind === 151 /* GetAccessor */ ? + return grammarErrorOnNode(accessor.name, kind === 153 /* GetAccessor */ ? ts.Diagnostics.A_get_accessor_cannot_have_parameters : ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); } - else if (kind === 152 /* SetAccessor */) { + else if (kind === 154 /* SetAccessor */) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -43789,14 +47103,14 @@ var ts; } } /** Does the accessor have the right number of parameters? - - A get accessor has no parameters or a single `this` parameter. - A set accessor has one parameter or a `this` parameter and one more parameter */ + * A get accessor has no parameters or a single `this` parameter. + * 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 === 151 /* GetAccessor */ ? 0 : 1); + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 153 /* GetAccessor */ ? 0 : 1); } function getAccessorThisParameter(accessor) { - if (accessor.parameters.length === (accessor.kind === 151 /* GetAccessor */ ? 1 : 2)) { + if (accessor.parameters.length === (accessor.kind === 153 /* GetAccessor */ ? 1 : 2)) { return ts.getThisParameter(accessor); } } @@ -43811,7 +47125,7 @@ var ts; checkGrammarForGenerator(node)) { return true; } - if (node.parent.kind === 176 /* ObjectLiteralExpression */) { + if (node.parent.kind === 178 /* ObjectLiteralExpression */) { if (checkGrammarForInvalidQuestionMark(node.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional)) { return true; } @@ -43832,10 +47146,10 @@ var ts; return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol); } } - else if (node.parent.kind === 227 /* InterfaceDeclaration */) { + else if (node.parent.kind === 230 /* InterfaceDeclaration */) { return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol); } - else if (node.parent.kind === 161 /* TypeLiteral */) { + else if (node.parent.kind === 163 /* TypeLiteral */) { return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol); } } @@ -43846,11 +47160,11 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 219 /* LabeledStatement */: + case 222 /* LabeledStatement */: if (node.label && current.label.text === node.label.text) { // found matching label - verify that label usage is correct // continue can only target labels that are on iteration statements - var isMisplacedContinueLabel = node.kind === 214 /* ContinueStatement */ + var isMisplacedContinueLabel = node.kind === 217 /* 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); @@ -43858,8 +47172,8 @@ var ts; return false; } break; - case 218 /* SwitchStatement */: - if (node.kind === 215 /* BreakStatement */ && !node.label) { + case 221 /* SwitchStatement */: + if (node.kind === 218 /* BreakStatement */ && !node.label) { // unlabeled break within switch statement - ok return false; } @@ -43874,13 +47188,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 215 /* BreakStatement */ + var message = node.kind === 218 /* 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 === 215 /* BreakStatement */ + var message = node.kind === 218 /* 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); @@ -43892,7 +47206,7 @@ var ts; if (node !== ts.lastOrUndefined(elements)) { return grammarErrorOnNode(node, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } - if (node.name.kind === 173 /* ArrayBindingPattern */ || node.name.kind === 172 /* ObjectBindingPattern */) { + if (node.name.kind === 175 /* ArrayBindingPattern */ || node.name.kind === 174 /* ObjectBindingPattern */) { return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); } if (node.initializer) { @@ -43903,11 +47217,11 @@ var ts; } function isStringOrNumberLiteralExpression(expr) { return expr.kind === 9 /* StringLiteral */ || expr.kind === 8 /* NumericLiteral */ || - expr.kind === 190 /* PrefixUnaryExpression */ && expr.operator === 37 /* MinusToken */ && + expr.kind === 192 /* PrefixUnaryExpression */ && expr.operator === 38 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 212 /* ForInStatement */ && node.parent.parent.kind !== 213 /* ForOfStatement */) { + if (node.parent.parent.kind !== 215 /* ForInStatement */ && node.parent.parent.kind !== 216 /* ForOfStatement */) { if (ts.isInAmbientContext(node)) { if (node.initializer) { if (ts.isConst(node) && !node.type) { @@ -43936,6 +47250,10 @@ var ts; } } } + if (compilerOptions.module !== ts.ModuleKind.ES2015 && compilerOptions.module !== ts.ModuleKind.System && !compilerOptions.noEmit && + !ts.isInAmbientContext(node.parent.parent) && ts.hasModifier(node.parent.parent, 1 /* Export */)) { + checkESModuleMarker(node.name); + } var checkLetConstNames = (ts.isLet(node) || ts.isConst(node)); // 1. LexicalDeclaration : LetOrConst BindingList ; // It is a Syntax Error if the BoundNames of BindingList contains "let". @@ -43945,16 +47263,32 @@ var ts; // and its Identifier is eval or arguments return checkLetConstNames && checkGrammarNameInLetOrConstDeclarations(node.name); } - function checkGrammarNameInLetOrConstDeclarations(name) { - if (name.kind === 70 /* Identifier */) { - if (name.originalKeywordKind === 109 /* LetKeyword */) { - return grammarErrorOnNode(name, ts.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations); + function checkESModuleMarker(name) { + if (name.kind === 71 /* Identifier */) { + if (ts.unescapeIdentifier(name.text) === "__esModule") { + return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules); } } else { var elements = name.elements; for (var _i = 0, elements_2 = elements; _i < elements_2.length; _i++) { var element = elements_2[_i]; + if (!ts.isOmittedExpression(element)) { + return checkESModuleMarker(element.name); + } + } + } + } + function checkGrammarNameInLetOrConstDeclarations(name) { + if (name.kind === 71 /* Identifier */) { + if (name.originalKeywordKind === 110 /* LetKeyword */) { + return grammarErrorOnNode(name, ts.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations); + } + } + else { + var elements = name.elements; + for (var _i = 0, elements_3 = elements; _i < elements_3.length; _i++) { + var element = elements_3[_i]; if (!ts.isOmittedExpression(element)) { checkGrammarNameInLetOrConstDeclarations(element.name); } @@ -43972,15 +47306,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 208 /* IfStatement */: - case 209 /* DoStatement */: - case 210 /* WhileStatement */: - case 217 /* WithStatement */: - case 211 /* ForStatement */: - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: + case 211 /* IfStatement */: + case 212 /* DoStatement */: + case 213 /* WhileStatement */: + case 220 /* WithStatement */: + case 214 /* ForStatement */: + case 215 /* ForInStatement */: + case 216 /* ForOfStatement */: return false; - case 219 /* LabeledStatement */: + case 222 /* LabeledStatement */: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -43995,6 +47329,13 @@ var ts; } } } + function checkGrammarMetaProperty(node) { + if (node.keywordToken === 94 /* NewKeyword */) { + if (node.name.text !== "target") { + return grammarErrorOnNode(node.name, ts.Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2, node.name.text, ts.tokenToString(node.keywordToken), "target"); + } + } + } function hasParseDiagnostics(sourceFile) { return sourceFile.parseDiagnostics.length > 0; } @@ -44035,7 +47376,7 @@ var ts; return true; } } - else if (node.parent.kind === 227 /* InterfaceDeclaration */) { + else if (node.parent.kind === 230 /* InterfaceDeclaration */) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol)) { return true; } @@ -44043,7 +47384,7 @@ var ts; return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); } } - else if (node.parent.kind === 161 /* TypeLiteral */) { + else if (node.parent.kind === 163 /* TypeLiteral */) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol)) { return true; } @@ -44068,13 +47409,13 @@ var ts; // export_opt AmbientDeclaration // // TODO: The spec needs to be amended to reflect this grammar. - if (node.kind === 227 /* InterfaceDeclaration */ || - node.kind === 228 /* TypeAliasDeclaration */ || - node.kind === 235 /* ImportDeclaration */ || - node.kind === 234 /* ImportEqualsDeclaration */ || - node.kind === 241 /* ExportDeclaration */ || - node.kind === 240 /* ExportAssignment */ || - node.kind === 233 /* NamespaceExportDeclaration */ || + if (node.kind === 230 /* InterfaceDeclaration */ || + node.kind === 231 /* TypeAliasDeclaration */ || + node.kind === 238 /* ImportDeclaration */ || + node.kind === 237 /* ImportEqualsDeclaration */ || + node.kind === 244 /* ExportDeclaration */ || + node.kind === 243 /* ExportAssignment */ || + node.kind === 236 /* NamespaceExportDeclaration */ || ts.getModifierFlags(node) & (2 /* Ambient */ | 1 /* Export */ | 512 /* Default */)) { return false; } @@ -44083,7 +47424,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 === 205 /* VariableStatement */) { + if (ts.isDeclaration(decl) || decl.kind === 208 /* VariableStatement */) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -44109,7 +47450,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 === 204 /* Block */ || node.parent.kind === 231 /* ModuleBlock */ || node.parent.kind === 261 /* SourceFile */) { + if (node.parent.kind === 207 /* Block */ || node.parent.kind === 234 /* ModuleBlock */ || node.parent.kind === 265 /* SourceFile */) { var links_1 = getNodeLinks(node.parent); // Check if the containing block ever report this error if (!links_1.hasReportedStatementInAmbientContext) { @@ -44117,21 +47458,27 @@ var ts; } } else { + // We must be parented by a statement. If so, there's no need + // to report the error as our parent will have already done it. + // Debug.assert(isStatement(node.parent)); } } } function checkGrammarNumericLiteral(node) { // Grammar checking - if (node.isOctalLiteral) { + if (node.numericLiteralFlags & 4 /* Octal */) { var diagnosticMessage = void 0; 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.isChildOfLiteralType(node)) { + else if (ts.isChildOfNodeWithKind(node, 173 /* LiteralType */)) { diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0; } + else if (ts.isChildOfNodeWithKind(node, 264 /* EnumMember */)) { + diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0; + } if (diagnosticMessage) { - var withMinus = ts.isPrefixUnaryExpression(node.parent) && node.parent.operator === 37 /* MinusToken */; + var withMinus = ts.isPrefixUnaryExpression(node.parent) && node.parent.operator === 38 /* MinusToken */; var literal = (withMinus ? "-" : "") + "0o" + node.text; return grammarErrorOnNode(withMinus ? node.parent : node, diagnosticMessage, literal); } @@ -44147,11 +47494,11 @@ var ts; } function getAmbientModules() { var result = []; - for (var sym in globals) { + globals.forEach(function (global, sym) { if (ambientModuleSymbolRegex.test(sym)) { - result.push(globals[sym]); + result.push(global); } - } + }); return result; } } @@ -44160,466 +47507,19 @@ var ts; /// /// /// -/* @internal */ var ts; (function (ts) { - ; - /** - * This map contains information about the shape of each Node in "types.ts" pertaining to how - * each node should be traversed during a transformation. - * - * Each edge corresponds to a property in a Node subtype that should be traversed when visiting - * each child. The properties are assigned in the order in which traversal should occur. - * - * We only add entries for nodes that do not have a create/update pair defined in factory.ts - * - * NOTE: This needs to be kept up to date with changes to nodes in "types.ts". Currently, this - * map is not comprehensive. Only node edges relevant to tree transformation are - * currently defined. We may extend this to be more comprehensive, and eventually - * supplant the existing `forEachChild` implementation if performance is not - * significantly impacted. - */ - var nodeEdgeTraversalMap = ts.createMap((_a = {}, - _a[141 /* QualifiedName */] = [ - { name: "left", test: ts.isEntityName }, - { name: "right", test: ts.isIdentifier } - ], - _a[145 /* Decorator */] = [ - { name: "expression", test: ts.isLeftHandSideExpression } - ], - _a[182 /* TypeAssertionExpression */] = [ - { name: "type", test: ts.isTypeNode }, - { name: "expression", test: ts.isUnaryExpression } - ], - _a[200 /* AsExpression */] = [ - { name: "expression", test: ts.isExpression }, - { name: "type", test: ts.isTypeNode } - ], - _a[201 /* NonNullExpression */] = [ - { name: "expression", test: ts.isLeftHandSideExpression } - ], - _a[229 /* EnumDeclaration */] = [ - { name: "decorators", test: ts.isDecorator }, - { name: "modifiers", test: ts.isModifier }, - { name: "name", test: ts.isIdentifier }, - { name: "members", test: ts.isEnumMember } - ], - _a[230 /* ModuleDeclaration */] = [ - { name: "decorators", test: ts.isDecorator }, - { name: "modifiers", test: ts.isModifier }, - { name: "name", test: ts.isModuleName }, - { name: "body", test: ts.isModuleBody } - ], - _a[231 /* ModuleBlock */] = [ - { name: "statements", test: ts.isStatement } - ], - _a[234 /* ImportEqualsDeclaration */] = [ - { name: "decorators", test: ts.isDecorator }, - { name: "modifiers", test: ts.isModifier }, - { name: "name", test: ts.isIdentifier }, - { name: "moduleReference", test: ts.isModuleReference } - ], - _a[245 /* ExternalModuleReference */] = [ - { name: "expression", test: ts.isExpression, optional: true } - ], - _a[260 /* EnumMember */] = [ - { name: "name", test: ts.isPropertyName }, - { name: "initializer", test: ts.isExpression, optional: true, parenthesize: ts.parenthesizeExpressionForList } - ], - _a)); - function reduceNode(node, f, initial) { - return node ? f(initial, node) : initial; - } - function reduceNodeArray(nodes, f, initial) { - return nodes ? f(initial, nodes) : initial; - } - /** - * Similar to `reduceLeft`, performs a reduction against each child of a node. - * NOTE: Unlike `forEachChild`, this does *not* visit every node. Only nodes added to the - * `nodeEdgeTraversalMap` above will be visited. - * - * @param node The node containing the children to reduce. - * @param initial The initial value to supply to the reduction. - * @param f The callback function - */ - function reduceEachChild(node, initial, cbNode, cbNodeArray) { - if (node === undefined) { - return initial; - } - var reduceNodes = cbNodeArray ? reduceNodeArray : ts.reduceLeft; - var cbNodes = cbNodeArray || cbNode; - var kind = node.kind; - // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 140 /* LastToken */)) { - return initial; - } - // We do not yet support types. - if ((kind >= 156 /* TypePredicate */ && kind <= 171 /* LiteralType */)) { - return initial; - } - var result = initial; - switch (node.kind) { - // Leaf nodes - case 203 /* SemicolonClassElement */: - case 206 /* EmptyStatement */: - case 198 /* OmittedExpression */: - case 222 /* DebuggerStatement */: - case 293 /* NotEmittedStatement */: - // No need to visit nodes with no children. - break; - // Names - case 142 /* ComputedPropertyName */: - result = reduceNode(node.expression, cbNode, result); - break; - // Signature elements - case 144 /* 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 145 /* Decorator */: - result = reduceNode(node.expression, cbNode, result); - break; - // Type member - case 147 /* 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 149 /* MethodDeclaration */: - result = reduceNodes(node.decorators, cbNodes, result); - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.name, cbNode, 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 150 /* Constructor */: - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNodes(node.parameters, cbNodes, result); - result = reduceNode(node.body, cbNode, result); - break; - case 151 /* GetAccessor */: - result = reduceNodes(node.decorators, cbNodes, result); - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.name, cbNode, result); - result = reduceNodes(node.parameters, cbNodes, result); - result = reduceNode(node.type, cbNode, result); - result = reduceNode(node.body, cbNode, result); - break; - case 152 /* SetAccessor */: - result = reduceNodes(node.decorators, cbNodes, result); - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.name, cbNode, result); - result = reduceNodes(node.parameters, cbNodes, result); - result = reduceNode(node.body, cbNode, result); - break; - // Binding patterns - case 172 /* ObjectBindingPattern */: - case 173 /* ArrayBindingPattern */: - result = reduceNodes(node.elements, cbNodes, result); - break; - case 174 /* BindingElement */: - result = reduceNode(node.propertyName, cbNode, result); - result = reduceNode(node.name, cbNode, result); - result = reduceNode(node.initializer, cbNode, result); - break; - // Expression - case 175 /* ArrayLiteralExpression */: - result = reduceNodes(node.elements, cbNodes, result); - break; - case 176 /* ObjectLiteralExpression */: - result = reduceNodes(node.properties, cbNodes, result); - break; - case 177 /* PropertyAccessExpression */: - result = reduceNode(node.expression, cbNode, result); - result = reduceNode(node.name, cbNode, result); - break; - case 178 /* ElementAccessExpression */: - result = reduceNode(node.expression, cbNode, result); - result = reduceNode(node.argumentExpression, cbNode, result); - break; - case 179 /* CallExpression */: - result = reduceNode(node.expression, cbNode, result); - result = reduceNodes(node.typeArguments, cbNodes, result); - result = reduceNodes(node.arguments, cbNodes, result); - break; - case 180 /* NewExpression */: - result = reduceNode(node.expression, cbNode, result); - result = reduceNodes(node.typeArguments, cbNodes, result); - result = reduceNodes(node.arguments, cbNodes, result); - break; - case 181 /* TaggedTemplateExpression */: - result = reduceNode(node.tag, cbNode, result); - result = reduceNode(node.template, cbNode, result); - break; - case 184 /* FunctionExpression */: - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.name, cbNode, 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 185 /* 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 183 /* ParenthesizedExpression */: - case 186 /* DeleteExpression */: - case 187 /* TypeOfExpression */: - case 188 /* VoidExpression */: - case 189 /* AwaitExpression */: - case 195 /* YieldExpression */: - case 196 /* SpreadElement */: - case 201 /* NonNullExpression */: - result = reduceNode(node.expression, cbNode, result); - break; - case 190 /* PrefixUnaryExpression */: - case 191 /* PostfixUnaryExpression */: - result = reduceNode(node.operand, cbNode, result); - break; - case 192 /* BinaryExpression */: - result = reduceNode(node.left, cbNode, result); - result = reduceNode(node.right, cbNode, result); - break; - case 193 /* ConditionalExpression */: - result = reduceNode(node.condition, cbNode, result); - result = reduceNode(node.whenTrue, cbNode, result); - result = reduceNode(node.whenFalse, cbNode, result); - break; - case 194 /* TemplateExpression */: - result = reduceNode(node.head, cbNode, result); - result = reduceNodes(node.templateSpans, cbNodes, result); - break; - case 197 /* 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 199 /* ExpressionWithTypeArguments */: - result = reduceNode(node.expression, cbNode, result); - result = reduceNodes(node.typeArguments, cbNodes, result); - break; - // Misc - case 202 /* TemplateSpan */: - result = reduceNode(node.expression, cbNode, result); - result = reduceNode(node.literal, cbNode, result); - break; - // Element - case 204 /* Block */: - result = reduceNodes(node.statements, cbNodes, result); - break; - case 205 /* VariableStatement */: - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.declarationList, cbNode, result); - break; - case 207 /* ExpressionStatement */: - result = reduceNode(node.expression, cbNode, result); - break; - case 208 /* IfStatement */: - result = reduceNode(node.expression, cbNode, result); - result = reduceNode(node.thenStatement, cbNode, result); - result = reduceNode(node.elseStatement, cbNode, result); - break; - case 209 /* DoStatement */: - result = reduceNode(node.statement, cbNode, result); - result = reduceNode(node.expression, cbNode, result); - break; - case 210 /* WhileStatement */: - case 217 /* WithStatement */: - result = reduceNode(node.expression, cbNode, result); - result = reduceNode(node.statement, cbNode, result); - break; - case 211 /* 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 212 /* ForInStatement */: - case 213 /* ForOfStatement */: - result = reduceNode(node.initializer, cbNode, result); - result = reduceNode(node.expression, cbNode, result); - result = reduceNode(node.statement, cbNode, result); - break; - case 216 /* ReturnStatement */: - case 220 /* ThrowStatement */: - result = reduceNode(node.expression, cbNode, result); - break; - case 218 /* SwitchStatement */: - result = reduceNode(node.expression, cbNode, result); - result = reduceNode(node.caseBlock, cbNode, result); - break; - case 219 /* LabeledStatement */: - result = reduceNode(node.label, cbNode, result); - result = reduceNode(node.statement, cbNode, result); - break; - case 221 /* TryStatement */: - result = reduceNode(node.tryBlock, cbNode, result); - result = reduceNode(node.catchClause, cbNode, result); - result = reduceNode(node.finallyBlock, cbNode, result); - break; - case 223 /* VariableDeclaration */: - result = reduceNode(node.name, cbNode, result); - result = reduceNode(node.type, cbNode, result); - result = reduceNode(node.initializer, cbNode, result); - break; - case 224 /* VariableDeclarationList */: - result = reduceNodes(node.declarations, cbNodes, result); - break; - case 225 /* FunctionDeclaration */: - result = reduceNodes(node.decorators, cbNodes, result); - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.name, cbNode, 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 226 /* ClassDeclaration */: - result = reduceNodes(node.decorators, cbNodes, result); - 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 232 /* CaseBlock */: - result = reduceNodes(node.clauses, cbNodes, result); - break; - case 235 /* 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 236 /* ImportClause */: - result = reduceNode(node.name, cbNode, result); - result = reduceNode(node.namedBindings, cbNode, result); - break; - case 237 /* NamespaceImport */: - result = reduceNode(node.name, cbNode, result); - break; - case 238 /* NamedImports */: - case 242 /* NamedExports */: - result = reduceNodes(node.elements, cbNodes, result); - break; - case 239 /* ImportSpecifier */: - case 243 /* ExportSpecifier */: - result = reduceNode(node.propertyName, cbNode, result); - result = reduceNode(node.name, cbNode, result); - break; - case 240 /* ExportAssignment */: - result = ts.reduceLeft(node.decorators, cbNode, result); - result = ts.reduceLeft(node.modifiers, cbNode, result); - result = reduceNode(node.expression, cbNode, result); - break; - case 241 /* 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; - // JSX - case 246 /* JsxElement */: - result = reduceNode(node.openingElement, cbNode, result); - result = ts.reduceLeft(node.children, cbNode, result); - result = reduceNode(node.closingElement, cbNode, result); - break; - case 247 /* JsxSelfClosingElement */: - case 248 /* JsxOpeningElement */: - result = reduceNode(node.tagName, cbNode, result); - result = reduceNodes(node.attributes, cbNodes, result); - break; - case 249 /* JsxClosingElement */: - result = reduceNode(node.tagName, cbNode, result); - break; - case 250 /* JsxAttribute */: - result = reduceNode(node.name, cbNode, result); - result = reduceNode(node.initializer, cbNode, result); - break; - case 251 /* JsxSpreadAttribute */: - result = reduceNode(node.expression, cbNode, result); - break; - case 252 /* JsxExpression */: - result = reduceNode(node.expression, cbNode, result); - break; - // Clauses - case 253 /* CaseClause */: - result = reduceNode(node.expression, cbNode, result); - // fall-through - case 254 /* DefaultClause */: - result = reduceNodes(node.statements, cbNodes, result); - break; - case 255 /* HeritageClause */: - result = reduceNodes(node.types, cbNodes, result); - break; - case 256 /* CatchClause */: - result = reduceNode(node.variableDeclaration, cbNode, result); - result = reduceNode(node.block, cbNode, result); - break; - // Property assignments - case 257 /* PropertyAssignment */: - result = reduceNode(node.name, cbNode, result); - result = reduceNode(node.initializer, cbNode, result); - break; - case 258 /* ShorthandPropertyAssignment */: - result = reduceNode(node.name, cbNode, result); - result = reduceNode(node.objectAssignmentInitializer, cbNode, result); - break; - case 259 /* SpreadAssignment */: - result = reduceNode(node.expression, cbNode, result); - break; - // Top-level nodes - case 261 /* SourceFile */: - result = reduceNodes(node.statements, cbNodes, result); - break; - case 294 /* PartiallyEmittedExpression */: - result = reduceNode(node.expression, cbNode, result); - break; - default: - var edgeTraversalPath = nodeEdgeTraversalMap[kind]; - if (edgeTraversalPath) { - for (var _i = 0, edgeTraversalPath_1 = edgeTraversalPath; _i < edgeTraversalPath_1.length; _i++) { - var edge = edgeTraversalPath_1[_i]; - var value = node[edge.name]; - if (value !== undefined) { - result = ts.isArray(value) - ? reduceNodes(value, cbNodes, result) - : cbNode(result, value); - } - } - } - break; - } - return result; - } - ts.reduceEachChild = reduceEachChild; - function visitNode(node, visitor, test, optional, lift, parenthesize, parentNode) { + function visitNode(node, visitor, test, lift) { if (node === undefined || visitor === undefined) { return node; } - aggregateTransformFlags(node); + ts.aggregateTransformFlags(node); var visited = visitor(node); if (visited === node) { return node; } var visitedNode; if (visited === undefined) { - if (!optional) { - Debug.failNotOptional(); - } return undefined; } else if (ts.isArray(visited)) { @@ -44628,17 +47528,23 @@ var ts; else { visitedNode = visited; } - if (parenthesize !== undefined) { - visitedNode = parenthesize(visitedNode, parentNode); - } - Debug.assertNode(visitedNode, test); - aggregateTransformFlags(visitedNode); + ts.Debug.assertNode(visitedNode, test); + ts.aggregateTransformFlags(visitedNode); return visitedNode; } ts.visitNode = visitNode; - function visitNodes(nodes, visitor, test, start, count, parenthesize, parentNode) { - if (nodes === undefined) { - return undefined; + /** + * Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place. + * + * @param nodes The NodeArray to visit. + * @param visitor The callback used to visit a Node. + * @param test A node test to execute for each node. + * @param start An optional value indicating the starting offset at which to start visiting. + * @param count An optional value indicating the maximum number of nodes to visit. + */ + function visitNodes(nodes, visitor, test, start, count) { + if (nodes === undefined || visitor === undefined) { + return nodes; } var updated; // Ensure start and count have valid values @@ -44653,38 +47559,32 @@ var ts; // If we are not visiting all of the original nodes, we must always create a new array. // Since this is a fragment of a node array, we do not copy over the previous location // and will only copy over `hasTrailingComma` if we are including the last element. - updated = ts.createNodeArray([], /*location*/ undefined, - /*hasTrailingComma*/ nodes.hasTrailingComma && start + count === length); + updated = ts.createNodeArray([], /*hasTrailingComma*/ nodes.hasTrailingComma && start + count === length); } // Visit each original node. for (var i = 0; i < count; i++) { var node = nodes[i + start]; - aggregateTransformFlags(node); + ts.aggregateTransformFlags(node); var visited = node !== undefined ? visitor(node) : undefined; if (updated !== undefined || visited === undefined || visited !== node) { if (updated === undefined) { // Ensure we have a copy of `nodes`, up to the current index. - updated = ts.createNodeArray(nodes.slice(0, i), /*location*/ nodes, nodes.hasTrailingComma); + updated = ts.createNodeArray(nodes.slice(0, i), nodes.hasTrailingComma); + ts.setTextRange(updated, nodes); } if (visited) { if (ts.isArray(visited)) { for (var _i = 0, visited_1 = visited; _i < visited_1.length; _i++) { var visitedNode = visited_1[_i]; - visitedNode = parenthesize - ? parenthesize(visitedNode, parentNode) - : visitedNode; - Debug.assertNode(visitedNode, test); - aggregateTransformFlags(visitedNode); + ts.Debug.assertNode(visitedNode, test); + ts.aggregateTransformFlags(visitedNode); updated.push(visitedNode); } } else { - var visitedNode = parenthesize - ? parenthesize(visited, parentNode) - : visited; - Debug.assertNode(visitedNode, test); - aggregateTransformFlags(visitedNode); - updated.push(visitedNode); + ts.Debug.assertNode(visited, test); + ts.aggregateTransformFlags(visited); + updated.push(visited); } } } @@ -44700,19 +47600,20 @@ var ts; context.startLexicalEnvironment(); statements = visitNodes(statements, visitor, ts.isStatement, start); if (ensureUseStrict && !ts.startsWithUseStrict(statements)) { - statements = ts.createNodeArray([ts.createStatement(ts.createLiteral("use strict"))].concat(statements), statements); + statements = ts.setTextRange(ts.createNodeArray([ts.createStatement(ts.createLiteral("use strict"))].concat(statements)), statements); } var declarations = context.endLexicalEnvironment(); - return ts.createNodeArray(ts.concatenate(statements, declarations), statements); + return ts.setTextRange(ts.createNodeArray(ts.concatenate(statements, declarations)), statements); } ts.visitLexicalEnvironment = visitLexicalEnvironment; /** * Starts a new lexical environment and visits a parameter list, suspending the lexical * environment upon completion. */ - function visitParameterList(nodes, visitor, context) { + function visitParameterList(nodes, visitor, context, nodesVisitor) { + if (nodesVisitor === void 0) { nodesVisitor = visitNodes; } context.startLexicalEnvironment(); - var updated = visitNodes(nodes, visitor, ts.isParameterDeclaration); + var updated = nodesVisitor(nodes, visitor, ts.isParameterDeclaration); context.suspendLexicalEnvironment(); return updated; } @@ -44723,256 +47624,715 @@ var ts; var declarations = context.endLexicalEnvironment(); if (ts.some(declarations)) { var block = ts.convertToFunctionBody(updated); - var statements = mergeLexicalEnvironment(block.statements, declarations); + var statements = ts.mergeLexicalEnvironment(block.statements, declarations); return ts.updateBlock(block, statements); } return updated; } ts.visitFunctionBody = visitFunctionBody; - function visitEachChild(node, visitor, context) { + function visitEachChild(node, visitor, context, nodesVisitor, tokenVisitor) { + if (nodesVisitor === void 0) { nodesVisitor = visitNodes; } if (node === undefined) { return undefined; } var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 140 /* LastToken */)) { - return node; - } - // We do not yet support types. - if ((kind >= 156 /* TypePredicate */ && kind <= 171 /* LiteralType */)) { + if ((kind > 0 /* FirstToken */ && kind <= 142 /* LastToken */) || kind === 169 /* ThisType */) { return node; } switch (node.kind) { - case 203 /* SemicolonClassElement */: - case 206 /* EmptyStatement */: - case 198 /* OmittedExpression */: - case 222 /* DebuggerStatement */: + case 206 /* SemicolonClassElement */: + case 209 /* EmptyStatement */: + case 200 /* OmittedExpression */: + case 225 /* DebuggerStatement */: + case 298 /* EndOfDeclarationMarker */: + case 247 /* MissingDeclaration */: // No need to visit nodes with no children. return node; // Names - case 142 /* ComputedPropertyName */: + case 143 /* QualifiedName */: + return ts.updateQualifiedName(node, visitNode(node.left, visitor, ts.isEntityName), visitNode(node.right, visitor, ts.isIdentifier)); + case 144 /* ComputedPropertyName */: return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression)); - // Signature elements - case 144 /* Parameter */: - return ts.updateParameter(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), node.dotDotDotToken, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode, /*optional*/ true), visitNode(node.initializer, visitor, ts.isExpression, /*optional*/ true)); - // Type member - case 147 /* PropertyDeclaration */: - return ts.updateProperty(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.type, visitor, ts.isTypeNode, /*optional*/ true), visitNode(node.initializer, visitor, ts.isExpression, /*optional*/ true)); - case 149 /* MethodDeclaration */: - return ts.updateMethod(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context), visitNode(node.type, visitor, ts.isTypeNode, /*optional*/ true), visitFunctionBody(node.body, visitor, context)); - case 150 /* Constructor */: - return ts.updateConstructor(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context), visitFunctionBody(node.body, visitor, context)); - case 151 /* GetAccessor */: - return ts.updateGetAccessor(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context), visitNode(node.type, visitor, ts.isTypeNode, /*optional*/ true), visitFunctionBody(node.body, visitor, context)); - case 152 /* SetAccessor */: - return ts.updateSetAccessor(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context), visitFunctionBody(node.body, visitor, context)); + // Signatures and Signature Elements + case 160 /* FunctionType */: + return ts.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode)); + case 161 /* ConstructorType */: + return ts.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode)); + case 155 /* CallSignature */: + return ts.updateCallSignatureDeclaration(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode)); + case 156 /* ConstructSignature */: + return ts.updateConstructSignatureDeclaration(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode)); + case 150 /* MethodSignature */: + return ts.updateMethodSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken)); + case 157 /* IndexSignature */: + return ts.updateIndexSignatureDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode)); + case 146 /* 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 147 /* Decorator */: + return ts.updateDecorator(node, visitNode(node.expression, visitor, ts.isExpression)); + // Types + case 159 /* TypeReference */: + return ts.updateTypeReferenceNode(node, visitNode(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); + case 158 /* TypePredicate */: + return ts.updateTypePredicateNode(node, visitNode(node.parameterName, visitor), visitNode(node.type, visitor, ts.isTypeNode)); + case 162 /* TypeQuery */: + return ts.updateTypeQueryNode(node, visitNode(node.exprName, visitor, ts.isEntityName)); + case 163 /* TypeLiteral */: + return ts.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor)); + case 164 /* ArrayType */: + return ts.updateArrayTypeNode(node, visitNode(node.elementType, visitor, ts.isTypeNode)); + case 165 /* TupleType */: + return ts.updateTypleTypeNode(node, nodesVisitor(node.elementTypes, visitor, ts.isTypeNode)); + case 166 /* UnionType */: + case 167 /* IntersectionType */: + return ts.updateUnionOrIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); + case 168 /* ParenthesizedType */: + throw ts.Debug.fail("not implemented."); + case 170 /* TypeOperator */: + return ts.updateTypeOperatorNode(node, visitNode(node.type, visitor, ts.isTypeNode)); + case 171 /* IndexedAccessType */: + return ts.updateIndexedAccessTypeNode(node, visitNode(node.objectType, visitor, ts.isTypeNode), visitNode(node.indexType, visitor, ts.isTypeNode)); + case 172 /* MappedType */: + return ts.updateMappedTypeNode(node, visitNode(node.readonlyToken, tokenVisitor, ts.isToken), visitNode(node.typeParameter, visitor, ts.isTypeParameter), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); + case 173 /* LiteralType */: + return ts.updateLiteralTypeNode(node, visitNode(node.literal, visitor, ts.isExpression)); + // Type Declarations + case 145 /* TypeParameter */: + return ts.updateTypeParameterDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.constraint, visitor, ts.isTypeNode), visitNode(node.default, visitor, ts.isTypeNode)); + // Type members + case 148 /* PropertySignature */: + return ts.updatePropertySignature(node, 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 149 /* 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.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); + case 151 /* 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.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + case 152 /* 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 153 /* 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 154 /* 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)); // Binding patterns - case 172 /* ObjectBindingPattern */: - return ts.updateObjectBindingPattern(node, visitNodes(node.elements, visitor, ts.isBindingElement)); - case 173 /* ArrayBindingPattern */: - return ts.updateArrayBindingPattern(node, visitNodes(node.elements, visitor, ts.isArrayBindingElement)); - case 174 /* BindingElement */: - return ts.updateBindingElement(node, node.dotDotDotToken, visitNode(node.propertyName, visitor, ts.isPropertyName, /*optional*/ true), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression, /*optional*/ true)); + case 174 /* ObjectBindingPattern */: + return ts.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement)); + case 175 /* ArrayBindingPattern */: + return ts.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement)); + case 176 /* 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 175 /* ArrayLiteralExpression */: - return ts.updateArrayLiteral(node, visitNodes(node.elements, visitor, ts.isExpression)); - case 176 /* ObjectLiteralExpression */: - return ts.updateObjectLiteral(node, visitNodes(node.properties, visitor, ts.isObjectLiteralElementLike)); - case 177 /* PropertyAccessExpression */: + case 177 /* ArrayLiteralExpression */: + return ts.updateArrayLiteral(node, nodesVisitor(node.elements, visitor, ts.isExpression)); + case 178 /* ObjectLiteralExpression */: + return ts.updateObjectLiteral(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike)); + case 179 /* PropertyAccessExpression */: return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifier)); - case 178 /* ElementAccessExpression */: + case 180 /* ElementAccessExpression */: return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression)); - case 179 /* CallExpression */: - return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isTypeNode), visitNodes(node.arguments, visitor, ts.isExpression)); - case 180 /* NewExpression */: - return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isTypeNode), visitNodes(node.arguments, visitor, ts.isExpression)); - case 181 /* TaggedTemplateExpression */: + case 181 /* CallExpression */: + return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); + case 182 /* NewExpression */: + return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); + case 183 /* TaggedTemplateExpression */: return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral)); - case 183 /* ParenthesizedExpression */: + case 184 /* TypeAssertionExpression */: + return ts.updateTypeAssertion(node, visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); + case 185 /* ParenthesizedExpression */: return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression)); - case 184 /* FunctionExpression */: - return ts.updateFunctionExpression(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context), visitNode(node.type, visitor, ts.isTypeNode, /*optional*/ true), visitFunctionBody(node.body, visitor, context)); - case 185 /* ArrowFunction */: - return ts.updateArrowFunction(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context), visitNode(node.type, visitor, ts.isTypeNode, /*optional*/ true), visitFunctionBody(node.body, visitor, context)); - case 186 /* DeleteExpression */: + case 186 /* 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.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + case 187 /* ArrowFunction */: + return ts.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + case 188 /* DeleteExpression */: return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression)); - case 187 /* TypeOfExpression */: + case 189 /* TypeOfExpression */: return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression)); - case 188 /* VoidExpression */: + case 190 /* VoidExpression */: return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression)); - case 189 /* AwaitExpression */: + case 191 /* AwaitExpression */: return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression)); - case 192 /* BinaryExpression */: + case 194 /* BinaryExpression */: return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression)); - case 190 /* PrefixUnaryExpression */: + case 192 /* PrefixUnaryExpression */: return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 191 /* PostfixUnaryExpression */: + case 193 /* PostfixUnaryExpression */: return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 193 /* ConditionalExpression */: + case 195 /* ConditionalExpression */: return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.whenFalse, visitor, ts.isExpression)); - case 194 /* TemplateExpression */: - return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), visitNodes(node.templateSpans, visitor, ts.isTemplateSpan)); - case 195 /* YieldExpression */: - return ts.updateYield(node, visitNode(node.expression, visitor, ts.isExpression)); - case 196 /* SpreadElement */: + case 196 /* TemplateExpression */: + return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan)); + case 197 /* YieldExpression */: + return ts.updateYield(node, visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.expression, visitor, ts.isExpression)); + case 198 /* SpreadElement */: return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression)); - case 197 /* ClassExpression */: - return ts.updateClassExpression(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier, /*optional*/ true), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), visitNodes(node.members, visitor, ts.isClassElement)); - case 199 /* ExpressionWithTypeArguments */: - return ts.updateExpressionWithTypeArguments(node, visitNodes(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); + case 199 /* ClassExpression */: + return ts.updateClassExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); + case 201 /* ExpressionWithTypeArguments */: + return ts.updateExpressionWithTypeArguments(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); + case 202 /* AsExpression */: + return ts.updateAsExpression(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.type, visitor, ts.isTypeNode)); + case 203 /* NonNullExpression */: + return ts.updateNonNullExpression(node, visitNode(node.expression, visitor, ts.isExpression)); // Misc - case 202 /* TemplateSpan */: + case 205 /* TemplateSpan */: return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); // Element - case 204 /* Block */: - return ts.updateBlock(node, visitNodes(node.statements, visitor, ts.isStatement)); - case 205 /* VariableStatement */: - return ts.updateVariableStatement(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList)); - case 207 /* ExpressionStatement */: + case 207 /* Block */: + return ts.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); + case 208 /* VariableStatement */: + return ts.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList)); + case 210 /* ExpressionStatement */: return ts.updateStatement(node, visitNode(node.expression, visitor, ts.isExpression)); - case 208 /* IfStatement */: - return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, /*optional*/ false, liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, /*optional*/ true, liftToBlock)); - case 209 /* DoStatement */: - return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, /*optional*/ false, liftToBlock), visitNode(node.expression, visitor, ts.isExpression)); - case 210 /* WhileStatement */: - return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, /*optional*/ false, liftToBlock)); - case 211 /* 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, /*optional*/ false, liftToBlock)); - case 212 /* ForInStatement */: - return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, /*optional*/ false, liftToBlock)); - case 213 /* ForOfStatement */: - return ts.updateForOf(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, /*optional*/ false, liftToBlock)); - case 214 /* ContinueStatement */: - return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier, /*optional*/ true)); - case 215 /* BreakStatement */: - return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier, /*optional*/ true)); - case 216 /* ReturnStatement */: - return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression, /*optional*/ true)); - case 217 /* WithStatement */: - return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, /*optional*/ false, liftToBlock)); - case 218 /* SwitchStatement */: + case 211 /* 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 212 /* DoStatement */: + return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.expression, visitor, ts.isExpression)); + case 213 /* WhileStatement */: + return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 214 /* 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 215 /* 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 216 /* ForOfStatement */: + return ts.updateForOf(node, node.awaitModifier, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 217 /* ContinueStatement */: + return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier)); + case 218 /* BreakStatement */: + return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier)); + case 219 /* ReturnStatement */: + return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression)); + case 220 /* WithStatement */: + return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 221 /* SwitchStatement */: return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock)); - case 219 /* LabeledStatement */: - return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, /*optional*/ false, liftToBlock)); - case 220 /* ThrowStatement */: + case 222 /* LabeledStatement */: + return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 223 /* ThrowStatement */: return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression)); - case 221 /* TryStatement */: - return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause, /*optional*/ true), visitNode(node.finallyBlock, visitor, ts.isBlock, /*optional*/ true)); - case 223 /* VariableDeclaration */: - return ts.updateVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode, /*optional*/ true), visitNode(node.initializer, visitor, ts.isExpression, /*optional*/ true)); - case 224 /* VariableDeclarationList */: - return ts.updateVariableDeclarationList(node, visitNodes(node.declarations, visitor, ts.isVariableDeclaration)); - case 225 /* FunctionDeclaration */: - return ts.updateFunctionDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context), visitNode(node.type, visitor, ts.isTypeNode, /*optional*/ true), visitFunctionBody(node.body, visitor, context)); - case 226 /* ClassDeclaration */: - return ts.updateClassDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier, /*optional*/ true), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), visitNodes(node.members, visitor, ts.isClassElement)); - case 232 /* CaseBlock */: - return ts.updateCaseBlock(node, visitNodes(node.clauses, visitor, ts.isCaseOrDefaultClause)); - case 235 /* ImportDeclaration */: - return ts.updateImportDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause, /*optional*/ true), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); - case 236 /* ImportClause */: - return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier, /*optional*/ true), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings, /*optional*/ true)); - case 237 /* NamespaceImport */: + case 224 /* TryStatement */: + return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause), visitNode(node.finallyBlock, visitor, ts.isBlock)); + case 226 /* VariableDeclaration */: + return ts.updateVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); + case 227 /* VariableDeclarationList */: + return ts.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration)); + case 228 /* 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.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + case 229 /* 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.isTypeParameter), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); + case 232 /* 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 233 /* 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 234 /* ModuleBlock */: + return ts.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); + case 235 /* CaseBlock */: + return ts.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause)); + case 237 /* 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 238 /* 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 239 /* ImportClause */: + return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings)); + case 240 /* NamespaceImport */: return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 238 /* NamedImports */: - return ts.updateNamedImports(node, visitNodes(node.elements, visitor, ts.isImportSpecifier)); - case 239 /* ImportSpecifier */: - return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier, /*optional*/ true), visitNode(node.name, visitor, ts.isIdentifier)); - case 240 /* ExportAssignment */: - return ts.updateExportAssignment(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression)); - case 241 /* ExportDeclaration */: - return ts.updateExportDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExports, /*optional*/ true), visitNode(node.moduleSpecifier, visitor, ts.isExpression, /*optional*/ true)); - case 242 /* NamedExports */: - return ts.updateNamedExports(node, visitNodes(node.elements, visitor, ts.isExportSpecifier)); - case 243 /* ExportSpecifier */: - return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier, /*optional*/ true), visitNode(node.name, visitor, ts.isIdentifier)); + case 241 /* NamedImports */: + return ts.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); + case 242 /* ImportSpecifier */: + return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); + case 243 /* ExportAssignment */: + return ts.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression)); + case 244 /* 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 245 /* NamedExports */: + return ts.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier)); + case 246 /* ExportSpecifier */: + return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); + // Module references + case 248 /* ExternalModuleReference */: + return ts.updateExternalModuleReference(node, visitNode(node.expression, visitor, ts.isExpression)); // JSX - case 246 /* JsxElement */: - return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), visitNodes(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement)); - case 247 /* JsxSelfClosingElement */: - return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNodes(node.attributes, visitor, ts.isJsxAttributeLike)); - case 248 /* JsxOpeningElement */: - return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNodes(node.attributes, visitor, ts.isJsxAttributeLike)); - case 249 /* JsxClosingElement */: + case 249 /* JsxElement */: + return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement)); + case 254 /* JsxAttributes */: + return ts.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike)); + case 250 /* JsxSelfClosingElement */: + return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNode(node.attributes, visitor, ts.isJsxAttributes)); + case 251 /* JsxOpeningElement */: + return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNode(node.attributes, visitor, ts.isJsxAttributes)); + case 252 /* JsxClosingElement */: return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression)); - case 250 /* JsxAttribute */: + case 253 /* JsxAttribute */: return ts.updateJsxAttribute(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); - case 251 /* JsxSpreadAttribute */: + case 255 /* JsxSpreadAttribute */: return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression)); - case 252 /* JsxExpression */: + case 256 /* JsxExpression */: return ts.updateJsxExpression(node, visitNode(node.expression, visitor, ts.isExpression)); // Clauses - case 253 /* CaseClause */: - return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), visitNodes(node.statements, visitor, ts.isStatement)); - case 254 /* DefaultClause */: - return ts.updateDefaultClause(node, visitNodes(node.statements, visitor, ts.isStatement)); - case 255 /* HeritageClause */: - return ts.updateHeritageClause(node, visitNodes(node.types, visitor, ts.isExpressionWithTypeArguments)); - case 256 /* CatchClause */: + case 257 /* CaseClause */: + return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement)); + case 258 /* DefaultClause */: + return ts.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement)); + case 259 /* HeritageClause */: + return ts.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments)); + case 260 /* CatchClause */: return ts.updateCatchClause(node, visitNode(node.variableDeclaration, visitor, ts.isVariableDeclaration), visitNode(node.block, visitor, ts.isBlock)); // Property assignments - case 257 /* PropertyAssignment */: + case 261 /* PropertyAssignment */: return ts.updatePropertyAssignment(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); - case 258 /* ShorthandPropertyAssignment */: + case 262 /* ShorthandPropertyAssignment */: return ts.updateShorthandPropertyAssignment(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.objectAssignmentInitializer, visitor, ts.isExpression)); - case 259 /* SpreadAssignment */: + case 263 /* SpreadAssignment */: return ts.updateSpreadAssignment(node, visitNode(node.expression, visitor, ts.isExpression)); + // Enum + case 264 /* EnumMember */: + return ts.updateEnumMember(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); // Top-level nodes - case 261 /* SourceFile */: + case 265 /* SourceFile */: return ts.updateSourceFileNode(node, visitLexicalEnvironment(node.statements, visitor, context)); // Transformation nodes - case 294 /* PartiallyEmittedExpression */: + case 296 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(node, visitNode(node.expression, visitor, ts.isExpression)); default: - var updated = void 0; - var edgeTraversalPath = nodeEdgeTraversalMap[kind]; - if (edgeTraversalPath) { - for (var _i = 0, edgeTraversalPath_2 = edgeTraversalPath; _i < edgeTraversalPath_2.length; _i++) { - var edge = edgeTraversalPath_2[_i]; - var value = node[edge.name]; - if (value !== undefined) { - var visited = ts.isArray(value) - ? visitNodes(value, visitor, edge.test, 0, value.length, edge.parenthesize, node) - : visitNode(value, visitor, edge.test, edge.optional, edge.lift, edge.parenthesize, node); - if (updated !== undefined || visited !== value) { - if (updated === undefined) { - updated = ts.getMutableClone(node); - } - if (visited !== value) { - updated[edge.name] = visited; - } - } - } - } - } - return updated ? ts.updateNode(updated, node) : node; + return node; } - // return node; } ts.visitEachChild = visitEachChild; + /** + * Extracts the single node from a NodeArray. + * + * @param nodes The NodeArray. + */ + function extractSingleNode(nodes) { + ts.Debug.assert(nodes.length <= 1, "Too many nodes written to output."); + return ts.singleOrUndefined(nodes); + } +})(ts || (ts = {})); +/* @internal */ +(function (ts) { + function reduceNode(node, f, initial) { + return node ? f(initial, node) : initial; + } + function reduceNodeArray(nodes, f, initial) { + return nodes ? f(initial, nodes) : initial; + } + /** + * Similar to `reduceLeft`, performs a reduction against each child of a node. + * NOTE: Unlike `forEachChild`, this does *not* visit every node. + * + * @param node The node containing the children to reduce. + * @param initial The initial value to supply to the reduction. + * @param f The callback function + */ + function reduceEachChild(node, initial, cbNode, cbNodeArray) { + if (node === undefined) { + return initial; + } + var reduceNodes = cbNodeArray ? reduceNodeArray : ts.reduceLeft; + var cbNodes = cbNodeArray || cbNode; + var kind = node.kind; + // No need to visit nodes with no children. + if ((kind > 0 /* FirstToken */ && kind <= 142 /* LastToken */)) { + return initial; + } + // We do not yet support types. + if ((kind >= 158 /* TypePredicate */ && kind <= 173 /* LiteralType */)) { + return initial; + } + var result = initial; + switch (node.kind) { + // Leaf nodes + case 206 /* SemicolonClassElement */: + case 209 /* EmptyStatement */: + case 200 /* OmittedExpression */: + case 225 /* DebuggerStatement */: + case 295 /* NotEmittedStatement */: + // No need to visit nodes with no children. + break; + // Names + case 143 /* QualifiedName */: + result = reduceNode(node.left, cbNode, result); + result = reduceNode(node.right, cbNode, result); + break; + case 144 /* ComputedPropertyName */: + result = reduceNode(node.expression, cbNode, result); + break; + // Signature elements + case 146 /* 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 147 /* Decorator */: + result = reduceNode(node.expression, cbNode, result); + break; + // Type member + case 149 /* 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 151 /* MethodDeclaration */: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, 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 152 /* Constructor */: + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNodes(node.parameters, cbNodes, result); + result = reduceNode(node.body, cbNode, result); + break; + case 153 /* GetAccessor */: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNodes(node.parameters, cbNodes, result); + result = reduceNode(node.type, cbNode, result); + result = reduceNode(node.body, cbNode, result); + break; + case 154 /* SetAccessor */: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNodes(node.parameters, cbNodes, result); + result = reduceNode(node.body, cbNode, result); + break; + // Binding patterns + case 174 /* ObjectBindingPattern */: + case 175 /* ArrayBindingPattern */: + result = reduceNodes(node.elements, cbNodes, result); + break; + case 176 /* BindingElement */: + result = reduceNode(node.propertyName, cbNode, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.initializer, cbNode, result); + break; + // Expression + case 177 /* ArrayLiteralExpression */: + result = reduceNodes(node.elements, cbNodes, result); + break; + case 178 /* ObjectLiteralExpression */: + result = reduceNodes(node.properties, cbNodes, result); + break; + case 179 /* PropertyAccessExpression */: + result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.name, cbNode, result); + break; + case 180 /* ElementAccessExpression */: + result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.argumentExpression, cbNode, result); + break; + case 181 /* CallExpression */: + result = reduceNode(node.expression, cbNode, result); + result = reduceNodes(node.typeArguments, cbNodes, result); + result = reduceNodes(node.arguments, cbNodes, result); + break; + case 182 /* NewExpression */: + result = reduceNode(node.expression, cbNode, result); + result = reduceNodes(node.typeArguments, cbNodes, result); + result = reduceNodes(node.arguments, cbNodes, result); + break; + case 183 /* TaggedTemplateExpression */: + result = reduceNode(node.tag, cbNode, result); + result = reduceNode(node.template, cbNode, result); + break; + case 184 /* TypeAssertionExpression */: + result = reduceNode(node.type, cbNode, result); + result = reduceNode(node.expression, cbNode, result); + break; + case 186 /* FunctionExpression */: + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, 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 187 /* 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 185 /* ParenthesizedExpression */: + case 188 /* DeleteExpression */: + case 189 /* TypeOfExpression */: + case 190 /* VoidExpression */: + case 191 /* AwaitExpression */: + case 197 /* YieldExpression */: + case 198 /* SpreadElement */: + case 203 /* NonNullExpression */: + result = reduceNode(node.expression, cbNode, result); + break; + case 192 /* PrefixUnaryExpression */: + case 193 /* PostfixUnaryExpression */: + result = reduceNode(node.operand, cbNode, result); + break; + case 194 /* BinaryExpression */: + result = reduceNode(node.left, cbNode, result); + result = reduceNode(node.right, cbNode, result); + break; + case 195 /* ConditionalExpression */: + result = reduceNode(node.condition, cbNode, result); + result = reduceNode(node.whenTrue, cbNode, result); + result = reduceNode(node.whenFalse, cbNode, result); + break; + case 196 /* TemplateExpression */: + result = reduceNode(node.head, cbNode, result); + result = reduceNodes(node.templateSpans, cbNodes, result); + break; + case 199 /* 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 201 /* ExpressionWithTypeArguments */: + result = reduceNode(node.expression, cbNode, result); + result = reduceNodes(node.typeArguments, cbNodes, result); + break; + case 202 /* AsExpression */: + result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.type, cbNode, result); + break; + case 203 /* NonNullExpression */: + result = reduceNode(node.expression, cbNode, result); + break; + // Misc + case 205 /* TemplateSpan */: + result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.literal, cbNode, result); + break; + // Element + case 207 /* Block */: + result = reduceNodes(node.statements, cbNodes, result); + break; + case 208 /* VariableStatement */: + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.declarationList, cbNode, result); + break; + case 210 /* ExpressionStatement */: + result = reduceNode(node.expression, cbNode, result); + break; + case 211 /* IfStatement */: + result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.thenStatement, cbNode, result); + result = reduceNode(node.elseStatement, cbNode, result); + break; + case 212 /* DoStatement */: + result = reduceNode(node.statement, cbNode, result); + result = reduceNode(node.expression, cbNode, result); + break; + case 213 /* WhileStatement */: + case 220 /* WithStatement */: + result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.statement, cbNode, result); + break; + case 214 /* 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 215 /* ForInStatement */: + case 216 /* ForOfStatement */: + result = reduceNode(node.initializer, cbNode, result); + result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.statement, cbNode, result); + break; + case 219 /* ReturnStatement */: + case 223 /* ThrowStatement */: + result = reduceNode(node.expression, cbNode, result); + break; + case 221 /* SwitchStatement */: + result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.caseBlock, cbNode, result); + break; + case 222 /* LabeledStatement */: + result = reduceNode(node.label, cbNode, result); + result = reduceNode(node.statement, cbNode, result); + break; + case 224 /* TryStatement */: + result = reduceNode(node.tryBlock, cbNode, result); + result = reduceNode(node.catchClause, cbNode, result); + result = reduceNode(node.finallyBlock, cbNode, result); + break; + case 226 /* VariableDeclaration */: + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.type, cbNode, result); + result = reduceNode(node.initializer, cbNode, result); + break; + case 227 /* VariableDeclarationList */: + result = reduceNodes(node.declarations, cbNodes, result); + break; + case 228 /* FunctionDeclaration */: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, 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 229 /* ClassDeclaration */: + result = reduceNodes(node.decorators, cbNodes, result); + 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 232 /* 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 233 /* 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 234 /* ModuleBlock */: + result = reduceNodes(node.statements, cbNodes, result); + break; + case 235 /* CaseBlock */: + result = reduceNodes(node.clauses, cbNodes, result); + break; + case 237 /* 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 238 /* 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 239 /* ImportClause */: + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.namedBindings, cbNode, result); + break; + case 240 /* NamespaceImport */: + result = reduceNode(node.name, cbNode, result); + break; + case 241 /* NamedImports */: + case 245 /* NamedExports */: + result = reduceNodes(node.elements, cbNodes, result); + break; + case 242 /* ImportSpecifier */: + case 246 /* ExportSpecifier */: + result = reduceNode(node.propertyName, cbNode, result); + result = reduceNode(node.name, cbNode, result); + break; + case 243 /* ExportAssignment */: + result = ts.reduceLeft(node.decorators, cbNode, result); + result = ts.reduceLeft(node.modifiers, cbNode, result); + result = reduceNode(node.expression, cbNode, result); + break; + case 244 /* 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 248 /* ExternalModuleReference */: + result = reduceNode(node.expression, cbNode, result); + break; + // JSX + case 249 /* JsxElement */: + result = reduceNode(node.openingElement, cbNode, result); + result = ts.reduceLeft(node.children, cbNode, result); + result = reduceNode(node.closingElement, cbNode, result); + break; + case 250 /* JsxSelfClosingElement */: + case 251 /* JsxOpeningElement */: + result = reduceNode(node.tagName, cbNode, result); + result = reduceNode(node.attributes, cbNode, result); + break; + case 254 /* JsxAttributes */: + result = reduceNodes(node.properties, cbNodes, result); + break; + case 252 /* JsxClosingElement */: + result = reduceNode(node.tagName, cbNode, result); + break; + case 253 /* JsxAttribute */: + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.initializer, cbNode, result); + break; + case 255 /* JsxSpreadAttribute */: + result = reduceNode(node.expression, cbNode, result); + break; + case 256 /* JsxExpression */: + result = reduceNode(node.expression, cbNode, result); + break; + // Clauses + case 257 /* CaseClause */: + result = reduceNode(node.expression, cbNode, result); + // falls through + case 258 /* DefaultClause */: + result = reduceNodes(node.statements, cbNodes, result); + break; + case 259 /* HeritageClause */: + result = reduceNodes(node.types, cbNodes, result); + break; + case 260 /* CatchClause */: + result = reduceNode(node.variableDeclaration, cbNode, result); + result = reduceNode(node.block, cbNode, result); + break; + // Property assignments + case 261 /* PropertyAssignment */: + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.initializer, cbNode, result); + break; + case 262 /* ShorthandPropertyAssignment */: + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.objectAssignmentInitializer, cbNode, result); + break; + case 263 /* SpreadAssignment */: + result = reduceNode(node.expression, cbNode, result); + break; + // Enum + case 264 /* EnumMember */: + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.initializer, cbNode, result); + break; + // Top-level nodes + case 265 /* SourceFile */: + result = reduceNodes(node.statements, cbNodes, result); + break; + // Transformation nodes + case 296 /* PartiallyEmittedExpression */: + result = reduceNode(node.expression, cbNode, result); + break; + default: + break; + } + return result; + } + ts.reduceEachChild = reduceEachChild; function mergeLexicalEnvironment(statements, declarations) { if (!ts.some(declarations)) { return statements; } return ts.isNodeArray(statements) - ? ts.createNodeArray(ts.concatenate(statements, declarations), statements) + ? ts.setTextRange(ts.createNodeArray(ts.concatenate(statements, declarations)), statements) : ts.addRange(statements, declarations); } ts.mergeLexicalEnvironment = mergeLexicalEnvironment; - function mergeFunctionBodyLexicalEnvironment(body, declarations) { - if (body && declarations !== undefined && declarations.length > 0) { - if (ts.isBlock(body)) { - return ts.updateBlock(body, ts.createNodeArray(ts.concatenate(body.statements, declarations), body.statements)); - } - else { - return ts.createBlock(ts.createNodeArray([ts.createReturn(body, /*location*/ body)].concat(declarations), body), - /*location*/ body, - /*multiLine*/ true); - } - } - return body; - } - ts.mergeFunctionBodyLexicalEnvironment = mergeFunctionBodyLexicalEnvironment; /** * Lifts a NodeArray containing only Statement nodes to a block. * @@ -44983,15 +48343,6 @@ var ts; return ts.singleOrUndefined(nodes) || ts.createBlock(nodes); } ts.liftToBlock = liftToBlock; - /** - * Extracts the single node from a NodeArray. - * - * @param nodes The NodeArray. - */ - function extractSingleNode(nodes) { - Debug.assert(nodes.length <= 1, "Too many nodes written to output."); - return ts.singleOrUndefined(nodes); - } /** * Aggregates the TransformFlags for a Node and its subtree. */ @@ -45037,7 +48388,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 !== 199 /* ExpressionWithTypeArguments */)) { + if (ts.hasModifier(node, 2 /* Ambient */) || (ts.isTypeNode(node) && node.kind !== 201 /* ExpressionWithTypeArguments */)) { return 0 /* None */; } // Aggregate the transform flags of each child. @@ -45055,9 +48406,6 @@ var ts; } var Debug; (function (Debug) { - Debug.failNotOptional = Debug.shouldAssert(1 /* Normal */) - ? function (message) { return Debug.assert(false, message || "Node not optional."); } - : ts.noop; Debug.failBadSyntaxKind = Debug.shouldAssert(1 /* Normal */) ? function (node, message) { return Debug.assert(false, message || "Unexpected node.", function () { return "Node " + ts.formatSyntaxKind(node.kind) + " was unexpected."; }); } : ts.noop; @@ -45090,7 +48438,6 @@ var ts; } } })(Debug = ts.Debug || (ts.Debug = {})); - var _a; })(ts || (ts = {})); /// /// @@ -45118,7 +48465,7 @@ var ts; var value; if (ts.isDestructuringAssignment(node)) { value = node.right; - while (ts.isEmptyObjectLiteralOrArrayLiteral(node.left)) { + while (ts.isEmptyArrayLiteral(node.left) || ts.isEmptyObjectLiteral(node.left)) { if (ts.isDestructuringAssignment(value)) { location = node = value; value = node.right; @@ -45132,6 +48479,7 @@ var ts; var flattenContext = { context: context, level: level, + downlevelIteration: context.getCompilerOptions().downlevelIteration, hoistTempVariables: true, emitExpression: emitExpression, emitBindingOrAssignment: emitBindingOrAssignment, @@ -45180,7 +48528,7 @@ var ts; ts.Debug.assertNode(target, createAssignmentCallback ? ts.isIdentifier : ts.isExpression); var expression = createAssignmentCallback ? createAssignmentCallback(target, value, location) - : ts.createAssignment(ts.visitNode(target, visitor, ts.isExpression), value, location); + : ts.setTextRange(ts.createAssignment(ts.visitNode(target, visitor, ts.isExpression), value), location); expression.original = original; emitExpression(expression); } @@ -45204,6 +48552,7 @@ var ts; var flattenContext = { context: context, level: level, + downlevelIteration: context.getCompilerOptions().downlevelIteration, hoistTempVariables: hoistTempVariables, emitExpression: emitExpression, emitBindingOrAssignment: emitBindingOrAssignment, @@ -45229,11 +48578,12 @@ var ts; } } for (var _i = 0, pendingDeclarations_1 = pendingDeclarations; _i < pendingDeclarations_1.length; _i++) { - var _a = pendingDeclarations_1[_i], pendingExpressions_1 = _a.pendingExpressions, name_30 = _a.name, value = _a.value, location_2 = _a.location, original = _a.original; - var variable = ts.createVariableDeclaration(name_30, - /*type*/ undefined, pendingExpressions_1 ? ts.inlineExpressions(ts.append(pendingExpressions_1, value)) : value, location_2); + var _a = pendingDeclarations_1[_i], pendingExpressions_1 = _a.pendingExpressions, name = _a.name, value = _a.value, location = _a.location, original = _a.original; + var variable = ts.createVariableDeclaration(name, + /*type*/ undefined, pendingExpressions_1 ? ts.inlineExpressions(ts.append(pendingExpressions_1, value)) : value); variable.original = original; - if (ts.isIdentifier(name_30)) { + ts.setTextRange(variable, location); + if (ts.isIdentifier(name)) { ts.setEmitFlags(variable, 64 /* NoNestedSourceMaps */); } ts.aggregateTransformFlags(variable); @@ -45355,7 +48705,14 @@ var ts; function flattenArrayBindingOrAssignmentPattern(flattenContext, parent, pattern, value, location) { var elements = ts.getElementsOfBindingOrAssignmentPattern(pattern); var numElements = elements.length; - if (numElements !== 1 && (flattenContext.level < 1 /* ObjectRest */ || numElements === 0)) { + if (flattenContext.level < 1 /* ObjectRest */ && flattenContext.downlevelIteration) { + // Read the elements of the iterable into an array + value = ensureIdentifier(flattenContext, ts.createReadHelper(flattenContext.context, value, numElements > 0 && ts.getRestIndicatorOfBindingOrAssignmentElement(elements[numElements - 1]) + ? undefined + : numElements, location), + /*reuseIdentifierExpressions*/ false, location); + } + else if (numElements !== 1 && (flattenContext.level < 1 /* ObjectRest */ || numElements === 0)) { // For anything other than a single-element destructuring we need to generate a temporary // to ensure value is evaluated exactly once. Additionally, if we have zero elements // we need to emit *something* to ensure that in case a 'var' keyword was already emitted, @@ -45437,8 +48794,8 @@ var ts; return ts.createElementAccess(value, argumentExpression); } else { - var name_31 = ts.createIdentifier(ts.unescapeIdentifier(propertyName.text)); - return ts.createPropertyAccess(value, name_31); + var name = ts.createIdentifier(ts.unescapeIdentifier(propertyName.text)); + return ts.createPropertyAccess(value, name); } } /** @@ -45460,7 +48817,7 @@ var ts; var temp = ts.createTempVariable(/*recordTempVariable*/ undefined); if (flattenContext.hoistTempVariables) { flattenContext.context.hoistVariableDeclaration(temp); - flattenContext.emitExpression(ts.createAssignment(temp, value, location)); + flattenContext.emitExpression(ts.setTextRange(ts.createAssignment(temp, value), location)); } else { flattenContext.emitBindingOrAssignment(temp, value, location, /*original*/ undefined); @@ -45483,7 +48840,7 @@ var ts; return ts.createObjectLiteral(ts.map(elements, ts.convertToObjectAssignmentElement)); } function makeBindingElement(name) { - return ts.createBindingElement(/*propertyName*/ undefined, /*dotDotDotToken*/ undefined, name); + return ts.createBindingElement(/*dotDotDotToken*/ undefined, /*propertyName*/ undefined, name); } function makeAssignmentElement(name) { return name; @@ -45494,7 +48851,8 @@ var ts; text: "\n var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\n t[p[i]] = s[p[i]];\n return t;\n };" }; /** Given value: o, propName: p, pattern: { a, b, ...p } from the original statement - * `{ a, b, ...p } = o`, create `p = __rest(o, ["a", "b"]);`*/ + * `{ a, b, ...p } = o`, create `p = __rest(o, ["a", "b"]);` + */ function createRestCall(context, value, elements, computedTempVariables, location) { context.requestEmitHelper(restHelper); var propertyNames = []; @@ -45513,7 +48871,11 @@ var ts; } } } - return ts.createCall(ts.getHelperName("__rest"), undefined, [value, ts.createArrayLiteral(propertyNames, location)]); + return ts.createCall(ts.getHelperName("__rest"), + /*typeArguments*/ undefined, [ + value, + ts.setTextRange(ts.createArrayLiteral(propertyNames), location) + ]); } })(ts || (ts = {})); /// @@ -45548,8 +48910,8 @@ var ts; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; // Enable substitution for property/element access to emit const enum values. - context.enableSubstitution(177 /* PropertyAccessExpression */); - context.enableSubstitution(178 /* ElementAccessExpression */); + context.enableSubstitution(179 /* PropertyAccessExpression */); + context.enableSubstitution(180 /* ElementAccessExpression */); // These variables contain state that changes as we descend into the tree. var currentSourceFile; var currentNamespace; @@ -45613,15 +48975,15 @@ var ts; */ function onBeforeVisitNode(node) { switch (node.kind) { - case 261 /* SourceFile */: - case 232 /* CaseBlock */: - case 231 /* ModuleBlock */: - case 204 /* Block */: + case 265 /* SourceFile */: + case 235 /* CaseBlock */: + case 234 /* ModuleBlock */: + case 207 /* Block */: currentScope = node; currentScopeFirstDeclarationsOfName = undefined; break; - case 226 /* ClassDeclaration */: - case 225 /* FunctionDeclaration */: + case 229 /* ClassDeclaration */: + case 228 /* FunctionDeclaration */: if (ts.hasModifier(node, 2 /* Ambient */)) { break; } @@ -45668,13 +49030,13 @@ var ts; */ function sourceElementVisitorWorker(node) { switch (node.kind) { - case 235 /* ImportDeclaration */: + case 238 /* ImportDeclaration */: return visitImportDeclaration(node); - case 234 /* ImportEqualsDeclaration */: + case 237 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 240 /* ExportAssignment */: + case 243 /* ExportAssignment */: return visitExportAssignment(node); - case 241 /* ExportDeclaration */: + case 244 /* ExportDeclaration */: return visitExportDeclaration(node); default: return visitorWorker(node); @@ -45694,11 +49056,11 @@ var ts; * @param node The node to visit. */ function namespaceElementVisitorWorker(node) { - if (node.kind === 241 /* ExportDeclaration */ || - node.kind === 235 /* ImportDeclaration */ || - node.kind === 236 /* ImportClause */ || - (node.kind === 234 /* ImportEqualsDeclaration */ && - node.moduleReference.kind === 245 /* ExternalModuleReference */)) { + if (node.kind === 244 /* ExportDeclaration */ || + node.kind === 238 /* ImportDeclaration */ || + node.kind === 239 /* ImportClause */ || + (node.kind === 237 /* ImportEqualsDeclaration */ && + node.moduleReference.kind === 248 /* ExternalModuleReference */)) { // do not emit ES6 imports and exports since they are illegal inside a namespace return undefined; } @@ -45728,19 +49090,19 @@ var ts; */ function classElementVisitorWorker(node) { switch (node.kind) { - case 150 /* Constructor */: + case 152 /* 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 147 /* PropertyDeclaration */: - case 155 /* IndexSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 149 /* MethodDeclaration */: + case 149 /* PropertyDeclaration */: + case 157 /* IndexSignature */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + case 151 /* MethodDeclaration */: // Fallback to the default visit behavior. return visitorWorker(node); - case 203 /* SemicolonClassElement */: + case 206 /* SemicolonClassElement */: return node; default: ts.Debug.failBadSyntaxKind(node); @@ -45751,7 +49113,7 @@ var ts; if (ts.modifierToFlag(node.kind) & 2270 /* TypeScriptModifier */) { return undefined; } - else if (currentNamespace && node.kind === 83 /* ExportKeyword */) { + else if (currentNamespace && node.kind === 84 /* ExportKeyword */) { return undefined; } return node; @@ -45768,59 +49130,59 @@ var ts; return ts.createNotEmittedStatement(node); } switch (node.kind) { - case 83 /* ExportKeyword */: - case 78 /* DefaultKeyword */: + case 84 /* ExportKeyword */: + case 79 /* DefaultKeyword */: // ES6 export and default modifiers are elided when inside a namespace. return currentNamespace ? undefined : node; - case 113 /* PublicKeyword */: - case 111 /* PrivateKeyword */: - case 112 /* ProtectedKeyword */: - case 116 /* AbstractKeyword */: - case 75 /* ConstKeyword */: - case 123 /* DeclareKeyword */: - case 130 /* ReadonlyKeyword */: + case 114 /* PublicKeyword */: + case 112 /* PrivateKeyword */: + case 113 /* ProtectedKeyword */: + case 117 /* AbstractKeyword */: + case 76 /* ConstKeyword */: + case 124 /* DeclareKeyword */: + case 131 /* ReadonlyKeyword */: // TypeScript accessibility and readonly modifiers are elided. - case 162 /* ArrayType */: - case 163 /* TupleType */: - case 161 /* TypeLiteral */: - case 156 /* TypePredicate */: - case 143 /* TypeParameter */: - case 118 /* AnyKeyword */: - case 121 /* BooleanKeyword */: - case 134 /* StringKeyword */: - case 132 /* NumberKeyword */: - case 129 /* NeverKeyword */: - case 104 /* VoidKeyword */: - case 135 /* SymbolKeyword */: - case 159 /* ConstructorType */: - case 158 /* FunctionType */: - case 160 /* TypeQuery */: - case 157 /* TypeReference */: - case 164 /* UnionType */: - case 165 /* IntersectionType */: - case 166 /* ParenthesizedType */: - case 167 /* ThisType */: - case 168 /* TypeOperator */: - case 169 /* IndexedAccessType */: - case 170 /* MappedType */: - case 171 /* LiteralType */: + case 164 /* ArrayType */: + case 165 /* TupleType */: + case 163 /* TypeLiteral */: + case 158 /* TypePredicate */: + case 145 /* TypeParameter */: + case 119 /* AnyKeyword */: + case 122 /* BooleanKeyword */: + case 136 /* StringKeyword */: + case 133 /* NumberKeyword */: + case 130 /* NeverKeyword */: + case 105 /* VoidKeyword */: + case 137 /* SymbolKeyword */: + case 161 /* ConstructorType */: + case 160 /* FunctionType */: + case 162 /* TypeQuery */: + case 159 /* TypeReference */: + case 166 /* UnionType */: + case 167 /* IntersectionType */: + case 168 /* ParenthesizedType */: + case 169 /* ThisType */: + case 170 /* TypeOperator */: + case 171 /* IndexedAccessType */: + case 172 /* MappedType */: + case 173 /* LiteralType */: // TypeScript type nodes are elided. - case 155 /* IndexSignature */: + case 157 /* IndexSignature */: // TypeScript index signatures are elided. - case 145 /* Decorator */: + case 147 /* Decorator */: // TypeScript decorators are elided. They will be emitted as part of visitClassDeclaration. - case 228 /* TypeAliasDeclaration */: + case 231 /* TypeAliasDeclaration */: // TypeScript type-only declarations are elided. - case 147 /* PropertyDeclaration */: + case 149 /* PropertyDeclaration */: // TypeScript property declarations are elided. return undefined; - case 150 /* Constructor */: + case 152 /* Constructor */: return visitConstructor(node); - case 227 /* InterfaceDeclaration */: + case 230 /* 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 226 /* ClassDeclaration */: + case 229 /* ClassDeclaration */: // This is a class declaration with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -45831,7 +49193,7 @@ var ts; // - index signatures // - method overload signatures return visitClassDeclaration(node); - case 197 /* ClassExpression */: + case 199 /* ClassExpression */: // This is a class expression with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -45842,35 +49204,35 @@ var ts; // - index signatures // - method overload signatures return visitClassExpression(node); - case 255 /* HeritageClause */: + case 259 /* HeritageClause */: // This is a heritage clause with TypeScript syntax extensions. // // TypeScript heritage clause extensions include: // - `implements` clause return visitHeritageClause(node); - case 199 /* ExpressionWithTypeArguments */: + case 201 /* ExpressionWithTypeArguments */: // TypeScript supports type arguments on an expression in an `extends` heritage clause. return visitExpressionWithTypeArguments(node); - case 149 /* MethodDeclaration */: + case 151 /* MethodDeclaration */: // TypeScript method declarations may have decorators, modifiers // or type annotations. return visitMethodDeclaration(node); - case 151 /* GetAccessor */: + case 153 /* GetAccessor */: // Get Accessors can have TypeScript modifiers, decorators, and type annotations. return visitGetAccessor(node); - case 152 /* SetAccessor */: + case 154 /* SetAccessor */: // Set Accessors can have TypeScript modifiers and type annotations. return visitSetAccessor(node); - case 225 /* FunctionDeclaration */: + case 228 /* FunctionDeclaration */: // Typescript function declarations can have modifiers, decorators, and type annotations. return visitFunctionDeclaration(node); - case 184 /* FunctionExpression */: + case 186 /* FunctionExpression */: // TypeScript function expressions can have modifiers and type annotations. return visitFunctionExpression(node); - case 185 /* ArrowFunction */: + case 187 /* ArrowFunction */: // TypeScript arrow functions can have modifiers and type annotations. return visitArrowFunction(node); - case 144 /* Parameter */: + case 146 /* Parameter */: // This is a parameter declaration with TypeScript syntax extensions. // // TypeScript parameter declaration syntax extensions include: @@ -45880,33 +49242,33 @@ var ts; // - type annotations // - this parameters return visitParameter(node); - case 183 /* ParenthesizedExpression */: + case 185 /* ParenthesizedExpression */: // ParenthesizedExpressions are TypeScript if their expression is a // TypeAssertion or AsExpression return visitParenthesizedExpression(node); - case 182 /* TypeAssertionExpression */: - case 200 /* AsExpression */: + case 184 /* TypeAssertionExpression */: + case 202 /* AsExpression */: // TypeScript type assertions are removed, but their subtrees are preserved. return visitAssertionExpression(node); - case 179 /* CallExpression */: + case 181 /* CallExpression */: return visitCallExpression(node); - case 180 /* NewExpression */: + case 182 /* NewExpression */: return visitNewExpression(node); - case 201 /* NonNullExpression */: + case 203 /* NonNullExpression */: // TypeScript non-null expressions are removed, but their subtrees are preserved. return visitNonNullExpression(node); - case 229 /* EnumDeclaration */: + case 232 /* EnumDeclaration */: // TypeScript enum declarations do not exist in ES6 and must be rewritten. return visitEnumDeclaration(node); - case 205 /* VariableStatement */: + case 208 /* VariableStatement */: // TypeScript namespace exports for variable statements must be transformed. return visitVariableStatement(node); - case 223 /* VariableDeclaration */: + case 226 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 230 /* ModuleDeclaration */: + case 233 /* ModuleDeclaration */: // TypeScript namespace declarations must be transformed. return visitModuleDeclaration(node); - case 234 /* ImportEqualsDeclaration */: + case 237 /* ImportEqualsDeclaration */: // TypeScript namespace or external module import. return visitImportEqualsDeclaration(node); default: @@ -45915,7 +49277,8 @@ var ts; } } function visitSourceFile(node) { - var alwaysStrict = compilerOptions.alwaysStrict && !(ts.isExternalModule(node) && moduleKind === ts.ModuleKind.ES2015); + var alwaysStrict = (compilerOptions.alwaysStrict === undefined ? compilerOptions.strict : compilerOptions.alwaysStrict) && + !(ts.isExternalModule(node) && moduleKind === ts.ModuleKind.ES2015); return ts.updateSourceFileNode(node, ts.visitLexicalEnvironment(node.statements, sourceElementVisitor, context, /*start*/ 0, alwaysStrict)); } /** @@ -45955,9 +49318,10 @@ var ts; // emit name if // - node has a name // - node has static initializers + // - node has a member that is decorated // var name = node.name; - if (!name && staticProperties.length > 0) { + if (!name && (staticProperties.length > 0 || ts.childIsDecorated(node))) { name = ts.getGeneratedNameForNode(node); } var classStatement = isDecoratedClass @@ -45993,7 +49357,7 @@ var ts; if (statements.length > 1) { // Add a DeclarationMarker as a marker for the end of the declaration statements.push(ts.createEndOfDeclarationMarker(node)); - ts.setEmitFlags(classStatement, ts.getEmitFlags(classStatement) | 2097152 /* HasEndOfDeclarationMarker */); + ts.setEmitFlags(classStatement, ts.getEmitFlags(classStatement) | 4194304 /* HasEndOfDeclarationMarker */); } return ts.singleOrMany(statements); } @@ -46011,13 +49375,14 @@ var ts; // } var classDeclaration = ts.createClassDeclaration( /*decorators*/ undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), name, - /*typeParameters*/ undefined, ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), transformClassMembers(node, hasExtendsClause), node); - var emitFlags = ts.getEmitFlags(node); + /*typeParameters*/ undefined, ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), transformClassMembers(node, hasExtendsClause)); // To better align with the old emitter, we should not emit a trailing source map // entry if the class has static properties. + var emitFlags = ts.getEmitFlags(node); if (hasStaticProperties) { emitFlags |= 32 /* NoTrailingSourceMap */; } + ts.setTextRange(classDeclaration, node); ts.setOriginalNode(classDeclaration, node); ts.setEmitFlags(classDeclaration, emitFlags); return classDeclaration; @@ -46125,12 +49490,18 @@ var ts; // } var heritageClauses = ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause); var members = transformClassMembers(node, hasExtendsClause); - var classExpression = ts.createClassExpression(/*modifiers*/ undefined, name, /*typeParameters*/ undefined, heritageClauses, members, location); + var classExpression = ts.createClassExpression(/*modifiers*/ undefined, name, /*typeParameters*/ undefined, heritageClauses, members); ts.setOriginalNode(classExpression, node); + ts.setTextRange(classExpression, location); // let ${name} = ${classExpression} where name is either declaredName if the class doesn't contain self-reference // or decoratedClassAlias if the class contain self-reference. - var statement = ts.createLetStatement(declName, classAlias ? ts.createAssignment(classAlias, classExpression) : classExpression, location); + var statement = ts.createVariableStatement( + /*modifiers*/ undefined, ts.createVariableDeclarationList([ + ts.createVariableDeclaration(declName, + /*type*/ undefined, classAlias ? ts.createAssignment(classAlias, classExpression) : classExpression) + ], 1 /* Let */)); ts.setOriginalNode(statement, node); + ts.setTextRange(statement, location); ts.setCommentRange(statement, node); return statement; } @@ -46146,11 +49517,12 @@ var ts; function visitClassExpression(node) { var staticProperties = getInitializedProperties(node, /*isStatic*/ true); var heritageClauses = ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause); - var members = transformClassMembers(node, ts.some(heritageClauses, function (c) { return c.token === 84 /* ExtendsKeyword */; })); - var classExpression = ts.setOriginalNode(ts.createClassExpression( + var members = transformClassMembers(node, ts.some(heritageClauses, function (c) { return c.token === 85 /* ExtendsKeyword */; })); + var classExpression = ts.createClassExpression( /*modifiers*/ undefined, node.name, - /*typeParameters*/ undefined, heritageClauses, members, - /*location*/ node), node); + /*typeParameters*/ undefined, heritageClauses, members); + ts.setOriginalNode(classExpression, node); + ts.setTextRange(classExpression, node); if (staticProperties.length > 0) { var expressions = []; var temp = ts.createTempVariable(hoistVariableDeclaration); @@ -46161,7 +49533,7 @@ var ts; } // To preserve the behavior of the old emitter, we explicitly indent // the body of a class with static initializers. - ts.setEmitFlags(classExpression, 32768 /* Indented */ | ts.getEmitFlags(classExpression)); + ts.setEmitFlags(classExpression, 65536 /* Indented */ | ts.getEmitFlags(classExpression)); expressions.push(ts.startOnNewLine(ts.createAssignment(temp, classExpression))); ts.addRange(expressions, generateInitializedPropertyExpressions(staticProperties, temp)); expressions.push(ts.startOnNewLine(temp)); @@ -46182,7 +49554,7 @@ var ts; members.push(constructor); } ts.addRange(members, ts.visitNodes(node.members, classElementVisitor, ts.isClassElement)); - return ts.createNodeArray(members, /*location*/ node.members); + return ts.setTextRange(ts.createNodeArray(members), /*location*/ node.members); } /** * Transforms (or creates) a constructor for a class. @@ -46207,10 +49579,9 @@ var ts; // constructor(${parameters}) { // ${body} // } - return ts.startOnNewLine(ts.setOriginalNode(ts.createConstructor( + return ts.startOnNewLine(ts.setOriginalNode(ts.setTextRange(ts.createConstructor( /*decorators*/ undefined, - /*modifiers*/ undefined, parameters, body, - /*location*/ constructor || node), constructor)); + /*modifiers*/ undefined, parameters, body), constructor || node), constructor)); } /** * Transforms (or creates) the parameters for the constructor of a class with @@ -46292,11 +49663,11 @@ var ts; ts.addRange(statements, ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, indexOfFirstStatement)); } // End the lexical environment. - ts.addRange(statements, endLexicalEnvironment()); - return ts.createBlock(ts.createNodeArray(statements, + statements = ts.mergeLexicalEnvironment(statements, endLexicalEnvironment()); + return ts.setTextRange(ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), /*location*/ constructor ? constructor.body.statements : node.members), - /*location*/ constructor ? constructor.body : undefined, - /*multiLine*/ true); + /*multiLine*/ true), + /*location*/ constructor ? constructor.body : undefined); } /** * Adds super call and preceding prologue directives into the list of statements. @@ -46308,13 +49679,13 @@ var ts; if (ctor.body) { var statements = ctor.body.statements; // add prologue directives to the list (if any) - var index = ts.addPrologueDirectives(result, statements, /*ensureUseStrict*/ false, visitor); + var index = ts.addPrologue(result, statements, /*ensureUseStrict*/ false, visitor); if (index === statements.length) { // list contains nothing but prologue directives (or empty) - exit return index; } var statement = statements[index]; - if (statement.kind === 207 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { + if (statement.kind === 210 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { result.push(ts.visitNode(statement, visitor, ts.isStatement)); return index + 1; } @@ -46351,9 +49722,7 @@ var ts; ts.setEmitFlags(propertyName, 1536 /* NoComments */ | 48 /* NoSourceMap */); var localName = ts.getMutableClone(name); ts.setEmitFlags(localName, 1536 /* NoComments */); - return ts.startOnNewLine(ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createThis(), propertyName, - /*location*/ node.name), localName), - /*location*/ ts.moveRangePos(node, -1))); + return ts.startOnNewLine(ts.setTextRange(ts.createStatement(ts.createAssignment(ts.setTextRange(ts.createPropertyAccess(ts.createThis(), propertyName), node.name), localName)), ts.moveRangePos(node, -1))); } /** * Gets all property declarations with initializers on either the static or instance side of a class. @@ -46387,7 +49756,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 === 147 /* PropertyDeclaration */ + return member.kind === 149 /* PropertyDeclaration */ && isStatic === ts.hasModifier(member, 32 /* Static */) && member.initializer !== undefined; } @@ -46398,8 +49767,8 @@ var ts; * @param receiver The receiver on which each property should be assigned. */ function addInitializedPropertyStatements(statements, properties, receiver) { - for (var _i = 0, properties_8 = properties; _i < properties_8.length; _i++) { - var property = properties_8[_i]; + for (var _i = 0, properties_9 = properties; _i < properties_9.length; _i++) { + var property = properties_9[_i]; var statement = ts.createStatement(transformInitializedProperty(property, receiver)); ts.setSourceMapRange(statement, ts.moveRangePastModifiers(property)); ts.setCommentRange(statement, property); @@ -46414,8 +49783,8 @@ var ts; */ function generateInitializedPropertyExpressions(properties, receiver) { var expressions = []; - for (var _i = 0, properties_9 = properties; _i < properties_9.length; _i++) { - var property = properties_9[_i]; + for (var _i = 0, properties_10 = properties; _i < properties_10.length; _i++) { + var property = properties_10[_i]; var expression = transformInitializedProperty(property, receiver); expression.startsOnNewLine = true; ts.setSourceMapRange(expression, ts.moveRangePastModifiers(property)); @@ -46522,12 +49891,12 @@ var ts; */ function getAllDecoratorsOfClassElement(node, member) { switch (member.kind) { - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: return getAllDecoratorsOfAccessors(node, member); - case 149 /* MethodDeclaration */: + case 151 /* MethodDeclaration */: return getAllDecoratorsOfMethod(member); - case 147 /* PropertyDeclaration */: + case 149 /* PropertyDeclaration */: return getAllDecoratorsOfProperty(member); default: return undefined; @@ -46680,7 +50049,7 @@ var ts; var prefix = getClassMemberPrefix(node, member); var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ true); var descriptor = languageVersion > 0 /* ES3 */ - ? member.kind === 147 /* PropertyDeclaration */ + ? member.kind === 149 /* PropertyDeclaration */ ? ts.createVoidZero() : ts.createNull() : undefined; @@ -46777,16 +50146,16 @@ var ts; if (compilerOptions.emitDecoratorMetadata) { var properties = void 0; if (shouldAddTypeMetadata(node)) { - (properties || (properties = [])).push(ts.createPropertyAssignment("type", ts.createArrowFunction(/*modifiers*/ undefined, /*typeParameters*/ undefined, [], /*type*/ undefined, ts.createToken(35 /* EqualsGreaterThanToken */), serializeTypeOfNode(node)))); + (properties || (properties = [])).push(ts.createPropertyAssignment("type", ts.createArrowFunction(/*modifiers*/ undefined, /*typeParameters*/ undefined, [], /*type*/ undefined, ts.createToken(36 /* EqualsGreaterThanToken */), serializeTypeOfNode(node)))); } if (shouldAddParamTypesMetadata(node)) { - (properties || (properties = [])).push(ts.createPropertyAssignment("paramTypes", ts.createArrowFunction(/*modifiers*/ undefined, /*typeParameters*/ undefined, [], /*type*/ undefined, ts.createToken(35 /* EqualsGreaterThanToken */), serializeParameterTypesOfNode(node, container)))); + (properties || (properties = [])).push(ts.createPropertyAssignment("paramTypes", ts.createArrowFunction(/*modifiers*/ undefined, /*typeParameters*/ undefined, [], /*type*/ undefined, ts.createToken(36 /* EqualsGreaterThanToken */), serializeParameterTypesOfNode(node, container)))); } if (shouldAddReturnTypeMetadata(node)) { - (properties || (properties = [])).push(ts.createPropertyAssignment("returnType", ts.createArrowFunction(/*modifiers*/ undefined, /*typeParameters*/ undefined, [], /*type*/ undefined, ts.createToken(35 /* EqualsGreaterThanToken */), serializeReturnTypeOfNode(node)))); + (properties || (properties = [])).push(ts.createPropertyAssignment("returnType", ts.createArrowFunction(/*modifiers*/ undefined, /*typeParameters*/ undefined, [], /*type*/ undefined, ts.createToken(36 /* EqualsGreaterThanToken */), serializeReturnTypeOfNode(node)))); } if (properties) { - decoratorExpressions.push(createMetadataHelper(context, "design:typeinfo", ts.createObjectLiteral(properties, /*location*/ undefined, /*multiLine*/ true))); + decoratorExpressions.push(createMetadataHelper(context, "design:typeinfo", ts.createObjectLiteral(properties, /*multiLine*/ true))); } } } @@ -46799,10 +50168,10 @@ var ts; */ function shouldAddTypeMetadata(node) { var kind = node.kind; - return kind === 149 /* MethodDeclaration */ - || kind === 151 /* GetAccessor */ - || kind === 152 /* SetAccessor */ - || kind === 147 /* PropertyDeclaration */; + return kind === 151 /* MethodDeclaration */ + || kind === 153 /* GetAccessor */ + || kind === 154 /* SetAccessor */ + || kind === 149 /* PropertyDeclaration */; } /** * Determines whether to emit the "design:returntype" metadata based on the node's kind. @@ -46812,7 +50181,7 @@ var ts; * @param node The node to test. */ function shouldAddReturnTypeMetadata(node) { - return node.kind === 149 /* MethodDeclaration */; + return node.kind === 151 /* MethodDeclaration */; } /** * Determines whether to emit the "design:paramtypes" metadata based on the node's kind. @@ -46823,12 +50192,12 @@ var ts; */ function shouldAddParamTypesMetadata(node) { switch (node.kind) { - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: + case 229 /* ClassDeclaration */: + case 199 /* ClassExpression */: return ts.getFirstConstructorWithBody(node) !== undefined; - case 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 151 /* MethodDeclaration */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: return true; } return false; @@ -46840,15 +50209,15 @@ var ts; */ function serializeTypeOfNode(node) { switch (node.kind) { - case 147 /* PropertyDeclaration */: - case 144 /* Parameter */: - case 151 /* GetAccessor */: + case 149 /* PropertyDeclaration */: + case 146 /* Parameter */: + case 153 /* GetAccessor */: return serializeTypeNode(node.type); - case 152 /* SetAccessor */: + case 154 /* SetAccessor */: return serializeTypeNode(ts.getSetAccessorTypeAnnotationNode(node)); - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: - case 149 /* MethodDeclaration */: + case 229 /* ClassDeclaration */: + case 199 /* ClassExpression */: + case 151 /* MethodDeclaration */: return ts.createIdentifier("Function"); default: return ts.createVoidZero(); @@ -46885,7 +50254,7 @@ var ts; return ts.createArrayLiteral(expressions); } function getParametersOfDecoratedDeclaration(node, container) { - if (container && node.kind === 151 /* GetAccessor */) { + if (container && node.kind === 153 /* GetAccessor */) { var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor; if (setAccessor) { return setAccessor.parameters; @@ -46902,7 +50271,7 @@ var ts; if (ts.isFunctionLike(node) && node.type) { return serializeTypeNode(node.type); } - else if (ts.isAsyncFunctionLike(node)) { + else if (ts.isAsyncFunction(node)) { return ts.createIdentifier("Promise"); } return ts.createVoidZero(); @@ -46930,56 +50299,58 @@ var ts; return ts.createIdentifier("Object"); } switch (node.kind) { - case 104 /* VoidKeyword */: - case 137 /* UndefinedKeyword */: - case 94 /* NullKeyword */: - case 129 /* NeverKeyword */: + case 105 /* VoidKeyword */: + case 139 /* UndefinedKeyword */: + case 95 /* NullKeyword */: + case 130 /* NeverKeyword */: return ts.createVoidZero(); - case 166 /* ParenthesizedType */: + case 168 /* ParenthesizedType */: return serializeTypeNode(node.type); - case 158 /* FunctionType */: - case 159 /* ConstructorType */: + case 160 /* FunctionType */: + case 161 /* ConstructorType */: return ts.createIdentifier("Function"); - case 162 /* ArrayType */: - case 163 /* TupleType */: + case 164 /* ArrayType */: + case 165 /* TupleType */: return ts.createIdentifier("Array"); - case 156 /* TypePredicate */: - case 121 /* BooleanKeyword */: + case 158 /* TypePredicate */: + case 122 /* BooleanKeyword */: return ts.createIdentifier("Boolean"); - case 134 /* StringKeyword */: + case 136 /* StringKeyword */: return ts.createIdentifier("String"); - case 171 /* LiteralType */: + case 134 /* ObjectKeyword */: + return ts.createIdentifier("Object"); + case 173 /* LiteralType */: switch (node.literal.kind) { case 9 /* StringLiteral */: return ts.createIdentifier("String"); case 8 /* NumericLiteral */: return ts.createIdentifier("Number"); - case 100 /* TrueKeyword */: - case 85 /* FalseKeyword */: + case 101 /* TrueKeyword */: + case 86 /* FalseKeyword */: return ts.createIdentifier("Boolean"); default: ts.Debug.failBadSyntaxKind(node.literal); break; } break; - case 132 /* NumberKeyword */: + case 133 /* NumberKeyword */: return ts.createIdentifier("Number"); - case 135 /* SymbolKeyword */: + case 137 /* SymbolKeyword */: return languageVersion < 2 /* ES2015 */ ? getGlobalSymbolNameWithFallback() : ts.createIdentifier("Symbol"); - case 157 /* TypeReference */: + case 159 /* TypeReference */: return serializeTypeReferenceNode(node); - case 165 /* IntersectionType */: - case 164 /* UnionType */: + case 167 /* IntersectionType */: + case 166 /* UnionType */: return serializeUnionOrIntersectionType(node); - case 160 /* TypeQuery */: - case 168 /* TypeOperator */: - case 169 /* IndexedAccessType */: - case 170 /* MappedType */: - case 161 /* TypeLiteral */: - case 118 /* AnyKeyword */: - case 167 /* ThisType */: + case 162 /* TypeQuery */: + case 170 /* TypeOperator */: + case 171 /* IndexedAccessType */: + case 172 /* MappedType */: + case 163 /* TypeLiteral */: + case 119 /* AnyKeyword */: + case 169 /* ThisType */: break; default: ts.Debug.failBadSyntaxKind(node); @@ -47064,18 +50435,18 @@ var ts; */ function serializeEntityNameAsExpression(node, useFallback) { switch (node.kind) { - case 70 /* Identifier */: + case 71 /* Identifier */: // Create a clone of the name with a new parent, and treat it as if it were // a source tree node for the purposes of the checker. - var name_32 = ts.getMutableClone(node); - name_32.flags &= ~8 /* Synthesized */; - name_32.original = undefined; - name_32.parent = currentScope; + var name = ts.getMutableClone(node); + name.flags &= ~8 /* Synthesized */; + name.original = undefined; + name.parent = currentScope; if (useFallback) { - return ts.createLogicalAnd(ts.createStrictInequality(ts.createTypeOf(name_32), ts.createLiteral("undefined")), name_32); + return ts.createLogicalAnd(ts.createStrictInequality(ts.createTypeOf(name), ts.createLiteral("undefined")), name); } - return name_32; - case 141 /* QualifiedName */: + return name; + case 143 /* QualifiedName */: return serializeQualifiedNameAsExpression(node, useFallback); } } @@ -47088,7 +50459,7 @@ var ts; */ function serializeQualifiedNameAsExpression(node, useFallback) { var left; - if (node.left.kind === 70 /* Identifier */) { + if (node.left.kind === 71 /* Identifier */) { left = serializeEntityNameAsExpression(node.left, useFallback); } else if (useFallback) { @@ -47143,7 +50514,7 @@ var ts; hoistVariableDeclaration(generatedName); expression = ts.createAssignment(generatedName, expression); } - return ts.setOriginalNode(ts.createComputedPropertyName(expression, /*location*/ name), name); + return ts.updateComputedPropertyName(name, expression); } else { return name; @@ -47159,9 +50530,9 @@ var ts; * @param node The HeritageClause to transform. */ function visitHeritageClause(node) { - if (node.token === 84 /* ExtendsKeyword */) { + if (node.token === 85 /* ExtendsKeyword */) { var types = ts.visitNodes(node.types, visitor, ts.isExpressionWithTypeArguments, 0, 1); - return ts.createHeritageClause(84 /* ExtendsKeyword */, types, node); + return ts.setTextRange(ts.createHeritageClause(85 /* ExtendsKeyword */, types), node); } return undefined; } @@ -47174,9 +50545,8 @@ var ts; * @param node The ExpressionWithTypeArguments to transform. */ function visitExpressionWithTypeArguments(node) { - var expression = ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression); - return ts.createExpressionWithTypeArguments( - /*typeArguments*/ undefined, expression, node); + return ts.updateExpressionWithTypeArguments(node, + /*typeArguments*/ undefined, ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression)); } /** * Determines whether to emit a function-like declaration. We should not emit the @@ -47191,7 +50561,7 @@ var ts; if (!shouldEmitFunctionLikeDeclaration(node)) { return undefined; } - return ts.visitEachChild(node, visitor, context); + return ts.updateConstructor(node, ts.visitNodes(node.decorators, visitor, ts.isDecorator), ts.visitNodes(node.modifiers, visitor, ts.isModifier), ts.visitParameterList(node.parameters, visitor, context), ts.visitFunctionBody(node.body, visitor, context)); } /** * Visits a method declaration of a class. @@ -47208,7 +50578,8 @@ var ts; return undefined; } var updated = ts.updateMethod(node, - /*decorators*/ undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), visitPropertyNameOfClassElement(node), + /*decorators*/ undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, visitPropertyNameOfClassElement(node), + /*questionToken*/ undefined, /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), /*type*/ undefined, ts.visitFunctionBody(node.body, visitor, context)); if (updated !== node) { @@ -47290,7 +50661,7 @@ var ts; return ts.createNotEmittedStatement(node); } var updated = ts.updateFunctionDeclaration(node, - /*decorators*/ undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.name, + /*decorators*/ undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, node.name, /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), /*type*/ undefined, ts.visitFunctionBody(node.body, visitor, context) || ts.createBlock([])); if (isNamespaceExport(node)) { @@ -47309,12 +50680,12 @@ var ts; * @param node The function expression node. */ function visitFunctionExpression(node) { - if (ts.nodeIsMissing(node.body)) { + if (!shouldEmitFunctionLikeDeclaration(node)) { return ts.createOmittedExpression(); } - var updated = ts.updateFunctionExpression(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.name, + var updated = ts.updateFunctionExpression(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, node.name, /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, ts.visitFunctionBody(node.body, visitor, context)); + /*type*/ undefined, ts.visitFunctionBody(node.body, visitor, context) || ts.createBlock([])); return updated; } /** @@ -47346,11 +50717,11 @@ var ts; /*decorators*/ undefined, /*modifiers*/ undefined, node.dotDotDotToken, ts.visitNode(node.name, visitor, ts.isBindingName), /*questionToken*/ undefined, - /*type*/ undefined, ts.visitNode(node.initializer, visitor, ts.isExpression), - /*location*/ ts.moveRangePastModifiers(node)); + /*type*/ undefined, ts.visitNode(node.initializer, visitor, ts.isExpression)); // While we emit the source map for the node after skipping decorators and modifiers, // we need to emit the comments for the original range. ts.setOriginalNode(parameter, node); + ts.setTextRange(parameter, ts.moveRangePastModifiers(node)); ts.setCommentRange(parameter, node); ts.setSourceMapRange(parameter, ts.moveRangePastModifiers(node)); ts.setEmitFlags(parameter.name, 32 /* NoTrailingSourceMap */); @@ -47369,8 +50740,7 @@ var ts; // elide statement if there are no initialized variables. return undefined; } - return ts.createStatement(ts.inlineExpressions(ts.map(variables, transformInitializedVariable)), - /*location*/ node); + return ts.setTextRange(ts.createStatement(ts.inlineExpressions(ts.map(variables, transformInitializedVariable))), node); } else { return ts.visitEachChild(node, visitor, context); @@ -47383,7 +50753,7 @@ var ts; /*needsValue*/ false, createNamespaceExportExpression); } else { - return ts.createAssignment(getNamespaceMemberNameWithSourceMapsAndWithoutComments(name), ts.visitNode(node.initializer, visitor, ts.isExpression), + return ts.setTextRange(ts.createAssignment(getNamespaceMemberNameWithSourceMapsAndWithoutComments(name), ts.visitNode(node.initializer, visitor, ts.isExpression)), /*location*/ node); } } @@ -47409,13 +50779,13 @@ var ts; // code if the casted expression has a lower precedence than the rest of the // expression. // + // To preserve comments, we return a "PartiallyEmittedExpression" here which will + // preserve the position information of the original expression. + // // Due to the auto-parenthesization rules used by the visitor and factory functions // we can safely elide the parentheses here, as a new synthetic // ParenthesizedExpression will be inserted if we remove parentheses too // aggressively. - // - // To preserve comments, we return a "PartiallyEmittedExpression" here which will - // preserve the position information of the original expression. return ts.createPartiallyEmittedExpression(expression, node); } return ts.visitEachChild(node, visitor, context); @@ -47497,9 +50867,9 @@ var ts; /*name*/ undefined, /*typeParameters*/ undefined, [ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, parameterName)], /*type*/ undefined, transformEnumBody(node, containerName)), - /*typeArguments*/ undefined, [moduleArg]), - /*location*/ node); + /*typeArguments*/ undefined, [moduleArg])); ts.setOriginalNode(enumStatement, node); + ts.setTextRange(enumStatement, node); ts.setEmitFlags(enumStatement, emitFlags); statements.push(enumStatement); // Add a DeclarationMarker for the enum to preserve trailing comments and mark @@ -47520,8 +50890,7 @@ var ts; ts.addRange(statements, ts.map(node.members, transformEnumMember)); ts.addRange(statements, endLexicalEnvironment()); currentNamespaceContainerName = savedCurrentNamespaceLocalName; - return ts.createBlock(ts.createNodeArray(statements, /*location*/ node.members), - /*location*/ undefined, + return ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), /*location*/ node.members), /*multiLine*/ true); } /** @@ -47534,9 +50903,7 @@ var ts; // we pass false as 'generateNameForComputedPropertyName' for a backward compatibility purposes // old emitter always generate 'expression' part of the name as-is. var name = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ false); - return ts.createStatement(ts.createAssignment(ts.createElementAccess(currentNamespaceContainerName, ts.createAssignment(ts.createElementAccess(currentNamespaceContainerName, name), transformEnumMemberDeclarationValue(member))), name, - /*location*/ member), - /*location*/ member); + return ts.setTextRange(ts.createStatement(ts.setTextRange(ts.createAssignment(ts.createElementAccess(currentNamespaceContainerName, ts.createAssignment(ts.createElementAccess(currentNamespaceContainerName, name), transformEnumMemberDeclarationValue(member))), name), member)), member); } /** * Transforms the value of an enum member. @@ -47589,8 +50956,8 @@ var ts; if (!currentScopeFirstDeclarationsOfName) { currentScopeFirstDeclarationsOfName = ts.createMap(); } - if (!(name in currentScopeFirstDeclarationsOfName)) { - currentScopeFirstDeclarationsOfName[name] = node; + if (!currentScopeFirstDeclarationsOfName.has(name)) { + currentScopeFirstDeclarationsOfName.set(name, node); } } } @@ -47600,9 +50967,9 @@ var ts; */ function isFirstEmittedDeclarationInScope(node) { if (currentScopeFirstDeclarationsOfName) { - var name_33 = node.symbol && node.symbol.name; - if (name_33) { - return currentScopeFirstDeclarationsOfName[name_33] === node; + var name = node.symbol && node.symbol.name; + if (name) { + return currentScopeFirstDeclarationsOfName.get(name) === node; } } return false; @@ -47619,7 +50986,7 @@ var ts; recordEmittedDeclarationInScope(node); if (isFirstEmittedDeclarationInScope(node)) { // Adjust the source map emit to match the old emitter. - if (node.kind === 229 /* EnumDeclaration */) { + if (node.kind === 232 /* EnumDeclaration */) { ts.setSourceMapRange(statement.declarationList, node); } else { @@ -47644,7 +51011,7 @@ var ts; // })(m1 || (m1 = {})); // trailing comment module // ts.setCommentRange(statement, node); - ts.setEmitFlags(statement, 1024 /* NoTrailingComments */ | 2097152 /* HasEndOfDeclarationMarker */); + ts.setEmitFlags(statement, 1024 /* NoTrailingComments */ | 4194304 /* HasEndOfDeclarationMarker */); statements.push(statement); return true; } @@ -47654,7 +51021,7 @@ var ts; // begin/end semantics of the declararation and to properly handle exports // we wrap the leading variable declaration in a `MergeDeclarationMarker`. var mergeMarker = ts.createMergeDeclarationMarker(statement); - ts.setEmitFlags(mergeMarker, 1536 /* NoComments */ | 2097152 /* HasEndOfDeclarationMarker */); + ts.setEmitFlags(mergeMarker, 1536 /* NoComments */ | 4194304 /* HasEndOfDeclarationMarker */); statements.push(mergeMarker); return false; } @@ -47711,9 +51078,9 @@ var ts; /*name*/ undefined, /*typeParameters*/ undefined, [ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, parameterName)], /*type*/ undefined, transformModuleBody(node, containerName)), - /*typeArguments*/ undefined, [moduleArg]), - /*location*/ node); + /*typeArguments*/ undefined, [moduleArg])); ts.setOriginalNode(moduleStatement, node); + ts.setTextRange(moduleStatement, node); ts.setEmitFlags(moduleStatement, emitFlags); statements.push(moduleStatement); // Add a DeclarationMarker for the namespace to preserve trailing comments and mark @@ -47738,7 +51105,7 @@ var ts; var statementsLocation; var blockLocation; var body = node.body; - if (body.kind === 231 /* ModuleBlock */) { + if (body.kind === 234 /* ModuleBlock */) { saveStateAndInvoke(body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); }); statementsLocation = body.statements; blockLocation = body; @@ -47760,10 +51127,10 @@ var ts; currentNamespaceContainerName = savedCurrentNamespaceContainerName; currentNamespace = savedCurrentNamespace; currentScopeFirstDeclarationsOfName = savedCurrentScopeFirstDeclarationsOfName; - var block = ts.createBlock(ts.createNodeArray(statements, + var block = ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), /*location*/ statementsLocation), - /*location*/ blockLocation, /*multiLine*/ true); + ts.setTextRange(block, blockLocation); // namespace hello.hi.world { // function foo() {} // @@ -47784,13 +51151,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 !== 231 /* ModuleBlock */) { + if (body.kind !== 234 /* ModuleBlock */) { ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536 /* NoComments */); } return block; } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 230 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 233 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -47807,7 +51174,7 @@ var ts; return node; } // Elide the declaration if the import clause was elided. - var importClause = ts.visitNode(node.importClause, visitImportClause, ts.isImportClause, /*optional*/ true); + var importClause = ts.visitNode(node.importClause, visitImportClause, ts.isImportClause); return importClause ? ts.updateImportDeclaration(node, /*decorators*/ undefined, @@ -47822,7 +51189,7 @@ var ts; function visitImportClause(node) { // Elide the import clause if we elide both its name and its named bindings. var name = resolver.isReferencedAliasDeclaration(node) ? node.name : undefined; - var namedBindings = ts.visitNode(node.namedBindings, visitNamedImportBindings, ts.isNamedImportBindings, /*optional*/ true); + var namedBindings = ts.visitNode(node.namedBindings, visitNamedImportBindings, ts.isNamedImportBindings); return (name || namedBindings) ? ts.updateImportClause(node, name, namedBindings) : undefined; } /** @@ -47831,7 +51198,7 @@ var ts; * @param node The named import bindings node. */ function visitNamedImportBindings(node) { - if (node.kind === 237 /* NamespaceImport */) { + if (node.kind === 240 /* NamespaceImport */) { // Elide a namespace import if it is not referenced. return resolver.isReferencedAliasDeclaration(node) ? node : undefined; } @@ -47878,7 +51245,7 @@ var ts; return undefined; } // Elide the export declaration if all of its named exports are elided. - var exportClause = ts.visitNode(node.exportClause, visitNamedExports, ts.isNamedExports, /*optional*/ true); + var exportClause = ts.visitNode(node.exportClause, visitNamedExports, ts.isNamedExports); return exportClause ? ts.updateExportDeclaration(node, /*decorators*/ undefined, @@ -47938,10 +51305,10 @@ var ts; if (isNamedExternalModuleExport(node) || !isNamespaceExport(node)) { // export var ${name} = ${moduleReference}; // var ${name} = ${moduleReference}; - return ts.setOriginalNode(ts.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.createVariableDeclarationList([ + return ts.setOriginalNode(ts.setTextRange(ts.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.createVariableDeclarationList([ ts.setOriginalNode(ts.createVariableDeclaration(node.name, /*type*/ undefined, moduleReference), node) - ]), node), node); + ])), node), node); } else { // exports.${name} = ${moduleReference}; @@ -47986,7 +51353,7 @@ var ts; * Creates a statement for the provided expression. This is used in calls to `map`. */ function expressionToStatement(expression) { - return ts.createStatement(expression, /*location*/ undefined); + return ts.createStatement(expression); } function addExportMemberAssignment(statements, node) { var expression = ts.createAssignment(ts.getExternalModuleOrNamespaceExportName(currentNamespaceContainerName, node, /*allowComments*/ false, /*allowSourceMaps*/ true), ts.getLocalName(node)); @@ -47996,10 +51363,10 @@ var ts; statements.push(statement); } function createNamespaceExport(exportName, exportValue, location) { - return ts.createStatement(ts.createAssignment(ts.getNamespaceMemberName(currentNamespaceContainerName, exportName, /*allowComments*/ false, /*allowSourceMaps*/ true), exportValue), location); + return ts.setTextRange(ts.createStatement(ts.createAssignment(ts.getNamespaceMemberName(currentNamespaceContainerName, exportName, /*allowComments*/ false, /*allowSourceMaps*/ true), exportValue)), location); } function createNamespaceExportExpression(exportName, exportValue, location) { - return ts.createAssignment(getNamespaceMemberNameWithSourceMapsAndWithoutComments(exportName), exportValue, location); + return ts.setTextRange(ts.createAssignment(getNamespaceMemberNameWithSourceMapsAndWithoutComments(exportName), exportValue), location); } function getNamespaceMemberNameWithSourceMapsAndWithoutComments(name) { return ts.getNamespaceMemberName(currentNamespaceContainerName, name, /*allowComments*/ false, /*allowSourceMaps*/ true); @@ -48027,7 +51394,7 @@ var ts; function getClassAliasIfNeeded(node) { if (resolver.getNodeCheckFlags(node) & 8388608 /* ClassWithConstructorReference */) { enableSubstitutionForClassAliases(); - var classAlias = ts.createUniqueName(node.name && !ts.isGeneratedIdentifier(node.name) ? node.name.text : "default"); + var classAlias = ts.createUniqueName(node.name && !ts.isGeneratedIdentifier(node.name) ? ts.unescapeIdentifier(node.name.text) : "default"); classAliases[ts.getOriginalNodeId(node)] = classAlias; hoistVariableDeclaration(classAlias); return classAlias; @@ -48044,7 +51411,7 @@ var ts; function enableSubstitutionForNonQualifiedEnumMembers() { if ((enabledSubstitutions & 8 /* NonQualifiedEnumMembers */) === 0) { enabledSubstitutions |= 8 /* NonQualifiedEnumMembers */; - context.enableSubstitution(70 /* Identifier */); + context.enableSubstitution(71 /* Identifier */); } } function enableSubstitutionForClassAliases() { @@ -48052,9 +51419,9 @@ var ts; enabledSubstitutions |= 1 /* ClassAliases */; // We need to enable substitutions for identifiers. This allows us to // substitute class names inside of a class declaration. - context.enableSubstitution(70 /* Identifier */); + context.enableSubstitution(71 /* Identifier */); // Keep track of class aliases. - classAliases = ts.createMap(); + classAliases = []; } } function enableSubstitutionForNamespaceExports() { @@ -48062,45 +51429,50 @@ var ts; enabledSubstitutions |= 2 /* NamespaceExports */; // 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(70 /* Identifier */); - context.enableSubstitution(258 /* ShorthandPropertyAssignment */); + context.enableSubstitution(71 /* Identifier */); + context.enableSubstitution(262 /* ShorthandPropertyAssignment */); // We need to be notified when entering and exiting namespaces. - context.enableEmitNotification(230 /* ModuleDeclaration */); + context.enableEmitNotification(233 /* ModuleDeclaration */); } } function isTransformedModuleDeclaration(node) { - return ts.getOriginalNode(node).kind === 230 /* ModuleDeclaration */; + return ts.getOriginalNode(node).kind === 233 /* ModuleDeclaration */; } function isTransformedEnumDeclaration(node) { - return ts.getOriginalNode(node).kind === 229 /* EnumDeclaration */; + return ts.getOriginalNode(node).kind === 232 /* EnumDeclaration */; } /** * Hook for node emit. * - * @param emitContext A context hint for the emitter. + * @param hint A hint as to the intended usage of the node. * @param node The node to emit. * @param emit A callback used to emit the node in the printer. */ - function onEmitNode(emitContext, node, emitCallback) { + function onEmitNode(hint, node, emitCallback) { var savedApplicableSubstitutions = applicableSubstitutions; + var savedCurrentSourceFile = currentSourceFile; + if (ts.isSourceFile(node)) { + currentSourceFile = node; + } if (enabledSubstitutions & 2 /* NamespaceExports */ && isTransformedModuleDeclaration(node)) { applicableSubstitutions |= 2 /* NamespaceExports */; } if (enabledSubstitutions & 8 /* NonQualifiedEnumMembers */ && isTransformedEnumDeclaration(node)) { applicableSubstitutions |= 8 /* NonQualifiedEnumMembers */; } - previousOnEmitNode(emitContext, node, emitCallback); + previousOnEmitNode(hint, node, emitCallback); applicableSubstitutions = savedApplicableSubstitutions; + currentSourceFile = savedCurrentSourceFile; } /** * Hooks node substitutions. * - * @param emitContext A context hint for the emitter. + * @param hint A hint as to the intended usage of the node. * @param node The node to substitute. */ - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (emitContext === 1 /* Expression */) { + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1 /* Expression */) { return substituteExpression(node); } else if (ts.isShorthandPropertyAssignment(node)) { @@ -48110,27 +51482,27 @@ var ts; } function substituteShorthandPropertyAssignment(node) { if (enabledSubstitutions & 2 /* NamespaceExports */) { - var name_34 = node.name; - var exportedName = trySubstituteNamespaceExportedName(name_34); + var name = node.name; + var exportedName = trySubstituteNamespaceExportedName(name); if (exportedName) { // A shorthand property with an assignment initializer is probably part of a // destructuring assignment if (node.objectAssignmentInitializer) { var initializer = ts.createAssignment(exportedName, node.objectAssignmentInitializer); - return ts.createPropertyAssignment(name_34, initializer, /*location*/ node); + return ts.setTextRange(ts.createPropertyAssignment(name, initializer), node); } - return ts.createPropertyAssignment(name_34, exportedName, /*location*/ node); + return ts.setTextRange(ts.createPropertyAssignment(name, exportedName), node); } } return node; } function substituteExpression(node) { switch (node.kind) { - case 70 /* Identifier */: + case 71 /* Identifier */: return substituteExpressionIdentifier(node); - case 177 /* PropertyAccessExpression */: + case 179 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 178 /* ElementAccessExpression */: + case 180 /* ElementAccessExpression */: return substituteElementAccessExpression(node); } return node; @@ -48168,11 +51540,12 @@ 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 !== 261 /* SourceFile */) { - var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 230 /* ModuleDeclaration */) || - (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 229 /* EnumDeclaration */); + if (container && container.kind !== 265 /* SourceFile */) { + var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 233 /* ModuleDeclaration */) || + (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 232 /* EnumDeclaration */); if (substitute) { - return ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node, /*location*/ node); + return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node), + /*location*/ node); } } } @@ -48187,16 +51560,15 @@ var ts; function substituteConstantValue(node) { var constantValue = tryGetConstEnumValue(node); if (constantValue !== undefined) { + // track the constant value on the node for the printer in needsDotDotForPropertyAccess + ts.setConstantValue(node, constantValue); var substitute = ts.createLiteral(constantValue); - ts.setSourceMapRange(substitute, node); - ts.setCommentRange(substitute, node); if (!compilerOptions.removeComments) { var propertyName = ts.isPropertyAccessExpression(node) ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); - substitute.trailingComment = " " + propertyName + " "; + ts.addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, " " + propertyName + " "); } - ts.setConstantValue(node, constantValue); return substitute; } return node; @@ -48211,25 +51583,25 @@ var ts; } } ts.transformTypeScript = transformTypeScript; - var paramHelper = { - name: "typescript:param", - scoped: false, - priority: 4, - text: "\n var __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n };" - }; - function createParamHelper(context, expression, parameterOffset, location) { - context.requestEmitHelper(paramHelper); - return ts.createCall(ts.getHelperName("__param"), - /*typeArguments*/ undefined, [ - ts.createLiteral(parameterOffset), - expression - ], location); + function createDecorateHelper(context, decoratorExpressions, target, memberName, descriptor, location) { + var argumentsArray = []; + argumentsArray.push(ts.createArrayLiteral(decoratorExpressions, /*multiLine*/ true)); + argumentsArray.push(target); + if (memberName) { + argumentsArray.push(memberName); + if (descriptor) { + argumentsArray.push(descriptor); + } + } + context.requestEmitHelper(decorateHelper); + return ts.setTextRange(ts.createCall(ts.getHelperName("__decorate"), + /*typeArguments*/ undefined, argumentsArray), location); } - var metadataHelper = { - name: "typescript:metadata", + var decorateHelper = { + name: "typescript:decorate", scoped: false, - priority: 3, - text: "\n var __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n };" + priority: 2, + text: "\n var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n };" }; function createMetadataHelper(context, metadataKey, metadataValue) { context.requestEmitHelper(metadataHelper); @@ -48239,33 +51611,397 @@ var ts; metadataValue ]); } - var decorateHelper = { - name: "typescript:decorate", + var metadataHelper = { + name: "typescript:metadata", scoped: false, - priority: 2, - text: "\n var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n };" + priority: 3, + text: "\n var __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n };" }; - function createDecorateHelper(context, decoratorExpressions, target, memberName, descriptor, location) { - context.requestEmitHelper(decorateHelper); - var argumentsArray = []; - argumentsArray.push(ts.createArrayLiteral(decoratorExpressions, /*location*/ undefined, /*multiLine*/ true)); - argumentsArray.push(target); - if (memberName) { - argumentsArray.push(memberName); - if (descriptor) { - argumentsArray.push(descriptor); - } - } - return ts.createCall(ts.getHelperName("__decorate"), /*typeArguments*/ undefined, argumentsArray, location); + function createParamHelper(context, expression, parameterOffset, location) { + context.requestEmitHelper(paramHelper); + return ts.setTextRange(ts.createCall(ts.getHelperName("__param"), + /*typeArguments*/ undefined, [ + ts.createLiteral(parameterOffset), + expression + ]), location); } + var paramHelper = { + name: "typescript:param", + scoped: false, + priority: 4, + text: "\n var __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n };" + }; })(ts || (ts = {})); /// /// /*@internal*/ var ts; (function (ts) { + var ES2017SubstitutionFlags; + (function (ES2017SubstitutionFlags) { + /** Enables substitutions for async methods with `super` calls. */ + ES2017SubstitutionFlags[ES2017SubstitutionFlags["AsyncMethodsWithSuper"] = 1] = "AsyncMethodsWithSuper"; + })(ES2017SubstitutionFlags || (ES2017SubstitutionFlags = {})); + function transformES2017(context) { + var startLexicalEnvironment = context.startLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment; + var resolver = context.getEmitResolver(); + var compilerOptions = context.getCompilerOptions(); + var languageVersion = ts.getEmitScriptTarget(compilerOptions); + // These variables contain state that changes as we descend into the tree. + var currentSourceFile; + /** + * Keeps track of whether expression substitution has been enabled for specific edge cases. + * They are persisted between each SourceFile transformation and should not be reset. + */ + var enabledSubstitutions; + /** + * This keeps track of containers where `super` is valid, for use with + * just-in-time substitution for `super` expressions inside of async methods. + */ + var enclosingSuperContainerFlags = 0; + // Save the previous transformation hooks. + var previousOnEmitNode = context.onEmitNode; + var previousOnSubstituteNode = context.onSubstituteNode; + // Set new transformation hooks. + context.onEmitNode = onEmitNode; + context.onSubstituteNode = onSubstituteNode; + return transformSourceFile; + function transformSourceFile(node) { + if (ts.isDeclarationFile(node)) { + return node; + } + currentSourceFile = node; + var visited = ts.visitEachChild(node, visitor, context); + ts.addEmitHelpers(visited, context.readEmitHelpers()); + currentSourceFile = undefined; + return visited; + } + function visitor(node) { + if ((node.transformFlags & 16 /* ContainsES2017 */) === 0) { + return node; + } + switch (node.kind) { + case 120 /* AsyncKeyword */: + // ES2017 async modifier should be elided for targets < ES2017 + return undefined; + case 191 /* AwaitExpression */: + return visitAwaitExpression(node); + case 151 /* MethodDeclaration */: + return visitMethodDeclaration(node); + case 228 /* FunctionDeclaration */: + return visitFunctionDeclaration(node); + case 186 /* FunctionExpression */: + return visitFunctionExpression(node); + case 187 /* ArrowFunction */: + return visitArrowFunction(node); + default: + return ts.visitEachChild(node, visitor, context); + } + } + /** + * Visits an AwaitExpression node. + * + * This function will be called any time a ES2017 await expression is encountered. + * + * @param node The node to visit. + */ + function visitAwaitExpression(node) { + return ts.setOriginalNode(ts.setTextRange(ts.createYield( + /*asteriskToken*/ undefined, ts.visitNode(node.expression, visitor, ts.isExpression)), node), node); + } + /** + * Visits a MethodDeclaration node. + * + * This function will be called when one of the following conditions are met: + * - The node is marked as async + * + * @param node The node to visit. + */ + function visitMethodDeclaration(node) { + return ts.updateMethod(node, + /*decorators*/ undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, node.name, + /*questionToken*/ undefined, + /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), + /*type*/ undefined, ts.getFunctionFlags(node) & 2 /* Async */ + ? transformAsyncFunctionBody(node) + : ts.visitFunctionBody(node.body, visitor, context)); + } + /** + * Visits a FunctionDeclaration node. + * + * This function will be called when one of the following conditions are met: + * - The node is marked async + * + * @param node The node to visit. + */ + function visitFunctionDeclaration(node) { + return ts.updateFunctionDeclaration(node, + /*decorators*/ undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, node.name, + /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), + /*type*/ undefined, ts.getFunctionFlags(node) & 2 /* Async */ + ? transformAsyncFunctionBody(node) + : ts.visitFunctionBody(node.body, visitor, context)); + } + /** + * Visits a FunctionExpression node. + * + * This function will be called when one of the following conditions are met: + * - The node is marked async + * + * @param node The node to visit. + */ + function visitFunctionExpression(node) { + return ts.updateFunctionExpression(node, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, node.name, + /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), + /*type*/ undefined, ts.getFunctionFlags(node) & 2 /* Async */ + ? transformAsyncFunctionBody(node) + : ts.visitFunctionBody(node.body, visitor, context)); + } + /** + * Visits an ArrowFunction. + * + * This function will be called when one of the following conditions are met: + * - The node is marked async + * + * @param node The node to visit. + */ + function visitArrowFunction(node) { + return ts.updateArrowFunction(node, ts.visitNodes(node.modifiers, visitor, ts.isModifier), + /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), + /*type*/ undefined, ts.getFunctionFlags(node) & 2 /* Async */ + ? transformAsyncFunctionBody(node) + : ts.visitFunctionBody(node.body, visitor, context)); + } + function transformAsyncFunctionBody(node) { + resumeLexicalEnvironment(); + var original = ts.getOriginalNode(node, ts.isFunctionLike); + var nodeType = original.type; + var promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : undefined; + var isArrowFunction = node.kind === 187 /* 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 + // `this` and `arguments` objects to `__awaiter`. The generator function + // passed to `__awaiter` is executed inside of the callback to the + // promise constructor. + if (!isArrowFunction) { + var statements = []; + var statementOffset = ts.addPrologue(statements, node.body.statements, /*ensureUseStrict*/ false, visitor); + statements.push(ts.createReturn(createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body, statementOffset)))); + ts.addRange(statements, endLexicalEnvironment()); + var block = ts.createBlock(statements, /*multiLine*/ true); + ts.setTextRange(block, node.body); + // Minor optimization, emit `_super` helper to capture `super` access in an arrow. + // This step isn't needed if we eventually transform this to ES5. + if (languageVersion >= 2 /* ES2015 */) { + if (resolver.getNodeCheckFlags(node) & 4096 /* AsyncMethodWithSuperBinding */) { + enableSubstitutionForAsyncMethodsWithSuper(); + ts.addEmitHelper(block, ts.advancedAsyncSuperHelper); + } + else if (resolver.getNodeCheckFlags(node) & 2048 /* AsyncMethodWithSuper */) { + enableSubstitutionForAsyncMethodsWithSuper(); + ts.addEmitHelper(block, ts.asyncSuperHelper); + } + } + return block; + } + else { + var expression = createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body)); + var declarations = endLexicalEnvironment(); + if (ts.some(declarations)) { + var block = ts.convertToFunctionBody(expression); + return ts.updateBlock(block, ts.setTextRange(ts.createNodeArray(ts.concatenate(block.statements, declarations)), block.statements)); + } + return expression; + } + } + function transformFunctionBodyWorker(body, start) { + if (ts.isBlock(body)) { + return ts.updateBlock(body, ts.visitLexicalEnvironment(body.statements, visitor, context, start)); + } + else { + startLexicalEnvironment(); + var visited = ts.convertToFunctionBody(ts.visitNode(body, visitor, ts.isConciseBody)); + var declarations = endLexicalEnvironment(); + return ts.updateBlock(visited, ts.setTextRange(ts.createNodeArray(ts.concatenate(visited.statements, declarations)), visited.statements)); + } + } + function getPromiseConstructor(type) { + var typeName = type && ts.getEntityNameFromTypeNode(type); + if (typeName && ts.isEntityName(typeName)) { + var serializationKind = resolver.getTypeReferenceSerializationKind(typeName); + if (serializationKind === ts.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue + || serializationKind === ts.TypeReferenceSerializationKind.Unknown) { + return typeName; + } + } + return undefined; + } + function enableSubstitutionForAsyncMethodsWithSuper() { + if ((enabledSubstitutions & 1 /* AsyncMethodsWithSuper */) === 0) { + enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; + // We need to enable substitutions for call, property access, and element access + // if we need to rewrite super calls. + context.enableSubstitution(181 /* CallExpression */); + context.enableSubstitution(179 /* PropertyAccessExpression */); + context.enableSubstitution(180 /* ElementAccessExpression */); + // We need to be notified when entering and exiting declarations that bind super. + context.enableEmitNotification(229 /* ClassDeclaration */); + context.enableEmitNotification(151 /* MethodDeclaration */); + context.enableEmitNotification(153 /* GetAccessor */); + context.enableEmitNotification(154 /* SetAccessor */); + context.enableEmitNotification(152 /* Constructor */); + } + } + /** + * Hook for node emit. + * + * @param hint A hint as to the intended usage of the node. + * @param node The node to emit. + * @param emit A callback used to emit the node in the printer. + */ + function onEmitNode(hint, node, emitCallback) { + // If we need to support substitutions for `super` in an async method, + // we should track it here. + if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */ && isSuperContainer(node)) { + var superContainerFlags = resolver.getNodeCheckFlags(node) & (2048 /* AsyncMethodWithSuper */ | 4096 /* AsyncMethodWithSuperBinding */); + if (superContainerFlags !== enclosingSuperContainerFlags) { + var savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags; + enclosingSuperContainerFlags = superContainerFlags; + previousOnEmitNode(hint, node, emitCallback); + enclosingSuperContainerFlags = savedEnclosingSuperContainerFlags; + return; + } + } + previousOnEmitNode(hint, node, emitCallback); + } + /** + * Hooks node substitutions. + * + * @param hint A hint as to the intended usage of the node. + * @param node The node to substitute. + */ + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1 /* Expression */ && enclosingSuperContainerFlags) { + return substituteExpression(node); + } + return node; + } + function substituteExpression(node) { + switch (node.kind) { + case 179 /* PropertyAccessExpression */: + return substitutePropertyAccessExpression(node); + case 180 /* ElementAccessExpression */: + return substituteElementAccessExpression(node); + case 181 /* CallExpression */: + return substituteCallExpression(node); + } + return node; + } + function substitutePropertyAccessExpression(node) { + if (node.expression.kind === 97 /* SuperKeyword */) { + return createSuperAccessInAsyncMethod(ts.createLiteral(node.name.text), node); + } + return node; + } + function substituteElementAccessExpression(node) { + if (node.expression.kind === 97 /* SuperKeyword */) { + return createSuperAccessInAsyncMethod(node.argumentExpression, node); + } + return node; + } + function substituteCallExpression(node) { + var expression = node.expression; + if (ts.isSuperProperty(expression)) { + var argumentExpression = ts.isPropertyAccessExpression(expression) + ? substitutePropertyAccessExpression(expression) + : substituteElementAccessExpression(expression); + return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"), + /*typeArguments*/ undefined, [ + ts.createThis() + ].concat(node.arguments)); + } + return node; + } + function isSuperContainer(node) { + var kind = node.kind; + return kind === 229 /* ClassDeclaration */ + || kind === 152 /* Constructor */ + || kind === 151 /* MethodDeclaration */ + || kind === 153 /* GetAccessor */ + || kind === 154 /* SetAccessor */; + } + function createSuperAccessInAsyncMethod(argumentExpression, location) { + if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { + return ts.setTextRange(ts.createPropertyAccess(ts.createCall(ts.createIdentifier("_super"), + /*typeArguments*/ undefined, [argumentExpression]), "value"), location); + } + else { + return ts.setTextRange(ts.createCall(ts.createIdentifier("_super"), + /*typeArguments*/ undefined, [argumentExpression]), location); + } + } + } + ts.transformES2017 = transformES2017; + var awaiterHelper = { + name: "typescript:awaiter", + scoped: false, + priority: 5, + text: "\n var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n };" + }; + function createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, body) { + context.requestEmitHelper(awaiterHelper); + var generatorFunc = ts.createFunctionExpression( + /*modifiers*/ undefined, ts.createToken(39 /* AsteriskToken */), + /*name*/ undefined, + /*typeParameters*/ undefined, + /*parameters*/ [], + /*type*/ undefined, body); + // Mark this node as originally an async function + (generatorFunc.emitNode || (generatorFunc.emitNode = {})).flags |= 262144 /* AsyncFunctionBody */; + return ts.createCall(ts.getHelperName("__awaiter"), + /*typeArguments*/ undefined, [ + ts.createThis(), + hasLexicalArguments ? ts.createIdentifier("arguments") : ts.createVoidZero(), + promiseConstructor ? ts.createExpressionFromEntityName(promiseConstructor) : ts.createVoidZero(), + generatorFunc + ]); + } + ts.asyncSuperHelper = { + name: "typescript:async-super", + scoped: true, + text: "\n const _super = name => super[name];\n " + }; + ts.advancedAsyncSuperHelper = { + name: "typescript:advanced-async-super", + scoped: true, + text: "\n const _super = (function (geti, seti) {\n const cache = Object.create(null);\n return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } });\n })(name => super[name], (name, value) => super[name] = value);\n " + }; +})(ts || (ts = {})); +/// +/// +/// +/*@internal*/ +var ts; +(function (ts) { + var ESNextSubstitutionFlags; + (function (ESNextSubstitutionFlags) { + /** Enables substitutions for async methods with `super` calls. */ + ESNextSubstitutionFlags[ESNextSubstitutionFlags["AsyncMethodsWithSuper"] = 1] = "AsyncMethodsWithSuper"; + })(ESNextSubstitutionFlags || (ESNextSubstitutionFlags = {})); function transformESNext(context) { - var resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment; + var resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration; + var resolver = context.getEmitResolver(); + var compilerOptions = context.getCompilerOptions(); + var languageVersion = ts.getEmitScriptTarget(compilerOptions); + var previousOnEmitNode = context.onEmitNode; + context.onEmitNode = onEmitNode; + var previousOnSubstituteNode = context.onSubstituteNode; + context.onSubstituteNode = onSubstituteNode; + var enabledSubstitutions; + var enclosingFunctionFlags; + var enclosingSuperContainerFlags = 0; return transformSourceFile; function transformSourceFile(node) { if (ts.isDeclarationFile(node)) { @@ -48281,53 +52017,89 @@ var ts; function visitorNoDestructuringValue(node) { return visitorWorker(node, /*noDestructuringValue*/ true); } + function visitorNoAsyncModifier(node) { + if (node.kind === 120 /* AsyncKeyword */) { + return undefined; + } + return node; + } function visitorWorker(node, noDestructuringValue) { if ((node.transformFlags & 8 /* ContainsESNext */) === 0) { return node; } switch (node.kind) { - case 176 /* ObjectLiteralExpression */: + case 191 /* AwaitExpression */: + return visitAwaitExpression(node); + case 197 /* YieldExpression */: + return visitYieldExpression(node); + case 222 /* LabeledStatement */: + return visitLabeledStatement(node); + case 178 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 192 /* BinaryExpression */: + case 194 /* BinaryExpression */: return visitBinaryExpression(node, noDestructuringValue); - case 223 /* VariableDeclaration */: + case 226 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 213 /* ForOfStatement */: - return visitForOfStatement(node); - case 211 /* ForStatement */: + case 216 /* ForOfStatement */: + return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); + case 214 /* ForStatement */: return visitForStatement(node); - case 188 /* VoidExpression */: + case 190 /* VoidExpression */: return visitVoidExpression(node); - case 150 /* Constructor */: + case 152 /* Constructor */: return visitConstructorDeclaration(node); - case 149 /* MethodDeclaration */: + case 151 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 151 /* GetAccessor */: + case 153 /* GetAccessor */: return visitGetAccessorDeclaration(node); - case 152 /* SetAccessor */: + case 154 /* SetAccessor */: return visitSetAccessorDeclaration(node); - case 225 /* FunctionDeclaration */: + case 228 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 184 /* FunctionExpression */: + case 186 /* FunctionExpression */: return visitFunctionExpression(node); - case 185 /* ArrowFunction */: + case 187 /* ArrowFunction */: return visitArrowFunction(node); - case 144 /* Parameter */: + case 146 /* Parameter */: return visitParameter(node); - case 207 /* ExpressionStatement */: + case 210 /* ExpressionStatement */: return visitExpressionStatement(node); - case 183 /* ParenthesizedExpression */: + case 185 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, noDestructuringValue); default: return ts.visitEachChild(node, visitor, context); } } + function visitAwaitExpression(node) { + if (enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */) { + return ts.setOriginalNode(ts.setTextRange(ts.createYield(createAwaitHelper(context, ts.visitNode(node.expression, visitor, ts.isExpression))), + /*location*/ node), node); + } + return ts.visitEachChild(node, visitor, context); + } + function visitYieldExpression(node) { + if (enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */ && node.asteriskToken) { + var expression = ts.visitNode(node.expression, visitor, ts.isExpression); + return ts.setOriginalNode(ts.setTextRange(ts.createYield(createAwaitHelper(context, ts.updateYield(node, node.asteriskToken, createAsyncDelegatorHelper(context, createAsyncValuesHelper(context, expression, expression), expression)))), node), node); + } + return ts.visitEachChild(node, visitor, context); + } + function visitLabeledStatement(node) { + if (enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */) { + var statement = ts.unwrapInnermostStatementOfLabel(node); + if (statement.kind === 216 /* ForOfStatement */ && statement.awaitModifier) { + return visitForOfStatement(statement, node); + } + return ts.restoreEnclosingLabel(ts.visitEachChild(node, visitor, context), node); + } + return ts.visitEachChild(node, visitor, context); + } function chunkObjectLiteralElements(elements) { var chunkObject; var objects = []; - for (var _i = 0, elements_3 = elements; _i < elements_3.length; _i++) { - var e = elements_3[_i]; - if (e.kind === 259 /* SpreadAssignment */) { + for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) { + var e = elements_4[_i]; + if (e.kind === 263 /* SpreadAssignment */) { if (chunkObject) { objects.push(ts.createObjectLiteral(chunkObject)); chunkObject = undefined; @@ -48339,7 +52111,7 @@ var ts; if (!chunkObject) { chunkObject = []; } - if (e.kind === 257 /* PropertyAssignment */) { + if (e.kind === 261 /* PropertyAssignment */) { var p = e; chunkObject.push(ts.createPropertyAssignment(p.name, ts.visitNode(p.initializer, visitor, ts.isExpression))); } @@ -48361,7 +52133,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 !== 176 /* ObjectLiteralExpression */) { + if (objects.length && objects[0].kind !== 178 /* ObjectLiteralExpression */) { objects.unshift(ts.createObjectLiteral()); } return createAssignHelper(context, objects); @@ -48383,7 +52155,7 @@ var ts; if (ts.isDestructuringAssignment(node) && node.left.transformFlags & 1048576 /* ContainsObjectRest */) { return ts.flattenDestructuringAssignment(node, visitor, context, 1 /* ObjectRest */, !noDestructuringValue); } - else if (node.operatorToken.kind === 25 /* CommaToken */) { + else if (node.operatorToken.kind === 26 /* CommaToken */) { return ts.updateBinary(node, ts.visitNode(node.left, visitorNoDestructuringValue, ts.isExpression), ts.visitNode(node.right, noDestructuringValue ? visitorNoDestructuringValue : visitor, ts.isExpression)); } return ts.visitEachChild(node, visitor, context); @@ -48411,41 +52183,95 @@ var ts; * * @param node A ForOfStatement. */ - function visitForOfStatement(node) { - var leadingStatements; - var temp; - var initializer = ts.skipParentheses(node.initializer); - if (initializer.transformFlags & 1048576 /* ContainsObjectRest */) { - if (ts.isVariableDeclarationList(initializer)) { - temp = ts.createTempVariable(/*recordTempVariable*/ undefined); - var firstDeclaration = ts.firstOrUndefined(initializer.declarations); - var declarations = ts.flattenDestructuringBinding(firstDeclaration, visitor, context, 1 /* ObjectRest */, temp, - /*doNotRecordTempVariablesInLine*/ false, - /*skipInitializer*/ true); - if (ts.some(declarations)) { - var statement = ts.createVariableStatement( - /*modifiers*/ undefined, ts.updateVariableDeclarationList(initializer, declarations), - /*location*/ initializer); - leadingStatements = ts.append(leadingStatements, statement); - } - } - else if (ts.isAssignmentPattern(initializer)) { - temp = ts.createTempVariable(/*recordTempVariable*/ undefined); - var expression = ts.flattenDestructuringAssignment(ts.aggregateTransformFlags(ts.createAssignment(initializer, temp, /*location*/ node.initializer)), visitor, context, 1 /* ObjectRest */); - leadingStatements = ts.append(leadingStatements, ts.createStatement(expression, /*location*/ node.initializer)); - } + function visitForOfStatement(node, outermostLabeledStatement) { + if (node.initializer.transformFlags & 1048576 /* ContainsObjectRest */) { + node = transformForOfStatementWithObjectRest(node); } - if (temp) { - var expression = ts.visitNode(node.expression, visitor, ts.isExpression); - var statement = ts.visitNode(node.statement, visitor, ts.isStatement); - var block = ts.isBlock(statement) - ? ts.updateBlock(statement, ts.createNodeArray(ts.concatenate(leadingStatements, statement.statements), statement.statements)) - : ts.createBlock(ts.append(leadingStatements, statement), statement, /*multiLine*/ true); - return ts.updateForOf(node, ts.createVariableDeclarationList([ - ts.createVariableDeclaration(temp, /*type*/ undefined, /*initializer*/ undefined, node.initializer) - ], node.initializer, 1 /* Let */), expression, block); + if (node.awaitModifier) { + return transformForAwaitOfStatement(node, outermostLabeledStatement); } - return ts.visitEachChild(node, visitor, context); + else { + return ts.restoreEnclosingLabel(ts.visitEachChild(node, visitor, context), outermostLabeledStatement); + } + } + function transformForOfStatementWithObjectRest(node) { + var initializerWithoutParens = ts.skipParentheses(node.initializer); + if (ts.isVariableDeclarationList(initializerWithoutParens) || ts.isAssignmentPattern(initializerWithoutParens)) { + var bodyLocation = void 0; + var statementsLocation = void 0; + var temp = ts.createTempVariable(/*recordTempVariable*/ undefined); + var statements = [ts.createForOfBindingStatement(initializerWithoutParens, temp)]; + if (ts.isBlock(node.statement)) { + ts.addRange(statements, node.statement.statements); + bodyLocation = node.statement; + statementsLocation = node.statement.statements; + } + return ts.updateForOf(node, node.awaitModifier, ts.setTextRange(ts.createVariableDeclarationList([ + ts.setTextRange(ts.createVariableDeclaration(temp), node.initializer) + ], 1 /* Let */), node.initializer), node.expression, ts.setTextRange(ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), statementsLocation), + /*multiLine*/ true), bodyLocation)); + } + return node; + } + function convertForOfStatementHead(node, boundValue) { + var binding = ts.createForOfBindingStatement(node.initializer, boundValue); + var bodyLocation; + var statementsLocation; + var statements = [ts.visitNode(binding, visitor, ts.isStatement)]; + var statement = ts.visitNode(node.statement, visitor, ts.isStatement); + if (ts.isBlock(statement)) { + ts.addRange(statements, statement.statements); + bodyLocation = statement; + statementsLocation = statement.statements; + } + else { + statements.push(statement); + } + return ts.setEmitFlags(ts.setTextRange(ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), statementsLocation), + /*multiLine*/ true), bodyLocation), 48 /* NoSourceMap */ | 384 /* NoTokenSourceMaps */); + } + function awaitAsYield(expression) { + return ts.createYield(/*asteriskToken*/ undefined, enclosingFunctionFlags & 1 /* Generator */ ? createAwaitHelper(context, expression) : expression); + } + function transformForAwaitOfStatement(node, outermostLabeledStatement) { + var expression = ts.visitNode(node.expression, visitor, ts.isExpression); + var iterator = ts.isIdentifier(expression) ? ts.getGeneratedNameForNode(expression) : ts.createTempVariable(/*recordTempVariable*/ undefined); + var result = ts.isIdentifier(expression) ? ts.getGeneratedNameForNode(iterator) : ts.createTempVariable(/*recordTempVariable*/ undefined); + var errorRecord = ts.createUniqueName("e"); + var catchVariable = ts.getGeneratedNameForNode(errorRecord); + var returnMethod = ts.createTempVariable(/*recordTempVariable*/ undefined); + var callValues = createAsyncValuesHelper(context, expression, /*location*/ node.expression); + var callNext = ts.createCall(ts.createPropertyAccess(iterator, "next"), /*typeArguments*/ undefined, []); + var getDone = ts.createPropertyAccess(result, "done"); + var getValue = ts.createPropertyAccess(result, "value"); + var callReturn = ts.createFunctionCall(returnMethod, iterator, []); + hoistVariableDeclaration(errorRecord); + hoistVariableDeclaration(returnMethod); + var forStatement = ts.setEmitFlags(ts.setTextRange(ts.createFor( + /*initializer*/ ts.setEmitFlags(ts.setTextRange(ts.createVariableDeclarationList([ + ts.setTextRange(ts.createVariableDeclaration(iterator, /*type*/ undefined, callValues), node.expression), + ts.createVariableDeclaration(result) + ]), node.expression), 2097152 /* NoHoisting */), + /*condition*/ ts.createComma(ts.createAssignment(result, awaitAsYield(callNext)), ts.createLogicalNot(getDone)), + /*incrementor*/ undefined, + /*statement*/ convertForOfStatementHead(node, awaitAsYield(getValue))), + /*location*/ node), 256 /* NoTokenTrailingSourceMaps */); + return ts.createTry(ts.createBlock([ + ts.restoreEnclosingLabel(forStatement, outermostLabeledStatement) + ]), ts.createCatchClause(ts.createVariableDeclaration(catchVariable), ts.setEmitFlags(ts.createBlock([ + ts.createStatement(ts.createAssignment(errorRecord, ts.createObjectLiteral([ + ts.createPropertyAssignment("error", catchVariable) + ]))) + ]), 1 /* SingleLine */)), ts.createBlock([ + ts.createTry( + /*tryBlock*/ ts.createBlock([ + ts.setEmitFlags(ts.createIf(ts.createLogicalAnd(ts.createLogicalAnd(result, ts.createLogicalNot(getDone)), ts.createAssignment(returnMethod, ts.createPropertyAccess(iterator, "return"))), ts.createStatement(awaitAsYield(callReturn))), 1 /* SingleLine */) + ]), + /*catchClause*/ undefined, + /*finallyBlock*/ ts.setEmitFlags(ts.createBlock([ + ts.setEmitFlags(ts.createIf(errorRecord, ts.createThrow(ts.createPropertyAccess(errorRecord, "error"))), 1 /* SingleLine */) + ]), 1 /* SingleLine */)) + ])); } function visitParameter(node) { if (node.transformFlags & 1048576 /* ContainsObjectRest */) { @@ -48454,48 +52280,137 @@ var ts; return ts.updateParameter(node, /*decorators*/ undefined, /*modifiers*/ undefined, node.dotDotDotToken, ts.getGeneratedNameForNode(node), + /*questionToken*/ undefined, /*type*/ undefined, ts.visitNode(node.initializer, visitor, ts.isExpression)); } return ts.visitEachChild(node, visitor, context); } function visitConstructorDeclaration(node) { - return ts.updateConstructor(node, + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = 0 /* Normal */; + var updated = ts.updateConstructor(node, /*decorators*/ undefined, node.modifiers, ts.visitParameterList(node.parameters, visitor, context), transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; } function visitGetAccessorDeclaration(node) { - return ts.updateGetAccessor(node, + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = 0 /* Normal */; + var updated = ts.updateGetAccessor(node, /*decorators*/ undefined, node.modifiers, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitParameterList(node.parameters, visitor, context), /*type*/ undefined, transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; } function visitSetAccessorDeclaration(node) { - return ts.updateSetAccessor(node, + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = 0 /* Normal */; + var updated = ts.updateSetAccessor(node, /*decorators*/ undefined, node.modifiers, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitParameterList(node.parameters, visitor, context), transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; } function visitMethodDeclaration(node) { - return ts.updateMethod(node, - /*decorators*/ undefined, node.modifiers, ts.visitNode(node.name, visitor, ts.isPropertyName), + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = ts.getFunctionFlags(node); + var updated = ts.updateMethod(node, + /*decorators*/ undefined, enclosingFunctionFlags & 1 /* Generator */ + ? ts.visitNodes(node.modifiers, visitorNoAsyncModifier, ts.isModifier) + : node.modifiers, enclosingFunctionFlags & 2 /* Async */ + ? undefined + : node.asteriskToken, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitNode(/*questionToken*/ undefined, visitor, ts.isToken), /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, transformFunctionBody(node)); + /*type*/ undefined, enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */ + ? transformAsyncGeneratorFunctionBody(node) + : transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; } function visitFunctionDeclaration(node) { - return ts.updateFunctionDeclaration(node, - /*decorators*/ undefined, node.modifiers, node.name, + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = ts.getFunctionFlags(node); + var updated = ts.updateFunctionDeclaration(node, + /*decorators*/ undefined, enclosingFunctionFlags & 1 /* Generator */ + ? ts.visitNodes(node.modifiers, visitorNoAsyncModifier, ts.isModifier) + : node.modifiers, enclosingFunctionFlags & 2 /* Async */ + ? undefined + : node.asteriskToken, node.name, /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, transformFunctionBody(node)); + /*type*/ undefined, enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */ + ? transformAsyncGeneratorFunctionBody(node) + : transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; } function visitArrowFunction(node) { - return ts.updateArrowFunction(node, node.modifiers, + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = ts.getFunctionFlags(node); + var updated = ts.updateArrowFunction(node, node.modifiers, /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), /*type*/ undefined, transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; } function visitFunctionExpression(node) { - return ts.updateFunctionExpression(node, node.modifiers, node.name, + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = ts.getFunctionFlags(node); + var updated = ts.updateFunctionExpression(node, enclosingFunctionFlags & 1 /* Generator */ + ? ts.visitNodes(node.modifiers, visitorNoAsyncModifier, ts.isModifier) + : node.modifiers, enclosingFunctionFlags & 2 /* Async */ + ? undefined + : node.asteriskToken, node.name, /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, transformFunctionBody(node)); + /*type*/ undefined, enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */ + ? transformAsyncGeneratorFunctionBody(node) + : transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; + } + function transformAsyncGeneratorFunctionBody(node) { + resumeLexicalEnvironment(); + var statements = []; + var statementOffset = ts.addPrologue(statements, node.body.statements, /*ensureUseStrict*/ false, visitor); + appendObjectRestAssignmentsIfNeeded(statements, node); + statements.push(ts.createReturn(createAsyncGeneratorHelper(context, ts.createFunctionExpression( + /*modifiers*/ undefined, ts.createToken(39 /* AsteriskToken */), node.name && ts.getGeneratedNameForNode(node.name), + /*typeParameters*/ undefined, + /*parameters*/ [], + /*type*/ undefined, ts.updateBlock(node.body, ts.visitLexicalEnvironment(node.body.statements, visitor, context, statementOffset)))))); + ts.addRange(statements, endLexicalEnvironment()); + var block = ts.updateBlock(node.body, statements); + // Minor optimization, emit `_super` helper to capture `super` access in an arrow. + // This step isn't needed if we eventually transform this to ES5. + if (languageVersion >= 2 /* ES2015 */) { + if (resolver.getNodeCheckFlags(node) & 4096 /* AsyncMethodWithSuperBinding */) { + enableSubstitutionForAsyncMethodsWithSuper(); + ts.addEmitHelper(block, ts.advancedAsyncSuperHelper); + } + else if (resolver.getNodeCheckFlags(node) & 2048 /* AsyncMethodWithSuper */) { + enableSubstitutionForAsyncMethodsWithSuper(); + ts.addEmitHelper(block, ts.asyncSuperHelper); + } + } + return block; } function transformFunctionBody(node) { resumeLexicalEnvironment(); - var leadingStatements; + var statementOffset = 0; + var statements = []; + var body = ts.visitNode(node.body, visitor, ts.isConciseBody); + if (ts.isBlock(body)) { + statementOffset = ts.addPrologue(statements, body.statements, /*ensureUseStrict*/ false, visitor); + } + ts.addRange(statements, appendObjectRestAssignmentsIfNeeded(/*statements*/ undefined, node)); + var trailingStatements = endLexicalEnvironment(); + if (statementOffset > 0 || ts.some(statements) || ts.some(trailingStatements)) { + var block = ts.convertToFunctionBody(body, /*multiLine*/ true); + ts.addRange(statements, block.statements.slice(statementOffset)); + ts.addRange(statements, trailingStatements); + return ts.updateBlock(block, ts.setTextRange(ts.createNodeArray(statements), block.statements)); + } + return body; + } + function appendObjectRestAssignmentsIfNeeded(statements, node) { for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { var parameter = _a[_i]; if (parameter.transformFlags & 1048576 /* ContainsObjectRest */) { @@ -48506,18 +52421,117 @@ var ts; if (ts.some(declarations)) { var statement = ts.createVariableStatement( /*modifiers*/ undefined, ts.createVariableDeclarationList(declarations)); - ts.setEmitFlags(statement, 524288 /* CustomPrologue */); - leadingStatements = ts.append(leadingStatements, statement); + ts.setEmitFlags(statement, 1048576 /* CustomPrologue */); + statements = ts.append(statements, statement); } } } - var body = ts.visitNode(node.body, visitor, ts.isConciseBody); - var trailingStatements = endLexicalEnvironment(); - if (ts.some(leadingStatements) || ts.some(trailingStatements)) { - var block = ts.convertToFunctionBody(body, /*multiLine*/ true); - return ts.updateBlock(block, ts.createNodeArray(ts.concatenate(ts.concatenate(leadingStatements, block.statements), trailingStatements), block.statements)); + return statements; + } + function enableSubstitutionForAsyncMethodsWithSuper() { + if ((enabledSubstitutions & 1 /* AsyncMethodsWithSuper */) === 0) { + enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; + // We need to enable substitutions for call, property access, and element access + // if we need to rewrite super calls. + context.enableSubstitution(181 /* CallExpression */); + context.enableSubstitution(179 /* PropertyAccessExpression */); + context.enableSubstitution(180 /* ElementAccessExpression */); + // We need to be notified when entering and exiting declarations that bind super. + context.enableEmitNotification(229 /* ClassDeclaration */); + context.enableEmitNotification(151 /* MethodDeclaration */); + context.enableEmitNotification(153 /* GetAccessor */); + context.enableEmitNotification(154 /* SetAccessor */); + context.enableEmitNotification(152 /* Constructor */); + } + } + /** + * Called by the printer just before a node is printed. + * + * @param hint A hint as to the intended usage of the node. + * @param node The node to be printed. + * @param emitCallback The callback used to emit the node. + */ + function onEmitNode(hint, node, emitCallback) { + // If we need to support substitutions for `super` in an async method, + // we should track it here. + if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */ && isSuperContainer(node)) { + var superContainerFlags = resolver.getNodeCheckFlags(node) & (2048 /* AsyncMethodWithSuper */ | 4096 /* AsyncMethodWithSuperBinding */); + if (superContainerFlags !== enclosingSuperContainerFlags) { + var savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags; + enclosingSuperContainerFlags = superContainerFlags; + previousOnEmitNode(hint, node, emitCallback); + enclosingSuperContainerFlags = savedEnclosingSuperContainerFlags; + return; + } + } + previousOnEmitNode(hint, node, emitCallback); + } + /** + * Hooks node substitutions. + * + * @param hint The context for the emitter. + * @param node The node to substitute. + */ + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1 /* Expression */ && enclosingSuperContainerFlags) { + return substituteExpression(node); + } + return node; + } + function substituteExpression(node) { + switch (node.kind) { + case 179 /* PropertyAccessExpression */: + return substitutePropertyAccessExpression(node); + case 180 /* ElementAccessExpression */: + return substituteElementAccessExpression(node); + case 181 /* CallExpression */: + return substituteCallExpression(node); + } + return node; + } + function substitutePropertyAccessExpression(node) { + if (node.expression.kind === 97 /* SuperKeyword */) { + return createSuperAccessInAsyncMethod(ts.createLiteral(node.name.text), node); + } + return node; + } + function substituteElementAccessExpression(node) { + if (node.expression.kind === 97 /* SuperKeyword */) { + return createSuperAccessInAsyncMethod(node.argumentExpression, node); + } + return node; + } + function substituteCallExpression(node) { + var expression = node.expression; + if (ts.isSuperProperty(expression)) { + var argumentExpression = ts.isPropertyAccessExpression(expression) + ? substitutePropertyAccessExpression(expression) + : substituteElementAccessExpression(expression); + return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"), + /*typeArguments*/ undefined, [ + ts.createThis() + ].concat(node.arguments)); + } + return node; + } + function isSuperContainer(node) { + var kind = node.kind; + return kind === 229 /* ClassDeclaration */ + || kind === 152 /* Constructor */ + || kind === 151 /* MethodDeclaration */ + || kind === 153 /* GetAccessor */ + || kind === 154 /* SetAccessor */; + } + function createSuperAccessInAsyncMethod(argumentExpression, location) { + if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { + return ts.setTextRange(ts.createPropertyAccess(ts.createCall(ts.createIdentifier("_super"), + /*typeArguments*/ undefined, [argumentExpression]), "value"), location); + } + else { + return ts.setTextRange(ts.createCall(ts.createIdentifier("_super"), + /*typeArguments*/ undefined, [argumentExpression]), location); } - return body; } } ts.transformESNext = transformESNext; @@ -48528,11 +52542,62 @@ var ts; text: "\n var __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };" }; function createAssignHelper(context, attributesSegments) { + if (context.getCompilerOptions().target >= 2 /* ES2015 */) { + return ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "assign"), + /*typeArguments*/ undefined, attributesSegments); + } context.requestEmitHelper(assignHelper); return ts.createCall(ts.getHelperName("__assign"), /*typeArguments*/ undefined, attributesSegments); } ts.createAssignHelper = createAssignHelper; + var awaitHelper = { + name: "typescript:await", + scoped: false, + text: "\n var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }\n " + }; + function createAwaitHelper(context, expression) { + context.requestEmitHelper(awaitHelper); + return ts.createCall(ts.getHelperName("__await"), /*typeArguments*/ undefined, [expression]); + } + var asyncGeneratorHelper = { + name: "typescript:asyncGenerator", + scoped: false, + text: "\n var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n };\n " + }; + function createAsyncGeneratorHelper(context, generatorFunc) { + context.requestEmitHelper(awaitHelper); + context.requestEmitHelper(asyncGeneratorHelper); + // Mark this node as originally an async function + (generatorFunc.emitNode || (generatorFunc.emitNode = {})).flags |= 262144 /* AsyncFunctionBody */; + return ts.createCall(ts.getHelperName("__asyncGenerator"), + /*typeArguments*/ undefined, [ + ts.createThis(), + ts.createIdentifier("arguments"), + generatorFunc + ]); + } + var asyncDelegator = { + name: "typescript:asyncDelegator", + scoped: false, + text: "\n var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { if (o[n]) i[n] = function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; }; }\n };\n " + }; + function createAsyncDelegatorHelper(context, expression, location) { + context.requestEmitHelper(awaitHelper); + context.requestEmitHelper(asyncDelegator); + return ts.setTextRange(ts.createCall(ts.getHelperName("__asyncDelegator"), + /*typeArguments*/ undefined, [expression]), location); + } + var asyncValues = { + name: "typescript:asyncValues", + scoped: false, + text: "\n var __asyncValues = (this && this.__asyncIterator) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator];\n return m ? m.call(o) : typeof __values === \"function\" ? __values(o) : o[Symbol.iterator]();\n };\n " + }; + function createAsyncValuesHelper(context, expression, location) { + context.requestEmitHelper(asyncValues); + return ts.setTextRange(ts.createCall(ts.getHelperName("__asyncValues"), + /*typeArguments*/ undefined, [expression]), location); + } })(ts || (ts = {})); /// /// @@ -48542,7 +52607,6 @@ var ts; (function (ts) { function transformJsx(context) { var compilerOptions = context.getCompilerOptions(); - var currentSourceFile; return transformSourceFile; /** * Transform JSX-specific syntax in a SourceFile. @@ -48553,10 +52617,8 @@ var ts; if (ts.isDeclarationFile(node)) { return node; } - currentSourceFile = node; var visited = ts.visitEachChild(node, visitor, context); ts.addEmitHelpers(visited, context.readEmitHelpers()); - currentSourceFile = undefined; return visited; } function visitor(node) { @@ -48569,11 +52631,11 @@ var ts; } function visitorWorker(node) { switch (node.kind) { - case 246 /* JsxElement */: + case 249 /* JsxElement */: return visitJsxElement(node, /*isChild*/ false); - case 247 /* JsxSelfClosingElement */: + case 250 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ false); - case 252 /* JsxExpression */: + case 256 /* JsxExpression */: return visitJsxExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -48583,11 +52645,11 @@ var ts; switch (node.kind) { case 10 /* JsxText */: return visitJsxText(node); - case 252 /* JsxExpression */: + case 256 /* JsxExpression */: return visitJsxExpression(node); - case 246 /* JsxElement */: + case 249 /* JsxElement */: return visitJsxElement(node, /*isChild*/ true); - case 247 /* JsxSelfClosingElement */: + case 250 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ true); default: ts.Debug.failBadSyntaxKind(node); @@ -48603,7 +52665,7 @@ var ts; function visitJsxOpeningLikeElement(node, children, isChild, location) { var tagName = getTagName(node); var objectProperties; - var attrs = node.attributes; + var attrs = node.attributes.properties; if (attrs.length === 0) { // When there are no attributes, React wants "null" objectProperties = ts.createNull(); @@ -48642,15 +52704,15 @@ var ts; } function transformJsxAttributeInitializer(node) { if (node === undefined) { - return ts.createLiteral(true); + return ts.createTrue(); } else if (node.kind === 9 /* StringLiteral */) { var decoded = tryDecodeEntities(node.text); - return decoded ? ts.createLiteral(decoded, /*location*/ node) : node; + return decoded ? ts.setTextRange(ts.createLiteral(decoded), node) : node; } - else if (node.kind === 252 /* JsxExpression */) { + else if (node.kind === 256 /* JsxExpression */) { if (node.expression === undefined) { - return ts.createLiteral(true); + return ts.createTrue(); } return visitJsxExpression(node); } @@ -48659,54 +52721,61 @@ var ts; } } function visitJsxText(node) { - var text = ts.getTextOfNode(node, /*includeTrivia*/ true); - var parts; + var fixed = fixupWhitespaceAndDecodeEntities(ts.getTextOfNode(node, /*includeTrivia*/ true)); + return fixed === undefined ? undefined : ts.createLiteral(fixed); + } + /** + * JSX trims whitespace at the end and beginning of lines, except that the + * start/end of a tag is considered a start/end of a line only if that line is + * on the same line as the closing tag. See examples in + * tests/cases/conformance/jsx/tsxReactEmitWhitespace.tsx + * See also https://www.w3.org/TR/html4/struct/text.html#h-9.1 and https://www.w3.org/TR/CSS2/text.html#white-space-model + * + * An equivalent algorithm would be: + * - If there is only one line, return it. + * - If there is only whitespace (but multiple lines), return `undefined`. + * - Split the text into lines. + * - 'trimRight' the first line, 'trimLeft' the last line, 'trim' middle lines. + * - Decode entities on each line (individually). + * - Remove empty lines and join the rest with " ". + */ + function fixupWhitespaceAndDecodeEntities(text) { + var acc; + // First non-whitespace character on this line. var firstNonWhitespace = 0; + // Last non-whitespace character on this line. var lastNonWhitespace = -1; - // JSX trims whitespace at the end and beginning of lines, except that the - // start/end of a tag is considered a start/end of a line only if that line is - // on the same line as the closing tag. See examples in - // tests/cases/conformance/jsx/tsxReactEmitWhitespace.tsx + // These initial values are special because the first line is: + // firstNonWhitespace = 0 to indicate that we want leading whitsepace, + // but lastNonWhitespace = -1 as a special flag to indicate that we *don't* include the line if it's all whitespace. for (var i = 0; i < text.length; i++) { var c = text.charCodeAt(i); if (ts.isLineBreak(c)) { - if (firstNonWhitespace !== -1 && (lastNonWhitespace - firstNonWhitespace + 1 > 0)) { - var part = text.substr(firstNonWhitespace, lastNonWhitespace - firstNonWhitespace + 1); - if (!parts) { - parts = []; - } - // We do not escape the string here as that is handled by the printer - // when it emits the literal. We do, however, need to decode JSX entities. - parts.push(ts.createLiteral(decodeEntities(part))); + // If we've seen any non-whitespace characters on this line, add the 'trim' of the line. + // (lastNonWhitespace === -1 is a special flag to detect whether the first line is all whitespace.) + if (firstNonWhitespace !== -1 && lastNonWhitespace !== -1) { + acc = addLineOfJsxText(acc, text.substr(firstNonWhitespace, lastNonWhitespace - firstNonWhitespace + 1)); } + // Reset firstNonWhitespace for the next line. + // Don't bother to reset lastNonWhitespace because we ignore it if firstNonWhitespace = -1. firstNonWhitespace = -1; } - else if (!ts.isWhiteSpace(c)) { + else if (!ts.isWhiteSpaceSingleLine(c)) { lastNonWhitespace = i; if (firstNonWhitespace === -1) { firstNonWhitespace = i; } } } - if (firstNonWhitespace !== -1) { - var part = text.substr(firstNonWhitespace); - if (!parts) { - parts = []; - } - // We do not escape the string here as that is handled by the printer - // when it emits the literal. We do, however, need to decode JSX entities. - parts.push(ts.createLiteral(decodeEntities(part))); - } - if (parts) { - return ts.reduceLeft(parts, aggregateJsxTextParts); - } - return undefined; + return firstNonWhitespace !== -1 + ? addLineOfJsxText(acc, text.substr(firstNonWhitespace)) + : acc; } - /** - * Aggregates two expressions by interpolating them with a whitespace literal. - */ - function aggregateJsxTextParts(left, right) { - return ts.createAdd(ts.createAdd(left, ts.createLiteral(" ")), right); + function addLineOfJsxText(acc, trimmedLine) { + // We do not escape the string here as that is handled by the printer + // when it emits the literal. We do, however, need to decode JSX entities. + var decoded = decodeEntities(trimmedLine); + return acc === undefined ? decoded : acc + " " + decoded; } /** * Replace entities like " ", "{", and "�" with the characters they encode. @@ -48721,7 +52790,7 @@ var ts; return String.fromCharCode(parseInt(hex, 16)); } else { - var ch = entities[word]; + var ch = entities.get(word); // If this is not a valid entity, then just use `match` (replace it with itself, i.e. don't replace) return ch ? String.fromCharCode(ch) : match; } @@ -48733,16 +52802,16 @@ var ts; return decoded === text ? undefined : decoded; } function getTagName(node) { - if (node.kind === 246 /* JsxElement */) { + if (node.kind === 249 /* JsxElement */) { return getTagName(node.openingElement); } else { - var name_35 = node.tagName; - if (ts.isIdentifier(name_35) && ts.isIntrinsicJsxName(name_35.text)) { - return ts.createLiteral(name_35.text); + var name = node.tagName; + if (ts.isIdentifier(name) && ts.isIntrinsicJsxName(name.text)) { + return ts.createLiteral(name.text); } else { - return ts.createExpressionFromEntityName(name_35); + return ts.createExpressionFromEntityName(name); } } } @@ -48765,7 +52834,7 @@ var ts; } } ts.transformJsx = transformJsx; - var entities = ts.createMap({ + var entities = ts.createMapFromTemplate({ "quot": 0x0022, "amp": 0x0026, "apos": 0x0027, @@ -49025,375 +53094,6 @@ var ts; /// /*@internal*/ var ts; -(function (ts) { - var ES2017SubstitutionFlags; - (function (ES2017SubstitutionFlags) { - /** Enables substitutions for async methods with `super` calls. */ - ES2017SubstitutionFlags[ES2017SubstitutionFlags["AsyncMethodsWithSuper"] = 1] = "AsyncMethodsWithSuper"; - })(ES2017SubstitutionFlags || (ES2017SubstitutionFlags = {})); - function transformES2017(context) { - var startLexicalEnvironment = context.startLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment; - var resolver = context.getEmitResolver(); - var compilerOptions = context.getCompilerOptions(); - var languageVersion = ts.getEmitScriptTarget(compilerOptions); - // These variables contain state that changes as we descend into the tree. - var currentSourceFile; - /** - * Keeps track of whether expression substitution has been enabled for specific edge cases. - * They are persisted between each SourceFile transformation and should not be reset. - */ - var enabledSubstitutions; - /** - * This keeps track of containers where `super` is valid, for use with - * just-in-time substitution for `super` expressions inside of async methods. - */ - var currentSuperContainer; - // Save the previous transformation hooks. - var previousOnEmitNode = context.onEmitNode; - var previousOnSubstituteNode = context.onSubstituteNode; - // Set new transformation hooks. - context.onEmitNode = onEmitNode; - context.onSubstituteNode = onSubstituteNode; - return transformSourceFile; - function transformSourceFile(node) { - if (ts.isDeclarationFile(node)) { - return node; - } - currentSourceFile = node; - var visited = ts.visitEachChild(node, visitor, context); - ts.addEmitHelpers(visited, context.readEmitHelpers()); - currentSourceFile = undefined; - return visited; - } - function visitor(node) { - if ((node.transformFlags & 16 /* ContainsES2017 */) === 0) { - return node; - } - switch (node.kind) { - case 119 /* AsyncKeyword */: - // ES2017 async modifier should be elided for targets < ES2017 - return undefined; - case 189 /* AwaitExpression */: - // ES2017 'await' expressions must be transformed for targets < ES2017. - return visitAwaitExpression(node); - case 149 /* MethodDeclaration */: - // ES2017 method declarations may be 'async' - return visitMethodDeclaration(node); - case 225 /* FunctionDeclaration */: - // ES2017 function declarations may be 'async' - return visitFunctionDeclaration(node); - case 184 /* FunctionExpression */: - // ES2017 function expressions may be 'async' - return visitFunctionExpression(node); - case 185 /* ArrowFunction */: - // ES2017 arrow functions may be 'async' - return visitArrowFunction(node); - default: - return ts.visitEachChild(node, visitor, context); - } - } - /** - * Visits an AwaitExpression node. - * - * This function will be called any time a ES2017 await expression is encountered. - * - * @param node The node to visit. - */ - function visitAwaitExpression(node) { - return ts.setOriginalNode(ts.createYield( - /*asteriskToken*/ undefined, ts.visitNode(node.expression, visitor, ts.isExpression), - /*location*/ node), node); - } - /** - * Visits a MethodDeclaration node. - * - * This function will be called when one of the following conditions are met: - * - The node is marked as async - * - * @param node The node to visit. - */ - function visitMethodDeclaration(node) { - return ts.updateMethod(node, - /*decorators*/ undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.name, - /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, ts.isAsyncFunctionLike(node) - ? transformAsyncFunctionBody(node) - : ts.visitFunctionBody(node.body, visitor, context)); - } - /** - * Visits a FunctionDeclaration node. - * - * This function will be called when one of the following conditions are met: - * - The node is marked async - * - * @param node The node to visit. - */ - function visitFunctionDeclaration(node) { - return ts.updateFunctionDeclaration(node, - /*decorators*/ undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.name, - /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, ts.isAsyncFunctionLike(node) - ? transformAsyncFunctionBody(node) - : ts.visitFunctionBody(node.body, visitor, context)); - } - /** - * Visits a FunctionExpression node. - * - * This function will be called when one of the following conditions are met: - * - The node is marked async - * - * @param node The node to visit. - */ - function visitFunctionExpression(node) { - if (ts.nodeIsMissing(node.body)) { - return ts.createOmittedExpression(); - } - return ts.updateFunctionExpression(node, - /*modifiers*/ undefined, node.name, - /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, ts.isAsyncFunctionLike(node) - ? transformAsyncFunctionBody(node) - : ts.visitFunctionBody(node.body, visitor, context)); - } - /** - * Visits an ArrowFunction. - * - * This function will be called when one of the following conditions are met: - * - The node is marked async - * - * @param node The node to visit. - */ - function visitArrowFunction(node) { - return ts.updateArrowFunction(node, ts.visitNodes(node.modifiers, visitor, ts.isModifier), - /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, ts.isAsyncFunctionLike(node) - ? transformAsyncFunctionBody(node) - : ts.visitFunctionBody(node.body, visitor, context)); - } - function transformAsyncFunctionBody(node) { - resumeLexicalEnvironment(); - var original = ts.getOriginalNode(node, ts.isFunctionLike); - var nodeType = original.type; - var promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : undefined; - var isArrowFunction = node.kind === 185 /* 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 - // `this` and `arguments` objects to `__awaiter`. The generator function - // passed to `__awaiter` is executed inside of the callback to the - // promise constructor. - if (!isArrowFunction) { - var statements = []; - var statementOffset = ts.addPrologueDirectives(statements, node.body.statements, /*ensureUseStrict*/ false, visitor); - statements.push(ts.createReturn(createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body, statementOffset)))); - ts.addRange(statements, endLexicalEnvironment()); - var block = ts.createBlock(statements, /*location*/ node.body, /*multiLine*/ true); - // Minor optimization, emit `_super` helper to capture `super` access in an arrow. - // This step isn't needed if we eventually transform this to ES5. - if (languageVersion >= 2 /* ES2015 */) { - if (resolver.getNodeCheckFlags(node) & 4096 /* AsyncMethodWithSuperBinding */) { - enableSubstitutionForAsyncMethodsWithSuper(); - ts.addEmitHelper(block, advancedAsyncSuperHelper); - } - else if (resolver.getNodeCheckFlags(node) & 2048 /* AsyncMethodWithSuper */) { - enableSubstitutionForAsyncMethodsWithSuper(); - ts.addEmitHelper(block, asyncSuperHelper); - } - } - return block; - } - else { - var expression = createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body)); - var declarations = endLexicalEnvironment(); - if (ts.some(declarations)) { - var block = ts.convertToFunctionBody(expression); - return ts.updateBlock(block, ts.createNodeArray(ts.concatenate(block.statements, declarations), block.statements)); - } - return expression; - } - } - function transformFunctionBodyWorker(body, start) { - if (ts.isBlock(body)) { - return ts.updateBlock(body, ts.visitLexicalEnvironment(body.statements, visitor, context, start)); - } - else { - startLexicalEnvironment(); - var visited = ts.convertToFunctionBody(ts.visitNode(body, visitor, ts.isConciseBody)); - var declarations = endLexicalEnvironment(); - return ts.updateBlock(visited, ts.createNodeArray(ts.concatenate(visited.statements, declarations), visited.statements)); - } - } - function getPromiseConstructor(type) { - var typeName = type && ts.getEntityNameFromTypeNode(type); - if (typeName && ts.isEntityName(typeName)) { - var serializationKind = resolver.getTypeReferenceSerializationKind(typeName); - if (serializationKind === ts.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue - || serializationKind === ts.TypeReferenceSerializationKind.Unknown) { - return typeName; - } - } - return undefined; - } - function enableSubstitutionForAsyncMethodsWithSuper() { - if ((enabledSubstitutions & 1 /* AsyncMethodsWithSuper */) === 0) { - enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; - // We need to enable substitutions for call, property access, and element access - // if we need to rewrite super calls. - context.enableSubstitution(179 /* CallExpression */); - context.enableSubstitution(177 /* PropertyAccessExpression */); - context.enableSubstitution(178 /* ElementAccessExpression */); - // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(226 /* ClassDeclaration */); - context.enableEmitNotification(149 /* MethodDeclaration */); - context.enableEmitNotification(151 /* GetAccessor */); - context.enableEmitNotification(152 /* SetAccessor */); - context.enableEmitNotification(150 /* Constructor */); - } - } - function substituteExpression(node) { - switch (node.kind) { - case 177 /* PropertyAccessExpression */: - return substitutePropertyAccessExpression(node); - case 178 /* ElementAccessExpression */: - return substituteElementAccessExpression(node); - case 179 /* CallExpression */: - if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */) { - return substituteCallExpression(node); - } - break; - } - return node; - } - function substitutePropertyAccessExpression(node) { - if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */ && node.expression.kind === 96 /* SuperKeyword */) { - var flags = getSuperContainerAsyncMethodFlags(); - if (flags) { - return createSuperAccessInAsyncMethod(ts.createLiteral(node.name.text), flags, node); - } - } - return node; - } - function substituteElementAccessExpression(node) { - if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */ && node.expression.kind === 96 /* SuperKeyword */) { - var flags = getSuperContainerAsyncMethodFlags(); - if (flags) { - return createSuperAccessInAsyncMethod(node.argumentExpression, flags, node); - } - } - return node; - } - function substituteCallExpression(node) { - var expression = node.expression; - if (ts.isSuperProperty(expression)) { - var flags = getSuperContainerAsyncMethodFlags(); - if (flags) { - var argumentExpression = ts.isPropertyAccessExpression(expression) - ? substitutePropertyAccessExpression(expression) - : substituteElementAccessExpression(expression); - return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"), - /*typeArguments*/ undefined, [ - ts.createThis() - ].concat(node.arguments)); - } - } - return node; - } - function isSuperContainer(node) { - var kind = node.kind; - return kind === 226 /* ClassDeclaration */ - || kind === 150 /* Constructor */ - || kind === 149 /* MethodDeclaration */ - || kind === 151 /* GetAccessor */ - || kind === 152 /* SetAccessor */; - } - /** - * Hook for node emit. - * - * @param node The node to emit. - * @param emit A callback used to emit the node in the printer. - */ - function onEmitNode(emitContext, node, emitCallback) { - // If we need to support substitutions for `super` in an async method, - // we should track it here. - if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */ && isSuperContainer(node)) { - var savedCurrentSuperContainer = currentSuperContainer; - currentSuperContainer = node; - previousOnEmitNode(emitContext, node, emitCallback); - currentSuperContainer = savedCurrentSuperContainer; - } - else { - previousOnEmitNode(emitContext, node, emitCallback); - } - } - /** - * Hooks node substitutions. - * - * @param node The node to substitute. - * @param isExpression A value indicating whether the node is to be used in an expression - * position. - */ - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (emitContext === 1 /* Expression */) { - return substituteExpression(node); - } - return node; - } - function createSuperAccessInAsyncMethod(argumentExpression, flags, location) { - if (flags & 4096 /* AsyncMethodWithSuperBinding */) { - return ts.createPropertyAccess(ts.createCall(ts.createIdentifier("_super"), - /*typeArguments*/ undefined, [argumentExpression]), "value", location); - } - else { - return ts.createCall(ts.createIdentifier("_super"), - /*typeArguments*/ undefined, [argumentExpression], location); - } - } - function getSuperContainerAsyncMethodFlags() { - return currentSuperContainer !== undefined - && resolver.getNodeCheckFlags(currentSuperContainer) & (2048 /* AsyncMethodWithSuper */ | 4096 /* AsyncMethodWithSuperBinding */); - } - } - ts.transformES2017 = transformES2017; - function createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, body) { - context.requestEmitHelper(awaiterHelper); - var generatorFunc = ts.createFunctionExpression( - /*modifiers*/ undefined, ts.createToken(38 /* AsteriskToken */), - /*name*/ undefined, - /*typeParameters*/ undefined, - /*parameters*/ [], - /*type*/ undefined, body); - // Mark this node as originally an async function - (generatorFunc.emitNode || (generatorFunc.emitNode = {})).flags |= 131072 /* AsyncFunctionBody */; - return ts.createCall(ts.getHelperName("__awaiter"), - /*typeArguments*/ undefined, [ - ts.createThis(), - hasLexicalArguments ? ts.createIdentifier("arguments") : ts.createVoidZero(), - promiseConstructor ? ts.createExpressionFromEntityName(promiseConstructor) : ts.createVoidZero(), - generatorFunc - ]); - } - var awaiterHelper = { - name: "typescript:awaiter", - scoped: false, - priority: 5, - text: "\n var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n };" - }; - var asyncSuperHelper = { - name: "typescript:async-super", - scoped: true, - text: "\n const _super = name => super[name];" - }; - var advancedAsyncSuperHelper = { - name: "typescript:advanced-async-super", - scoped: true, - text: "\n const _super = (function (geti, seti) {\n const cache = Object.create(null);\n return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } });\n })(name => super[name], (name, value) => super[name] = value);" - }; -})(ts || (ts = {})); -/// -/// -/*@internal*/ -var ts; (function (ts) { function transformES2016(context) { var hoistVariableDeclaration = context.hoistVariableDeclaration; @@ -49409,7 +53109,7 @@ var ts; return node; } switch (node.kind) { - case 192 /* BinaryExpression */: + case 194 /* BinaryExpression */: return visitBinaryExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -49417,9 +53117,9 @@ var ts; } function visitBinaryExpression(node) { switch (node.operatorToken.kind) { - case 61 /* AsteriskAsteriskEqualsToken */: + case 62 /* AsteriskAsteriskEqualsToken */: return visitExponentiationAssignmentExpression(node); - case 39 /* AsteriskAsteriskToken */: + case 40 /* AsteriskAsteriskToken */: return visitExponentiationExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -49434,25 +53134,21 @@ var ts; // Transforms `a[x] **= b` into `(_a = a)[_x = x] = Math.pow(_a[_x], b)` var expressionTemp = ts.createTempVariable(hoistVariableDeclaration); var argumentExpressionTemp = ts.createTempVariable(hoistVariableDeclaration); - target = ts.createElementAccess(ts.createAssignment(expressionTemp, left.expression, /*location*/ left.expression), ts.createAssignment(argumentExpressionTemp, left.argumentExpression, /*location*/ left.argumentExpression), - /*location*/ left); - value = ts.createElementAccess(expressionTemp, argumentExpressionTemp, - /*location*/ left); + target = ts.setTextRange(ts.createElementAccess(ts.setTextRange(ts.createAssignment(expressionTemp, left.expression), left.expression), ts.setTextRange(ts.createAssignment(argumentExpressionTemp, left.argumentExpression), left.argumentExpression)), left); + value = ts.setTextRange(ts.createElementAccess(expressionTemp, argumentExpressionTemp), left); } else if (ts.isPropertyAccessExpression(left)) { // Transforms `a.x **= b` into `(_a = a).x = Math.pow(_a.x, b)` var expressionTemp = ts.createTempVariable(hoistVariableDeclaration); - target = ts.createPropertyAccess(ts.createAssignment(expressionTemp, left.expression, /*location*/ left.expression), left.name, - /*location*/ left); - value = ts.createPropertyAccess(expressionTemp, left.name, - /*location*/ left); + target = ts.setTextRange(ts.createPropertyAccess(ts.setTextRange(ts.createAssignment(expressionTemp, left.expression), left.expression), left.name), left); + value = ts.setTextRange(ts.createPropertyAccess(expressionTemp, left.name), left); } else { // Transforms `a **= b` into `a = Math.pow(a, b)` target = left; value = left; } - return ts.createAssignment(target, ts.createMathPow(value, right, /*location*/ node), /*location*/ node); + return ts.setTextRange(ts.createAssignment(target, ts.createMathPow(value, right, /*location*/ node)), node); } function visitExponentiationExpression(node) { // Transforms `a ** b` into `Math.pow(a, b)` @@ -49465,6 +53161,7 @@ var ts; })(ts || (ts = {})); /// /// +/// /*@internal*/ var ts; (function (ts) { @@ -49510,8 +53207,85 @@ var ts; */ SuperCaptureResult[SuperCaptureResult["ReplaceWithReturn"] = 2] = "ReplaceWithReturn"; })(SuperCaptureResult || (SuperCaptureResult = {})); + // Facts we track as we traverse the tree + var HierarchyFacts; + (function (HierarchyFacts) { + HierarchyFacts[HierarchyFacts["None"] = 0] = "None"; + // + // Ancestor facts + // + HierarchyFacts[HierarchyFacts["Function"] = 1] = "Function"; + HierarchyFacts[HierarchyFacts["ArrowFunction"] = 2] = "ArrowFunction"; + HierarchyFacts[HierarchyFacts["AsyncFunctionBody"] = 4] = "AsyncFunctionBody"; + HierarchyFacts[HierarchyFacts["NonStaticClassElement"] = 8] = "NonStaticClassElement"; + HierarchyFacts[HierarchyFacts["CapturesThis"] = 16] = "CapturesThis"; + HierarchyFacts[HierarchyFacts["ExportedVariableStatement"] = 32] = "ExportedVariableStatement"; + HierarchyFacts[HierarchyFacts["TopLevel"] = 64] = "TopLevel"; + HierarchyFacts[HierarchyFacts["Block"] = 128] = "Block"; + HierarchyFacts[HierarchyFacts["IterationStatement"] = 256] = "IterationStatement"; + HierarchyFacts[HierarchyFacts["IterationStatementBlock"] = 512] = "IterationStatementBlock"; + HierarchyFacts[HierarchyFacts["ForStatement"] = 1024] = "ForStatement"; + HierarchyFacts[HierarchyFacts["ForInOrForOfStatement"] = 2048] = "ForInOrForOfStatement"; + HierarchyFacts[HierarchyFacts["ConstructorWithCapturedSuper"] = 4096] = "ConstructorWithCapturedSuper"; + HierarchyFacts[HierarchyFacts["ComputedPropertyName"] = 8192] = "ComputedPropertyName"; + // NOTE: do not add more ancestor flags without also updating AncestorFactsMask below. + // + // Ancestor masks + // + HierarchyFacts[HierarchyFacts["AncestorFactsMask"] = 16383] = "AncestorFactsMask"; + // We are always in *some* kind of block scope, but only specific block-scope containers are + // top-level or Blocks. + HierarchyFacts[HierarchyFacts["BlockScopeIncludes"] = 0] = "BlockScopeIncludes"; + HierarchyFacts[HierarchyFacts["BlockScopeExcludes"] = 4032] = "BlockScopeExcludes"; + // A source file is a top-level block scope. + HierarchyFacts[HierarchyFacts["SourceFileIncludes"] = 64] = "SourceFileIncludes"; + HierarchyFacts[HierarchyFacts["SourceFileExcludes"] = 3968] = "SourceFileExcludes"; + // Functions, methods, and accessors are both new lexical scopes and new block scopes. + HierarchyFacts[HierarchyFacts["FunctionIncludes"] = 65] = "FunctionIncludes"; + HierarchyFacts[HierarchyFacts["FunctionExcludes"] = 16286] = "FunctionExcludes"; + HierarchyFacts[HierarchyFacts["AsyncFunctionBodyIncludes"] = 69] = "AsyncFunctionBodyIncludes"; + HierarchyFacts[HierarchyFacts["AsyncFunctionBodyExcludes"] = 16278] = "AsyncFunctionBodyExcludes"; + // Arrow functions are lexically scoped to their container, but are new block scopes. + HierarchyFacts[HierarchyFacts["ArrowFunctionIncludes"] = 66] = "ArrowFunctionIncludes"; + HierarchyFacts[HierarchyFacts["ArrowFunctionExcludes"] = 16256] = "ArrowFunctionExcludes"; + // Constructors are both new lexical scopes and new block scopes. Constructors are also + // always considered non-static members of a class. + HierarchyFacts[HierarchyFacts["ConstructorIncludes"] = 73] = "ConstructorIncludes"; + HierarchyFacts[HierarchyFacts["ConstructorExcludes"] = 16278] = "ConstructorExcludes"; + // 'do' and 'while' statements are not block scopes. We track that the subtree is contained + // within an IterationStatement to indicate whether the embedded statement is an + // IterationStatementBlock. + HierarchyFacts[HierarchyFacts["DoOrWhileStatementIncludes"] = 256] = "DoOrWhileStatementIncludes"; + HierarchyFacts[HierarchyFacts["DoOrWhileStatementExcludes"] = 0] = "DoOrWhileStatementExcludes"; + // 'for' statements are new block scopes and have special handling for 'let' declarations. + HierarchyFacts[HierarchyFacts["ForStatementIncludes"] = 1280] = "ForStatementIncludes"; + HierarchyFacts[HierarchyFacts["ForStatementExcludes"] = 3008] = "ForStatementExcludes"; + // 'for-in' and 'for-of' statements are new block scopes and have special handling for + // 'let' declarations. + HierarchyFacts[HierarchyFacts["ForInOrForOfStatementIncludes"] = 2304] = "ForInOrForOfStatementIncludes"; + HierarchyFacts[HierarchyFacts["ForInOrForOfStatementExcludes"] = 1984] = "ForInOrForOfStatementExcludes"; + // Blocks (other than function bodies) are new block scopes. + HierarchyFacts[HierarchyFacts["BlockIncludes"] = 128] = "BlockIncludes"; + HierarchyFacts[HierarchyFacts["BlockExcludes"] = 3904] = "BlockExcludes"; + HierarchyFacts[HierarchyFacts["IterationStatementBlockIncludes"] = 512] = "IterationStatementBlockIncludes"; + HierarchyFacts[HierarchyFacts["IterationStatementBlockExcludes"] = 4032] = "IterationStatementBlockExcludes"; + // Computed property names track subtree flags differently than their containing members. + HierarchyFacts[HierarchyFacts["ComputedPropertyNameIncludes"] = 8192] = "ComputedPropertyNameIncludes"; + HierarchyFacts[HierarchyFacts["ComputedPropertyNameExcludes"] = 0] = "ComputedPropertyNameExcludes"; + // + // Subtree facts + // + HierarchyFacts[HierarchyFacts["NewTarget"] = 16384] = "NewTarget"; + HierarchyFacts[HierarchyFacts["NewTargetInComputedPropertyName"] = 32768] = "NewTargetInComputedPropertyName"; + // + // Subtree masks + // + HierarchyFacts[HierarchyFacts["SubtreeFactsMask"] = -16384] = "SubtreeFactsMask"; + HierarchyFacts[HierarchyFacts["PropagateNewTargetMask"] = 49152] = "PropagateNewTargetMask"; + })(HierarchyFacts || (HierarchyFacts = {})); function transformES2015(context) { var startLexicalEnvironment = context.startLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration; + var compilerOptions = context.getCompilerOptions(); var resolver = context.getEmitResolver(); var previousOnSubstituteNode = context.onSubstituteNode; var previousOnEmitNode = context.onEmitNode; @@ -49519,15 +53293,7 @@ var ts; context.onSubstituteNode = onSubstituteNode; var currentSourceFile; var currentText; - var currentParent; - var currentNode; - var enclosingVariableStatement; - var enclosingBlockScopeContainer; - var enclosingBlockScopeContainerParent; - var enclosingFunction; - var enclosingNonArrowFunction; - var enclosingNonAsyncFunctionBody; - var isInConstructorWithCapturedSuper; + var hierarchyFacts; /** * Used to track if we are emitting body of the converted loop */ @@ -49545,257 +53311,221 @@ var ts; } currentSourceFile = node; currentText = node.text; - var visited = saveStateAndInvoke(node, visitSourceFile); + var visited = visitSourceFile(node); ts.addEmitHelpers(visited, context.readEmitHelpers()); currentSourceFile = undefined; currentText = undefined; + hierarchyFacts = 0 /* None */; return visited; } - function visitor(node) { - return saveStateAndInvoke(node, dispatcher); + /** + * Sets the `HierarchyFacts` for this node prior to visiting this node's subtree, returning the facts set prior to modification. + * @param excludeFacts The existing `HierarchyFacts` to reset before visiting the subtree. + * @param includeFacts The new `HierarchyFacts` to set before visiting the subtree. + */ + function enterSubtree(excludeFacts, includeFacts) { + var ancestorFacts = hierarchyFacts; + hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & 16383 /* AncestorFactsMask */; + return ancestorFacts; } - function dispatcher(node) { - return convertedLoopState - ? visitorForConvertedLoopWorker(node) - : visitorWorker(node); - } - function saveStateAndInvoke(node, f) { - var savedEnclosingFunction = enclosingFunction; - var savedEnclosingNonArrowFunction = enclosingNonArrowFunction; - var savedEnclosingNonAsyncFunctionBody = enclosingNonAsyncFunctionBody; - var savedEnclosingBlockScopeContainer = enclosingBlockScopeContainer; - var savedEnclosingBlockScopeContainerParent = enclosingBlockScopeContainerParent; - var savedEnclosingVariableStatement = enclosingVariableStatement; - var savedCurrentParent = currentParent; - var savedCurrentNode = currentNode; - var savedConvertedLoopState = convertedLoopState; - var savedIsInConstructorWithCapturedSuper = isInConstructorWithCapturedSuper; - if (ts.nodeStartsNewLexicalEnvironment(node)) { - // don't treat content of nodes that start new lexical environment as part of converted loop copy or constructor body - isInConstructorWithCapturedSuper = false; - convertedLoopState = undefined; - } - onBeforeVisitNode(node); - var visited = f(node); - isInConstructorWithCapturedSuper = savedIsInConstructorWithCapturedSuper; - convertedLoopState = savedConvertedLoopState; - enclosingFunction = savedEnclosingFunction; - enclosingNonArrowFunction = savedEnclosingNonArrowFunction; - enclosingNonAsyncFunctionBody = savedEnclosingNonAsyncFunctionBody; - enclosingBlockScopeContainer = savedEnclosingBlockScopeContainer; - enclosingBlockScopeContainerParent = savedEnclosingBlockScopeContainerParent; - enclosingVariableStatement = savedEnclosingVariableStatement; - currentParent = savedCurrentParent; - currentNode = savedCurrentNode; - return visited; - } - function onBeforeVisitNode(node) { - if (currentNode) { - if (ts.isBlockScope(currentNode, currentParent)) { - enclosingBlockScopeContainer = currentNode; - enclosingBlockScopeContainerParent = currentParent; - } - if (ts.isFunctionLike(currentNode)) { - enclosingFunction = currentNode; - if (currentNode.kind !== 185 /* ArrowFunction */) { - enclosingNonArrowFunction = currentNode; - if (!(ts.getEmitFlags(currentNode) & 131072 /* AsyncFunctionBody */)) { - enclosingNonAsyncFunctionBody = currentNode; - } - } - } - // keep track of the enclosing variable statement when in the context of - // variable statements, variable declarations, binding elements, and binding - // patterns. - switch (currentNode.kind) { - case 205 /* VariableStatement */: - enclosingVariableStatement = currentNode; - break; - case 224 /* VariableDeclarationList */: - case 223 /* VariableDeclaration */: - case 174 /* BindingElement */: - case 172 /* ObjectBindingPattern */: - case 173 /* ArrayBindingPattern */: - break; - default: - enclosingVariableStatement = undefined; - } - } - currentParent = currentNode; - currentNode = node; - } - function returnCapturedThis(node) { - return ts.setOriginalNode(ts.createReturn(ts.createIdentifier("_this")), node); + /** + * Restores the `HierarchyFacts` for this node's ancestor after visiting this node's + * subtree, propagating specific facts from the subtree. + * @param ancestorFacts The `HierarchyFacts` of the ancestor to restore after visiting the subtree. + * @param excludeFacts The existing `HierarchyFacts` of the subtree that should not be propagated. + * @param includeFacts The new `HierarchyFacts` of the subtree that should be propagated. + */ + function exitSubtree(ancestorFacts, excludeFacts, includeFacts) { + hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & -16384 /* SubtreeFactsMask */ | ancestorFacts; } function isReturnVoidStatementInConstructorWithCapturedSuper(node) { - return isInConstructorWithCapturedSuper && node.kind === 216 /* ReturnStatement */ && !node.expression; + return hierarchyFacts & 4096 /* ConstructorWithCapturedSuper */ + && node.kind === 219 /* ReturnStatement */ + && !node.expression; } - function shouldCheckNode(node) { - return (node.transformFlags & 64 /* ES2015 */) !== 0 || - node.kind === 219 /* LabeledStatement */ || - (ts.isIterationStatement(node, /*lookInLabeledStatements*/ false) && shouldConvertIterationStatementBody(node)); + function shouldVisitNode(node) { + return (node.transformFlags & 128 /* ContainsES2015 */) !== 0 + || convertedLoopState !== undefined + || (hierarchyFacts & 4096 /* ConstructorWithCapturedSuper */ && ts.isStatement(node)) + || (ts.isIterationStatement(node, /*lookInLabeledStatements*/ false) && shouldConvertIterationStatementBody(node)); } - function visitorWorker(node) { - if (isReturnVoidStatementInConstructorWithCapturedSuper(node)) { - return returnCapturedThis(node); - } - else if (shouldCheckNode(node)) { + function visitor(node) { + if (shouldVisitNode(node)) { return visitJavaScript(node); } - else if (node.transformFlags & 128 /* ContainsES2015 */ || (isInConstructorWithCapturedSuper && !ts.isExpression(node))) { - // we want to dive in this branch either if node has children with ES2015 specific syntax - // or we are inside constructor that captures result of the super call so all returns without expression should be - // rewritten. Note: we skip expressions since returns should never appear there - return ts.visitEachChild(node, visitor, context); - } else { return node; } } - function visitorForConvertedLoopWorker(node) { - var result; - if (shouldCheckNode(node)) { - result = visitJavaScript(node); + function functionBodyVisitor(node) { + if (shouldVisitNode(node)) { + return visitBlock(node, /*isFunctionBody*/ true); } - else { - result = visitNodesInConvertedLoop(node); - } - return result; + return node; } - function visitNodesInConvertedLoop(node) { - switch (node.kind) { - case 216 /* ReturnStatement */: - node = isReturnVoidStatementInConstructorWithCapturedSuper(node) ? returnCapturedThis(node) : node; - return visitReturnStatement(node); - case 205 /* VariableStatement */: - return visitVariableStatement(node); - case 218 /* SwitchStatement */: - return visitSwitchStatement(node); - case 215 /* BreakStatement */: - case 214 /* ContinueStatement */: - return visitBreakOrContinueStatement(node); - case 98 /* ThisKeyword */: - return visitThisKeyword(node); - case 70 /* Identifier */: - return visitIdentifier(node); - default: - return ts.visitEachChild(node, visitor, context); + function callExpressionVisitor(node) { + if (node.kind === 97 /* SuperKeyword */) { + return visitSuperKeyword(/*isExpressionOfCall*/ true); } + return visitor(node); } function visitJavaScript(node) { switch (node.kind) { - case 114 /* StaticKeyword */: + case 115 /* StaticKeyword */: return undefined; // elide static keyword - case 226 /* ClassDeclaration */: + case 229 /* ClassDeclaration */: return visitClassDeclaration(node); - case 197 /* ClassExpression */: + case 199 /* ClassExpression */: return visitClassExpression(node); - case 144 /* Parameter */: + case 146 /* Parameter */: return visitParameter(node); - case 225 /* FunctionDeclaration */: + case 228 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 185 /* ArrowFunction */: + case 187 /* ArrowFunction */: return visitArrowFunction(node); - case 184 /* FunctionExpression */: + case 186 /* FunctionExpression */: return visitFunctionExpression(node); - case 223 /* VariableDeclaration */: + case 226 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 70 /* Identifier */: + case 71 /* Identifier */: return visitIdentifier(node); - case 224 /* VariableDeclarationList */: + case 227 /* VariableDeclarationList */: return visitVariableDeclarationList(node); - case 219 /* LabeledStatement */: + case 221 /* SwitchStatement */: + return visitSwitchStatement(node); + case 235 /* CaseBlock */: + return visitCaseBlock(node); + case 207 /* Block */: + return visitBlock(node, /*isFunctionBody*/ false); + case 218 /* BreakStatement */: + case 217 /* ContinueStatement */: + return visitBreakOrContinueStatement(node); + case 222 /* LabeledStatement */: return visitLabeledStatement(node); - case 209 /* DoStatement */: - return visitDoStatement(node); - case 210 /* WhileStatement */: - return visitWhileStatement(node); - case 211 /* ForStatement */: - return visitForStatement(node); - case 212 /* ForInStatement */: - return visitForInStatement(node); - case 213 /* ForOfStatement */: - return visitForOfStatement(node); - case 207 /* ExpressionStatement */: + case 212 /* DoStatement */: + case 213 /* WhileStatement */: + return visitDoOrWhileStatement(node, /*outermostLabeledStatement*/ undefined); + case 214 /* ForStatement */: + return visitForStatement(node, /*outermostLabeledStatement*/ undefined); + case 215 /* ForInStatement */: + return visitForInStatement(node, /*outermostLabeledStatement*/ undefined); + case 216 /* ForOfStatement */: + return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); + case 210 /* ExpressionStatement */: return visitExpressionStatement(node); - case 176 /* ObjectLiteralExpression */: + case 178 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 256 /* CatchClause */: + case 260 /* CatchClause */: return visitCatchClause(node); - case 258 /* ShorthandPropertyAssignment */: + case 262 /* ShorthandPropertyAssignment */: return visitShorthandPropertyAssignment(node); - case 175 /* ArrayLiteralExpression */: + case 144 /* ComputedPropertyName */: + return visitComputedPropertyName(node); + case 177 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 179 /* CallExpression */: + case 181 /* CallExpression */: return visitCallExpression(node); - case 180 /* NewExpression */: + case 182 /* NewExpression */: return visitNewExpression(node); - case 183 /* ParenthesizedExpression */: + case 185 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, /*needsDestructuringValue*/ true); - case 192 /* BinaryExpression */: + case 194 /* BinaryExpression */: return visitBinaryExpression(node, /*needsDestructuringValue*/ true); - case 12 /* NoSubstitutionTemplateLiteral */: - case 13 /* TemplateHead */: - case 14 /* TemplateMiddle */: - case 15 /* TemplateTail */: + case 13 /* NoSubstitutionTemplateLiteral */: + case 14 /* TemplateHead */: + case 15 /* TemplateMiddle */: + case 16 /* TemplateTail */: return visitTemplateLiteral(node); - case 181 /* TaggedTemplateExpression */: + case 9 /* StringLiteral */: + return visitStringLiteral(node); + case 8 /* NumericLiteral */: + return visitNumericLiteral(node); + case 183 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 194 /* TemplateExpression */: + case 196 /* TemplateExpression */: return visitTemplateExpression(node); - case 195 /* YieldExpression */: + case 197 /* YieldExpression */: return visitYieldExpression(node); - case 196 /* SpreadElement */: + case 198 /* SpreadElement */: return visitSpreadElement(node); - case 96 /* SuperKeyword */: - return visitSuperKeyword(); - case 195 /* YieldExpression */: - // `yield` will be handled by a generators transform. - return ts.visitEachChild(node, visitor, context); - case 149 /* MethodDeclaration */: + case 97 /* SuperKeyword */: + return visitSuperKeyword(/*isExpressionOfCall*/ false); + case 99 /* ThisKeyword */: + return visitThisKeyword(node); + case 204 /* MetaProperty */: + return visitMetaProperty(node); + case 151 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 205 /* VariableStatement */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + return visitAccessorDeclaration(node); + case 208 /* VariableStatement */: return visitVariableStatement(node); + case 219 /* ReturnStatement */: + return visitReturnStatement(node); default: - ts.Debug.failBadSyntaxKind(node); return ts.visitEachChild(node, visitor, context); } } function visitSourceFile(node) { + var ancestorFacts = enterSubtree(3968 /* SourceFileExcludes */, 64 /* SourceFileIncludes */); var statements = []; startLexicalEnvironment(); - var statementOffset = ts.addPrologueDirectives(statements, node.statements, /*ensureUseStrict*/ false, visitor); + var statementOffset = ts.addStandardPrologue(statements, node.statements, /*ensureUseStrict*/ false); addCaptureThisForNodeIfNeeded(statements, node); + statementOffset = ts.addCustomPrologue(statements, node.statements, statementOffset, visitor); ts.addRange(statements, ts.visitNodes(node.statements, visitor, ts.isStatement, statementOffset)); ts.addRange(statements, endLexicalEnvironment()); - return ts.updateSourceFileNode(node, ts.createNodeArray(statements, node.statements)); + exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); + return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray(statements), node.statements)); } function visitSwitchStatement(node) { - ts.Debug.assert(convertedLoopState !== undefined); - var savedAllowedNonLabeledJumps = convertedLoopState.allowedNonLabeledJumps; - // for switch statement allow only non-labeled break - convertedLoopState.allowedNonLabeledJumps |= 2 /* Break */; - var result = ts.visitEachChild(node, visitor, context); - convertedLoopState.allowedNonLabeledJumps = savedAllowedNonLabeledJumps; - return result; + if (convertedLoopState !== undefined) { + var savedAllowedNonLabeledJumps = convertedLoopState.allowedNonLabeledJumps; + // for switch statement allow only non-labeled break + convertedLoopState.allowedNonLabeledJumps |= 2 /* Break */; + var result = ts.visitEachChild(node, visitor, context); + convertedLoopState.allowedNonLabeledJumps = savedAllowedNonLabeledJumps; + return result; + } + return ts.visitEachChild(node, visitor, context); + } + function visitCaseBlock(node) { + var ancestorFacts = enterSubtree(4032 /* BlockScopeExcludes */, 0 /* BlockScopeIncludes */); + var updated = ts.visitEachChild(node, visitor, context); + exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); + return updated; + } + function returnCapturedThis(node) { + return ts.setOriginalNode(ts.createReturn(ts.createIdentifier("_this")), node); } function visitReturnStatement(node) { - ts.Debug.assert(convertedLoopState !== undefined); - convertedLoopState.nonLocalJumps |= 8 /* Return */; - return ts.createReturn(ts.createObjectLiteral([ - ts.createPropertyAssignment(ts.createIdentifier("value"), node.expression - ? ts.visitNode(node.expression, visitor, ts.isExpression) - : ts.createVoidZero()) - ])); + if (convertedLoopState) { + convertedLoopState.nonLocalJumps |= 8 /* Return */; + if (isReturnVoidStatementInConstructorWithCapturedSuper(node)) { + node = returnCapturedThis(node); + } + return ts.createReturn(ts.createObjectLiteral([ + ts.createPropertyAssignment(ts.createIdentifier("value"), node.expression + ? ts.visitNode(node.expression, visitor, ts.isExpression) + : ts.createVoidZero()) + ])); + } + else if (isReturnVoidStatementInConstructorWithCapturedSuper(node)) { + return returnCapturedThis(node); + } + return ts.visitEachChild(node, visitor, context); } function visitThisKeyword(node) { - ts.Debug.assert(convertedLoopState !== undefined); - if (enclosingFunction && enclosingFunction.kind === 185 /* ArrowFunction */) { - // if the enclosing function is an ArrowFunction is then we use the captured 'this' keyword. - convertedLoopState.containsLexicalThis = true; - return node; + if (convertedLoopState) { + if (hierarchyFacts & 2 /* ArrowFunction */) { + // if the enclosing function is an ArrowFunction then we use the captured 'this' keyword. + convertedLoopState.containsLexicalThis = true; + return node; + } + return convertedLoopState.thisName || (convertedLoopState.thisName = ts.createUniqueName("this")); } - return convertedLoopState.thisName || (convertedLoopState.thisName = ts.createUniqueName("this")); + return node; } function visitIdentifier(node) { if (!convertedLoopState) { @@ -49804,7 +53534,7 @@ var ts; if (ts.isGeneratedIdentifier(node)) { return node; } - if (node.text !== "arguments" && !resolver.isArgumentsLocalBinding(node)) { + if (node.text !== "arguments" || !resolver.isArgumentsLocalBinding(node)) { return node; } return convertedLoopState.argumentsName || (convertedLoopState.argumentsName = ts.createUniqueName("arguments")); @@ -49815,13 +53545,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 === 215 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; - var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels[node.label.text]) || + var jump = node.kind === 218 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; + var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels.get(node.label.text)) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { var labelMarker = void 0; if (!node.label) { - if (node.kind === 215 /* BreakStatement */) { + if (node.kind === 218 /* BreakStatement */) { convertedLoopState.nonLocalJumps |= 2 /* Break */; labelMarker = "break"; } @@ -49832,7 +53562,7 @@ var ts; } } else { - if (node.kind === 215 /* BreakStatement */) { + if (node.kind === 218 /* BreakStatement */) { labelMarker = "break-" + node.label.text; setLabeledJump(convertedLoopState, /*isBreak*/ true, node.label.text, labelMarker); } @@ -49851,10 +53581,10 @@ var ts; expr = copyExpr; } else { - expr = ts.createBinary(expr, 25 /* CommaToken */, copyExpr); + expr = ts.createBinary(expr, 26 /* CommaToken */, copyExpr); } } - returnExpression = ts.createBinary(expr, 25 /* CommaToken */, returnExpression); + returnExpression = ts.createBinary(expr, 26 /* CommaToken */, returnExpression); } return ts.createReturn(returnExpression); } @@ -49880,8 +53610,9 @@ var ts; /*type*/ undefined, transformClassLikeDeclarationToExpression(node)); ts.setOriginalNode(variable, node); var statements = []; - var statement = ts.createVariableStatement(/*modifiers*/ undefined, ts.createVariableDeclarationList([variable]), /*location*/ node); + var statement = ts.createVariableStatement(/*modifiers*/ undefined, ts.createVariableDeclarationList([variable])); ts.setOriginalNode(statement, node); + ts.setTextRange(statement, node); ts.startOnNewLine(statement); statements.push(statement); // Add an `export default` statement for default exports (for `--target es5 --module es6`) @@ -49893,10 +53624,10 @@ var ts; statements.push(exportStatement); } var emitFlags = ts.getEmitFlags(node); - if ((emitFlags & 2097152 /* HasEndOfDeclarationMarker */) === 0) { + if ((emitFlags & 4194304 /* HasEndOfDeclarationMarker */) === 0) { // Add a DeclarationMarker as a marker for the end of the declaration statements.push(ts.createEndOfDeclarationMarker(node)); - ts.setEmitFlags(statement, emitFlags | 2097152 /* HasEndOfDeclarationMarker */); + ts.setEmitFlags(statement, emitFlags | 4194304 /* HasEndOfDeclarationMarker */); } return ts.singleOrMany(statements); } @@ -49958,8 +53689,8 @@ var ts; // To preserve the behavior of the old emitter, we explicitly indent // the body of the function here if it was requested in an earlier // transformation. - if (ts.getEmitFlags(node) & 32768 /* Indented */) { - ts.setEmitFlags(classFunction, 32768 /* Indented */); + if (ts.getEmitFlags(node) & 65536 /* Indented */) { + ts.setEmitFlags(classFunction, 65536 /* Indented */); } // "inner" and "outer" below are added purely to preserve source map locations from // the old emitter @@ -49987,8 +53718,8 @@ var ts; addConstructor(statements, node, extendsClauseElement); addClassMembers(statements, node); // Create a synthetic text range for the return statement. - var closingBraceLocation = ts.createTokenRange(ts.skipTrivia(currentText, node.members.end), 17 /* CloseBraceToken */); - var localName = ts.getLocalName(node); + var closingBraceLocation = ts.createTokenRange(ts.skipTrivia(currentText, node.members.end), 18 /* CloseBraceToken */); + var localName = ts.getInternalName(node); // The following partially-emitted expression exists purely to align our sourcemap // emit with the original emitter. var outer = ts.createPartiallyEmittedExpression(localName); @@ -49999,7 +53730,7 @@ var ts; ts.setEmitFlags(statement, 1536 /* NoComments */ | 384 /* NoTokenSourceMaps */); statements.push(statement); ts.addRange(statements, endLexicalEnvironment()); - var block = ts.createBlock(ts.createNodeArray(statements, /*location*/ node.members), /*location*/ undefined, /*multiLine*/ true); + var block = ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), /*location*/ node.members), /*multiLine*/ true); ts.setEmitFlags(block, 1536 /* NoComments */); return block; } @@ -50012,7 +53743,7 @@ var ts; */ function addExtendsHelperIfNeeded(statements, node, extendsClauseElement) { if (extendsClauseElement) { - statements.push(ts.createStatement(createExtendsHelper(context, ts.getLocalName(node)), + statements.push(ts.setTextRange(ts.createStatement(createExtendsHelper(context, ts.getLocalName(node))), /*location*/ extendsClauseElement)); } } @@ -50024,19 +53755,24 @@ var ts; * @param extendsClauseElement The expression for the class `extends` clause. */ function addConstructor(statements, node, extendsClauseElement) { + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = undefined; + var ancestorFacts = enterSubtree(16278 /* ConstructorExcludes */, 73 /* ConstructorIncludes */); var constructor = ts.getFirstConstructorWithBody(node); var hasSynthesizedSuper = hasSynthesizedDefaultSuperCall(constructor, extendsClauseElement !== undefined); var constructorFunction = ts.createFunctionDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, - /*asteriskToken*/ undefined, ts.getDeclarationName(node), + /*asteriskToken*/ undefined, ts.getInternalName(node), /*typeParameters*/ undefined, transformConstructorParameters(constructor, hasSynthesizedSuper), - /*type*/ undefined, transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper), - /*location*/ constructor || node); + /*type*/ undefined, transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper)); + ts.setTextRange(constructorFunction, constructor || node); if (extendsClauseElement) { ts.setEmitFlags(constructorFunction, 8 /* CapturesThis */); } statements.push(constructorFunction); + exitSubtree(ancestorFacts, 49152 /* PropagateNewTargetMask */, 0 /* None */); + convertedLoopState = savedConvertedLoopState; } /** * Transforms the parameters of the constructor declaration of a class. @@ -50074,28 +53810,30 @@ var ts; statementOffset = 0; } else if (constructor) { - // Otherwise, try to emit all potential prologue directives first. - statementOffset = ts.addPrologueDirectives(statements, constructor.body.statements, /*ensureUseStrict*/ false, visitor); + statementOffset = ts.addStandardPrologue(statements, constructor.body.statements, /*ensureUseStrict*/ false); } if (constructor) { addDefaultValueAssignmentsIfNeeded(statements, constructor); addRestParameterIfNeeded(statements, constructor, hasSynthesizedSuper); + if (!hasSynthesizedSuper) { + // If no super call has been synthesized, emit custom prologue directives. + statementOffset = ts.addCustomPrologue(statements, constructor.body.statements, statementOffset, visitor); + } ts.Debug.assert(statementOffset >= 0, "statementOffset not initialized correctly!"); } // determine whether the class is known syntactically to be a derived class (e.g. a // class that extends a value that is not syntactically known to be `null`). - var isDerivedClass = extendsClauseElement && ts.skipOuterExpressions(extendsClauseElement.expression).kind !== 94 /* NullKeyword */; + var isDerivedClass = extendsClauseElement && ts.skipOuterExpressions(extendsClauseElement.expression).kind !== 95 /* NullKeyword */; var superCaptureStatus = declareOrCaptureOrReturnThisForConstructorIfNeeded(statements, constructor, isDerivedClass, hasSynthesizedSuper, statementOffset); // The last statement expression was replaced. Skip it. if (superCaptureStatus === 1 /* ReplaceSuperCapture */ || superCaptureStatus === 2 /* ReplaceWithReturn */) { statementOffset++; } if (constructor) { - var body = saveStateAndInvoke(constructor, function (constructor) { - isInConstructorWithCapturedSuper = superCaptureStatus === 1 /* ReplaceSuperCapture */; - return ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, /*start*/ statementOffset); - }); - ts.addRange(statements, body); + if (superCaptureStatus === 1 /* ReplaceSuperCapture */) { + hierarchyFacts |= 4096 /* ConstructorWithCapturedSuper */; + } + ts.addRange(statements, ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, /*start*/ statementOffset)); } // Return `_this` unless we're sure enough that it would be pointless to add a return statement. // If there's a constructor that we can tell returns in enough places, then we *do not* want to add a return. @@ -50105,10 +53843,13 @@ var ts; statements.push(ts.createReturn(ts.createIdentifier("_this"))); } ts.addRange(statements, endLexicalEnvironment()); - var block = ts.createBlock(ts.createNodeArray(statements, + if (constructor) { + prependCaptureNewTargetIfNeeded(statements, constructor, /*copyOnWrite*/ false); + } + var block = ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), /*location*/ constructor ? constructor.body.statements : node.members), - /*location*/ constructor ? constructor.body : node, /*multiLine*/ true); + ts.setTextRange(block, constructor ? constructor.body : node); if (!constructor) { ts.setEmitFlags(block, 1536 /* NoComments */); } @@ -50121,17 +53862,17 @@ var ts; */ function isSufficientlyCoveredByReturnStatements(statement) { // A return statement is considered covered. - if (statement.kind === 216 /* ReturnStatement */) { + if (statement.kind === 219 /* ReturnStatement */) { return true; } - else if (statement.kind === 208 /* IfStatement */) { + else if (statement.kind === 211 /* IfStatement */) { var ifStatement = statement; if (ifStatement.elseStatement) { return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && isSufficientlyCoveredByReturnStatements(ifStatement.elseStatement); } } - else if (statement.kind === 204 /* Block */) { + else if (statement.kind === 207 /* Block */) { var lastStatement = ts.lastOrUndefined(statement.statements); if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { return true; @@ -50189,9 +53930,8 @@ var ts; var ctorStatements = ctor.body.statements; if (statementOffset < ctorStatements.length) { firstStatement = ctorStatements[statementOffset]; - if (firstStatement.kind === 207 /* ExpressionStatement */ && ts.isSuperCall(firstStatement.expression)) { - var superCall = firstStatement.expression; - superCallExpression = ts.setOriginalNode(saveStateAndInvoke(superCall, visitImmediateSuperCallInBody), superCall); + if (firstStatement.kind === 210 /* ExpressionStatement */ && ts.isSuperCall(firstStatement.expression)) { + superCallExpression = visitImmediateSuperCallInBody(firstStatement.expression); } } // Return the result if we have an immediate super() call on the last statement, @@ -50200,8 +53940,8 @@ var ts; && statementOffset === ctorStatements.length - 1 && !(ctor.transformFlags & (16384 /* ContainsLexicalThis */ | 32768 /* ContainsCapturedLexicalThis */))) { var returnStatement = ts.createReturn(superCallExpression); - if (superCallExpression.kind !== 192 /* BinaryExpression */ - || superCallExpression.left.kind !== 179 /* CallExpression */) { + if (superCallExpression.kind !== 194 /* BinaryExpression */ + || superCallExpression.left.kind !== 181 /* 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. @@ -50236,25 +53976,25 @@ var ts; else if (ts.isBindingPattern(node.name)) { // Binding patterns are converted into a generated name and are // evaluated inside the function body. - return ts.setOriginalNode(ts.createParameter( + return ts.setOriginalNode(ts.setTextRange(ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, ts.getGeneratedNameForNode(node), /*questionToken*/ undefined, /*type*/ undefined, - /*initializer*/ undefined, + /*initializer*/ undefined), /*location*/ node), /*original*/ node); } else if (node.initializer) { // Initializers are elided - return ts.setOriginalNode(ts.createParameter( + return ts.setOriginalNode(ts.setTextRange(ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, node.name, /*questionToken*/ undefined, /*type*/ undefined, - /*initializer*/ undefined, + /*initializer*/ undefined), /*location*/ node), /*original*/ node); } @@ -50284,17 +54024,17 @@ var ts; } for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { var parameter = _a[_i]; - var name_36 = parameter.name, initializer = parameter.initializer, dotDotDotToken = parameter.dotDotDotToken; + var name = parameter.name, initializer = parameter.initializer, dotDotDotToken = parameter.dotDotDotToken; // A rest parameter cannot have a binding pattern or an initializer, // so let's just ignore it. if (dotDotDotToken) { continue; } - if (ts.isBindingPattern(name_36)) { - addDefaultValueAssignmentForBindingPattern(statements, parameter, name_36, initializer); + if (ts.isBindingPattern(name)) { + addDefaultValueAssignmentForBindingPattern(statements, parameter, name, initializer); } else if (initializer) { - addDefaultValueAssignmentForInitializer(statements, parameter, name_36, initializer); + addDefaultValueAssignmentForInitializer(statements, parameter, name, initializer); } } } @@ -50313,10 +54053,10 @@ var ts; // of an initializer, we must emit that expression to preserve side effects. if (name.elements.length > 0) { statements.push(ts.setEmitFlags(ts.createVariableStatement( - /*modifiers*/ undefined, ts.createVariableDeclarationList(ts.flattenDestructuringBinding(parameter, visitor, context, 0 /* All */, temp))), 524288 /* CustomPrologue */)); + /*modifiers*/ undefined, ts.createVariableDeclarationList(ts.flattenDestructuringBinding(parameter, visitor, context, 0 /* All */, temp))), 1048576 /* CustomPrologue */)); } else if (initializer) { - statements.push(ts.setEmitFlags(ts.createStatement(ts.createAssignment(temp, ts.visitNode(initializer, visitor, ts.isExpression))), 524288 /* CustomPrologue */)); + statements.push(ts.setEmitFlags(ts.createStatement(ts.createAssignment(temp, ts.visitNode(initializer, visitor, ts.isExpression))), 1048576 /* CustomPrologue */)); } } /** @@ -50329,14 +54069,12 @@ 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.createBlock([ - ts.createStatement(ts.createAssignment(ts.setEmitFlags(ts.getMutableClone(name), 48 /* NoSourceMap */), ts.setEmitFlags(initializer, 48 /* NoSourceMap */ | ts.getEmitFlags(initializer)), - /*location*/ parameter)) - ], /*location*/ parameter), 1 /* SingleLine */ | 32 /* NoTrailingSourceMap */ | 384 /* NoTokenSourceMaps */), - /*elseStatement*/ undefined, - /*location*/ parameter); + 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 */)); statement.startsOnNewLine = true; - ts.setEmitFlags(statement, 384 /* NoTokenSourceMaps */ | 32 /* NoTrailingSourceMap */ | 524288 /* CustomPrologue */); + ts.setTextRange(statement, parameter); + ts.setEmitFlags(statement, 384 /* NoTokenSourceMaps */ | 32 /* NoTrailingSourceMap */ | 1048576 /* CustomPrologue */); statements.push(statement); } /** @@ -50348,7 +54086,7 @@ var ts; * synthesized call to `super` */ function shouldAddRestParameter(node, inConstructorWithSynthesizedSuper) { - return node && node.dotDotDotToken && node.name.kind === 70 /* Identifier */ && !inConstructorWithSynthesizedSuper; + return node && node.dotDotDotToken && node.name.kind === 71 /* Identifier */ && !inConstructorWithSynthesizedSuper; } /** * Adds statements to the body of a function-like node if it contains a rest parameter. @@ -50372,25 +54110,24 @@ var ts; var restIndex = node.parameters.length - 1; var temp = ts.createLoopVariable(); // var param = []; - statements.push(ts.setEmitFlags(ts.createVariableStatement( + statements.push(ts.setEmitFlags(ts.setTextRange(ts.createVariableStatement( /*modifiers*/ undefined, ts.createVariableDeclarationList([ ts.createVariableDeclaration(declarationName, /*type*/ undefined, ts.createArrayLiteral([])) - ]), - /*location*/ parameter), 524288 /* CustomPrologue */)); + ])), + /*location*/ parameter), 1048576 /* CustomPrologue */)); // for (var _i = restIndex; _i < arguments.length; _i++) { // param[_i - restIndex] = arguments[_i]; // } - var forStatement = ts.createFor(ts.createVariableDeclarationList([ + var forStatement = ts.createFor(ts.setTextRange(ts.createVariableDeclarationList([ ts.createVariableDeclaration(temp, /*type*/ undefined, ts.createLiteral(restIndex)) - ], /*location*/ parameter), ts.createLessThan(temp, ts.createPropertyAccess(ts.createIdentifier("arguments"), "length"), - /*location*/ parameter), ts.createPostfixIncrement(temp, /*location*/ parameter), ts.createBlock([ - ts.startOnNewLine(ts.createStatement(ts.createAssignment(ts.createElementAccess(expressionName, restIndex === 0 + ]), parameter), ts.setTextRange(ts.createLessThan(temp, ts.createPropertyAccess(ts.createIdentifier("arguments"), "length")), parameter), ts.setTextRange(ts.createPostfixIncrement(temp), parameter), ts.createBlock([ + ts.startOnNewLine(ts.setTextRange(ts.createStatement(ts.createAssignment(ts.createElementAccess(expressionName, restIndex === 0 ? temp - : ts.createSubtract(temp, ts.createLiteral(restIndex))), ts.createElementAccess(ts.createIdentifier("arguments"), temp)), + : ts.createSubtract(temp, ts.createLiteral(restIndex))), ts.createElementAccess(ts.createIdentifier("arguments"), temp))), /*location*/ parameter)) ])); - ts.setEmitFlags(forStatement, 524288 /* CustomPrologue */); + ts.setEmitFlags(forStatement, 1048576 /* CustomPrologue */); ts.startOnNewLine(forStatement); statements.push(forStatement); } @@ -50401,7 +54138,7 @@ var ts; * @param node A node. */ function addCaptureThisForNodeIfNeeded(statements, node) { - if (node.transformFlags & 32768 /* ContainsCapturedLexicalThis */ && node.kind !== 185 /* ArrowFunction */) { + if (node.transformFlags & 32768 /* ContainsCapturedLexicalThis */ && node.kind !== 187 /* ArrowFunction */) { captureThisForNode(statements, node, ts.createThis()); } } @@ -50411,11 +54148,52 @@ var ts; /*modifiers*/ undefined, ts.createVariableDeclarationList([ ts.createVariableDeclaration("_this", /*type*/ undefined, initializer) - ]), originalStatement); - ts.setEmitFlags(captureThisStatement, 1536 /* NoComments */ | 524288 /* CustomPrologue */); + ])); + ts.setEmitFlags(captureThisStatement, 1536 /* NoComments */ | 1048576 /* CustomPrologue */); + ts.setTextRange(captureThisStatement, originalStatement); ts.setSourceMapRange(captureThisStatement, node); statements.push(captureThisStatement); } + function prependCaptureNewTargetIfNeeded(statements, node, copyOnWrite) { + if (hierarchyFacts & 16384 /* NewTarget */) { + var newTarget = void 0; + switch (node.kind) { + case 187 /* ArrowFunction */: + return statements; + case 151 /* MethodDeclaration */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + // Methods and accessors cannot be constructors, so 'new.target' will + // always return 'undefined'. + newTarget = ts.createVoidZero(); + break; + case 152 /* 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 228 /* FunctionDeclaration */: + case 186 /* 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()); + break; + default: + ts.Debug.failBadSyntaxKind(node); + break; + } + var captureNewTargetStatement = ts.createVariableStatement( + /*modifiers*/ undefined, ts.createVariableDeclarationList([ + ts.createVariableDeclaration("_newTarget", + /*type*/ undefined, newTarget) + ])); + if (copyOnWrite) { + return [captureNewTargetStatement].concat(statements); + } + statements.unshift(captureNewTargetStatement); + } + return statements; + } /** * Adds statements to the class body function for a class to define the members of the * class. @@ -50427,20 +54205,20 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 203 /* SemicolonClassElement */: + case 206 /* SemicolonClassElement */: statements.push(transformSemicolonClassElementToStatement(member)); break; - case 149 /* MethodDeclaration */: - statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member)); + case 151 /* MethodDeclaration */: + statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); break; - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { - statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors)); + statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); } break; - case 150 /* Constructor */: + case 152 /* Constructor */: // Constructors are handled in visitClassExpression/visitClassDeclaration break; default: @@ -50455,7 +54233,7 @@ var ts; * @param member The SemicolonClassElement node. */ function transformSemicolonClassElementToStatement(member) { - return ts.createEmptyStatement(/*location*/ member); + return ts.setTextRange(ts.createEmptyStatement(), member); } /** * Transforms a MethodDeclaration into a statement for a class body function. @@ -50463,14 +54241,15 @@ var ts; * @param receiver The receiver for the member. * @param member The MethodDeclaration node. */ - function transformClassMethodDeclarationToStatement(receiver, member) { + function transformClassMethodDeclarationToStatement(receiver, member, container) { + var ancestorFacts = enterSubtree(0 /* None */, 0 /* None */); var commentRange = ts.getCommentRange(member); var sourceMapRange = ts.getSourceMapRange(member); var memberName = ts.createMemberAccessForPropertyName(receiver, ts.visitNode(member.name, visitor, ts.isPropertyName), /*location*/ member.name); - var memberFunction = transformFunctionLikeToExpression(member, /*location*/ member, /*name*/ undefined); + var memberFunction = transformFunctionLikeToExpression(member, /*location*/ member, /*name*/ undefined, container); ts.setEmitFlags(memberFunction, 1536 /* NoComments */); ts.setSourceMapRange(memberFunction, sourceMapRange); - var statement = ts.createStatement(ts.createAssignment(memberName, memberFunction), + var statement = ts.setTextRange(ts.createStatement(ts.createAssignment(memberName, memberFunction)), /*location*/ member); ts.setOriginalNode(statement, member); ts.setCommentRange(statement, commentRange); @@ -50478,6 +54257,7 @@ var ts; // No source map should be emitted for this statement to align with the // old emitter. ts.setEmitFlags(statement, 48 /* NoSourceMap */); + exitSubtree(ancestorFacts, 49152 /* PropagateNewTargetMask */, hierarchyFacts & 49152 /* PropagateNewTargetMask */ ? 16384 /* NewTarget */ : 0 /* None */); return statement; } /** @@ -50486,13 +54266,13 @@ var ts; * @param receiver The receiver for the member. * @param accessors The set of related get/set accessors. */ - function transformAccessorsToStatement(receiver, accessors) { - var statement = ts.createStatement(transformAccessorsToExpression(receiver, accessors, /*startsOnNewLine*/ false), - /*location*/ ts.getSourceMapRange(accessors.firstAccessor)); + function transformAccessorsToStatement(receiver, accessors, container) { + var statement = ts.createStatement(transformAccessorsToExpression(receiver, accessors, container, /*startsOnNewLine*/ false)); // The location for the statement is used to emit source maps only. // No comments should be emitted for this statement to align with the // old emitter. ts.setEmitFlags(statement, 1536 /* NoComments */); + ts.setSourceMapRange(statement, ts.getSourceMapRange(accessors.firstAccessor)); return statement; } /** @@ -50501,8 +54281,9 @@ var ts; * * @param receiver The receiver for the member. */ - function transformAccessorsToExpression(receiver, _a, startsOnNewLine) { + function transformAccessorsToExpression(receiver, _a, container, startsOnNewLine) { var firstAccessor = _a.firstAccessor, getAccessor = _a.getAccessor, setAccessor = _a.setAccessor; + var ancestorFacts = enterSubtree(0 /* None */, 0 /* None */); // To align with source maps in the old emitter, the receiver and property name // arguments are both mapped contiguously to the accessor name. var target = ts.getMutableClone(receiver); @@ -50513,7 +54294,7 @@ var ts; ts.setSourceMapRange(propertyName, firstAccessor.name); var properties = []; if (getAccessor) { - var getterFunction = transformFunctionLikeToExpression(getAccessor, /*location*/ undefined, /*name*/ undefined); + var getterFunction = transformFunctionLikeToExpression(getAccessor, /*location*/ undefined, /*name*/ undefined, container); ts.setSourceMapRange(getterFunction, ts.getSourceMapRange(getAccessor)); ts.setEmitFlags(getterFunction, 512 /* NoLeadingComments */); var getter = ts.createPropertyAssignment("get", getterFunction); @@ -50521,23 +54302,24 @@ var ts; properties.push(getter); } if (setAccessor) { - var setterFunction = transformFunctionLikeToExpression(setAccessor, /*location*/ undefined, /*name*/ undefined); + var setterFunction = transformFunctionLikeToExpression(setAccessor, /*location*/ undefined, /*name*/ undefined, container); ts.setSourceMapRange(setterFunction, ts.getSourceMapRange(setAccessor)); ts.setEmitFlags(setterFunction, 512 /* NoLeadingComments */); var setter = ts.createPropertyAssignment("set", setterFunction); ts.setCommentRange(setter, ts.getCommentRange(setAccessor)); properties.push(setter); } - properties.push(ts.createPropertyAssignment("enumerable", ts.createLiteral(true)), ts.createPropertyAssignment("configurable", ts.createLiteral(true))); + properties.push(ts.createPropertyAssignment("enumerable", ts.createTrue()), ts.createPropertyAssignment("configurable", ts.createTrue())); var call = ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "defineProperty"), /*typeArguments*/ undefined, [ target, propertyName, - ts.createObjectLiteral(properties, /*location*/ undefined, /*multiLine*/ true) + ts.createObjectLiteral(properties, /*multiLine*/ true) ]); if (startsOnNewLine) { call.startsOnNewLine = true; } + exitSubtree(ancestorFacts, 49152 /* PropagateNewTargetMask */, hierarchyFacts & 49152 /* PropagateNewTargetMask */ ? 16384 /* NewTarget */ : 0 /* None */); return call; } /** @@ -50549,14 +54331,20 @@ var ts; if (node.transformFlags & 16384 /* ContainsLexicalThis */) { enableSubstitutionsForCapturedThis(); } + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = undefined; + var ancestorFacts = enterSubtree(16256 /* ArrowFunctionExcludes */, 66 /* ArrowFunctionIncludes */); var func = ts.createFunctionExpression( /*modifiers*/ undefined, /*asteriskToken*/ undefined, /*name*/ undefined, /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, transformFunctionBody(node), node); + /*type*/ undefined, transformFunctionBody(node)); + ts.setTextRange(func, node); ts.setOriginalNode(func, node); ts.setEmitFlags(func, 8 /* CapturesThis */); + exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); + convertedLoopState = savedConvertedLoopState; return func; } /** @@ -50565,12 +54353,24 @@ var ts; * @param node a FunctionExpression node. */ function visitFunctionExpression(node) { - return ts.updateFunctionExpression(node, - /*modifiers*/ undefined, node.name, - /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, node.transformFlags & 64 /* ES2015 */ + var ancestorFacts = ts.getEmitFlags(node) & 262144 /* AsyncFunctionBody */ + ? enterSubtree(16278 /* AsyncFunctionBodyExcludes */, 69 /* AsyncFunctionBodyIncludes */) + : enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */); + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = undefined; + var parameters = ts.visitParameterList(node.parameters, visitor, context); + var body = node.transformFlags & 64 /* ES2015 */ ? transformFunctionBody(node) - : ts.visitFunctionBody(node.body, visitor, context)); + : visitFunctionBodyDownLevel(node); + var name = hierarchyFacts & 16384 /* NewTarget */ + ? ts.getLocalName(node) + : node.name; + exitSubtree(ancestorFacts, 49152 /* PropagateNewTargetMask */, 0 /* None */); + convertedLoopState = savedConvertedLoopState; + return ts.updateFunctionExpression(node, + /*modifiers*/ undefined, node.asteriskToken, name, + /*typeParameters*/ undefined, parameters, + /*type*/ undefined, body); } /** * Visits a FunctionDeclaration node. @@ -50578,12 +54378,22 @@ var ts; * @param node a FunctionDeclaration node. */ function visitFunctionDeclaration(node) { - return ts.updateFunctionDeclaration(node, - /*decorators*/ undefined, node.modifiers, node.name, - /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, node.transformFlags & 64 /* ES2015 */ + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = undefined; + var ancestorFacts = enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */); + var parameters = ts.visitParameterList(node.parameters, visitor, context); + var body = node.transformFlags & 64 /* ES2015 */ ? transformFunctionBody(node) - : ts.visitFunctionBody(node.body, visitor, context)); + : visitFunctionBodyDownLevel(node); + var name = hierarchyFacts & 16384 /* NewTarget */ + ? ts.getLocalName(node) + : node.name; + exitSubtree(ancestorFacts, 49152 /* PropagateNewTargetMask */, 0 /* None */); + convertedLoopState = savedConvertedLoopState; + return ts.updateFunctionDeclaration(node, + /*decorators*/ undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, name, + /*typeParameters*/ undefined, parameters, + /*type*/ undefined, body); } /** * Transforms a function-like node into a FunctionExpression. @@ -50592,18 +54402,24 @@ var ts; * @param location The source-map location for the new FunctionExpression. * @param name The name of the new FunctionExpression. */ - function transformFunctionLikeToExpression(node, location, name) { - var savedContainingNonArrowFunction = enclosingNonArrowFunction; - if (node.kind !== 185 /* ArrowFunction */) { - enclosingNonArrowFunction = node; + function transformFunctionLikeToExpression(node, location, name, container) { + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = undefined; + var ancestorFacts = container && ts.isClassLike(container) && !ts.hasModifier(node, 32 /* Static */) + ? enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */ | 8 /* NonStaticClassElement */) + : enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */); + var parameters = ts.visitParameterList(node.parameters, visitor, context); + var body = transformFunctionBody(node); + if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 228 /* FunctionDeclaration */ || node.kind === 186 /* FunctionExpression */)) { + name = ts.getGeneratedNameForNode(node); } - var expression = ts.setOriginalNode(ts.createFunctionExpression( + exitSubtree(ancestorFacts, 49152 /* PropagateNewTargetMask */, 0 /* None */); + convertedLoopState = savedConvertedLoopState; + return ts.setOriginalNode(ts.setTextRange(ts.createFunctionExpression( /*modifiers*/ undefined, node.asteriskToken, name, - /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, saveStateAndInvoke(node, transformFunctionBody), location), + /*typeParameters*/ undefined, parameters, + /*type*/ undefined, body), location), /*original*/ node); - enclosingNonArrowFunction = savedContainingNonArrowFunction; - return expression; } /** * Transforms the body of a function-like node. @@ -50621,8 +54437,8 @@ var ts; resumeLexicalEnvironment(); if (ts.isBlock(body)) { // ensureUseStrict is false because no new prologue-directive should be added. - // addPrologueDirectives will simply put already-existing directives at the beginning of the target statement-array - statementOffset = ts.addPrologueDirectives(statements, body.statements, /*ensureUseStrict*/ false, visitor); + // addStandardPrologue will put already-existing directives at the beginning of the target statement-array + statementOffset = ts.addStandardPrologue(statements, body.statements, /*ensureUseStrict*/ false); } addCaptureThisForNodeIfNeeded(statements, node); addDefaultValueAssignmentsIfNeeded(statements, node); @@ -50632,6 +54448,8 @@ var ts; multiLine = true; } if (ts.isBlock(body)) { + // addCustomPrologue puts already-existing directives at the beginning of the target statement-array + statementOffset = ts.addCustomPrologue(statements, body.statements, statementOffset, visitor); statementsLocation = body.statements; ts.addRange(statements, ts.visitNodes(body.statements, visitor, ts.isStatement, statementOffset)); // If the original body was a multi-line block, this must be a multi-line block. @@ -50640,7 +54458,7 @@ var ts; } } else { - ts.Debug.assert(node.kind === 185 /* ArrowFunction */); + ts.Debug.assert(node.kind === 187 /* 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 @@ -50656,7 +54474,8 @@ var ts; } } var expression = ts.visitNode(body, visitor, ts.isExpression); - var returnStatement = ts.createReturn(expression, /*location*/ body); + var returnStatement = ts.createReturn(expression); + ts.setTextRange(returnStatement, body); ts.setEmitFlags(returnStatement, 384 /* NoTokenSourceMaps */ | 32 /* NoTrailingSourceMap */ | 1024 /* NoTrailingComments */); statements.push(returnStatement); // To align with the source map emit for the old emitter, we set a custom @@ -50665,20 +54484,39 @@ var ts; } var lexicalEnvironment = context.endLexicalEnvironment(); ts.addRange(statements, lexicalEnvironment); + prependCaptureNewTargetIfNeeded(statements, node, /*copyOnWrite*/ false); // If we added any final generated statements, this must be a multi-line block if (!multiLine && lexicalEnvironment && lexicalEnvironment.length) { multiLine = true; } - var block = ts.createBlock(ts.createNodeArray(statements, statementsLocation), node.body, multiLine); + var block = ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), statementsLocation), multiLine); + ts.setTextRange(block, node.body); if (!multiLine && singleLine) { ts.setEmitFlags(block, 1 /* SingleLine */); } if (closeBraceLocation) { - ts.setTokenSourceMapRange(block, 17 /* CloseBraceToken */, closeBraceLocation); + ts.setTokenSourceMapRange(block, 18 /* CloseBraceToken */, closeBraceLocation); } ts.setOriginalNode(block, node.body); return block; } + function visitFunctionBodyDownLevel(node) { + var updated = ts.visitFunctionBody(node.body, functionBodyVisitor, context); + return ts.updateBlock(updated, ts.setTextRange(ts.createNodeArray(prependCaptureNewTargetIfNeeded(updated.statements, node, /*copyOnWrite*/ true)), + /*location*/ updated.statements)); + } + function visitBlock(node, isFunctionBody) { + if (isFunctionBody) { + // A function body is not a block scope. + return ts.visitEachChild(node, visitor, context); + } + var ancestorFacts = hierarchyFacts & 256 /* IterationStatement */ + ? enterSubtree(4032 /* IterationStatementBlockExcludes */, 512 /* IterationStatementBlockIncludes */) + : enterSubtree(3904 /* BlockExcludes */, 128 /* BlockIncludes */); + var updated = ts.visitEachChild(node, visitor, context); + exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); + return updated; + } /** * Visits an ExpressionStatement that contains a destructuring assignment. * @@ -50687,9 +54525,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 183 /* ParenthesizedExpression */: + case 185 /* ParenthesizedExpression */: return ts.updateStatement(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 192 /* BinaryExpression */: + case 194 /* BinaryExpression */: return ts.updateStatement(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } return ts.visitEachChild(node, visitor, context); @@ -50704,10 +54542,13 @@ var ts; function visitParenthesizedExpression(node, needsDestructuringValue) { // If we are here it is most likely because our expression is a destructuring assignment. if (!needsDestructuringValue) { + // By default we always emit the RHS at the end of a flattened destructuring + // 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 183 /* ParenthesizedExpression */: + case 185 /* ParenthesizedExpression */: return ts.updateParen(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 192 /* BinaryExpression */: + case 194 /* BinaryExpression */: return ts.updateParen(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } } @@ -50725,9 +54566,12 @@ var ts; if (ts.isDestructuringAssignment(node)) { return ts.flattenDestructuringAssignment(node, visitor, context, 0 /* All */, needsDestructuringValue); } + return ts.visitEachChild(node, visitor, context); } function visitVariableStatement(node) { - if (convertedLoopState && (ts.getCombinedNodeFlags(node.declarationList) & 3 /* BlockScoped */) == 0) { + var ancestorFacts = enterSubtree(0 /* None */, ts.hasModifier(node, 1 /* Export */) ? 32 /* ExportedVariableStatement */ : 0 /* None */); + var updated; + if (convertedLoopState && (node.declarationList.flags & 3 /* BlockScoped */) === 0) { // we are inside a converted loop - hoist variable declarations var assignments = void 0; for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { @@ -50739,20 +54583,24 @@ var ts; assignment = ts.flattenDestructuringAssignment(decl, visitor, context, 0 /* All */); } else { - assignment = ts.createBinary(decl.name, 57 /* EqualsToken */, ts.visitNode(decl.initializer, visitor, ts.isExpression)); + assignment = ts.createBinary(decl.name, 58 /* EqualsToken */, ts.visitNode(decl.initializer, visitor, ts.isExpression)); } - (assignments || (assignments = [])).push(assignment); + assignments = ts.append(assignments, assignment); } } if (assignments) { - return ts.createStatement(ts.reduceLeft(assignments, function (acc, v) { return ts.createBinary(v, 25 /* CommaToken */, acc); }), node); + updated = ts.setTextRange(ts.createStatement(ts.reduceLeft(assignments, function (acc, v) { return ts.createBinary(v, 26 /* CommaToken */, acc); })), node); } else { // none of declarations has initializer - the entire variable statement can be deleted - return undefined; + updated = undefined; } } - return ts.visitEachChild(node, visitor, context); + else { + updated = ts.visitEachChild(node, visitor, context); + } + exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); + return updated; } /** * Visits a VariableDeclarationList that is block scoped (e.g. `let` or `const`). @@ -50760,25 +54608,29 @@ var ts; * @param node A VariableDeclarationList node. */ function visitVariableDeclarationList(node) { - if (node.flags & 3 /* BlockScoped */) { - enableSubstitutionsForBlockScopedBindings(); + if (node.transformFlags & 64 /* ES2015 */) { + if (node.flags & 3 /* BlockScoped */) { + enableSubstitutionsForBlockScopedBindings(); + } + var declarations = ts.flatten(ts.map(node.declarations, node.flags & 1 /* Let */ + ? visitVariableDeclarationInLetDeclarationList + : visitVariableDeclaration)); + var declarationList = ts.createVariableDeclarationList(declarations); + ts.setOriginalNode(declarationList, node); + ts.setTextRange(declarationList, node); + ts.setCommentRange(declarationList, node); + if (node.transformFlags & 8388608 /* ContainsBindingPattern */ + && (ts.isBindingPattern(node.declarations[0].name) + || ts.isBindingPattern(ts.lastOrUndefined(node.declarations).name))) { + // If the first or last declaration is a binding pattern, we need to modify + // the source map range for the declaration list. + var firstDeclaration = ts.firstOrUndefined(declarations); + var lastDeclaration = ts.lastOrUndefined(declarations); + ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end)); + } + return declarationList; } - var declarations = ts.flatten(ts.map(node.declarations, node.flags & 1 /* Let */ - ? visitVariableDeclarationInLetDeclarationList - : visitVariableDeclaration)); - var declarationList = ts.createVariableDeclarationList(declarations, /*location*/ node); - ts.setOriginalNode(declarationList, node); - ts.setCommentRange(declarationList, node); - if (node.transformFlags & 8388608 /* ContainsBindingPattern */ - && (ts.isBindingPattern(node.declarations[0].name) - || ts.isBindingPattern(ts.lastOrUndefined(node.declarations).name))) { - // If the first or last declaration is a binding pattern, we need to modify - // the source map range for the declaration list. - var firstDeclaration = ts.firstOrUndefined(declarations); - var lastDeclaration = ts.lastOrUndefined(declarations); - ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end)); - } - return declarationList; + return ts.visitEachChild(node, visitor, context); } /** * Gets a value indicating whether we should emit an explicit initializer for a variable @@ -50829,18 +54681,16 @@ var ts; var flags = resolver.getNodeCheckFlags(node); var isCapturedInFunction = flags & 131072 /* CapturedBlockScopedBinding */; var isDeclaredInLoop = flags & 262144 /* BlockScopedBindingInLoop */; - var emittedAsTopLevel = ts.isBlockScopedContainerTopLevel(enclosingBlockScopeContainer) + var emittedAsTopLevel = (hierarchyFacts & 64 /* TopLevel */) !== 0 || (isCapturedInFunction && isDeclaredInLoop - && ts.isBlock(enclosingBlockScopeContainer) - && ts.isIterationStatement(enclosingBlockScopeContainerParent, /*lookInLabeledStatements*/ false)); + && (hierarchyFacts & 512 /* IterationStatementBlock */) !== 0); var emitExplicitInitializer = !emittedAsTopLevel - && enclosingBlockScopeContainer.kind !== 212 /* ForInStatement */ - && enclosingBlockScopeContainer.kind !== 213 /* ForOfStatement */ + && (hierarchyFacts & 2048 /* ForInOrForOfStatement */) === 0 && (!resolver.isDeclarationWithCollidingName(node) || (isDeclaredInLoop && !isCapturedInFunction - && !ts.isIterationStatement(enclosingBlockScopeContainer, /*lookInLabeledStatements*/ false))); + && (hierarchyFacts & (1024 /* ForStatement */ | 2048 /* ForInOrForOfStatement */)) === 0)); return emitExplicitInitializer; } /** @@ -50869,55 +54719,130 @@ var ts; * @param node A VariableDeclaration node. */ function visitVariableDeclaration(node) { - // If we are here it is because the name contains a binding pattern. + var ancestorFacts = enterSubtree(32 /* ExportedVariableStatement */, 0 /* None */); + var updated; if (ts.isBindingPattern(node.name)) { - var hoistTempVariables = enclosingVariableStatement - && ts.hasModifier(enclosingVariableStatement, 1 /* Export */); - return ts.flattenDestructuringBinding(node, visitor, context, 0 /* All */, - /*value*/ undefined, hoistTempVariables); - } - return ts.visitEachChild(node, visitor, context); - } - function visitLabeledStatement(node) { - if (convertedLoopState) { - if (!convertedLoopState.labels) { - convertedLoopState.labels = ts.createMap(); - } - convertedLoopState.labels[node.label.text] = node.label.text; - } - var result; - if (ts.isIterationStatement(node.statement, /*lookInLabeledStatements*/ false) && shouldConvertIterationStatementBody(node.statement)) { - result = ts.visitNodes(ts.createNodeArray([node.statement]), visitor, ts.isStatement); + updated = ts.flattenDestructuringBinding(node, visitor, context, 0 /* All */, + /*value*/ undefined, (ancestorFacts & 32 /* ExportedVariableStatement */) !== 0); } else { - result = ts.visitEachChild(node, visitor, context); + updated = ts.visitEachChild(node, visitor, context); } - if (convertedLoopState) { - convertedLoopState.labels[node.label.text] = undefined; + exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); + return updated; + } + function recordLabel(node) { + convertedLoopState.labels.set(node.label.text, node.label.text); + } + function resetLabel(node) { + convertedLoopState.labels.set(node.label.text, undefined); + } + function visitLabeledStatement(node) { + if (convertedLoopState && !convertedLoopState.labels) { + convertedLoopState.labels = ts.createMap(); } - return result; + var statement = ts.unwrapInnermostStatementOfLabel(node, convertedLoopState && recordLabel); + return ts.isIterationStatement(statement, /*lookInLabeledStatements*/ false) + ? visitIterationStatement(statement, /*outermostLabeledStatement*/ node) + : ts.restoreEnclosingLabel(ts.visitNode(statement, visitor, ts.isStatement), node, convertedLoopState && resetLabel); } - function visitDoStatement(node) { - return convertIterationStatementBodyIfNecessary(node); + function visitIterationStatement(node, outermostLabeledStatement) { + switch (node.kind) { + case 212 /* DoStatement */: + case 213 /* WhileStatement */: + return visitDoOrWhileStatement(node, outermostLabeledStatement); + case 214 /* ForStatement */: + return visitForStatement(node, outermostLabeledStatement); + case 215 /* ForInStatement */: + return visitForInStatement(node, outermostLabeledStatement); + case 216 /* ForOfStatement */: + return visitForOfStatement(node, outermostLabeledStatement); + } } - function visitWhileStatement(node) { - return convertIterationStatementBodyIfNecessary(node); + function visitIterationStatementWithFacts(excludeFacts, includeFacts, node, outermostLabeledStatement, convert) { + var ancestorFacts = enterSubtree(excludeFacts, includeFacts); + var updated = convertIterationStatementBodyIfNecessary(node, outermostLabeledStatement, convert); + exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); + return updated; } - function visitForStatement(node) { - return convertIterationStatementBodyIfNecessary(node); + function visitDoOrWhileStatement(node, outermostLabeledStatement) { + return visitIterationStatementWithFacts(0 /* DoOrWhileStatementExcludes */, 256 /* DoOrWhileStatementIncludes */, node, outermostLabeledStatement); } - function visitForInStatement(node) { - return convertIterationStatementBodyIfNecessary(node); + function visitForStatement(node, outermostLabeledStatement) { + return visitIterationStatementWithFacts(3008 /* ForStatementExcludes */, 1280 /* ForStatementIncludes */, node, outermostLabeledStatement); } - /** - * Visits a ForOfStatement and converts it into a compatible ForStatement. - * - * @param node A ForOfStatement. - */ - function visitForOfStatement(node) { - return convertIterationStatementBodyIfNecessary(node, convertForOfToFor); + function visitForInStatement(node, outermostLabeledStatement) { + return visitIterationStatementWithFacts(1984 /* ForInOrForOfStatementExcludes */, 2304 /* ForInOrForOfStatementIncludes */, node, outermostLabeledStatement); } - function convertForOfToFor(node, convertedLoopBodyStatements) { + function visitForOfStatement(node, outermostLabeledStatement) { + return visitIterationStatementWithFacts(1984 /* ForInOrForOfStatementExcludes */, 2304 /* ForInOrForOfStatementIncludes */, node, outermostLabeledStatement, compilerOptions.downlevelIteration ? convertForOfStatementForIterable : convertForOfStatementForArray); + } + function convertForOfStatementHead(node, boundValue, convertedLoopBodyStatements) { + var statements = []; + if (ts.isVariableDeclarationList(node.initializer)) { + if (node.initializer.flags & 3 /* BlockScoped */) { + enableSubstitutionsForBlockScopedBindings(); + } + var firstOriginalDeclaration = ts.firstOrUndefined(node.initializer.declarations); + if (firstOriginalDeclaration && ts.isBindingPattern(firstOriginalDeclaration.name)) { + // This works whether the declaration is a var, let, or const. + // It will use rhsIterationValue _a[_i] as the initializer. + var declarations = ts.flattenDestructuringBinding(firstOriginalDeclaration, visitor, context, 0 /* All */, boundValue); + var declarationList = ts.setTextRange(ts.createVariableDeclarationList(declarations), node.initializer); + ts.setOriginalNode(declarationList, node.initializer); + // Adjust the source map range for the first declaration to align with the old + // emitter. + var firstDeclaration = declarations[0]; + var lastDeclaration = ts.lastOrUndefined(declarations); + ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end)); + statements.push(ts.createVariableStatement( + /*modifiers*/ undefined, declarationList)); + } + else { + // The following call does not include the initializer, so we have + // to emit it separately. + statements.push(ts.setTextRange(ts.createVariableStatement( + /*modifiers*/ undefined, ts.setOriginalNode(ts.setTextRange(ts.createVariableDeclarationList([ + ts.createVariableDeclaration(firstOriginalDeclaration ? firstOriginalDeclaration.name : ts.createTempVariable(/*recordTempVariable*/ undefined), + /*type*/ undefined, boundValue) + ]), ts.moveRangePos(node.initializer, -1)), node.initializer)), ts.moveRangeEnd(node.initializer, -1))); + } + } + else { + // Initializer is an expression. Emit the expression in the body, so that it's + // evaluated on every iteration. + var assignment = ts.createAssignment(node.initializer, boundValue); + if (ts.isDestructuringAssignment(assignment)) { + ts.aggregateTransformFlags(assignment); + statements.push(ts.createStatement(visitBinaryExpression(assignment, /*needsDestructuringValue*/ false))); + } + else { + assignment.end = node.initializer.end; + statements.push(ts.setTextRange(ts.createStatement(ts.visitNode(assignment, visitor, ts.isExpression)), ts.moveRangeEnd(node.initializer, -1))); + } + } + var bodyLocation; + var statementsLocation; + if (convertedLoopBodyStatements) { + ts.addRange(statements, convertedLoopBodyStatements); + } + else { + var statement = ts.visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock); + if (ts.isBlock(statement)) { + ts.addRange(statements, statement.statements); + bodyLocation = statement; + statementsLocation = statement.statements; + } + else { + statements.push(statement); + } + } + // The old emitter does not emit source maps for the block. + // We add the location to preserve comments. + return ts.setEmitFlags(ts.setTextRange(ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), statementsLocation), + /*multiLine*/ true), bodyLocation), 48 /* NoSourceMap */ | 384 /* NoTokenSourceMaps */); + } + function convertForOfStatementForArray(node, outermostLabeledStatement, convertedLoopBodyStatements) { // The following ES6 code: // // for (let v of expr) { } @@ -50939,97 +54864,65 @@ var ts; // Note also that because an extra statement is needed to assign to the LHS, // for-of bodies are always emitted as blocks. var expression = ts.visitNode(node.expression, visitor, ts.isExpression); - var initializer = node.initializer; - var statements = []; // In the case where the user wrote an identifier as the RHS, like this: // // for (let v of arr) { } // // we don't want to emit a temporary variable for the RHS, just use it directly. var counter = ts.createLoopVariable(); - var rhsReference = expression.kind === 70 /* Identifier */ - ? ts.createUniqueName(expression.text) - : ts.createTempVariable(/*recordTempVariable*/ undefined); - var elementAccess = ts.createElementAccess(rhsReference, counter); - // Initialize LHS - // var v = _a[_i]; - if (ts.isVariableDeclarationList(initializer)) { - if (initializer.flags & 3 /* BlockScoped */) { - enableSubstitutionsForBlockScopedBindings(); - } - var firstOriginalDeclaration = ts.firstOrUndefined(initializer.declarations); - if (firstOriginalDeclaration && ts.isBindingPattern(firstOriginalDeclaration.name)) { - // This works whether the declaration is a var, let, or const. - // It will use rhsIterationValue _a[_i] as the initializer. - var declarations = ts.flattenDestructuringBinding(firstOriginalDeclaration, visitor, context, 0 /* All */, elementAccess); - var declarationList = ts.createVariableDeclarationList(declarations, /*location*/ initializer); - ts.setOriginalNode(declarationList, initializer); - // Adjust the source map range for the first declaration to align with the old - // emitter. - var firstDeclaration = declarations[0]; - var lastDeclaration = ts.lastOrUndefined(declarations); - ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end)); - statements.push(ts.createVariableStatement( - /*modifiers*/ undefined, declarationList)); - } - else { - // The following call does not include the initializer, so we have - // to emit it separately. - statements.push(ts.createVariableStatement( - /*modifiers*/ undefined, ts.setOriginalNode(ts.createVariableDeclarationList([ - ts.createVariableDeclaration(firstOriginalDeclaration ? firstOriginalDeclaration.name : ts.createTempVariable(/*recordTempVariable*/ undefined), - /*type*/ undefined, ts.createElementAccess(rhsReference, counter)) - ], /*location*/ ts.moveRangePos(initializer, -1)), initializer), - /*location*/ ts.moveRangeEnd(initializer, -1))); - } - } - else { - // Initializer is an expression. Emit the expression in the body, so that it's - // evaluated on every iteration. - var assignment = ts.createAssignment(initializer, elementAccess); - if (ts.isDestructuringAssignment(assignment)) { - // This is a destructuring pattern, so we flatten the destructuring instead. - statements.push(ts.createStatement(ts.flattenDestructuringAssignment(assignment, visitor, context, 0 /* All */))); - } - else { - // Currently there is not way to check that assignment is binary expression of destructing assignment - // so we have to cast never type to binaryExpression - assignment.end = initializer.end; - statements.push(ts.createStatement(assignment, /*location*/ ts.moveRangeEnd(initializer, -1))); - } - } - var bodyLocation; - var statementsLocation; - if (convertedLoopBodyStatements) { - ts.addRange(statements, convertedLoopBodyStatements); - } - else { - var statement = ts.visitNode(node.statement, visitor, ts.isStatement); - if (ts.isBlock(statement)) { - ts.addRange(statements, statement.statements); - bodyLocation = statement; - statementsLocation = statement.statements; - } - else { - statements.push(statement); - } - } + var rhsReference = ts.isIdentifier(expression) ? ts.getGeneratedNameForNode(expression) : ts.createTempVariable(/*recordTempVariable*/ undefined); // The old emitter does not emit source maps for the expression ts.setEmitFlags(expression, 48 /* NoSourceMap */ | ts.getEmitFlags(expression)); - // The old emitter does not emit source maps for the block. - // We add the location to preserve comments. - var body = ts.createBlock(ts.createNodeArray(statements, /*location*/ statementsLocation), - /*location*/ bodyLocation); - ts.setEmitFlags(body, 48 /* NoSourceMap */ | 384 /* NoTokenSourceMaps */); - var forStatement = ts.createFor(ts.setEmitFlags(ts.createVariableDeclarationList([ - ts.createVariableDeclaration(counter, /*type*/ undefined, ts.createLiteral(0), /*location*/ ts.moveRangePos(node.expression, -1)), - ts.createVariableDeclaration(rhsReference, /*type*/ undefined, expression, /*location*/ node.expression) - ], /*location*/ node.expression), 1048576 /* NoHoisting */), ts.createLessThan(counter, ts.createPropertyAccess(rhsReference, "length"), - /*location*/ node.expression), ts.createPostfixIncrement(counter, /*location*/ node.expression), body, + var forStatement = ts.setTextRange(ts.createFor( + /*initializer*/ ts.setEmitFlags(ts.setTextRange(ts.createVariableDeclarationList([ + ts.setTextRange(ts.createVariableDeclaration(counter, /*type*/ undefined, ts.createLiteral(0)), ts.moveRangePos(node.expression, -1)), + ts.setTextRange(ts.createVariableDeclaration(rhsReference, /*type*/ undefined, expression), node.expression) + ]), node.expression), 2097152 /* NoHoisting */), + /*condition*/ ts.setTextRange(ts.createLessThan(counter, ts.createPropertyAccess(rhsReference, "length")), node.expression), + /*incrementor*/ ts.setTextRange(ts.createPostfixIncrement(counter), node.expression), + /*statement*/ convertForOfStatementHead(node, ts.createElementAccess(rhsReference, counter), convertedLoopBodyStatements)), /*location*/ node); // Disable trailing source maps for the OpenParenToken to align source map emit with the old emitter. ts.setEmitFlags(forStatement, 256 /* NoTokenTrailingSourceMaps */); - return forStatement; + ts.setTextRange(forStatement, node); + return ts.restoreEnclosingLabel(forStatement, outermostLabeledStatement, convertedLoopState && resetLabel); + } + function convertForOfStatementForIterable(node, outermostLabeledStatement, convertedLoopBodyStatements) { + var expression = ts.visitNode(node.expression, visitor, ts.isExpression); + var iterator = ts.isIdentifier(expression) ? ts.getGeneratedNameForNode(expression) : ts.createTempVariable(/*recordTempVariable*/ undefined); + var result = ts.isIdentifier(expression) ? ts.getGeneratedNameForNode(iterator) : ts.createTempVariable(/*recordTempVariable*/ undefined); + var errorRecord = ts.createUniqueName("e"); + var catchVariable = ts.getGeneratedNameForNode(errorRecord); + var returnMethod = ts.createTempVariable(/*recordTempVariable*/ undefined); + var values = ts.createValuesHelper(context, expression, node.expression); + var next = ts.createCall(ts.createPropertyAccess(iterator, "next"), /*typeArguments*/ undefined, []); + hoistVariableDeclaration(errorRecord); + hoistVariableDeclaration(returnMethod); + var forStatement = ts.setEmitFlags(ts.setTextRange(ts.createFor( + /*initializer*/ ts.setEmitFlags(ts.setTextRange(ts.createVariableDeclarationList([ + ts.setTextRange(ts.createVariableDeclaration(iterator, /*type*/ undefined, values), node.expression), + ts.createVariableDeclaration(result, /*type*/ undefined, next) + ]), node.expression), 2097152 /* NoHoisting */), + /*condition*/ ts.createLogicalNot(ts.createPropertyAccess(result, "done")), + /*incrementor*/ ts.createAssignment(result, next), + /*statement*/ convertForOfStatementHead(node, ts.createPropertyAccess(result, "value"), convertedLoopBodyStatements)), + /*location*/ node), 256 /* NoTokenTrailingSourceMaps */); + return ts.createTry(ts.createBlock([ + ts.restoreEnclosingLabel(forStatement, outermostLabeledStatement, convertedLoopState && resetLabel) + ]), ts.createCatchClause(ts.createVariableDeclaration(catchVariable), ts.setEmitFlags(ts.createBlock([ + ts.createStatement(ts.createAssignment(errorRecord, ts.createObjectLiteral([ + ts.createPropertyAssignment("error", catchVariable) + ]))) + ]), 1 /* SingleLine */)), ts.createBlock([ + ts.createTry( + /*tryBlock*/ ts.createBlock([ + ts.setEmitFlags(ts.createIf(ts.createLogicalAnd(ts.createLogicalAnd(result, ts.createLogicalNot(ts.createPropertyAccess(result, "done"))), ts.createAssignment(returnMethod, ts.createPropertyAccess(iterator, "return"))), ts.createStatement(ts.createFunctionCall(returnMethod, iterator, []))), 1 /* SingleLine */), + ]), + /*catchClause*/ undefined, + /*finallyBlock*/ ts.setEmitFlags(ts.createBlock([ + ts.setEmitFlags(ts.createIf(errorRecord, ts.createThrow(ts.createPropertyAccess(errorRecord, "error"))), 1 /* SingleLine */) + ]), 1 /* SingleLine */)) + ])); } /** * Visits an ObjectLiteralExpression with computed propety names. @@ -51043,31 +54936,39 @@ var ts; // Find the first computed property. // Everything until that point can be emitted as part of the initial object literal. var numInitialProperties = numProperties; + var numInitialPropertiesWithoutYield = numProperties; for (var i = 0; i < numProperties; i++) { var property = properties[i]; - if (property.transformFlags & 16777216 /* ContainsYield */ - || property.name.kind === 142 /* ComputedPropertyName */) { + if ((property.transformFlags & 16777216 /* ContainsYield */ && hierarchyFacts & 4 /* AsyncFunctionBody */) + && i < numInitialPropertiesWithoutYield) { + numInitialPropertiesWithoutYield = i; + } + if (property.name.kind === 144 /* ComputedPropertyName */) { numInitialProperties = i; break; } } - ts.Debug.assert(numInitialProperties !== numProperties); - // For computed properties, we need to create a unique handle to the object - // literal so we can modify it without risking internal assignments tainting the object. - var temp = ts.createTempVariable(hoistVariableDeclaration); - // Write out the first non-computed properties, then emit the rest through indexing on the temp variable. - var expressions = []; - var assignment = ts.createAssignment(temp, ts.setEmitFlags(ts.createObjectLiteral(ts.visitNodes(properties, visitor, ts.isObjectLiteralElementLike, 0, numInitialProperties), - /*location*/ undefined, node.multiLine), 32768 /* Indented */)); - if (node.multiLine) { - assignment.startsOnNewLine = true; + if (numInitialProperties !== numProperties) { + if (numInitialPropertiesWithoutYield < numInitialProperties) { + numInitialProperties = numInitialPropertiesWithoutYield; + } + // For computed properties, we need to create a unique handle to the object + // literal so we can modify it without risking internal assignments tainting the object. + var temp = ts.createTempVariable(hoistVariableDeclaration); + // Write out the first non-computed properties, then emit the rest through indexing on the temp variable. + var expressions = []; + var assignment = ts.createAssignment(temp, ts.setEmitFlags(ts.createObjectLiteral(ts.visitNodes(properties, visitor, ts.isObjectLiteralElementLike, 0, numInitialProperties), node.multiLine), 65536 /* Indented */)); + if (node.multiLine) { + assignment.startsOnNewLine = true; + } + expressions.push(assignment); + addObjectLiteralMembers(expressions, node, temp, numInitialProperties); + // We need to clone the temporary identifier so that we can write it on a + // new line + expressions.push(node.multiLine ? ts.startOnNewLine(ts.getMutableClone(temp)) : temp); + return ts.inlineExpressions(expressions); } - expressions.push(assignment); - addObjectLiteralMembers(expressions, node, temp, numInitialProperties); - // We need to clone the temporary identifier so that we can write it on a - // new line - expressions.push(node.multiLine ? ts.startOnNewLine(ts.getMutableClone(temp)) : temp); - return ts.inlineExpressions(expressions); + return ts.visitEachChild(node, visitor, context); } function shouldConvertIterationStatementBody(node) { return (resolver.getNodeCheckFlags(node) & 65536 /* LoopWithCapturedBlockScopedBinding */) !== 0; @@ -51081,7 +54982,7 @@ var ts; } visit(node.name); function visit(node) { - if (node.kind === 70 /* Identifier */) { + if (node.kind === 71 /* Identifier */) { state.hoistedLocalVariables.push(node); } else { @@ -51094,7 +54995,7 @@ var ts; } } } - function convertIterationStatementBodyIfNecessary(node, convert) { + function convertIterationStatementBodyIfNecessary(node, outermostLabeledStatement, convert) { if (!shouldConvertIterationStatementBody(node)) { var saveAllowedNonLabeledJumps = void 0; if (convertedLoopState) { @@ -51103,7 +55004,9 @@ var ts; saveAllowedNonLabeledJumps = convertedLoopState.allowedNonLabeledJumps; convertedLoopState.allowedNonLabeledJumps = 2 /* Break */ | 4 /* Continue */; } - var result = convert ? convert(node, /*convertedLoopBodyStatements*/ undefined) : ts.visitEachChild(node, visitor, context); + var result = convert + ? convert(node, outermostLabeledStatement, /*convertedLoopBodyStatements*/ undefined) + : ts.restoreEnclosingLabel(ts.visitEachChild(node, visitor, context), outermostLabeledStatement, convertedLoopState && resetLabel); if (convertedLoopState) { convertedLoopState.allowedNonLabeledJumps = saveAllowedNonLabeledJumps; } @@ -51112,11 +55015,11 @@ var ts; var functionName = ts.createUniqueName("_loop"); var loopInitializer; switch (node.kind) { - case 211 /* ForStatement */: - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: + case 214 /* ForStatement */: + case 215 /* ForInStatement */: + case 216 /* ForOfStatement */: var initializer = node.initializer; - if (initializer && initializer.kind === 224 /* VariableDeclarationList */) { + if (initializer && initializer.kind === 227 /* VariableDeclarationList */) { loopInitializer = initializer; } break; @@ -51153,7 +55056,7 @@ var ts; } } startLexicalEnvironment(); - var loopBody = ts.visitNode(node.statement, visitor, ts.isStatement, /*optional*/ false, ts.liftToBlock); + var loopBody = ts.visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock); var lexicalEnvironment = endLexicalEnvironment(); var currentState = convertedLoopState; convertedLoopState = outerConvertedLoopState; @@ -51163,33 +55066,32 @@ var ts; copyOutParameters(loopOutParameters, 1 /* ToOutParameter */, statements_4); } ts.addRange(statements_4, lexicalEnvironment); - loopBody = ts.createBlock(statements_4, /*location*/ undefined, /*multiline*/ true); + loopBody = ts.createBlock(statements_4, /*multiline*/ true); } if (ts.isBlock(loopBody)) { loopBody.multiLine = true; } else { - loopBody = ts.createBlock([loopBody], /*location*/ undefined, /*multiline*/ true); + loopBody = ts.createBlock([loopBody], /*multiline*/ true); } - var isAsyncBlockContainingAwait = enclosingNonArrowFunction - && (ts.getEmitFlags(enclosingNonArrowFunction) & 131072 /* AsyncFunctionBody */) !== 0 - && (node.statement.transformFlags & 16777216 /* ContainsYield */) !== 0; + var containsYield = (node.statement.transformFlags & 16777216 /* ContainsYield */) !== 0; + var isAsyncBlockContainingAwait = containsYield && (hierarchyFacts & 4 /* AsyncFunctionBody */) !== 0; var loopBodyFlags = 0; if (currentState.containsLexicalThis) { loopBodyFlags |= 8 /* CapturesThis */; } if (isAsyncBlockContainingAwait) { - loopBodyFlags |= 131072 /* AsyncFunctionBody */; + loopBodyFlags |= 262144 /* AsyncFunctionBody */; } var convertedLoopVariable = ts.createVariableStatement( /*modifiers*/ undefined, ts.setEmitFlags(ts.createVariableDeclarationList([ ts.createVariableDeclaration(functionName, /*type*/ undefined, ts.setEmitFlags(ts.createFunctionExpression( - /*modifiers*/ undefined, isAsyncBlockContainingAwait ? ts.createToken(38 /* AsteriskToken */) : undefined, + /*modifiers*/ undefined, containsYield ? ts.createToken(39 /* AsteriskToken */) : undefined, /*name*/ undefined, /*typeParameters*/ undefined, loopParameters, /*type*/ undefined, loopBody), loopBodyFlags)) - ]), 1048576 /* NoHoisting */)); + ]), 2097152 /* NoHoisting */)); var statements = [convertedLoopVariable]; var extraVariableDeclarations; // propagate state from the inner loop to the outer loop if necessary @@ -51252,34 +55154,31 @@ var ts; statements.push(ts.createVariableStatement( /*modifiers*/ undefined, ts.createVariableDeclarationList(extraVariableDeclarations))); } - var convertedLoopBodyStatements = generateCallToConvertedLoop(functionName, loopParameters, currentState, isAsyncBlockContainingAwait); + var convertedLoopBodyStatements = generateCallToConvertedLoop(functionName, loopParameters, currentState, containsYield); var loop; if (convert) { - loop = convert(node, convertedLoopBodyStatements); + loop = convert(node, outermostLabeledStatement, convertedLoopBodyStatements); } else { - loop = ts.getMutableClone(node); + var clone_4 = ts.getMutableClone(node); // clean statement part - loop.statement = undefined; + clone_4.statement = undefined; // visit childnodes to transform initializer/condition/incrementor parts - loop = ts.visitEachChild(loop, visitor, context); + clone_4 = ts.visitEachChild(clone_4, visitor, context); // set loop statement - loop.statement = ts.createBlock(convertedLoopBodyStatements, - /*location*/ undefined, - /*multiline*/ true); + clone_4.statement = ts.createBlock(convertedLoopBodyStatements, /*multiline*/ true); // reset and re-aggregate the transform flags - loop.transformFlags = 0; - ts.aggregateTransformFlags(loop); + clone_4.transformFlags = 0; + ts.aggregateTransformFlags(clone_4); + loop = ts.restoreEnclosingLabel(clone_4, outermostLabeledStatement, convertedLoopState && resetLabel); } - statements.push(currentParent.kind === 219 /* LabeledStatement */ - ? ts.createLabel(currentParent.label, loop) - : loop); + statements.push(loop); return statements; } function copyOutParameter(outParam, copyDirection) { var source = copyDirection === 0 /* ToOriginal */ ? outParam.outParamName : outParam.originalName; var target = copyDirection === 0 /* ToOriginal */ ? outParam.originalName : outParam.outParamName; - return ts.createBinary(target, 57 /* EqualsToken */, source); + return ts.createBinary(target, 58 /* EqualsToken */, source); } function copyOutParameters(outParams, copyDirection, statements) { for (var _i = 0, outParams_1 = outParams; _i < outParams_1.length; _i++) { @@ -51297,7 +55196,9 @@ var ts; !state.labeledNonLocalBreaks && !state.labeledNonLocalContinues; var call = ts.createCall(loopFunctionExpressionName, /*typeArguments*/ undefined, ts.map(parameters, function (p) { return p.name; })); - var callResult = isAsyncBlockContainingAwait ? ts.createYield(ts.createToken(38 /* AsteriskToken */), call) : call; + var callResult = isAsyncBlockContainingAwait + ? ts.createYield(ts.createToken(39 /* AsteriskToken */), ts.setEmitFlags(call, 8388608 /* Iterator */)) + : call; if (isSimpleLoop) { statements.push(ts.createStatement(callResult)); copyOutParameters(state.loopOutParameters, 0 /* ToOriginal */, statements); @@ -51317,10 +55218,10 @@ var ts; else { returnStatement = ts.createReturn(ts.createPropertyAccess(loopResultName, "value")); } - statements.push(ts.createIf(ts.createBinary(ts.createTypeOf(loopResultName), 33 /* EqualsEqualsEqualsToken */, ts.createLiteral("object")), returnStatement)); + statements.push(ts.createIf(ts.createBinary(ts.createTypeOf(loopResultName), 34 /* EqualsEqualsEqualsToken */, ts.createLiteral("object")), returnStatement)); } if (state.nonLocalJumps & 2 /* Break */) { - statements.push(ts.createIf(ts.createBinary(loopResultName, 33 /* EqualsEqualsEqualsToken */, ts.createLiteral("break")), ts.createBreak())); + statements.push(ts.createIf(ts.createBinary(loopResultName, 34 /* EqualsEqualsEqualsToken */, ts.createLiteral("break")), ts.createBreak())); } if (state.labeledNonLocalBreaks || state.labeledNonLocalContinues) { var caseClauses = []; @@ -51336,26 +55237,25 @@ var ts; if (!state.labeledNonLocalBreaks) { state.labeledNonLocalBreaks = ts.createMap(); } - state.labeledNonLocalBreaks[labelText] = labelMarker; + state.labeledNonLocalBreaks.set(labelText, labelMarker); } else { if (!state.labeledNonLocalContinues) { state.labeledNonLocalContinues = ts.createMap(); } - state.labeledNonLocalContinues[labelText] = labelMarker; + state.labeledNonLocalContinues.set(labelText, labelMarker); } } function processLabeledJumps(table, isBreak, loopResultName, outerLoop, caseClauses) { if (!table) { return; } - for (var labelText in table) { - var labelMarker = table[labelText]; + table.forEach(function (labelMarker, labelText) { var statements = []; // if there are no outer converted loop or outer label in question is located inside outer converted loop // then emit labeled break\continue // otherwise propagate pair 'label -> marker' to outer converted loop and emit 'return labelMarker' so outer loop can later decide what to do - if (!outerLoop || (outerLoop.labels && outerLoop.labels[labelText])) { + if (!outerLoop || (outerLoop.labels && outerLoop.labels.get(labelText))) { var label = ts.createIdentifier(labelText); statements.push(isBreak ? ts.createBreak(label) : ts.createContinue(label)); } @@ -51364,7 +55264,7 @@ var ts; statements.push(ts.createReturn(loopResultName)); } caseClauses.push(ts.createCaseClause(ts.createLiteral(labelMarker), statements)); - } + }); } function processLoopVariableDeclaration(decl, loopParameters, loopOutParameters) { var name = decl.name; @@ -51379,7 +55279,7 @@ var ts; else { loopParameters.push(ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, name)); if (resolver.getNodeCheckFlags(decl) & 2097152 /* NeedsLoopOutParameter */) { - var outParamName = ts.createUniqueName("out_" + name.text); + var outParamName = ts.createUniqueName("out_" + ts.unescapeIdentifier(name.text)); loopOutParameters.push({ originalName: name, outParamName: outParamName }); } } @@ -51399,22 +55299,22 @@ var ts; for (var i = start; i < numProperties; i++) { var property = properties[i]; switch (property.kind) { - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property === accessors.firstAccessor) { - expressions.push(transformAccessorsToExpression(receiver, accessors, node.multiLine)); + expressions.push(transformAccessorsToExpression(receiver, accessors, node, node.multiLine)); } break; - case 257 /* PropertyAssignment */: + case 151 /* MethodDeclaration */: + expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); + break; + case 261 /* PropertyAssignment */: expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 258 /* ShorthandPropertyAssignment */: + case 262 /* ShorthandPropertyAssignment */: expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 149 /* MethodDeclaration */: - expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node.multiLine)); - break; default: ts.Debug.failBadSyntaxKind(node); break; @@ -51429,8 +55329,8 @@ var ts; * @param receiver The receiver for the assignment. */ function transformPropertyAssignmentToExpression(property, receiver, startsOnNewLine) { - var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(property.name, visitor, ts.isPropertyName)), ts.visitNode(property.initializer, visitor, ts.isExpression), - /*location*/ property); + var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(property.name, visitor, ts.isPropertyName)), ts.visitNode(property.initializer, visitor, ts.isExpression)); + ts.setTextRange(expression, property); if (startsOnNewLine) { expression.startsOnNewLine = true; } @@ -51444,8 +55344,8 @@ var ts; * @param receiver The receiver for the assignment. */ function transformShorthandPropertyAssignmentToExpression(property, receiver, startsOnNewLine) { - var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(property.name, visitor, ts.isPropertyName)), ts.getSynthesizedClone(property.name), - /*location*/ property); + var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(property.name, visitor, ts.isPropertyName)), ts.getSynthesizedClone(property.name)); + ts.setTextRange(expression, property); if (startsOnNewLine) { expression.startsOnNewLine = true; } @@ -51458,22 +55358,34 @@ var ts; * @param method The MethodDeclaration node. * @param receiver The receiver for the assignment. */ - function transformObjectLiteralMethodDeclarationToExpression(method, receiver, startsOnNewLine) { - var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(method.name, visitor, ts.isPropertyName)), transformFunctionLikeToExpression(method, /*location*/ method, /*name*/ undefined), - /*location*/ method); + function transformObjectLiteralMethodDeclarationToExpression(method, receiver, container, startsOnNewLine) { + var ancestorFacts = enterSubtree(0 /* None */, 0 /* None */); + var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(method.name, visitor, ts.isPropertyName)), transformFunctionLikeToExpression(method, /*location*/ method, /*name*/ undefined, container)); + ts.setTextRange(expression, method); if (startsOnNewLine) { expression.startsOnNewLine = true; } + exitSubtree(ancestorFacts, 49152 /* PropagateNewTargetMask */, hierarchyFacts & 49152 /* PropagateNewTargetMask */ ? 16384 /* NewTarget */ : 0 /* None */); return expression; } function visitCatchClause(node) { - ts.Debug.assert(ts.isBindingPattern(node.variableDeclaration.name)); - var temp = ts.createTempVariable(undefined); - var newVariableDeclaration = ts.createVariableDeclaration(temp, undefined, undefined, node.variableDeclaration); - var vars = ts.flattenDestructuringBinding(node.variableDeclaration, visitor, context, 0 /* All */, temp); - var list = ts.createVariableDeclarationList(vars, /*location*/ node.variableDeclaration, /*flags*/ node.variableDeclaration.flags); - var destructure = ts.createVariableStatement(undefined, list); - return ts.updateCatchClause(node, newVariableDeclaration, addStatementToStartOfBlock(node.block, destructure)); + var ancestorFacts = enterSubtree(4032 /* BlockScopeExcludes */, 0 /* BlockScopeIncludes */); + var updated; + if (ts.isBindingPattern(node.variableDeclaration.name)) { + var temp = ts.createTempVariable(/*recordTempVariable*/ undefined); + var newVariableDeclaration = ts.createVariableDeclaration(temp); + ts.setTextRange(newVariableDeclaration, node.variableDeclaration); + var vars = ts.flattenDestructuringBinding(node.variableDeclaration, visitor, context, 0 /* All */, temp); + var list = ts.createVariableDeclarationList(vars); + ts.setTextRange(list, node.variableDeclaration); + var destructure = ts.createVariableStatement(/*modifiers*/ undefined, list); + updated = ts.updateCatchClause(node, newVariableDeclaration, addStatementToStartOfBlock(node.block, destructure)); + } + else { + updated = ts.visitEachChild(node, visitor, context); + } + exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); + return updated; } function addStatementToStartOfBlock(block, statement) { var transformedStatements = ts.visitNodes(block.statements, visitor, ts.isStatement); @@ -51490,20 +55402,54 @@ var ts; // Methods on classes are handled in visitClassDeclaration/visitClassExpression. // Methods with computed property names are handled in visitObjectLiteralExpression. ts.Debug.assert(!ts.isComputedPropertyName(node.name)); - var functionExpression = transformFunctionLikeToExpression(node, /*location*/ ts.moveRangePos(node, -1), /*name*/ undefined); + var functionExpression = transformFunctionLikeToExpression(node, /*location*/ ts.moveRangePos(node, -1), /*name*/ undefined, /*container*/ undefined); ts.setEmitFlags(functionExpression, 512 /* NoLeadingComments */ | ts.getEmitFlags(functionExpression)); - return ts.createPropertyAssignment(node.name, functionExpression, + return ts.setTextRange(ts.createPropertyAssignment(node.name, functionExpression), /*location*/ node); } + /** + * Visits an AccessorDeclaration of an ObjectLiteralExpression. + * + * @param node An AccessorDeclaration node. + */ + function visitAccessorDeclaration(node) { + ts.Debug.assert(!ts.isComputedPropertyName(node.name)); + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = undefined; + var ancestorFacts = enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */); + var updated; + if (node.transformFlags & 32768 /* ContainsCapturedLexicalThis */) { + var parameters = ts.visitParameterList(node.parameters, visitor, context); + var body = transformFunctionBody(node); + if (node.kind === 153 /* GetAccessor */) { + updated = ts.updateGetAccessor(node, node.decorators, node.modifiers, node.name, parameters, node.type, body); + } + else { + updated = ts.updateSetAccessor(node, node.decorators, node.modifiers, node.name, parameters, body); + } + } + else { + updated = ts.visitEachChild(node, visitor, context); + } + exitSubtree(ancestorFacts, 49152 /* PropagateNewTargetMask */, 0 /* None */); + convertedLoopState = savedConvertedLoopState; + return updated; + } /** * Visits a ShorthandPropertyAssignment and transforms it into a PropertyAssignment. * * @param node A ShorthandPropertyAssignment node. */ function visitShorthandPropertyAssignment(node) { - return ts.createPropertyAssignment(node.name, ts.getSynthesizedClone(node.name), + return ts.setTextRange(ts.createPropertyAssignment(node.name, ts.getSynthesizedClone(node.name)), /*location*/ node); } + function visitComputedPropertyName(node) { + var ancestorFacts = enterSubtree(0 /* ComputedPropertyNameExcludes */, 8192 /* ComputedPropertyNameIncludes */); + var updated = ts.visitEachChild(node, visitor, context); + exitSubtree(ancestorFacts, 49152 /* PropagateNewTargetMask */, hierarchyFacts & 49152 /* PropagateNewTargetMask */ ? 32768 /* NewTargetInComputedPropertyName */ : 0 /* None */); + return updated; + } /** * Visits a YieldExpression node. * @@ -51519,8 +55465,11 @@ var ts; * @param node An ArrayLiteralExpression node. */ function visitArrayLiteralExpression(node) { - // We are here because we contain a SpreadElementExpression. - return transformAndSpreadElements(node.elements, /*needsUniqueCopy*/ true, node.multiLine, /*hasTrailingComma*/ node.elements.hasTrailingComma); + if (node.transformFlags & 64 /* ES2015 */) { + // We are here because we contain a SpreadElementExpression. + return transformAndSpreadElements(node.elements, /*needsUniqueCopy*/ true, node.multiLine, /*hasTrailingComma*/ node.elements.hasTrailingComma); + } + return ts.visitEachChild(node, visitor, context); } /** * Visits a CallExpression that contains either a spread element or `super`. @@ -51528,7 +55477,11 @@ var ts; * @param node a CallExpression. */ function visitCallExpression(node) { - return visitCallExpressionWithPotentialCapturedThisAssignment(node, /*assignToCapturedThis*/ true); + if (node.transformFlags & 64 /* ES2015 */) { + return visitCallExpressionWithPotentialCapturedThisAssignment(node, /*assignToCapturedThis*/ true); + } + return ts.updateCall(node, ts.visitNode(node.expression, callExpressionVisitor, ts.isExpression), + /*typeArguments*/ undefined, ts.visitNodes(node.arguments, visitor, ts.isExpression)); } function visitImmediateSuperCallInBody(node) { return visitCallExpressionWithPotentialCapturedThisAssignment(node, /*assignToCapturedThis*/ false); @@ -51537,7 +55490,7 @@ var ts; // We are here either because SuperKeyword was used somewhere in the expression, or // because we contain a SpreadElementExpression. var _a = ts.createCallBinding(node.expression, hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg; - if (node.expression.kind === 96 /* SuperKeyword */) { + if (node.expression.kind === 97 /* SuperKeyword */) { ts.setEmitFlags(thisArg, 4 /* NoSubstitution */); } var resultingCall; @@ -51555,7 +55508,7 @@ var ts; // _super.apply(this, a.concat([b])) // _super.m.apply(this, a.concat([b])) // _super.prototype.m.apply(this, a.concat([b])) - resultingCall = ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), transformAndSpreadElements(node.arguments, /*needsUniqueCopy*/ false, /*multiLine*/ false, /*hasTrailingComma*/ false)); + resultingCall = ts.createFunctionApply(ts.visitNode(target, callExpressionVisitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), transformAndSpreadElements(node.arguments, /*needsUniqueCopy*/ false, /*multiLine*/ false, /*hasTrailingComma*/ false)); } else { // [source] @@ -51567,18 +55520,18 @@ var ts; // _super.call(this, a) // _super.m.call(this, a) // _super.prototype.m.call(this, a) - resultingCall = ts.createFunctionCall(ts.visitNode(target, visitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), ts.visitNodes(node.arguments, visitor, ts.isExpression), + resultingCall = ts.createFunctionCall(ts.visitNode(target, callExpressionVisitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), ts.visitNodes(node.arguments, visitor, ts.isExpression), /*location*/ node); } - if (node.expression.kind === 96 /* SuperKeyword */) { + if (node.expression.kind === 97 /* SuperKeyword */) { var actualThis = ts.createThis(); ts.setEmitFlags(actualThis, 4 /* NoSubstitution */); var initializer = ts.createLogicalOr(resultingCall, actualThis); - return assignToCapturedThis + resultingCall = assignToCapturedThis ? ts.createAssignment(ts.createIdentifier("_this"), initializer) : initializer; } - return resultingCall; + return ts.setOriginalNode(resultingCall, node); } /** * Visits a NewExpression that contains a spread element. @@ -51586,16 +55539,18 @@ var ts; * @param node A NewExpression node. */ function visitNewExpression(node) { - // We are here because we contain a SpreadElementExpression. - ts.Debug.assert((node.transformFlags & 524288 /* ContainsSpread */) !== 0); - // [source] - // new C(...a) - // - // [output] - // new ((_a = C).bind.apply(_a, [void 0].concat(a)))() - var _a = ts.createCallBinding(ts.createPropertyAccess(node.expression, "bind"), hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg; - return ts.createNew(ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), thisArg, transformAndSpreadElements(ts.createNodeArray([ts.createVoidZero()].concat(node.arguments)), /*needsUniqueCopy*/ false, /*multiLine*/ false, /*hasTrailingComma*/ false)), - /*typeArguments*/ undefined, []); + if (node.transformFlags & 524288 /* ContainsSpread */) { + // We are here because we contain a SpreadElementExpression. + // [source] + // new C(...a) + // + // [output] + // new ((_a = C).bind.apply(_a, [void 0].concat(a)))() + var _a = ts.createCallBinding(ts.createPropertyAccess(node.expression, "bind"), hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg; + return ts.createNew(ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), thisArg, transformAndSpreadElements(ts.createNodeArray([ts.createVoidZero()].concat(node.arguments)), /*needsUniqueCopy*/ false, /*multiLine*/ false, /*hasTrailingComma*/ false)), + /*typeArguments*/ undefined, []); + } + return ts.visitEachChild(node, visitor, context); } /** * Transforms an array of Expression nodes that contains a SpreadExpression. @@ -51616,14 +55571,28 @@ var ts; var segments = ts.flatten(ts.spanMap(elements, partitionSpread, function (partition, visitPartition, _start, end) { return visitPartition(partition, multiLine, hasTrailingComma && end === numElements); })); - if (segments.length === 1) { - var firstElement = elements[0]; - return needsUniqueCopy && ts.isSpreadExpression(firstElement) && firstElement.expression.kind !== 175 /* ArrayLiteralExpression */ - ? ts.createArraySlice(segments[0]) - : segments[0]; + if (compilerOptions.downlevelIteration) { + if (segments.length === 1) { + var firstSegment = segments[0]; + if (ts.isCallExpression(firstSegment) + && ts.isIdentifier(firstSegment.expression) + && (ts.getEmitFlags(firstSegment.expression) & 4096 /* HelperName */) + && firstSegment.expression.text === "___spread") { + return segments[0]; + } + } + return ts.createSpreadHelper(context, segments); + } + else { + if (segments.length === 1) { + var firstElement = elements[0]; + return needsUniqueCopy && ts.isSpreadExpression(firstElement) && firstElement.expression.kind !== 177 /* ArrayLiteralExpression */ + ? ts.createArraySlice(segments[0]) + : segments[0]; + } + // Rewrite using the pattern .concat(, , ...) + return ts.createArrayConcat(segments.shift(), segments); } - // Rewrite using the pattern .concat(, , ...) - return ts.createArrayConcat(segments.shift(), segments); } function partitionSpread(node) { return ts.isSpreadExpression(node) @@ -51634,8 +55603,7 @@ var ts; return ts.map(chunk, visitExpressionOfSpread); } function visitSpanOfNonSpreads(chunk, multiLine, hasTrailingComma) { - return ts.createArrayLiteral(ts.visitNodes(ts.createNodeArray(chunk, /*location*/ undefined, hasTrailingComma), visitor, ts.isExpression), - /*location*/ undefined, multiLine); + return ts.createArrayLiteral(ts.visitNodes(ts.createNodeArray(chunk, hasTrailingComma), visitor, ts.isExpression), multiLine); } function visitSpreadElement(node) { return ts.visitNode(node.expression, visitor, ts.isExpression); @@ -51654,7 +55622,29 @@ var ts; * @param node A template literal. */ function visitTemplateLiteral(node) { - return ts.createLiteral(node.text, /*location*/ node); + return ts.setTextRange(ts.createLiteral(node.text), node); + } + /** + * Visits a string literal with an extended unicode escape. + * + * @param node A string literal. + */ + function visitStringLiteral(node) { + if (node.hasExtendedUnicodeEscape) { + return ts.setTextRange(ts.createLiteral(node.text), node); + } + return node; + } + /** + * Visits a binary or octal (ES6) numeric literal. + * + * @param node A string literal. + */ + function visitNumericLiteral(node) { + if (node.numericLiteralFlags & 48 /* BinaryOrOctalSpecifier */) { + return ts.setTextRange(ts.createNumericLiteral(node.text), node); + } + return node; } /** * Visits a TaggedTemplateExpression node. @@ -51708,13 +55698,13 @@ var ts; // thus we need to remove those characters. // First template piece starts with "`", others with "}" // Last template piece ends with "`", others with "${" - var isLast = node.kind === 12 /* NoSubstitutionTemplateLiteral */ || node.kind === 15 /* TemplateTail */; + var isLast = node.kind === 13 /* NoSubstitutionTemplateLiteral */ || node.kind === 16 /* TemplateTail */; text = text.substring(1, text.length - (isLast ? 1 : 2)); // Newline normalization: // ES6 Spec 11.8.6.1 - Static Semantics of TV's and TRV's // and LineTerminatorSequences are normalized to for both TV and TRV. text = text.replace(/\r\n?/g, "\n"); - return ts.createLiteral(text, /*location*/ node); + return ts.setTextRange(ts.createLiteral(text), node); } /** * Visits a TemplateExpression node. @@ -51736,7 +55726,8 @@ var ts; // "abc" + (1 << 2) + "" var expression = ts.reduceLeft(expressions, ts.createAdd); if (ts.nodeIsSynthesized(expression)) { - ts.setTextRange(expression, node); + expression.pos = node.pos; + expression.end = node.end; } return expression; } @@ -51798,27 +55789,42 @@ var ts; /** * Visits the `super` keyword */ - function visitSuperKeyword() { - return enclosingNonAsyncFunctionBody - && ts.isClassElement(enclosingNonAsyncFunctionBody) - && !ts.hasModifier(enclosingNonAsyncFunctionBody, 32 /* Static */) - && currentParent.kind !== 179 /* CallExpression */ + function visitSuperKeyword(isExpressionOfCall) { + return hierarchyFacts & 8 /* NonStaticClassElement */ + && !isExpressionOfCall ? ts.createPropertyAccess(ts.createIdentifier("_super"), "prototype") : ts.createIdentifier("_super"); } + function visitMetaProperty(node) { + if (node.keywordToken === 94 /* NewKeyword */ && node.name.text === "target") { + if (hierarchyFacts & 8192 /* ComputedPropertyName */) { + hierarchyFacts |= 32768 /* NewTargetInComputedPropertyName */; + } + else { + hierarchyFacts |= 16384 /* NewTarget */; + } + return ts.createIdentifier("_newTarget"); + } + return node; + } /** * Called by the printer just before a node is printed. * + * @param hint A hint as to the intended usage of the node. * @param node The node to be printed. + * @param emitCallback The callback used to emit the node. */ - function onEmitNode(emitContext, node, emitCallback) { - var savedEnclosingFunction = enclosingFunction; + function onEmitNode(hint, node, emitCallback) { if (enabledSubstitutions & 1 /* CapturedThis */ && ts.isFunctionLike(node)) { // If we are tracking a captured `this`, keep track of the enclosing function. - enclosingFunction = node; + var ancestorFacts = enterSubtree(16286 /* FunctionExcludes */, ts.getEmitFlags(node) & 8 /* CapturesThis */ + ? 65 /* FunctionIncludes */ | 16 /* CapturesThis */ + : 65 /* FunctionIncludes */); + previousOnEmitNode(hint, node, emitCallback); + exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); + return; } - previousOnEmitNode(emitContext, node, emitCallback); - enclosingFunction = savedEnclosingFunction; + previousOnEmitNode(hint, node, emitCallback); } /** * Enables a more costly code path for substitutions when we determine a source file @@ -51827,7 +55833,7 @@ var ts; function enableSubstitutionsForBlockScopedBindings() { if ((enabledSubstitutions & 2 /* BlockScopedBindings */) === 0) { enabledSubstitutions |= 2 /* BlockScopedBindings */; - context.enableSubstitution(70 /* Identifier */); + context.enableSubstitution(71 /* Identifier */); } } /** @@ -51837,25 +55843,25 @@ var ts; function enableSubstitutionsForCapturedThis() { if ((enabledSubstitutions & 1 /* CapturedThis */) === 0) { enabledSubstitutions |= 1 /* CapturedThis */; - context.enableSubstitution(98 /* ThisKeyword */); - context.enableEmitNotification(150 /* Constructor */); - context.enableEmitNotification(149 /* MethodDeclaration */); - context.enableEmitNotification(151 /* GetAccessor */); - context.enableEmitNotification(152 /* SetAccessor */); - context.enableEmitNotification(185 /* ArrowFunction */); - context.enableEmitNotification(184 /* FunctionExpression */); - context.enableEmitNotification(225 /* FunctionDeclaration */); + context.enableSubstitution(99 /* ThisKeyword */); + context.enableEmitNotification(152 /* Constructor */); + context.enableEmitNotification(151 /* MethodDeclaration */); + context.enableEmitNotification(153 /* GetAccessor */); + context.enableEmitNotification(154 /* SetAccessor */); + context.enableEmitNotification(187 /* ArrowFunction */); + context.enableEmitNotification(186 /* FunctionExpression */); + context.enableEmitNotification(228 /* FunctionDeclaration */); } } /** * Hooks node substitutions. * - * @param emitContext The context for the emitter. + * @param hint The context for the emitter. * @param node The node to substitute. */ - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (emitContext === 1 /* Expression */) { + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1 /* Expression */) { return substituteExpression(node); } if (ts.isIdentifier(node)) { @@ -51869,10 +55875,10 @@ var ts; function substituteIdentifier(node) { // Only substitute the identifier if we have enabled substitutions for block-scoped // bindings. - if (enabledSubstitutions & 2 /* BlockScopedBindings */) { + if (enabledSubstitutions & 2 /* BlockScopedBindings */ && !ts.isInternalName(node)) { var original = ts.getParseTreeNode(node, ts.isIdentifier); if (original && isNameOfDeclarationWithCollidingName(original)) { - return ts.getGeneratedNameForNode(original); + return ts.setTextRange(ts.getGeneratedNameForNode(original), node); } } return node; @@ -51886,10 +55892,10 @@ var ts; function isNameOfDeclarationWithCollidingName(node) { var parent = node.parent; switch (parent.kind) { - case 174 /* BindingElement */: - case 226 /* ClassDeclaration */: - case 229 /* EnumDeclaration */: - case 223 /* VariableDeclaration */: + case 176 /* BindingElement */: + case 229 /* ClassDeclaration */: + case 232 /* EnumDeclaration */: + case 226 /* VariableDeclaration */: return parent.name === node && resolver.isDeclarationWithCollidingName(parent); } @@ -51902,9 +55908,9 @@ var ts; */ function substituteExpression(node) { switch (node.kind) { - case 70 /* Identifier */: + case 71 /* Identifier */: return substituteExpressionIdentifier(node); - case 98 /* ThisKeyword */: + case 99 /* ThisKeyword */: return substituteThisKeyword(node); } return node; @@ -51915,14 +55921,39 @@ var ts; * @param node An Identifier node. */ function substituteExpressionIdentifier(node) { - if (enabledSubstitutions & 2 /* BlockScopedBindings */) { + if (enabledSubstitutions & 2 /* BlockScopedBindings */ && !ts.isInternalName(node)) { var declaration = resolver.getReferencedDeclarationWithCollidingName(node); - if (declaration) { - return ts.getGeneratedNameForNode(declaration.name); + if (declaration && !(ts.isClassLike(declaration) && isPartOfClassBody(declaration, node))) { + return ts.setTextRange(ts.getGeneratedNameForNode(ts.getNameOfDeclaration(declaration)), node); } } return node; } + function isPartOfClassBody(declaration, node) { + var currentNode = ts.getParseTreeNode(node); + if (!currentNode || currentNode === declaration || currentNode.end <= declaration.pos || currentNode.pos >= declaration.end) { + // if the node has no correlation to a parse tree node, its definitely not + // part of the body. + // if the node is outside of the document range of the declaration, its + // definitely not part of the body. + return false; + } + var blockScope = ts.getEnclosingBlockScopeContainer(declaration); + while (currentNode) { + if (currentNode === blockScope || currentNode === declaration) { + // if we are in the enclosing block scope of the declaration, we are definitely + // not inside the class body. + return false; + } + if (ts.isClassElement(currentNode) && currentNode.parent === declaration) { + // we are in the class body, but we treat static fields as outside of the class body + return currentNode.kind !== 149 /* PropertyDeclaration */ + || (ts.getModifierFlags(currentNode) & 32 /* Static */) === 0; + } + currentNode = currentNode.parent; + } + return false; + } /** * Substitutes `this` when contained within an arrow function. * @@ -51930,15 +55961,15 @@ var ts; */ function substituteThisKeyword(node) { if (enabledSubstitutions & 1 /* CapturedThis */ - && enclosingFunction - && ts.getEmitFlags(enclosingFunction) & 8 /* CapturesThis */) { - return ts.createIdentifier("_this", /*location*/ node); + && hierarchyFacts & 16 /* CapturesThis */) { + return ts.setTextRange(ts.createIdentifier("_this"), node); } return node; } function getClassMemberPrefix(node, member) { - var expression = ts.getLocalName(node); - return ts.hasModifier(member, 32 /* Static */) ? expression : ts.createPropertyAccess(expression, "prototype"); + return ts.hasModifier(member, 32 /* Static */) + ? ts.getInternalName(node) + : ts.createPropertyAccess(ts.getInternalName(node), "prototype"); } function hasSynthesizedDefaultSuperCall(constructor, hasExtendsClause) { if (!constructor || !hasExtendsClause) { @@ -51948,19 +55979,19 @@ var ts; return false; } var statement = ts.firstOrUndefined(constructor.body.statements); - if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 207 /* ExpressionStatement */) { + if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 210 /* ExpressionStatement */) { return false; } var statementExpression = statement.expression; - if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 179 /* CallExpression */) { + if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 181 /* CallExpression */) { return false; } var callTarget = statementExpression.expression; - if (!ts.nodeIsSynthesized(callTarget) || callTarget.kind !== 96 /* SuperKeyword */) { + if (!ts.nodeIsSynthesized(callTarget) || callTarget.kind !== 97 /* SuperKeyword */) { return false; } var callArgument = ts.singleOrUndefined(statementExpression.arguments); - if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 196 /* SpreadElement */) { + if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 198 /* SpreadElement */) { return false; } var expression = callArgument.expression; @@ -51980,11 +56011,123 @@ var ts; name: "typescript:extends", scoped: false, priority: 0, - text: "\n var __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };" + text: "\n var __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n })();" }; })(ts || (ts = {})); /// /// +/*@internal*/ +var ts; +(function (ts) { + /** + * Transforms ES5 syntax into ES3 syntax. + * + * @param context Context and state information for the transformation. + */ + function transformES5(context) { + var compilerOptions = context.getCompilerOptions(); + // enable emit notification only if using --jsx preserve or react-native + var previousOnEmitNode; + var noSubstitution; + if (compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */) { + previousOnEmitNode = context.onEmitNode; + context.onEmitNode = onEmitNode; + context.enableEmitNotification(251 /* JsxOpeningElement */); + context.enableEmitNotification(252 /* JsxClosingElement */); + context.enableEmitNotification(250 /* JsxSelfClosingElement */); + noSubstitution = []; + } + var previousOnSubstituteNode = context.onSubstituteNode; + context.onSubstituteNode = onSubstituteNode; + context.enableSubstitution(179 /* PropertyAccessExpression */); + context.enableSubstitution(261 /* PropertyAssignment */); + return transformSourceFile; + /** + * Transforms an ES5 source file to ES3. + * + * @param node A SourceFile + */ + function transformSourceFile(node) { + return node; + } + /** + * Called by the printer just before a node is printed. + * + * @param hint A hint as to the intended usage of the node. + * @param node The node to emit. + * @param emitCallback A callback used to emit the node. + */ + function onEmitNode(hint, node, emitCallback) { + switch (node.kind) { + case 251 /* JsxOpeningElement */: + case 252 /* JsxClosingElement */: + case 250 /* JsxSelfClosingElement */: + var tagName = node.tagName; + noSubstitution[ts.getOriginalNodeId(tagName)] = true; + break; + } + previousOnEmitNode(hint, node, emitCallback); + } + /** + * Hooks node substitutions. + * + * @param hint A hint as to the intended usage of the node. + * @param node The node to substitute. + */ + function onSubstituteNode(hint, node) { + if (node.id && noSubstitution && noSubstitution[node.id]) { + return previousOnSubstituteNode(hint, node); + } + node = previousOnSubstituteNode(hint, node); + if (ts.isPropertyAccessExpression(node)) { + return substitutePropertyAccessExpression(node); + } + else if (ts.isPropertyAssignment(node)) { + return substitutePropertyAssignment(node); + } + return node; + } + /** + * Substitutes a PropertyAccessExpression whose name is a reserved word. + * + * @param node A PropertyAccessExpression + */ + function substitutePropertyAccessExpression(node) { + var literalName = trySubstituteReservedName(node.name); + if (literalName) { + return ts.setTextRange(ts.createElementAccess(node.expression, literalName), node); + } + return node; + } + /** + * Substitutes a PropertyAssignment whose name is a reserved word. + * + * @param node A PropertyAssignment + */ + function substitutePropertyAssignment(node) { + var literalName = ts.isIdentifier(node.name) && trySubstituteReservedName(node.name); + if (literalName) { + return ts.updatePropertyAssignment(node, literalName, node.initializer); + } + return node; + } + /** + * If an identifier name is a reserved word, returns a string literal for the name. + * + * @param name An Identifier + */ + function trySubstituteReservedName(name) { + var token = name.originalKeywordKind || (ts.nodeIsSynthesized(name) ? ts.stringToToken(name.text) : undefined); + if (token >= 72 /* FirstReservedWord */ && token <= 107 /* LastReservedWord */) { + return ts.setTextRange(ts.createLiteral(name), name); + } + return undefined; + } + } + ts.transformES5 = transformES5; +})(ts || (ts = {})); +/// +/// // Transforms generator functions into a compatible ES5 representation with similar runtime // semantics. This is accomplished by first transforming the body of each generator // function into an intermediate representation that is the compiled into a JavaScript @@ -52155,13 +56298,15 @@ var ts; Instruction[Instruction["Catch"] = 6] = "Catch"; Instruction[Instruction["Endfinally"] = 7] = "Endfinally"; })(Instruction || (Instruction = {})); - var instructionNames = ts.createMap((_a = {}, - _a[2 /* Return */] = "return", - _a[3 /* Break */] = "break", - _a[4 /* Yield */] = "yield", - _a[5 /* YieldStar */] = "yield*", - _a[7 /* Endfinally */] = "endfinally", - _a)); + function getInstructionName(instruction) { + switch (instruction) { + case 2 /* Return */: return "return"; + case 3 /* Break */: return "break"; + case 4 /* Yield */: return "yield"; + case 5 /* YieldStar */: return "yield*"; + case 7 /* Endfinally */: return "endfinally"; + } + } function transformGenerators(context) { var resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistFunctionDeclaration = context.hoistFunctionDeclaration, hoistVariableDeclaration = context.hoistVariableDeclaration; var compilerOptions = context.getCompilerOptions(); @@ -52253,13 +56398,13 @@ var ts; */ function visitJavaScriptInStatementContainingYield(node) { switch (node.kind) { - case 209 /* DoStatement */: + case 212 /* DoStatement */: return visitDoStatement(node); - case 210 /* WhileStatement */: + case 213 /* WhileStatement */: return visitWhileStatement(node); - case 218 /* SwitchStatement */: + case 221 /* SwitchStatement */: return visitSwitchStatement(node); - case 219 /* LabeledStatement */: + case 222 /* LabeledStatement */: return visitLabeledStatement(node); default: return visitJavaScriptInGeneratorFunctionBody(node); @@ -52272,24 +56417,24 @@ var ts; */ function visitJavaScriptInGeneratorFunctionBody(node) { switch (node.kind) { - case 225 /* FunctionDeclaration */: + case 228 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 184 /* FunctionExpression */: + case 186 /* FunctionExpression */: return visitFunctionExpression(node); - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: return visitAccessorDeclaration(node); - case 205 /* VariableStatement */: + case 208 /* VariableStatement */: return visitVariableStatement(node); - case 211 /* ForStatement */: + case 214 /* ForStatement */: return visitForStatement(node); - case 212 /* ForInStatement */: + case 215 /* ForInStatement */: return visitForInStatement(node); - case 215 /* BreakStatement */: + case 218 /* BreakStatement */: return visitBreakStatement(node); - case 214 /* ContinueStatement */: + case 217 /* ContinueStatement */: return visitContinueStatement(node); - case 216 /* ReturnStatement */: + case 219 /* ReturnStatement */: return visitReturnStatement(node); default: if (node.transformFlags & 16777216 /* ContainsYield */) { @@ -52310,21 +56455,21 @@ var ts; */ function visitJavaScriptContainingYield(node) { switch (node.kind) { - case 192 /* BinaryExpression */: + case 194 /* BinaryExpression */: return visitBinaryExpression(node); - case 193 /* ConditionalExpression */: + case 195 /* ConditionalExpression */: return visitConditionalExpression(node); - case 195 /* YieldExpression */: + case 197 /* YieldExpression */: return visitYieldExpression(node); - case 175 /* ArrayLiteralExpression */: + case 177 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 176 /* ObjectLiteralExpression */: + case 178 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 178 /* ElementAccessExpression */: + case 180 /* ElementAccessExpression */: return visitElementAccessExpression(node); - case 179 /* CallExpression */: + case 181 /* CallExpression */: return visitCallExpression(node); - case 180 /* NewExpression */: + case 182 /* NewExpression */: return visitNewExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -52337,9 +56482,9 @@ var ts; */ function visitGenerator(node) { switch (node.kind) { - case 225 /* FunctionDeclaration */: + case 228 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 184 /* FunctionExpression */: + case 186 /* FunctionExpression */: return visitFunctionExpression(node); default: ts.Debug.failBadSyntaxKind(node); @@ -52357,12 +56502,12 @@ var ts; */ function visitFunctionDeclaration(node) { // Currently, we only support generators that were originally async functions. - if (node.asteriskToken && ts.getEmitFlags(node) & 131072 /* AsyncFunctionBody */) { - node = ts.setOriginalNode(ts.createFunctionDeclaration( + if (node.asteriskToken) { + node = ts.setOriginalNode(ts.setTextRange(ts.createFunctionDeclaration( /*decorators*/ undefined, node.modifiers, /*asteriskToken*/ undefined, node.name, /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, transformGeneratorFunctionBody(node.body), + /*type*/ undefined, transformGeneratorFunctionBody(node.body)), /*location*/ node), node); } else { @@ -52395,12 +56540,12 @@ var ts; */ function visitFunctionExpression(node) { // Currently, we only support generators that were originally async functions. - if (node.asteriskToken && ts.getEmitFlags(node) & 131072 /* AsyncFunctionBody */) { - node = ts.setOriginalNode(ts.createFunctionExpression( + if (node.asteriskToken) { + node = ts.setOriginalNode(ts.setTextRange(ts.createFunctionExpression( /*modifiers*/ undefined, /*asteriskToken*/ undefined, node.name, /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, transformGeneratorFunctionBody(node.body), + /*type*/ undefined, transformGeneratorFunctionBody(node.body)), /*location*/ node), node); } else { @@ -52469,7 +56614,7 @@ var ts; state = ts.createTempVariable(/*recordTempVariable*/ undefined); // Build the generator resumeLexicalEnvironment(); - var statementOffset = ts.addPrologueDirectives(statements, body.statements, /*ensureUseStrict*/ false, visitor); + var statementOffset = ts.addPrologue(statements, body.statements, /*ensureUseStrict*/ false, visitor); transformAndEmitStatements(body.statements, statementOffset); var buildResult = build(); ts.addRange(statements, endLexicalEnvironment()); @@ -52488,7 +56633,7 @@ var ts; operationArguments = savedOperationArguments; operationLocations = savedOperationLocations; state = savedState; - return ts.createBlock(statements, /*location*/ body, body.multiLine); + return ts.setTextRange(ts.createBlock(statements, body.multiLine), body); } /** * Visits a variable statement. @@ -52505,7 +56650,7 @@ var ts; } else { // Do not hoist custom prologues. - if (ts.getEmitFlags(node) & 524288 /* CustomPrologue */) { + if (ts.getEmitFlags(node) & 1048576 /* CustomPrologue */) { return node; } for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { @@ -52538,23 +56683,23 @@ var ts; } } function isCompoundAssignment(kind) { - return kind >= 58 /* FirstCompoundAssignment */ - && kind <= 69 /* LastCompoundAssignment */; + return kind >= 59 /* FirstCompoundAssignment */ + && kind <= 70 /* LastCompoundAssignment */; } function getOperatorForCompoundAssignment(kind) { switch (kind) { - case 58 /* PlusEqualsToken */: return 36 /* PlusToken */; - case 59 /* MinusEqualsToken */: return 37 /* MinusToken */; - case 60 /* AsteriskEqualsToken */: return 38 /* AsteriskToken */; - case 61 /* AsteriskAsteriskEqualsToken */: return 39 /* AsteriskAsteriskToken */; - case 62 /* SlashEqualsToken */: return 40 /* SlashToken */; - case 63 /* PercentEqualsToken */: return 41 /* PercentToken */; - case 64 /* LessThanLessThanEqualsToken */: return 44 /* LessThanLessThanToken */; - case 65 /* GreaterThanGreaterThanEqualsToken */: return 45 /* GreaterThanGreaterThanToken */; - case 66 /* GreaterThanGreaterThanGreaterThanEqualsToken */: return 46 /* GreaterThanGreaterThanGreaterThanToken */; - case 67 /* AmpersandEqualsToken */: return 47 /* AmpersandToken */; - case 68 /* BarEqualsToken */: return 48 /* BarToken */; - case 69 /* CaretEqualsToken */: return 49 /* CaretToken */; + case 59 /* PlusEqualsToken */: return 37 /* PlusToken */; + case 60 /* MinusEqualsToken */: return 38 /* MinusToken */; + case 61 /* AsteriskEqualsToken */: return 39 /* AsteriskToken */; + case 62 /* AsteriskAsteriskEqualsToken */: return 40 /* AsteriskAsteriskToken */; + case 63 /* SlashEqualsToken */: return 41 /* SlashToken */; + case 64 /* PercentEqualsToken */: return 42 /* PercentToken */; + case 65 /* LessThanLessThanEqualsToken */: return 45 /* LessThanLessThanToken */; + case 66 /* GreaterThanGreaterThanEqualsToken */: return 46 /* GreaterThanGreaterThanToken */; + case 67 /* GreaterThanGreaterThanGreaterThanEqualsToken */: return 47 /* GreaterThanGreaterThanGreaterThanToken */; + case 68 /* AmpersandEqualsToken */: return 48 /* AmpersandToken */; + case 69 /* BarEqualsToken */: return 49 /* BarToken */; + case 70 /* CaretEqualsToken */: return 50 /* CaretToken */; } } /** @@ -52567,7 +56712,7 @@ var ts; if (containsYield(right)) { var target = void 0; switch (left.kind) { - case 177 /* PropertyAccessExpression */: + case 179 /* PropertyAccessExpression */: // [source] // a.b = yield; // @@ -52579,7 +56724,7 @@ var ts; // _a.b = %sent%; target = ts.updatePropertyAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name); break; - case 178 /* ElementAccessExpression */: + case 180 /* ElementAccessExpression */: // [source] // a[b] = yield; // @@ -52598,7 +56743,7 @@ var ts; } var operator = node.operatorToken.kind; if (isCompoundAssignment(operator)) { - return ts.createBinary(target, 57 /* EqualsToken */, ts.createBinary(cacheExpression(target), getOperatorForCompoundAssignment(operator), ts.visitNode(right, visitor, ts.isExpression), node), node); + return ts.setTextRange(ts.createAssignment(target, ts.setTextRange(ts.createBinary(cacheExpression(target), getOperatorForCompoundAssignment(operator), ts.visitNode(right, visitor, ts.isExpression)), node)), node); } else { return ts.updateBinary(node, target, ts.visitNode(right, visitor, ts.isExpression)); @@ -52611,7 +56756,7 @@ var ts; if (ts.isLogicalOperator(node.operatorToken.kind)) { return visitLogicalBinaryExpression(node); } - else if (node.operatorToken.kind === 25 /* CommaToken */) { + else if (node.operatorToken.kind === 26 /* CommaToken */) { return visitCommaExpression(node); } // [source] @@ -52622,10 +56767,10 @@ var ts; // _a = a(); // .yield resumeLabel // _a + %sent% + c() - var clone_4 = ts.getMutableClone(node); - clone_4.left = cacheExpression(ts.visitNode(node.left, visitor, ts.isExpression)); - clone_4.right = ts.visitNode(node.right, visitor, ts.isExpression); - return clone_4; + var clone_5 = ts.getMutableClone(node); + clone_5.left = cacheExpression(ts.visitNode(node.left, visitor, ts.isExpression)); + clone_5.right = ts.visitNode(node.right, visitor, ts.isExpression); + return clone_5; } return ts.visitEachChild(node, visitor, context); } @@ -52666,7 +56811,7 @@ var ts; var resultLabel = defineLabel(); var resultLocal = declareLocal(); emitAssignment(resultLocal, ts.visitNode(node.left, visitor, ts.isExpression), /*location*/ node.left); - if (node.operatorToken.kind === 52 /* AmpersandAmpersandToken */) { + if (node.operatorToken.kind === 53 /* AmpersandAmpersandToken */) { // Logical `&&` shortcuts when the left-hand operand is falsey. emitBreakWhenFalse(resultLabel, resultLocal, /*location*/ node.left); } @@ -52697,7 +56842,7 @@ var ts; visit(node.right); return ts.inlineExpressions(pendingExpressions); function visit(node) { - if (ts.isBinaryExpression(node) && node.operatorToken.kind === 25 /* CommaToken */) { + if (ts.isBinaryExpression(node) && node.operatorToken.kind === 26 /* CommaToken */) { visit(node.left); visit(node.right); } @@ -52760,11 +56905,13 @@ var ts; // .yield resumeLabel, (a()) // .mark resumeLabel // x = %sent%; - // NOTE: we are explicitly not handling YieldStar at this time. var resumeLabel = defineLabel(); var expression = ts.visitNode(node.expression, visitor, ts.isExpression); if (node.asteriskToken) { - emitYieldStar(expression, /*location*/ node); + var iterator = (ts.getEmitFlags(node.expression) & 8388608 /* Iterator */) === 0 + ? ts.createValuesHelper(context, expression, /*location*/ node) + : expression; + emitYieldStar(iterator, /*location*/ node); } else { emitYield(expression, /*location*/ node); @@ -52798,26 +56945,27 @@ var ts; // .mark resumeLabel // ar = _a.concat([%sent%, 2]); var numInitialElements = countInitialNodesWithoutYield(elements); - var temp = declareLocal(); - var hasAssignedTemp = false; + var temp; if (numInitialElements > 0) { + temp = declareLocal(); var initialElements = ts.visitNodes(elements, visitor, ts.isExpression, 0, numInitialElements); emitAssignment(temp, ts.createArrayLiteral(leadingElement ? [leadingElement].concat(initialElements) : initialElements)); leadingElement = undefined; - hasAssignedTemp = true; } var expressions = ts.reduceLeft(elements, reduceElement, [], numInitialElements); - return hasAssignedTemp - ? ts.createArrayConcat(temp, [ts.createArrayLiteral(expressions, /*location*/ undefined, multiLine)]) - : ts.createArrayLiteral(leadingElement ? [leadingElement].concat(expressions) : expressions, location, multiLine); + return temp + ? ts.createArrayConcat(temp, [ts.createArrayLiteral(expressions, multiLine)]) + : ts.setTextRange(ts.createArrayLiteral(leadingElement ? [leadingElement].concat(expressions) : expressions, multiLine), location); function reduceElement(expressions, element) { if (containsYield(element) && expressions.length > 0) { + var hasAssignedTemp = temp !== undefined; + if (!temp) { + temp = declareLocal(); + } emitAssignment(temp, hasAssignedTemp - ? ts.createArrayConcat(temp, [ts.createArrayLiteral(expressions, /*location*/ undefined, multiLine)]) - : ts.createArrayLiteral(leadingElement ? [leadingElement].concat(expressions) : expressions, - /*location*/ undefined, multiLine)); - hasAssignedTemp = true; + ? ts.createArrayConcat(temp, [ts.createArrayLiteral(expressions, multiLine)]) + : ts.createArrayLiteral(leadingElement ? [leadingElement].concat(expressions) : expressions, multiLine)); leadingElement = undefined; expressions = []; } @@ -52847,8 +56995,7 @@ var ts; var multiLine = node.multiLine; var numInitialProperties = countInitialNodesWithoutYield(properties); var temp = declareLocal(); - emitAssignment(temp, ts.createObjectLiteral(ts.visitNodes(properties, visitor, ts.isObjectLiteralElementLike, 0, numInitialProperties), - /*location*/ undefined, multiLine)); + emitAssignment(temp, ts.createObjectLiteral(ts.visitNodes(properties, visitor, ts.isObjectLiteralElementLike, 0, numInitialProperties), multiLine)); var expressions = ts.reduceLeft(properties, reduceProperty, [], numInitialProperties); expressions.push(multiLine ? ts.startOnNewLine(ts.getMutableClone(temp)) : temp); return ts.inlineExpressions(expressions); @@ -52884,10 +57031,10 @@ var ts; // .yield resumeLabel // .mark resumeLabel // a = _a[%sent%] - var clone_5 = ts.getMutableClone(node); - clone_5.expression = cacheExpression(ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression)); - clone_5.argumentExpression = ts.visitNode(node.argumentExpression, visitor, ts.isExpression); - return clone_5; + var clone_6 = ts.getMutableClone(node); + clone_6.expression = cacheExpression(ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression)); + clone_6.argumentExpression = ts.visitNode(node.argumentExpression, visitor, ts.isExpression); + return clone_6; } return ts.visitEachChild(node, visitor, context); } @@ -52922,10 +57069,9 @@ var ts; // .mark resumeLabel // new (_b.apply(_a, _c.concat([%sent%, 2]))); var _a = ts.createCallBinding(ts.createPropertyAccess(node.expression, "bind"), hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg; - return ts.setOriginalNode(ts.createNew(ts.createFunctionApply(cacheExpression(ts.visitNode(target, visitor, ts.isExpression)), thisArg, visitElements(node.arguments, + return ts.setOriginalNode(ts.setTextRange(ts.createNew(ts.createFunctionApply(cacheExpression(ts.visitNode(target, visitor, ts.isExpression)), thisArg, visitElements(node.arguments, /*leadingElement*/ ts.createVoidZero())), - /*typeArguments*/ undefined, [], - /*location*/ node), node); + /*typeArguments*/ undefined, []), node), node); } return ts.visitEachChild(node, visitor, context); } @@ -52954,38 +57100,38 @@ var ts; } function transformAndEmitStatementWorker(node) { switch (node.kind) { - case 204 /* Block */: + case 207 /* Block */: return transformAndEmitBlock(node); - case 207 /* ExpressionStatement */: + case 210 /* ExpressionStatement */: return transformAndEmitExpressionStatement(node); - case 208 /* IfStatement */: + case 211 /* IfStatement */: return transformAndEmitIfStatement(node); - case 209 /* DoStatement */: + case 212 /* DoStatement */: return transformAndEmitDoStatement(node); - case 210 /* WhileStatement */: + case 213 /* WhileStatement */: return transformAndEmitWhileStatement(node); - case 211 /* ForStatement */: + case 214 /* ForStatement */: return transformAndEmitForStatement(node); - case 212 /* ForInStatement */: + case 215 /* ForInStatement */: return transformAndEmitForInStatement(node); - case 214 /* ContinueStatement */: + case 217 /* ContinueStatement */: return transformAndEmitContinueStatement(node); - case 215 /* BreakStatement */: + case 218 /* BreakStatement */: return transformAndEmitBreakStatement(node); - case 216 /* ReturnStatement */: + case 219 /* ReturnStatement */: return transformAndEmitReturnStatement(node); - case 217 /* WithStatement */: + case 220 /* WithStatement */: return transformAndEmitWithStatement(node); - case 218 /* SwitchStatement */: + case 221 /* SwitchStatement */: return transformAndEmitSwitchStatement(node); - case 219 /* LabeledStatement */: + case 222 /* LabeledStatement */: return transformAndEmitLabeledStatement(node); - case 220 /* ThrowStatement */: + case 223 /* ThrowStatement */: return transformAndEmitThrowStatement(node); - case 221 /* TryStatement */: + case 224 /* TryStatement */: return transformAndEmitTryStatement(node); default: - return emitStatement(ts.visitNode(node, visitor, ts.isStatement, /*optional*/ true)); + return emitStatement(ts.visitNode(node, visitor, ts.isStatement)); } } function transformAndEmitBlock(node) { @@ -53002,9 +57148,9 @@ var ts; function transformAndEmitVariableDeclarationList(node) { for (var _i = 0, _a = node.declarations; _i < _a.length; _i++) { var variable = _a[_i]; - var name_37 = ts.getSynthesizedClone(variable.name); - ts.setCommentRange(name_37, variable.name); - hoistVariableDeclaration(name_37); + var name = ts.getSynthesizedClone(variable.name); + ts.setCommentRange(name, variable.name); + hoistVariableDeclaration(name); } var variables = ts.getInitializedVariables(node); var numVariables = variables.length; @@ -53170,8 +57316,7 @@ var ts; transformAndEmitVariableDeclarationList(initializer); } else { - emitStatement(ts.createStatement(ts.visitNode(initializer, visitor, ts.isExpression), - /*location*/ initializer)); + emitStatement(ts.setTextRange(ts.createStatement(ts.visitNode(initializer, visitor, ts.isExpression)), initializer)); } } markLabel(conditionLabel); @@ -53181,8 +57326,7 @@ var ts; transformAndEmitEmbeddedStatement(node.statement); markLabel(incrementLabel); if (node.incrementor) { - emitStatement(ts.createStatement(ts.visitNode(node.incrementor, visitor, ts.isExpression), - /*location*/ node.incrementor)); + emitStatement(ts.setTextRange(ts.createStatement(ts.visitNode(node.incrementor, visitor, ts.isExpression)), node.incrementor)); } emitBreak(conditionLabel); endLoopBlock(); @@ -53196,7 +57340,7 @@ var ts; beginScriptLoopBlock(); } var initializer = node.initializer; - if (ts.isVariableDeclarationList(initializer)) { + if (initializer && ts.isVariableDeclarationList(initializer)) { for (var _i = 0, _a = initializer.declarations; _i < _a.length; _i++) { var variable = _a[_i]; hoistVariableDeclaration(variable.name); @@ -53204,7 +57348,7 @@ var ts; var variables = ts.getInitializedVariables(initializer); node = ts.updateFor(node, variables.length > 0 ? ts.inlineExpressions(ts.map(variables, transformInitializedVariable)) - : undefined, ts.visitNode(node.condition, visitor, ts.isExpression, /*optional*/ true), ts.visitNode(node.incrementor, visitor, ts.isExpression, /*optional*/ true), ts.visitNode(node.statement, visitor, ts.isStatement, /*optional*/ false, ts.liftToBlock)); + : undefined, ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitor, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); } else { node = ts.visitEachChild(node, visitor, context); @@ -53296,7 +57440,7 @@ var ts; var variable = _a[_i]; hoistVariableDeclaration(variable.name); } - node = ts.updateForIn(node, initializer.declarations[0].name, ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement, /*optional*/ false, ts.liftToBlock)); + node = ts.updateForIn(node, initializer.declarations[0].name, ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); } else { node = ts.visitEachChild(node, visitor, context); @@ -53335,11 +57479,11 @@ var ts; return ts.visitEachChild(node, visitor, context); } function transformAndEmitReturnStatement(node) { - emitReturn(ts.visitNode(node.expression, visitor, ts.isExpression, /*optional*/ true), + emitReturn(ts.visitNode(node.expression, visitor, ts.isExpression), /*location*/ node); } function visitReturnStatement(node) { - return createInlineReturn(ts.visitNode(node.expression, visitor, ts.isExpression, /*optional*/ true), + return createInlineReturn(ts.visitNode(node.expression, visitor, ts.isExpression), /*location*/ node); } function transformAndEmitWithStatement(node) { @@ -53404,7 +57548,7 @@ var ts; for (var i = 0; i < numClauses; i++) { var clause = caseBlock.clauses[i]; clauseLabels.push(defineLabel()); - if (clause.kind === 254 /* DefaultClause */ && defaultClauseIndex === -1) { + if (clause.kind === 258 /* DefaultClause */ && defaultClauseIndex === -1) { defaultClauseIndex = i; } } @@ -53417,7 +57561,7 @@ var ts; var defaultClausesSkipped = 0; for (var i = clausesWritten; i < numClauses; i++) { var clause = caseBlock.clauses[i]; - if (clause.kind === 253 /* CaseClause */) { + if (clause.kind === 257 /* CaseClause */) { var caseClause = clause; if (containsYield(caseClause.expression) && pendingClauses.length > 0) { break; @@ -53559,9 +57703,9 @@ var ts; } return -1; } - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (emitContext === 1 /* Expression */) { + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1 /* Expression */) { return substituteExpression(node); } return node; @@ -53573,17 +57717,17 @@ var ts; return node; } function substituteExpressionIdentifier(node) { - if (renamedCatchVariables && ts.hasProperty(renamedCatchVariables, node.text)) { + if (!ts.isGeneratedIdentifier(node) && renamedCatchVariables && renamedCatchVariables.has(node.text)) { var original = ts.getOriginalNode(node); if (ts.isIdentifier(original) && original.parent) { var declaration = resolver.getReferencedValueDeclaration(original); if (declaration) { - var name_38 = ts.getProperty(renamedCatchVariableDeclarations, String(ts.getOriginalNodeId(declaration))); - if (name_38) { - var clone_6 = ts.getMutableClone(name_38); - ts.setSourceMapRange(clone_6, node); - ts.setCommentRange(clone_6, node); - return clone_6; + var name = renamedCatchVariableDeclarations[ts.getOriginalNodeId(declaration)]; + if (name) { + var clone_7 = ts.getMutableClone(name); + ts.setSourceMapRange(clone_7, node); + ts.setCommentRange(clone_7, node); + return clone_7; } } } @@ -53592,7 +57736,7 @@ var ts; } function cacheExpression(node) { var temp; - if (ts.isGeneratedIdentifier(node)) { + if (ts.isGeneratedIdentifier(node) || ts.getEmitFlags(node) & 4096 /* HelperName */) { return node; } temp = ts.createTempVariable(hoistVariableDeclaration); @@ -53720,15 +57864,23 @@ var ts; */ function beginCatchBlock(variable) { ts.Debug.assert(peekBlockKind() === 0 /* Exception */); - var text = variable.name.text; - var name = declareLocal(text); - if (!renamedCatchVariables) { - renamedCatchVariables = ts.createMap(); - renamedCatchVariableDeclarations = ts.createMap(); - context.enableSubstitution(70 /* Identifier */); + // generated identifiers should already be unique within a file + var name; + if (ts.isGeneratedIdentifier(variable.name)) { + name = variable.name; + hoistVariableDeclaration(variable.name); + } + else { + var text = variable.name.text; + name = declareLocal(text); + if (!renamedCatchVariables) { + renamedCatchVariables = ts.createMap(); + renamedCatchVariableDeclarations = []; + context.enableSubstitution(71 /* Identifier */); + } + renamedCatchVariables.set(text, true); + renamedCatchVariableDeclarations[ts.getOriginalNodeId(variable)] = name; } - renamedCatchVariables[text] = true; - renamedCatchVariableDeclarations[ts.getOriginalNodeId(variable)] = name; var exception = peekBlock(); ts.Debug.assert(exception.state < 1 /* Catch */); var endLabel = exception.endLabel; @@ -53998,7 +58150,7 @@ var ts; */ function createInstruction(instruction) { var literal = ts.createLiteral(instruction); - literal.trailingComment = instructionNames[instruction]; + ts.addSyntheticTrailingComment(literal, 3 /* MultiLineCommentTrivia */, getInstructionName(instruction)); return literal; } /** @@ -54009,10 +58161,10 @@ var ts; */ function createInlineBreak(label, location) { ts.Debug.assert(label > 0, "Invalid label: " + label); - return ts.createReturn(ts.createArrayLiteral([ + return ts.setTextRange(ts.createReturn(ts.createArrayLiteral([ createInstruction(3 /* Break */), createLabel(label) - ]), location); + ])), location); } /** * Creates a statement that can be used indicate a Return operation. @@ -54021,15 +58173,16 @@ var ts; * @param location An optional source map location for the statement. */ function createInlineReturn(expression, location) { - return ts.createReturn(ts.createArrayLiteral(expression + return ts.setTextRange(ts.createReturn(ts.createArrayLiteral(expression ? [createInstruction(2 /* Return */), expression] - : [createInstruction(2 /* Return */)]), location); + : [createInstruction(2 /* Return */)])), location); } /** * Creates an expression that can be used to resume from a Yield operation. */ function createGeneratorResume(location) { - return ts.createCall(ts.createPropertyAccess(state, "sent"), /*typeArguments*/ undefined, [], location); + return ts.setTextRange(ts.createCall(ts.createPropertyAccess(state, "sent"), + /*typeArguments*/ undefined, []), location); } /** * Emits an empty instruction. @@ -54175,8 +58328,7 @@ var ts; /*name*/ undefined, /*typeParameters*/ undefined, [ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, state)], /*type*/ undefined, ts.createBlock(buildResult, - /*location*/ undefined, - /*multiLine*/ buildResult.length > 0)), 262144 /* ReuseTempVariableScope */)); + /*multiLine*/ buildResult.length > 0)), 524288 /* ReuseTempVariableScope */)); } /** * Builds the statements for the generator function body. @@ -54446,7 +58598,7 @@ var ts; * @param operationLocation The source map location for the operation. */ function writeAssign(left, right, operationLocation) { - writeStatement(ts.createStatement(ts.createAssignment(left, right), operationLocation)); + writeStatement(ts.setTextRange(ts.createStatement(ts.createAssignment(left, right)), operationLocation)); } /** * Writes a Throw operation to the current label's statement list. @@ -54457,7 +58609,7 @@ var ts; function writeThrow(expression, operationLocation) { lastOperationWasAbrupt = true; lastOperationWasCompletion = true; - writeStatement(ts.createThrow(expression, operationLocation)); + writeStatement(ts.setTextRange(ts.createThrow(expression), operationLocation)); } /** * Writes a Return operation to the current label's statement list. @@ -54468,9 +58620,9 @@ var ts; function writeReturn(expression, operationLocation) { lastOperationWasAbrupt = true; lastOperationWasCompletion = true; - writeStatement(ts.setEmitFlags(ts.createReturn(ts.createArrayLiteral(expression + writeStatement(ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral(expression ? [createInstruction(2 /* Return */), expression] - : [createInstruction(2 /* Return */)]), operationLocation), 384 /* NoTokenSourceMaps */)); + : [createInstruction(2 /* Return */)])), operationLocation), 384 /* NoTokenSourceMaps */)); } /** * Writes a Break operation to the current label's statement list. @@ -54480,10 +58632,10 @@ var ts; */ function writeBreak(label, operationLocation) { lastOperationWasAbrupt = true; - writeStatement(ts.setEmitFlags(ts.createReturn(ts.createArrayLiteral([ + writeStatement(ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral([ createInstruction(3 /* Break */), createLabel(label) - ]), operationLocation), 384 /* NoTokenSourceMaps */)); + ])), operationLocation), 384 /* NoTokenSourceMaps */)); } /** * Writes a BreakWhenTrue operation to the current label's statement list. @@ -54493,10 +58645,10 @@ var ts; * @param operationLocation The source map location for the operation. */ function writeBreakWhenTrue(label, condition, operationLocation) { - writeStatement(ts.setEmitFlags(ts.createIf(condition, ts.setEmitFlags(ts.createReturn(ts.createArrayLiteral([ + writeStatement(ts.setEmitFlags(ts.createIf(condition, ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral([ createInstruction(3 /* Break */), createLabel(label) - ]), operationLocation), 384 /* NoTokenSourceMaps */)), 1 /* SingleLine */)); + ])), operationLocation), 384 /* NoTokenSourceMaps */)), 1 /* SingleLine */)); } /** * Writes a BreakWhenFalse operation to the current label's statement list. @@ -54506,10 +58658,10 @@ var ts; * @param operationLocation The source map location for the operation. */ function writeBreakWhenFalse(label, condition, operationLocation) { - writeStatement(ts.setEmitFlags(ts.createIf(ts.createLogicalNot(condition), ts.setEmitFlags(ts.createReturn(ts.createArrayLiteral([ + writeStatement(ts.setEmitFlags(ts.createIf(ts.createLogicalNot(condition), ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral([ createInstruction(3 /* Break */), createLabel(label) - ]), operationLocation), 384 /* NoTokenSourceMaps */)), 1 /* SingleLine */)); + ])), operationLocation), 384 /* NoTokenSourceMaps */)), 1 /* SingleLine */)); } /** * Writes a Yield operation to the current label's statement list. @@ -54519,9 +58671,9 @@ var ts; */ function writeYield(expression, operationLocation) { lastOperationWasAbrupt = true; - writeStatement(ts.setEmitFlags(ts.createReturn(ts.createArrayLiteral(expression + writeStatement(ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral(expression ? [createInstruction(4 /* Yield */), expression] - : [createInstruction(4 /* Yield */)]), operationLocation), 384 /* NoTokenSourceMaps */)); + : [createInstruction(4 /* Yield */)])), operationLocation), 384 /* NoTokenSourceMaps */)); } /** * Writes a YieldStar instruction to the current label's statement list. @@ -54531,10 +58683,10 @@ var ts; */ function writeYieldStar(expression, operationLocation) { lastOperationWasAbrupt = true; - writeStatement(ts.setEmitFlags(ts.createReturn(ts.createArrayLiteral([ + writeStatement(ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral([ createInstruction(5 /* YieldStar */), expression - ]), operationLocation), 384 /* NoTokenSourceMaps */)); + ])), operationLocation), 384 /* NoTokenSourceMaps */)); } /** * Writes an Endfinally instruction to the current label's statement list. @@ -54615,188 +58767,918 @@ var ts; name: "typescript:generator", scoped: false, priority: 6, - text: "\n var __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t;\n return { next: verb(0), \"throw\": verb(1), \"return\": verb(2) };\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = y[op[0] & 2 ? \"return\" : op[0] ? \"throw\" : \"next\"]) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [0, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n };" + text: "\n var __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = y[op[0] & 2 ? \"return\" : op[0] ? \"throw\" : \"next\"]) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [0, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n };" }; - var _a; -})(ts || (ts = {})); -/// -/// -/*@internal*/ -var ts; -(function (ts) { - /** - * Transforms ES5 syntax into ES3 syntax. - * - * @param context Context and state information for the transformation. - */ - function transformES5(context) { - var compilerOptions = context.getCompilerOptions(); - // enable emit notification only if using --jsx preserve - var previousOnEmitNode; - var noSubstitution; - if (compilerOptions.jsx === 1 /* Preserve */) { - previousOnEmitNode = context.onEmitNode; - context.onEmitNode = onEmitNode; - context.enableEmitNotification(248 /* JsxOpeningElement */); - context.enableEmitNotification(249 /* JsxClosingElement */); - context.enableEmitNotification(247 /* JsxSelfClosingElement */); - noSubstitution = []; - } - var previousOnSubstituteNode = context.onSubstituteNode; - context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(177 /* PropertyAccessExpression */); - context.enableSubstitution(257 /* PropertyAssignment */); - return transformSourceFile; - /** - * Transforms an ES5 source file to ES3. - * - * @param node A SourceFile - */ - function transformSourceFile(node) { - return node; - } - /** - * Called by the printer just before a node is printed. - * - * @param node The node to be printed. - */ - function onEmitNode(emitContext, node, emitCallback) { - switch (node.kind) { - case 248 /* JsxOpeningElement */: - case 249 /* JsxClosingElement */: - case 247 /* JsxSelfClosingElement */: - var tagName = node.tagName; - noSubstitution[ts.getOriginalNodeId(tagName)] = true; - break; - } - previousOnEmitNode(emitContext, node, emitCallback); - } - /** - * Hooks node substitutions. - * - * @param emitContext The context for the emitter. - * @param node The node to substitute. - */ - function onSubstituteNode(emitContext, node) { - if (node.id && noSubstitution && noSubstitution[node.id]) { - return previousOnSubstituteNode(emitContext, node); - } - node = previousOnSubstituteNode(emitContext, node); - if (ts.isPropertyAccessExpression(node)) { - return substitutePropertyAccessExpression(node); - } - else if (ts.isPropertyAssignment(node)) { - return substitutePropertyAssignment(node); - } - return node; - } - /** - * Substitutes a PropertyAccessExpression whose name is a reserved word. - * - * @param node A PropertyAccessExpression - */ - function substitutePropertyAccessExpression(node) { - var literalName = trySubstituteReservedName(node.name); - if (literalName) { - return ts.createElementAccess(node.expression, literalName, /*location*/ node); - } - return node; - } - /** - * Substitutes a PropertyAssignment whose name is a reserved word. - * - * @param node A PropertyAssignment - */ - function substitutePropertyAssignment(node) { - var literalName = ts.isIdentifier(node.name) && trySubstituteReservedName(node.name); - if (literalName) { - return ts.updatePropertyAssignment(node, literalName, node.initializer); - } - return node; - } - /** - * If an identifier name is a reserved word, returns a string literal for the name. - * - * @param name An Identifier - */ - function trySubstituteReservedName(name) { - var token = name.originalKeywordKind || (ts.nodeIsSynthesized(name) ? ts.stringToToken(name.text) : undefined); - if (token >= 71 /* FirstReservedWord */ && token <= 106 /* LastReservedWord */) { - return ts.createLiteral(name, /*location*/ name); - } - return undefined; - } - } - ts.transformES5 = transformES5; })(ts || (ts = {})); /// /// +/// /*@internal*/ var ts; (function (ts) { - function transformES2015Module(context) { + function transformModule(context) { + function getTransformModuleDelegate(moduleKind) { + switch (moduleKind) { + case ts.ModuleKind.AMD: return transformAMDModule; + case ts.ModuleKind.UMD: return transformUMDModule; + default: return transformCommonJSModule; + } + } + var startLexicalEnvironment = context.startLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment; var compilerOptions = context.getCompilerOptions(); - var previousOnEmitNode = context.onEmitNode; + var resolver = context.getEmitResolver(); + var host = context.getEmitHost(); + var languageVersion = ts.getEmitScriptTarget(compilerOptions); + var moduleKind = ts.getEmitModuleKind(compilerOptions); var previousOnSubstituteNode = context.onSubstituteNode; - context.onEmitNode = onEmitNode; + var previousOnEmitNode = context.onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableEmitNotification(261 /* SourceFile */); - context.enableSubstitution(70 /* Identifier */); - var currentSourceFile; + context.onEmitNode = onEmitNode; + context.enableSubstitution(71 /* Identifier */); // Substitutes expression identifiers with imported/exported symbols. + context.enableSubstitution(194 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(192 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(193 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(262 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. + context.enableEmitNotification(265 /* 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. + var currentModuleInfo; // The ExternalModuleInfo for the current file. + var noSubstitution; // Set of nodes for which substitution rules should be ignored. return transformSourceFile; + /** + * Transforms the module aspects of a SourceFile. + * + * @param node The SourceFile node. + */ function transformSourceFile(node) { - if (ts.isDeclarationFile(node)) { + if (ts.isDeclarationFile(node) || !(ts.isExternalModule(node) || compilerOptions.isolatedModules)) { return node; } - if (ts.isExternalModule(node) || compilerOptions.isolatedModules) { - var externalHelpersModuleName = ts.getOrCreateExternalHelpersModuleNameIfNeeded(node, compilerOptions); - if (externalHelpersModuleName) { - var statements = []; - var statementOffset = ts.addPrologueDirectives(statements, node.statements); - ts.append(statements, ts.createImportDeclaration( - /*decorators*/ undefined, - /*modifiers*/ undefined, ts.createImportClause(/*name*/ undefined, ts.createNamespaceImport(externalHelpersModuleName)), ts.createLiteral(ts.externalHelpersModuleNameText))); - ts.addRange(statements, ts.visitNodes(node.statements, visitor, ts.isStatement, statementOffset)); - return ts.updateSourceFileNode(node, ts.createNodeArray(statements, node.statements)); + currentSourceFile = node; + currentModuleInfo = ts.collectExternalModuleInfo(node, resolver, compilerOptions); + moduleInfoMap[ts.getOriginalNodeId(node)] = currentModuleInfo; + // Perform the transformation. + var transformModule = getTransformModuleDelegate(moduleKind); + var updated = transformModule(node); + currentSourceFile = undefined; + currentModuleInfo = undefined; + return ts.aggregateTransformFlags(updated); + } + function shouldEmitUnderscoreUnderscoreESModule() { + if (!currentModuleInfo.exportEquals && ts.isExternalModule(currentSourceFile)) { + return true; + } + return false; + } + /** + * Transforms a SourceFile into a CommonJS module. + * + * @param node The SourceFile node. + */ + function transformCommonJSModule(node) { + startLexicalEnvironment(); + var statements = []; + var ensureUseStrict = compilerOptions.alwaysStrict || (!compilerOptions.noImplicitUseStrict && ts.isExternalModule(currentSourceFile)); + var statementOffset = ts.addPrologue(statements, node.statements, ensureUseStrict, sourceElementVisitor); + if (shouldEmitUnderscoreUnderscoreESModule()) { + ts.append(statements, createUnderscoreUnderscoreESModule()); + } + ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement)); + ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset)); + addExportEqualsIfNeeded(statements, /*emitAsReturn*/ false); + ts.addRange(statements, endLexicalEnvironment()); + var updated = ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray(statements), node.statements)); + if (currentModuleInfo.hasExportStarsToExportValues) { + // If we have any `export * from ...` declarations + // we need to inform the emitter to add the __export helper. + ts.addEmitHelper(updated, exportStarHelper); + } + return updated; + } + /** + * Transforms a SourceFile into an AMD module. + * + * @param node The SourceFile node. + */ + function transformAMDModule(node) { + var define = ts.createIdentifier("define"); + var moduleName = ts.tryGetModuleNameFromFile(node, host, compilerOptions); + // An AMD define function has the following shape: + // + // define(id?, dependencies?, factory); + // + // This has the shape of the following: + // + // define(name, ["module1", "module2"], function (module1Alias) { ... } + // + // The location of the alias in the parameter list in the factory function needs to + // match the position of the module name in the dependency list. + // + // To ensure this is true in cases of modules with no aliases, e.g.: + // + // import "module" + // + // or + // + // /// + // + // we need to add modules without alias names to the end of the dependencies list + var _a = collectAsynchronousDependencies(node, /*includeNonAmdDependencies*/ true), aliasedModuleNames = _a.aliasedModuleNames, unaliasedModuleNames = _a.unaliasedModuleNames, importAliasNames = _a.importAliasNames; + // Create an updated SourceFile: + // + // define(moduleName?, ["module1", "module2"], function ... + return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ + ts.createStatement(ts.createCall(define, + /*typeArguments*/ undefined, (moduleName ? [moduleName] : []).concat([ + // Add the dependency array argument: + // + // ["require", "exports", module1", "module2", ...] + ts.createArrayLiteral([ + ts.createLiteral("require"), + ts.createLiteral("exports") + ].concat(aliasedModuleNames, unaliasedModuleNames)), + // Add the module body function argument: + // + // function (require, exports, module1, module2) ... + ts.createFunctionExpression( + /*modifiers*/ undefined, + /*asteriskToken*/ undefined, + /*name*/ undefined, + /*typeParameters*/ undefined, [ + ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "require"), + ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "exports") + ].concat(importAliasNames), + /*type*/ undefined, transformAsynchronousModuleBody(node)) + ]))) + ]), + /*location*/ node.statements)); + } + /** + * Transforms a SourceFile into a UMD module. + * + * @param node The SourceFile node. + */ + function transformUMDModule(node) { + var _a = collectAsynchronousDependencies(node, /*includeNonAmdDependencies*/ false), aliasedModuleNames = _a.aliasedModuleNames, unaliasedModuleNames = _a.unaliasedModuleNames, importAliasNames = _a.importAliasNames; + var umdHeader = ts.createFunctionExpression( + /*modifiers*/ undefined, + /*asteriskToken*/ undefined, + /*name*/ undefined, + /*typeParameters*/ undefined, [ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "factory")], + /*type*/ undefined, ts.setTextRange(ts.createBlock([ + ts.createIf(ts.createLogicalAnd(ts.createTypeCheck(ts.createIdentifier("module"), "object"), ts.createTypeCheck(ts.createPropertyAccess(ts.createIdentifier("module"), "exports"), "object")), ts.createBlock([ + ts.createVariableStatement( + /*modifiers*/ undefined, [ + ts.createVariableDeclaration("v", + /*type*/ undefined, ts.createCall(ts.createIdentifier("factory"), + /*typeArguments*/ undefined, [ + ts.createIdentifier("require"), + ts.createIdentifier("exports") + ])) + ]), + ts.setEmitFlags(ts.createIf(ts.createStrictInequality(ts.createIdentifier("v"), ts.createIdentifier("undefined")), ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("module"), "exports"), ts.createIdentifier("v")))), 1 /* SingleLine */) + ]), ts.createIf(ts.createLogicalAnd(ts.createTypeCheck(ts.createIdentifier("define"), "function"), ts.createPropertyAccess(ts.createIdentifier("define"), "amd")), ts.createBlock([ + ts.createStatement(ts.createCall(ts.createIdentifier("define"), + /*typeArguments*/ undefined, [ + ts.createArrayLiteral([ + ts.createLiteral("require"), + ts.createLiteral("exports") + ].concat(aliasedModuleNames, unaliasedModuleNames)), + ts.createIdentifier("factory") + ])) + ]))) + ], + /*multiLine*/ true), + /*location*/ undefined)); + // Create an updated SourceFile: + // + // (function (factory) { + // if (typeof module === "object" && typeof module.exports === "object") { + // var v = factory(require, exports); + // if (v !== undefined) module.exports = v; + // } + // else if (typeof define === 'function' && define.amd) { + // define(["require", "exports"], factory); + // } + // })(function ...) + return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ + ts.createStatement(ts.createCall(umdHeader, + /*typeArguments*/ undefined, [ + // Add the module body function argument: + // + // function (require, exports) ... + ts.createFunctionExpression( + /*modifiers*/ undefined, + /*asteriskToken*/ undefined, + /*name*/ undefined, + /*typeParameters*/ undefined, [ + ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "require"), + ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "exports") + ].concat(importAliasNames), + /*type*/ undefined, transformAsynchronousModuleBody(node)) + ])) + ]), + /*location*/ node.statements)); + } + /** + * Collect the additional asynchronous dependencies for the module. + * + * @param node The source file. + * @param includeNonAmdDependencies A value indicating whether to include non-AMD dependencies. + */ + function collectAsynchronousDependencies(node, includeNonAmdDependencies) { + // names of modules with corresponding parameter in the factory function + var aliasedModuleNames = []; + // names of modules with no corresponding parameters in factory function + var unaliasedModuleNames = []; + // names of the parameters in the factory function; these + // parameters need to match the indexes of the corresponding + // module names in aliasedModuleNames. + var importAliasNames = []; + // Fill in amd-dependency tags + for (var _i = 0, _a = node.amdDependencies; _i < _a.length; _i++) { + var amdDependency = _a[_i]; + if (amdDependency.name) { + aliasedModuleNames.push(ts.createLiteral(amdDependency.path)); + importAliasNames.push(ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, amdDependency.name)); } else { - return ts.visitEachChild(node, visitor, context); + unaliasedModuleNames.push(ts.createLiteral(amdDependency.path)); } } - return node; + for (var _b = 0, _c = currentModuleInfo.externalImports; _b < _c.length; _b++) { + var importNode = _c[_b]; + // Find the name of the external module + var externalModuleName = ts.getExternalModuleNameLiteral(importNode, currentSourceFile, host, resolver, compilerOptions); + // Find the name of the module alias, if there is one + var importAliasName = ts.getLocalNameForExternalImport(importNode, currentSourceFile); + // It is possible that externalModuleName is undefined if it is not string literal. + // This can happen in the invalid import syntax. + // E.g : "import * from alias from 'someLib';" + if (externalModuleName) { + if (includeNonAmdDependencies && importAliasName) { + // Set emitFlags on the name of the classDeclaration + // This is so that when printer will not substitute the identifier + ts.setEmitFlags(importAliasName, 4 /* NoSubstitution */); + aliasedModuleNames.push(externalModuleName); + importAliasNames.push(ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, importAliasName)); + } + else { + unaliasedModuleNames.push(externalModuleName); + } + } + } + return { aliasedModuleNames: aliasedModuleNames, unaliasedModuleNames: unaliasedModuleNames, importAliasNames: importAliasNames }; } - function visitor(node) { + /** + * Transforms a SourceFile into an AMD or UMD module body. + * + * @param node The SourceFile node. + */ + function transformAsynchronousModuleBody(node) { + startLexicalEnvironment(); + var statements = []; + var statementOffset = ts.addPrologue(statements, node.statements, /*ensureUseStrict*/ !compilerOptions.noImplicitUseStrict, sourceElementVisitor); + if (shouldEmitUnderscoreUnderscoreESModule()) { + ts.append(statements, createUnderscoreUnderscoreESModule()); + } + // Visit each statement of the module body. + ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement)); + ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset)); + // Append the 'export =' statement if provided. + addExportEqualsIfNeeded(statements, /*emitAsReturn*/ true); + // End the lexical environment for the module body + // and merge any new lexical declarations. + ts.addRange(statements, endLexicalEnvironment()); + var body = ts.createBlock(statements, /*multiLine*/ true); + if (currentModuleInfo.hasExportStarsToExportValues) { + // If we have any `export * from ...` declarations + // we need to inform the emitter to add the __export helper. + ts.addEmitHelper(body, exportStarHelper); + } + return body; + } + /** + * Adds the down-level representation of `export=` to the statement list if one exists + * in the source file. + * + * @param statements The Statement list to modify. + * @param emitAsReturn A value indicating whether to emit the `export=` statement as a + * return statement. + */ + function addExportEqualsIfNeeded(statements, emitAsReturn) { + if (currentModuleInfo.exportEquals) { + if (emitAsReturn) { + var statement = ts.createReturn(currentModuleInfo.exportEquals.expression); + ts.setTextRange(statement, currentModuleInfo.exportEquals); + ts.setEmitFlags(statement, 384 /* NoTokenSourceMaps */ | 1536 /* NoComments */); + statements.push(statement); + } + else { + var statement = ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("module"), "exports"), currentModuleInfo.exportEquals.expression)); + ts.setTextRange(statement, currentModuleInfo.exportEquals); + ts.setEmitFlags(statement, 1536 /* NoComments */); + statements.push(statement); + } + } + } + // + // Top-Level Source Element Visitors + // + /** + * Visits a node at the top level of the source file. + * + * @param node The node to visit. + */ + function sourceElementVisitor(node) { switch (node.kind) { - case 234 /* ImportEqualsDeclaration */: - // Elide `import=` as it is not legal with --module ES6 - return undefined; - case 240 /* ExportAssignment */: + case 238 /* ImportDeclaration */: + return visitImportDeclaration(node); + case 237 /* ImportEqualsDeclaration */: + return visitImportEqualsDeclaration(node); + case 244 /* ExportDeclaration */: + return visitExportDeclaration(node); + case 243 /* ExportAssignment */: return visitExportAssignment(node); + case 208 /* VariableStatement */: + return visitVariableStatement(node); + case 228 /* FunctionDeclaration */: + return visitFunctionDeclaration(node); + case 229 /* ClassDeclaration */: + return visitClassDeclaration(node); + case 297 /* MergeDeclarationMarker */: + return visitMergeDeclarationMarker(node); + case 298 /* EndOfDeclarationMarker */: + return visitEndOfDeclarationMarker(node); + default: + // This visitor does not descend into the tree, as export/import statements + // are only transformed at the top level of a file. + return node; + } + } + /** + * Visits an ImportDeclaration node. + * + * @param node The node to visit. + */ + function visitImportDeclaration(node) { + var statements; + var namespaceDeclaration = ts.getNamespaceDeclarationNode(node); + if (moduleKind !== ts.ModuleKind.AMD) { + if (!node.importClause) { + // import "mod"; + return ts.setTextRange(ts.createStatement(createRequireCall(node)), node); + } + else { + var variables = []; + if (namespaceDeclaration && !ts.isDefaultImport(node)) { + // import * as n from "mod"; + variables.push(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), + /*type*/ undefined, createRequireCall(node))); + } + else { + // import d from "mod"; + // import { x, y } from "mod"; + // import d, { x, y } from "mod"; + // import d, * as n from "mod"; + variables.push(ts.createVariableDeclaration(ts.getGeneratedNameForNode(node), + /*type*/ undefined, createRequireCall(node))); + if (namespaceDeclaration && ts.isDefaultImport(node)) { + variables.push(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), + /*type*/ undefined, ts.getGeneratedNameForNode(node))); + } + } + statements = ts.append(statements, ts.setTextRange(ts.createVariableStatement( + /*modifiers*/ undefined, ts.createVariableDeclarationList(variables, languageVersion >= 2 /* ES2015 */ ? 2 /* Const */ : 0 /* None */)), + /*location*/ node)); + } + } + else if (namespaceDeclaration && ts.isDefaultImport(node)) { + // import d, * as n from "mod"; + statements = ts.append(statements, ts.createVariableStatement( + /*modifiers*/ undefined, ts.createVariableDeclarationList([ + ts.setTextRange(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), + /*type*/ undefined, ts.getGeneratedNameForNode(node)), + /*location*/ node) + ], languageVersion >= 2 /* ES2015 */ ? 2 /* Const */ : 0 /* None */))); + } + if (hasAssociatedEndOfDeclarationMarker(node)) { + // Defer exports until we encounter an EndOfDeclarationMarker node + var id = ts.getOriginalNodeId(node); + deferredExports[id] = appendExportsOfImportDeclaration(deferredExports[id], node); + } + else { + statements = appendExportsOfImportDeclaration(statements, node); + } + return ts.singleOrMany(statements); + } + /** + * Creates a `require()` call to import an external module. + * + * @param importNode The declararation to import. + */ + function createRequireCall(importNode) { + var moduleName = ts.getExternalModuleNameLiteral(importNode, currentSourceFile, host, resolver, compilerOptions); + var args = []; + if (moduleName) { + args.push(moduleName); + } + return ts.createCall(ts.createIdentifier("require"), /*typeArguments*/ undefined, args); + } + /** + * Visits an ImportEqualsDeclaration node. + * + * @param node The node to visit. + */ + function visitImportEqualsDeclaration(node) { + ts.Debug.assert(ts.isExternalModuleImportEqualsDeclaration(node), "import= for internal module references should be handled in an earlier transformer."); + var statements; + if (moduleKind !== ts.ModuleKind.AMD) { + if (ts.hasModifier(node, 1 /* Export */)) { + statements = ts.append(statements, ts.setTextRange(ts.createStatement(createExportExpression(node.name, createRequireCall(node))), node)); + } + else { + statements = ts.append(statements, ts.setTextRange(ts.createVariableStatement( + /*modifiers*/ undefined, ts.createVariableDeclarationList([ + ts.createVariableDeclaration(ts.getSynthesizedClone(node.name), + /*type*/ undefined, createRequireCall(node)) + ], + /*flags*/ languageVersion >= 2 /* ES2015 */ ? 2 /* Const */ : 0 /* None */)), node)); + } + } + else { + if (ts.hasModifier(node, 1 /* Export */)) { + statements = ts.append(statements, ts.setTextRange(ts.createStatement(createExportExpression(ts.getExportName(node), ts.getLocalName(node))), node)); + } + } + if (hasAssociatedEndOfDeclarationMarker(node)) { + // Defer exports until we encounter an EndOfDeclarationMarker node + var id = ts.getOriginalNodeId(node); + deferredExports[id] = appendExportsOfImportEqualsDeclaration(deferredExports[id], node); + } + else { + statements = appendExportsOfImportEqualsDeclaration(statements, node); + } + return ts.singleOrMany(statements); + } + /** + * Visits an ExportDeclaration node. + * + * @param The node to visit. + */ + function visitExportDeclaration(node) { + if (!node.moduleSpecifier) { + // Elide export declarations with no module specifier as they are handled + // elsewhere. + return undefined; + } + var generatedName = ts.getGeneratedNameForNode(node); + if (node.exportClause) { + var statements = []; + // export { x, y } from "mod"; + if (moduleKind !== ts.ModuleKind.AMD) { + statements.push(ts.setTextRange(ts.createVariableStatement( + /*modifiers*/ undefined, ts.createVariableDeclarationList([ + ts.createVariableDeclaration(generatedName, + /*type*/ undefined, createRequireCall(node)) + ])), + /*location*/ node)); + } + for (var _i = 0, _a = node.exportClause.elements; _i < _a.length; _i++) { + var specifier = _a[_i]; + var exportedValue = ts.createPropertyAccess(generatedName, specifier.propertyName || specifier.name); + statements.push(ts.setTextRange(ts.createStatement(createExportExpression(ts.getExportName(specifier), exportedValue)), specifier)); + } + return ts.singleOrMany(statements); + } + else { + // export * from "mod"; + return ts.setTextRange(ts.createStatement(ts.createCall(ts.createIdentifier("__export"), + /*typeArguments*/ undefined, [ + moduleKind !== ts.ModuleKind.AMD + ? createRequireCall(node) + : generatedName + ])), node); + } + } + /** + * Visits an ExportAssignment node. + * + * @param node The node to visit. + */ + function visitExportAssignment(node) { + if (node.isExportEquals) { + return undefined; + } + var statements; + var original = node.original; + if (original && hasAssociatedEndOfDeclarationMarker(original)) { + // Defer exports until we encounter an EndOfDeclarationMarker node + var id = ts.getOriginalNodeId(node); + deferredExports[id] = appendExportStatement(deferredExports[id], ts.createIdentifier("default"), node.expression, /*location*/ node, /*allowComments*/ true); + } + else { + statements = appendExportStatement(statements, ts.createIdentifier("default"), node.expression, /*location*/ node, /*allowComments*/ true); + } + return ts.singleOrMany(statements); + } + /** + * Visits a FunctionDeclaration node. + * + * @param node The node to visit. + */ + function visitFunctionDeclaration(node) { + var statements; + if (ts.hasModifier(node, 1 /* Export */)) { + statements = ts.append(statements, ts.setOriginalNode(ts.setTextRange(ts.createFunctionDeclaration( + /*decorators*/ undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, ts.getDeclarationName(node, /*allowComments*/ true, /*allowSourceMaps*/ true), + /*typeParameters*/ undefined, node.parameters, + /*type*/ undefined, node.body), + /*location*/ node), + /*original*/ node)); + } + else { + statements = ts.append(statements, node); + } + if (hasAssociatedEndOfDeclarationMarker(node)) { + // Defer exports until we encounter an EndOfDeclarationMarker node + var id = ts.getOriginalNodeId(node); + deferredExports[id] = appendExportsOfHoistedDeclaration(deferredExports[id], node); + } + else { + statements = appendExportsOfHoistedDeclaration(statements, node); + } + return ts.singleOrMany(statements); + } + /** + * Visits a ClassDeclaration node. + * + * @param node The node to visit. + */ + function visitClassDeclaration(node) { + var statements; + if (ts.hasModifier(node, 1 /* Export */)) { + statements = ts.append(statements, ts.setOriginalNode(ts.setTextRange(ts.createClassDeclaration( + /*decorators*/ undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.getDeclarationName(node, /*allowComments*/ true, /*allowSourceMaps*/ true), + /*typeParameters*/ undefined, node.heritageClauses, node.members), node), node)); + } + else { + statements = ts.append(statements, node); + } + if (hasAssociatedEndOfDeclarationMarker(node)) { + // Defer exports until we encounter an EndOfDeclarationMarker node + var id = ts.getOriginalNodeId(node); + deferredExports[id] = appendExportsOfHoistedDeclaration(deferredExports[id], node); + } + else { + statements = appendExportsOfHoistedDeclaration(statements, node); + } + return ts.singleOrMany(statements); + } + /** + * Visits a VariableStatement node. + * + * @param node The node to visit. + */ + function visitVariableStatement(node) { + var statements; + var variables; + var expressions; + if (ts.hasModifier(node, 1 /* Export */)) { + var modifiers = void 0; + // If we're exporting these variables, then these just become assignments to 'exports.x'. + // We only want to emit assignments for variables with initializers. + for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { + var variable = _a[_i]; + if (ts.isIdentifier(variable.name) && ts.isLocalName(variable.name)) { + if (!modifiers) { + modifiers = ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier); + } + variables = ts.append(variables, variable); + } + else if (variable.initializer) { + expressions = ts.append(expressions, transformInitializedVariable(variable)); + } + } + if (variables) { + statements = ts.append(statements, ts.updateVariableStatement(node, modifiers, ts.updateVariableDeclarationList(node.declarationList, variables))); + } + if (expressions) { + statements = ts.append(statements, ts.setTextRange(ts.createStatement(ts.inlineExpressions(expressions)), node)); + } + } + else { + statements = ts.append(statements, node); + } + if (hasAssociatedEndOfDeclarationMarker(node)) { + // Defer exports until we encounter an EndOfDeclarationMarker node + var id = ts.getOriginalNodeId(node); + deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node); + } + else { + statements = appendExportsOfVariableStatement(statements, node); + } + return ts.singleOrMany(statements); + } + /** + * Transforms an exported variable with an initializer into an expression. + * + * @param node The node to transform. + */ + function transformInitializedVariable(node) { + if (ts.isBindingPattern(node.name)) { + return ts.flattenDestructuringAssignment(node, + /*visitor*/ undefined, context, 0 /* All */, + /*needsValue*/ false, createExportExpression); + } + else { + return ts.createAssignment(ts.setTextRange(ts.createPropertyAccess(ts.createIdentifier("exports"), node.name), + /*location*/ node.name), node.initializer); + } + } + /** + * Visits a MergeDeclarationMarker used as a placeholder for the beginning of a merged + * and transformed declaration. + * + * @param node The node to visit. + */ + function visitMergeDeclarationMarker(node) { + // For an EnumDeclaration or ModuleDeclaration that merges with a preceeding + // declaration we do not emit a leading variable declaration. To preserve the + // begin/end semantics of the declararation and to properly handle exports + // we wrapped the leading variable declaration in a `MergeDeclarationMarker`. + // + // To balance the declaration, add the exports of the elided variable + // statement. + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 208 /* VariableStatement */) { + var id = ts.getOriginalNodeId(node); + deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); } return node; } - function visitExportAssignment(node) { - // Elide `export=` as it is not legal with --module ES6 - return node.isExportEquals ? undefined : node; + /** + * Determines whether a node has an associated EndOfDeclarationMarker. + * + * @param node The node to test. + */ + function hasAssociatedEndOfDeclarationMarker(node) { + return (ts.getEmitFlags(node) & 4194304 /* HasEndOfDeclarationMarker */) !== 0; + } + /** + * Visits a DeclarationMarker used as a placeholder for the end of a transformed + * declaration. + * + * @param node The node to visit. + */ + function visitEndOfDeclarationMarker(node) { + // For some transformations we emit an `EndOfDeclarationMarker` to mark the actual + // end of the transformed declaration. We use this marker to emit any deferred exports + // of the declaration. + var id = ts.getOriginalNodeId(node); + var statements = deferredExports[id]; + if (statements) { + delete deferredExports[id]; + return ts.append(statements, node); + } + return node; + } + /** + * Appends the exports of an ImportDeclaration to a statement list, returning the + * statement list. + * + * @param statements A statement list to which the down-level export statements are to be + * appended. If `statements` is `undefined`, a new array is allocated if statements are + * appended. + * @param decl The declaration whose exports are to be recorded. + */ + function appendExportsOfImportDeclaration(statements, decl) { + if (currentModuleInfo.exportEquals) { + return statements; + } + var importClause = decl.importClause; + if (!importClause) { + return statements; + } + if (importClause.name) { + statements = appendExportsOfDeclaration(statements, importClause); + } + var namedBindings = importClause.namedBindings; + if (namedBindings) { + switch (namedBindings.kind) { + case 240 /* NamespaceImport */: + statements = appendExportsOfDeclaration(statements, namedBindings); + break; + case 241 /* NamedImports */: + for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { + var importBinding = _a[_i]; + statements = appendExportsOfDeclaration(statements, importBinding); + } + break; + } + } + return statements; + } + /** + * Appends the exports of an ImportEqualsDeclaration to a statement list, returning the + * statement list. + * + * @param statements A statement list to which the down-level export statements are to be + * appended. If `statements` is `undefined`, a new array is allocated if statements are + * appended. + * @param decl The declaration whose exports are to be recorded. + */ + function appendExportsOfImportEqualsDeclaration(statements, decl) { + if (currentModuleInfo.exportEquals) { + return statements; + } + return appendExportsOfDeclaration(statements, decl); + } + /** + * Appends the exports of a VariableStatement to a statement list, returning the statement + * list. + * + * @param statements A statement list to which the down-level export statements are to be + * appended. If `statements` is `undefined`, a new array is allocated if statements are + * appended. + * @param node The VariableStatement whose exports are to be recorded. + */ + function appendExportsOfVariableStatement(statements, node) { + if (currentModuleInfo.exportEquals) { + return statements; + } + for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { + var decl = _a[_i]; + statements = appendExportsOfBindingElement(statements, decl); + } + return statements; + } + /** + * Appends the exports of a VariableDeclaration or BindingElement to a statement list, + * returning the statement list. + * + * @param statements A statement list to which the down-level export statements are to be + * appended. If `statements` is `undefined`, a new array is allocated if statements are + * appended. + * @param decl The declaration whose exports are to be recorded. + */ + function appendExportsOfBindingElement(statements, decl) { + if (currentModuleInfo.exportEquals) { + return statements; + } + if (ts.isBindingPattern(decl.name)) { + for (var _i = 0, _a = decl.name.elements; _i < _a.length; _i++) { + var element = _a[_i]; + if (!ts.isOmittedExpression(element)) { + statements = appendExportsOfBindingElement(statements, element); + } + } + } + else if (!ts.isGeneratedIdentifier(decl.name)) { + statements = appendExportsOfDeclaration(statements, decl); + } + return statements; + } + /** + * Appends the exports of a ClassDeclaration or FunctionDeclaration to a statement list, + * returning the statement list. + * + * @param statements A statement list to which the down-level export statements are to be + * appended. If `statements` is `undefined`, a new array is allocated if statements are + * appended. + * @param decl The declaration whose exports are to be recorded. + */ + function appendExportsOfHoistedDeclaration(statements, decl) { + if (currentModuleInfo.exportEquals) { + return statements; + } + if (ts.hasModifier(decl, 1 /* Export */)) { + var exportName = ts.hasModifier(decl, 512 /* Default */) ? ts.createIdentifier("default") : decl.name; + statements = appendExportStatement(statements, exportName, ts.getLocalName(decl), /*location*/ decl); + } + if (decl.name) { + statements = appendExportsOfDeclaration(statements, decl); + } + return statements; + } + /** + * Appends the exports of a declaration to a statement list, returning the statement list. + * + * @param statements A statement list to which the down-level export statements are to be + * appended. If `statements` is `undefined`, a new array is allocated if statements are + * appended. + * @param decl The declaration to export. + */ + function appendExportsOfDeclaration(statements, decl) { + var name = ts.getDeclarationName(decl); + var exportSpecifiers = currentModuleInfo.exportSpecifiers.get(name.text); + if (exportSpecifiers) { + for (var _i = 0, exportSpecifiers_1 = exportSpecifiers; _i < exportSpecifiers_1.length; _i++) { + var exportSpecifier = exportSpecifiers_1[_i]; + statements = appendExportStatement(statements, exportSpecifier.name, name, /*location*/ exportSpecifier.name); + } + } + return statements; + } + /** + * Appends the down-level representation of an export to a statement list, returning the + * statement list. + * + * @param statements A statement list to which the down-level export statements are to be + * appended. If `statements` is `undefined`, a new array is allocated if statements are + * appended. + * @param exportName The name of the export. + * @param expression The expression to export. + * @param location The location to use for source maps and comments for the export. + * @param allowComments Whether to allow comments on the export. + */ + function appendExportStatement(statements, exportName, expression, location, allowComments) { + statements = ts.append(statements, createExportStatement(exportName, expression, location, allowComments)); + return statements; + } + function createUnderscoreUnderscoreESModule() { + var statement; + if (languageVersion === 0 /* ES3 */) { + statement = ts.createStatement(createExportExpression(ts.createIdentifier("__esModule"), ts.createLiteral(/*value*/ true))); + } + else { + statement = ts.createStatement(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "defineProperty"), + /*typeArguments*/ undefined, [ + ts.createIdentifier("exports"), + ts.createLiteral("__esModule"), + ts.createObjectLiteral([ + ts.createPropertyAssignment("value", ts.createLiteral(/*value*/ true)) + ]) + ])); + } + ts.setEmitFlags(statement, 1048576 /* CustomPrologue */); + return statement; + } + /** + * Creates a call to the current file's export function to export a value. + * + * @param name The bound name of the export. + * @param value The exported value. + * @param location The location to use for source maps and comments for the export. + * @param allowComments An optional value indicating whether to emit comments for the statement. + */ + function createExportStatement(name, value, location, allowComments) { + var statement = ts.setTextRange(ts.createStatement(createExportExpression(name, value)), location); + ts.startOnNewLine(statement); + if (!allowComments) { + ts.setEmitFlags(statement, 1536 /* NoComments */); + } + return statement; + } + /** + * Creates a call to the current file's export function to export a value. + * + * @param name The bound name of the export. + * @param value The exported value. + * @param location The location to use for source maps and comments for the export. + */ + function createExportExpression(name, value, location) { + return ts.setTextRange(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(name)), value), location); + } + // + // Modifier Visitors + // + /** + * Visit nodes to elide module-specific modifiers. + * + * @param node The node to visit. + */ + function modifierVisitor(node) { + // Elide module-specific modifiers. + switch (node.kind) { + case 84 /* ExportKeyword */: + case 79 /* DefaultKeyword */: + return undefined; + } + return node; } // // Emit Notification // /** - * Hook for node emit. + * Hook for node emit notifications. * - * @param emitContext A context hint for the emitter. + * @param hint A hint as to the intended usage of the node. * @param node The node to emit. * @param emit A callback used to emit the node in the printer. */ - function onEmitNode(emitContext, node, emitCallback) { - if (ts.isSourceFile(node)) { + function onEmitNode(hint, node, emitCallback) { + if (node.kind === 265 /* SourceFile */) { currentSourceFile = node; - previousOnEmitNode(emitContext, node, emitCallback); + currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)]; + noSubstitution = []; + previousOnEmitNode(hint, node, emitCallback); currentSourceFile = undefined; + currentModuleInfo = undefined; + noSubstitution = undefined; } else { - previousOnEmitNode(emitContext, node, emitCallback); + previousOnEmitNode(hint, node, emitCallback); } } // @@ -54805,30 +59687,192 @@ var ts; /** * Hooks node substitutions. * - * @param emitContext A context hint for the emitter. + * @param hint A hint as to the intended usage of the node. * @param node The node to substitute. */ - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (ts.isIdentifier(node) && emitContext === 1 /* Expression */) { - return substituteExpressionIdentifier(node); + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (node.id && noSubstitution[node.id]) { + return node; + } + if (hint === 1 /* Expression */) { + return substituteExpression(node); + } + else if (ts.isShorthandPropertyAssignment(node)) { + return substituteShorthandPropertyAssignment(node); } return node; } + /** + * Substitution for a ShorthandPropertyAssignment whose declaration name is an imported + * or exported symbol. + * + * @param node The node to substitute. + */ + function substituteShorthandPropertyAssignment(node) { + var name = node.name; + var exportedOrImportedName = substituteExpressionIdentifier(name); + if (exportedOrImportedName !== name) { + // A shorthand property with an assignment initializer is probably part of a + // destructuring assignment + if (node.objectAssignmentInitializer) { + var initializer = ts.createAssignment(exportedOrImportedName, node.objectAssignmentInitializer); + return ts.setTextRange(ts.createPropertyAssignment(name, initializer), node); + } + return ts.setTextRange(ts.createPropertyAssignment(name, exportedOrImportedName), node); + } + return node; + } + /** + * Substitution for an Expression that may contain an imported or exported symbol. + * + * @param node The node to substitute. + */ + function substituteExpression(node) { + switch (node.kind) { + case 71 /* Identifier */: + return substituteExpressionIdentifier(node); + case 194 /* BinaryExpression */: + return substituteBinaryExpression(node); + case 193 /* PostfixUnaryExpression */: + case 192 /* PrefixUnaryExpression */: + return substituteUnaryExpression(node); + } + return node; + } + /** + * Substitution for an Identifier expression that may contain an imported or exported + * symbol. + * + * @param node The node to substitute. + */ function substituteExpressionIdentifier(node) { if (ts.getEmitFlags(node) & 4096 /* HelperName */) { var externalHelpersModuleName = ts.getExternalHelpersModuleName(currentSourceFile); if (externalHelpersModuleName) { return ts.createPropertyAccess(externalHelpersModuleName, node); } + return node; + } + if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { + var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node)); + if (exportContainer && exportContainer.kind === 265 /* SourceFile */) { + return ts.setTextRange(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node)), + /*location*/ node); + } + var importDeclaration = resolver.getReferencedImportDeclaration(node); + if (importDeclaration) { + if (ts.isImportClause(importDeclaration)) { + return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent), ts.createIdentifier("default")), + /*location*/ node); + } + else if (ts.isImportSpecifier(importDeclaration)) { + var name = importDeclaration.propertyName || importDeclaration.name; + return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent.parent.parent), ts.getSynthesizedClone(name)), + /*location*/ node); + } + } } return node; } + /** + * Substitution for a BinaryExpression that may contain an imported or exported symbol. + * + * @param node The node to substitute. + */ + function substituteBinaryExpression(node) { + // When we see an assignment expression whose left-hand side is an exported symbol, + // we should ensure all exports of that symbol are updated with the correct value. + // + // - We do not substitute generated identifiers for any reason. + // - We do not substitute identifiers tagged with the LocalName flag. + // - We do not substitute identifiers that were originally the name of an enum or + // namespace due to how they are transformed in TypeScript. + // - We only substitute identifiers that are exported at the top level. + if (ts.isAssignmentOperator(node.operatorToken.kind) + && ts.isIdentifier(node.left) + && !ts.isGeneratedIdentifier(node.left) + && !ts.isLocalName(node.left) + && !ts.isDeclarationNameOfEnumOrNamespace(node.left)) { + var exportedNames = getExports(node.left); + if (exportedNames) { + // For each additional export of the declaration, apply an export assignment. + var expression = node; + for (var _i = 0, exportedNames_1 = exportedNames; _i < exportedNames_1.length; _i++) { + var exportName = exportedNames_1[_i]; + // Mark the node to prevent triggering this rule again. + noSubstitution[ts.getNodeId(expression)] = true; + expression = createExportExpression(exportName, expression, /*location*/ node); + } + return expression; + } + } + return node; + } + /** + * Substitution for a UnaryExpression that may contain an imported or exported symbol. + * + * @param node The node to substitute. + */ + function substituteUnaryExpression(node) { + // When we see a prefix or postfix increment expression whose operand is an exported + // symbol, we should ensure all exports of that symbol are updated with the correct + // value. + // + // - We do not substitute generated identifiers for any reason. + // - We do not substitute identifiers tagged with the LocalName flag. + // - We do not substitute identifiers that were originally the name of an enum or + // namespace due to how they are transformed in TypeScript. + // - We only substitute identifiers that are exported at the top level. + if ((node.operator === 43 /* PlusPlusToken */ || node.operator === 44 /* MinusMinusToken */) + && ts.isIdentifier(node.operand) + && !ts.isGeneratedIdentifier(node.operand) + && !ts.isLocalName(node.operand) + && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { + var exportedNames = getExports(node.operand); + if (exportedNames) { + var expression = node.kind === 193 /* PostfixUnaryExpression */ + ? ts.setTextRange(ts.createBinary(node.operand, ts.createToken(node.operator === 43 /* PlusPlusToken */ ? 59 /* PlusEqualsToken */ : 60 /* MinusEqualsToken */), ts.createLiteral(1)), + /*location*/ node) + : node; + for (var _i = 0, exportedNames_2 = exportedNames; _i < exportedNames_2.length; _i++) { + var exportName = exportedNames_2[_i]; + // Mark the node to prevent triggering this rule again. + noSubstitution[ts.getNodeId(expression)] = true; + expression = createExportExpression(exportName, expression); + } + return expression; + } + } + return node; + } + /** + * Gets the additional exports of a name. + * + * @param name The name. + */ + function getExports(name) { + if (!ts.isGeneratedIdentifier(name)) { + var valueDeclaration = resolver.getReferencedImportDeclaration(name) + || resolver.getReferencedValueDeclaration(name); + if (valueDeclaration) { + return currentModuleInfo + && currentModuleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]; + } + } + } } - ts.transformES2015Module = transformES2015Module; + ts.transformModule = transformModule; + // emit output for the __export helper function + var exportStarHelper = { + name: "typescript:export-star", + scoped: true, + text: "\n function __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n }" + }; })(ts || (ts = {})); /// /// +/// /*@internal*/ var ts; (function (ts) { @@ -54841,15 +59885,15 @@ var ts; var previousOnEmitNode = context.onEmitNode; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; - context.enableSubstitution(70 /* Identifier */); // Substitutes expression identifiers for imported symbols. - context.enableSubstitution(192 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(190 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(191 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableEmitNotification(261 /* SourceFile */); // Restore state when substituting nodes in a file. - var moduleInfoMap = ts.createMap(); // The ExternalModuleInfo for each file. - var deferredExports = ts.createMap(); // Exports to defer until an EndOfDeclarationMarker is found. - var exportFunctionsMap = ts.createMap(); // The export function associated with a source file. - var noSubstitutionMap = ts.createMap(); // Set of nodes for which substitution rules should be ignored for each file. + context.enableSubstitution(71 /* Identifier */); // Substitutes expression identifiers for imported symbols. + context.enableSubstitution(194 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(192 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(193 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableEmitNotification(265 /* 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. + var noSubstitutionMap = []; // Set of nodes for which substitution rules should be ignored for each file. var currentSourceFile; // The current file. var moduleInfo; // ExternalModuleInfo for the current file. var exportFunction; // The export function for the current file. @@ -54888,7 +59932,8 @@ var ts; moduleInfo = moduleInfoMap[id] = ts.collectExternalModuleInfo(node, resolver, compilerOptions); // Make sure that the name of the 'exports' function does not conflict with // existing identifiers. - exportFunction = exportFunctionsMap[id] = ts.createUniqueName("exports"); + exportFunction = ts.createUniqueName("exports"); + exportFunctionsMap[id] = exportFunction; contextObject = ts.createUniqueName("context"); // Add the body of the module. var dependencyGroups = collectDependencyGroups(moduleInfo.externalImports); @@ -54907,12 +59952,12 @@ var ts; // So the helper will be emit at the correct position instead of at the top of the source-file var moduleName = ts.tryGetModuleNameFromFile(node, host, compilerOptions); var dependencies = ts.createArrayLiteral(ts.map(dependencyGroups, function (dependencyGroup) { return dependencyGroup.name; })); - var updated = ts.setEmitFlags(ts.updateSourceFileNode(node, ts.createNodeArray([ + var updated = ts.setEmitFlags(ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ ts.createStatement(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("System"), "register"), /*typeArguments*/ undefined, moduleName ? [moduleName, dependencies, moduleBodyFunction] : [dependencies, moduleBodyFunction])) - ], node.statements)), 1024 /* NoTrailingComments */); + ]), node.statements)), 1024 /* NoTrailingComments */); if (!(compilerOptions.outFile || compilerOptions.out)) { ts.moveEmitHelpers(updated, moduleBodyBlock, function (helper) { return !helper.scoped; }); } @@ -54939,18 +59984,20 @@ var ts; for (var i = 0; i < externalImports.length; i++) { var externalImport = externalImports[i]; var externalModuleName = ts.getExternalModuleNameLiteral(externalImport, currentSourceFile, host, resolver, compilerOptions); - var text = externalModuleName.text; - if (ts.hasProperty(groupIndices, text)) { - // deduplicate/group entries in dependency list by the dependency name - var groupIndex = groupIndices[text]; - dependencyGroups[groupIndex].externalImports.push(externalImport); - } - else { - groupIndices[text] = dependencyGroups.length; - dependencyGroups.push({ - name: externalModuleName, - externalImports: [externalImport] - }); + if (externalModuleName) { + var text = externalModuleName.text; + var groupIndex = groupIndices.get(text); + if (groupIndex !== undefined) { + // deduplicate/group entries in dependency list by the dependency name + dependencyGroups[groupIndex].externalImports.push(externalImport); + } + else { + groupIndices.set(text, dependencyGroups.length); + dependencyGroups.push({ + name: externalModuleName, + externalImports: [externalImport] + }); + } } } return dependencyGroups; @@ -55008,7 +60055,8 @@ var ts; // only in the outer module body and not in the inner one. startLexicalEnvironment(); // Add any prologue directives. - var statementOffset = ts.addPrologueDirectives(statements, node.statements, /*ensureUseStrict*/ !compilerOptions.noImplicitUseStrict, sourceElementVisitor); + var ensureUseStrict = compilerOptions.alwaysStrict || (!compilerOptions.noImplicitUseStrict && ts.isExternalModule(currentSourceFile)); + var statementOffset = ts.addPrologue(statements, node.statements, ensureUseStrict, sourceElementVisitor); // var __moduleName = context_1 && context_1.id; statements.push(ts.createVariableStatement( /*modifiers*/ undefined, ts.createVariableDeclarationList([ @@ -55016,7 +60064,7 @@ var ts; /*type*/ undefined, ts.createLogicalAnd(contextObject, ts.createPropertyAccess(contextObject, "id"))) ]))); // Visit the synthetic external helpers import declaration if present - ts.visitNode(moduleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement, /*optional*/ true); + ts.visitNode(moduleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement); // Visit the statements of the source file, emitting any transformations into // the `executeStatements` array. We do this *before* we fill the `setters` array // as we both emit transformations as well as aggregate some data used when creating @@ -55030,7 +60078,7 @@ var ts; // - Temporary variables will appear at the top rather than at the bottom of the file ts.addRange(statements, endLexicalEnvironment()); var exportStarFunction = addExportStarIfNeeded(statements); - statements.push(ts.createReturn(ts.setMultiLine(ts.createObjectLiteral([ + var moduleObject = ts.createObjectLiteral([ ts.createPropertyAssignment("setters", createSettersArray(exportStarFunction, dependencyGroups)), ts.createPropertyAssignment("execute", ts.createFunctionExpression( /*modifiers*/ undefined, @@ -55038,12 +60086,11 @@ var ts; /*name*/ undefined, /*typeParameters*/ undefined, /*parameters*/ [], - /*type*/ undefined, ts.createBlock(executeStatements, - /*location*/ undefined, - /*multiLine*/ true))) - ]), - /*multiLine*/ true))); - return ts.createBlock(statements, /*location*/ undefined, /*multiLine*/ true); + /*type*/ undefined, ts.createBlock(executeStatements, /*multiLine*/ true))) + ]); + moduleObject.multiLine = true; + statements.push(ts.createReturn(moduleObject)); + return ts.createBlock(statements, /*multiLine*/ true); } /** * Adds an exportStar function to a statement list if it is needed for the file. @@ -55059,13 +60106,13 @@ var ts; // to support this we store names of local/indirect exported entries in a set. // this set is used to filter names brought by star expors. // local names set should only be added if we have anything exported - if (!moduleInfo.exportedNames && ts.isEmpty(moduleInfo.exportSpecifiers)) { + if (!moduleInfo.exportedNames && moduleInfo.exportSpecifiers.size === 0) { // no exported declarations (export var ...) or export specifiers (export {x}) // check if we have any non star export declarations. var hasExportDeclarationWithExportClause = false; for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) { var externalImport = _a[_i]; - if (externalImport.kind === 241 /* ExportDeclaration */ && externalImport.exportClause) { + if (externalImport.kind === 244 /* ExportDeclaration */ && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -55085,12 +60132,12 @@ var ts; continue; } // write name of exported declaration, i.e 'export var x...' - exportedNames.push(ts.createPropertyAssignment(ts.createLiteral(exportedLocalName), ts.createLiteral(true))); + exportedNames.push(ts.createPropertyAssignment(ts.createLiteral(exportedLocalName), ts.createTrue())); } } for (var _d = 0, _e = moduleInfo.externalImports; _d < _e.length; _d++) { var externalImport = _e[_d]; - if (externalImport.kind !== 241 /* ExportDeclaration */) { + if (externalImport.kind !== 244 /* ExportDeclaration */) { continue; } var exportDecl = externalImport; @@ -55101,14 +60148,14 @@ var ts; for (var _f = 0, _g = exportDecl.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((element.name || element.propertyName).text), ts.createLiteral(true))); + exportedNames.push(ts.createPropertyAssignment(ts.createLiteral((element.name || element.propertyName).text), ts.createTrue())); } } var exportedNamesStorageRef = ts.createUniqueName("exportedNames"); statements.push(ts.createVariableStatement( /*modifiers*/ undefined, ts.createVariableDeclarationList([ ts.createVariableDeclaration(exportedNamesStorageRef, - /*type*/ undefined, ts.createObjectLiteral(exportedNames, /*location*/ undefined, /*multiline*/ true)) + /*type*/ undefined, ts.createObjectLiteral(exportedNames, /*multiline*/ true)) ]))); var exportStarFunction = createExportStarFunction(exportedNamesStorageRef); statements.push(exportStarFunction); @@ -55149,9 +60196,7 @@ var ts; ])), ts.createStatement(ts.createCall(exportFunction, /*typeArguments*/ undefined, [exports])) - ], - /*location*/ undefined, - /*multiline*/ true)); + ], /*multiline*/ true)); } /** * Creates an array setter callbacks for each dependency group. @@ -55171,19 +60216,19 @@ var ts; var entry = _b[_a]; var importVariableName = ts.getLocalNameForExternalImport(entry, currentSourceFile); switch (entry.kind) { - case 235 /* ImportDeclaration */: + case 238 /* ImportDeclaration */: if (!entry.importClause) { // 'import "..."' case // module is imported only for side-effects, no emit required break; } - // fall-through - case 234 /* ImportEqualsDeclaration */: + // falls through + case 237 /* ImportEqualsDeclaration */: ts.Debug.assert(importVariableName !== undefined); // save import into the local statements.push(ts.createStatement(ts.createAssignment(importVariableName, parameterName))); break; - case 241 /* ExportDeclaration */: + case 244 /* ExportDeclaration */: ts.Debug.assert(importVariableName !== undefined); if (entry.exportClause) { // export {a, b as c} from 'foo' @@ -55200,7 +60245,7 @@ var ts; properties.push(ts.createPropertyAssignment(ts.createLiteral(e.name.text), ts.createElementAccess(parameterName, ts.createLiteral((e.propertyName || e.name).text)))); } statements.push(ts.createStatement(ts.createCall(exportFunction, - /*typeArguments*/ undefined, [ts.createObjectLiteral(properties, /*location*/ undefined, /*multiline*/ true)]))); + /*typeArguments*/ undefined, [ts.createObjectLiteral(properties, /*multiline*/ true)]))); } else { // export * from 'foo' @@ -55219,9 +60264,9 @@ var ts; /*asteriskToken*/ undefined, /*name*/ undefined, /*typeParameters*/ undefined, [ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, parameterName)], - /*type*/ undefined, ts.createBlock(statements, /*location*/ undefined, /*multiLine*/ true))); + /*type*/ undefined, ts.createBlock(statements, /*multiLine*/ true))); } - return ts.createArrayLiteral(setters, /*location*/ undefined, /*multiLine*/ true); + return ts.createArrayLiteral(setters, /*multiLine*/ true); } // // Top-level Source Element Visitors @@ -55233,15 +60278,15 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 235 /* ImportDeclaration */: + case 238 /* ImportDeclaration */: return visitImportDeclaration(node); - case 234 /* ImportEqualsDeclaration */: + case 237 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 241 /* ExportDeclaration */: + case 244 /* ExportDeclaration */: // ExportDeclarations are elided as they are handled via // `appendExportsOfDeclaration`. return undefined; - case 240 /* ExportAssignment */: + case 243 /* ExportAssignment */: return visitExportAssignment(node); default: return nestedElementVisitor(node); @@ -55314,7 +60359,7 @@ var ts; */ function visitFunctionDeclaration(node) { if (ts.hasModifier(node, 1 /* Export */)) { - hoistedStatements = ts.append(hoistedStatements, ts.updateFunctionDeclaration(node, node.decorators, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.getDeclarationName(node, /*allowComments*/ true, /*allowSourceMaps*/ true), + hoistedStatements = ts.append(hoistedStatements, ts.updateFunctionDeclaration(node, node.decorators, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, ts.getDeclarationName(node, /*allowComments*/ true, /*allowSourceMaps*/ true), /*typeParameters*/ undefined, ts.visitNodes(node.parameters, destructuringVisitor, ts.isParameterDeclaration), /*type*/ undefined, ts.visitNode(node.body, destructuringVisitor, ts.isBlock))); } @@ -55342,11 +60387,9 @@ var ts; var name = ts.getLocalName(node); hoistVariableDeclaration(name); // Rewrite the class declaration into an assignment of a class expression. - statements = ts.append(statements, ts.createStatement(ts.createAssignment(name, ts.createClassExpression( + statements = ts.append(statements, ts.setTextRange(ts.createStatement(ts.createAssignment(name, ts.setTextRange(ts.createClassExpression( /*modifiers*/ undefined, node.name, - /*typeParameters*/ undefined, ts.visitNodes(node.heritageClauses, destructuringVisitor, ts.isHeritageClause), ts.visitNodes(node.members, destructuringVisitor, ts.isClassElement), - /*location*/ node)), - /*location*/ node)); + /*typeParameters*/ undefined, ts.visitNodes(node.heritageClauses, destructuringVisitor, ts.isHeritageClause), ts.visitNodes(node.members, destructuringVisitor, ts.isClassElement)), node))), node)); if (hasAssociatedEndOfDeclarationMarker(node)) { // Defer exports until we encounter an EndOfDeclarationMarker node var id = ts.getOriginalNodeId(node); @@ -55381,7 +60424,7 @@ var ts; } var statements; if (expressions) { - statements = ts.append(statements, ts.createStatement(ts.inlineExpressions(expressions), /*location*/ node)); + statements = ts.append(statements, ts.setTextRange(ts.createStatement(ts.inlineExpressions(expressions)), node)); } if (isMarkedDeclaration) { // Defer exports until we encounter an EndOfDeclarationMarker node @@ -55418,8 +60461,8 @@ var ts; */ function shouldHoistVariableDeclarationList(node) { // hoist only non-block scoped declarations or block scoped declarations parented by source file - return (ts.getEmitFlags(node) & 1048576 /* NoHoisting */) === 0 - && (enclosingBlockScopedContainer.kind === 261 /* SourceFile */ + return (ts.getEmitFlags(node) & 2097152 /* NoHoisting */) === 0 + && (enclosingBlockScopedContainer.kind === 265 /* SourceFile */ || (ts.getOriginalNode(node).flags & 3 /* BlockScoped */) === 0); } /** @@ -55466,8 +60509,8 @@ var ts; function createVariableAssignment(name, value, location, isExportedDeclaration) { hoistVariableDeclaration(ts.getSynthesizedClone(name)); return isExportedDeclaration - ? createExportExpression(name, preventSubstitution(ts.createAssignment(name, value, location))) - : preventSubstitution(ts.createAssignment(name, value, location)); + ? createExportExpression(name, preventSubstitution(ts.setTextRange(ts.createAssignment(name, value), location))) + : preventSubstitution(ts.setTextRange(ts.createAssignment(name, value), location)); } /** * Visits a MergeDeclarationMarker used as a placeholder for the beginning of a merged @@ -55483,7 +60526,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 === 205 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 208 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); var isExportedDeclaration = ts.hasModifier(node.original, 1 /* Export */); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration); @@ -55496,7 +60539,7 @@ var ts; * @param node The node to test. */ function hasAssociatedEndOfDeclarationMarker(node) { - return (ts.getEmitFlags(node) & 2097152 /* HasEndOfDeclarationMarker */) !== 0; + return (ts.getEmitFlags(node) & 4194304 /* HasEndOfDeclarationMarker */) !== 0; } /** * Visits a DeclarationMarker used as a placeholder for the end of a transformed @@ -55539,10 +60582,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 237 /* NamespaceImport */: + case 240 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 238 /* NamedImports */: + case 241 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -55660,10 +60703,10 @@ var ts; return statements; } var name = ts.getDeclarationName(decl); - var exportSpecifiers = moduleInfo.exportSpecifiers[name.text]; + var exportSpecifiers = moduleInfo.exportSpecifiers.get(name.text); if (exportSpecifiers) { - for (var _i = 0, exportSpecifiers_1 = exportSpecifiers; _i < exportSpecifiers_1.length; _i++) { - var exportSpecifier = exportSpecifiers_1[_i]; + for (var _i = 0, exportSpecifiers_2 = exportSpecifiers; _i < exportSpecifiers_2.length; _i++) { + var exportSpecifier = exportSpecifiers_2[_i]; if (exportSpecifier.name.text !== excludeName) { statements = appendExportStatement(statements, exportSpecifier.name, name); } @@ -55721,43 +60764,43 @@ var ts; */ function nestedElementVisitor(node) { switch (node.kind) { - case 205 /* VariableStatement */: + case 208 /* VariableStatement */: return visitVariableStatement(node); - case 225 /* FunctionDeclaration */: + case 228 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 226 /* ClassDeclaration */: + case 229 /* ClassDeclaration */: return visitClassDeclaration(node); - case 211 /* ForStatement */: + case 214 /* ForStatement */: return visitForStatement(node); - case 212 /* ForInStatement */: + case 215 /* ForInStatement */: return visitForInStatement(node); - case 213 /* ForOfStatement */: + case 216 /* ForOfStatement */: return visitForOfStatement(node); - case 209 /* DoStatement */: + case 212 /* DoStatement */: return visitDoStatement(node); - case 210 /* WhileStatement */: + case 213 /* WhileStatement */: return visitWhileStatement(node); - case 219 /* LabeledStatement */: + case 222 /* LabeledStatement */: return visitLabeledStatement(node); - case 217 /* WithStatement */: + case 220 /* WithStatement */: return visitWithStatement(node); - case 218 /* SwitchStatement */: + case 221 /* SwitchStatement */: return visitSwitchStatement(node); - case 232 /* CaseBlock */: + case 235 /* CaseBlock */: return visitCaseBlock(node); - case 253 /* CaseClause */: + case 257 /* CaseClause */: return visitCaseClause(node); - case 254 /* DefaultClause */: + case 258 /* DefaultClause */: return visitDefaultClause(node); - case 221 /* TryStatement */: + case 224 /* TryStatement */: return visitTryStatement(node); - case 256 /* CatchClause */: + case 260 /* CatchClause */: return visitCatchClause(node); - case 204 /* Block */: + case 207 /* Block */: return visitBlock(node); - case 295 /* MergeDeclarationMarker */: + case 297 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 296 /* EndOfDeclarationMarker */: + case 298 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return destructuringVisitor(node); @@ -55771,7 +60814,7 @@ var ts; function visitForStatement(node) { var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer; enclosingBlockScopedContainer = node; - node = ts.updateFor(node, visitForInitializer(node.initializer), ts.visitNode(node.condition, destructuringVisitor, ts.isExpression, /*optional*/ true), ts.visitNode(node.incrementor, destructuringVisitor, ts.isExpression, /*optional*/ true), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement)); + node = ts.updateFor(node, visitForInitializer(node.initializer), ts.visitNode(node.condition, destructuringVisitor, ts.isExpression), ts.visitNode(node.incrementor, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement)); enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; return node; } @@ -55783,7 +60826,7 @@ var ts; function visitForInStatement(node) { var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer; enclosingBlockScopedContainer = node; - node = ts.updateForIn(node, visitForInitializer(node.initializer), ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, /*optional*/ false, ts.liftToBlock)); + node = ts.updateForIn(node, visitForInitializer(node.initializer), ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock)); enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; return node; } @@ -55795,7 +60838,7 @@ var ts; function visitForOfStatement(node) { var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer; enclosingBlockScopedContainer = node; - node = ts.updateForOf(node, visitForInitializer(node.initializer), ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, /*optional*/ false, ts.liftToBlock)); + node = ts.updateForOf(node, node.awaitModifier, visitForInitializer(node.initializer), ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock)); enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; return node; } @@ -55815,6 +60858,9 @@ var ts; * @param node The node to visit. */ function visitForInitializer(node) { + if (!node) { + return node; + } if (shouldHoistForInitializer(node)) { var expressions = void 0; for (var _i = 0, _a = node.declarations; _i < _a.length; _i++) { @@ -55833,7 +60879,7 @@ var ts; * @param node The node to visit. */ function visitDoStatement(node) { - return ts.updateDo(node, ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, /*optional*/ false, ts.liftToBlock), ts.visitNode(node.expression, destructuringVisitor, ts.isExpression)); + return ts.updateDo(node, ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock), ts.visitNode(node.expression, destructuringVisitor, ts.isExpression)); } /** * Visits the body of a WhileStatement to hoist declarations. @@ -55841,7 +60887,7 @@ var ts; * @param node The node to visit. */ function visitWhileStatement(node) { - return ts.updateWhile(node, ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, /*optional*/ false, ts.liftToBlock)); + return ts.updateWhile(node, ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock)); } /** * Visits the body of a LabeledStatement to hoist declarations. @@ -55849,7 +60895,7 @@ var ts; * @param node The node to visit. */ function visitLabeledStatement(node) { - return ts.updateLabel(node, node.label, ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, /*optional*/ false, ts.liftToBlock)); + return ts.updateLabel(node, node.label, ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock)); } /** * Visits the body of a WithStatement to hoist declarations. @@ -55857,7 +60903,7 @@ var ts; * @param node The node to visit. */ function visitWithStatement(node) { - return ts.updateWith(node, ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, /*optional*/ false, ts.liftToBlock)); + return ts.updateWith(node, ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock)); } /** * Visits the body of a SwitchStatement to hoist declarations. @@ -55937,7 +60983,7 @@ var ts; */ function destructuringVisitor(node) { if (node.transformFlags & 1024 /* DestructuringAssignment */ - && node.kind === 192 /* BinaryExpression */) { + && node.kind === 194 /* BinaryExpression */) { return visitDestructuringAssignment(node); } else if (node.transformFlags & 2048 /* ContainsDestructuringAssignment */) { @@ -55965,7 +61011,7 @@ var ts; * @param node The destructuring target. */ function hasExportedReferenceInDestructuringTarget(node) { - if (ts.isAssignmentExpression(node)) { + if (ts.isAssignmentExpression(node, /*excludeCompoundAssignment*/ true)) { return hasExportedReferenceInDestructuringTarget(node.left); } else if (ts.isSpreadExpression(node)) { @@ -55985,7 +61031,7 @@ var ts; } else if (ts.isIdentifier(node)) { var container = resolver.getReferencedExportContainer(node); - return container !== undefined && container.kind === 261 /* SourceFile */; + return container !== undefined && container.kind === 265 /* SourceFile */; } else { return false; @@ -56001,8 +61047,8 @@ var ts; */ function modifierVisitor(node) { switch (node.kind) { - case 83 /* ExportKeyword */: - case 78 /* DefaultKeyword */: + case 84 /* ExportKeyword */: + case 79 /* DefaultKeyword */: return undefined; } return node; @@ -56013,12 +61059,12 @@ var ts; /** * Hook for node emit notifications. * - * @param emitContext A context hint for the emitter. + * @param hint A hint as to the intended usage of the node. * @param node The node to emit. - * @param emit A callback used to emit the node in the printer. + * @param emitCallback A callback used to emit the node in the printer. */ - function onEmitNode(emitContext, node, emitCallback) { - if (node.kind === 261 /* SourceFile */) { + function onEmitNode(hint, node, emitCallback) { + if (node.kind === 265 /* SourceFile */) { var id = ts.getOriginalNodeId(node); currentSourceFile = node; moduleInfo = moduleInfoMap[id]; @@ -56027,14 +61073,14 @@ var ts; if (noSubstitution) { delete noSubstitutionMap[id]; } - previousOnEmitNode(emitContext, node, emitCallback); + previousOnEmitNode(hint, node, emitCallback); currentSourceFile = undefined; moduleInfo = undefined; exportFunction = undefined; noSubstitution = undefined; } else { - previousOnEmitNode(emitContext, node, emitCallback); + previousOnEmitNode(hint, node, emitCallback); } } // @@ -56043,15 +61089,15 @@ var ts; /** * Hooks node substitutions. * - * @param emitContext A context hint for the emitter. + * @param hint A hint as to the intended usage of the node. * @param node The node to substitute. */ - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); if (isSubstitutionPrevented(node)) { return node; } - if (emitContext === 1 /* Expression */) { + if (hint === 1 /* Expression */) { return substituteExpression(node); } return node; @@ -56063,12 +61109,12 @@ var ts; */ function substituteExpression(node) { switch (node.kind) { - case 70 /* Identifier */: + case 71 /* Identifier */: return substituteExpressionIdentifier(node); - case 192 /* BinaryExpression */: + case 194 /* BinaryExpression */: return substituteBinaryExpression(node); - case 190 /* PrefixUnaryExpression */: - case 191 /* PostfixUnaryExpression */: + case 192 /* PrefixUnaryExpression */: + case 193 /* PostfixUnaryExpression */: return substituteUnaryExpression(node); } return node; @@ -56096,1119 +61142,11 @@ var ts; var importDeclaration = resolver.getReferencedImportDeclaration(node); if (importDeclaration) { if (ts.isImportClause(importDeclaration)) { - return ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent), ts.createIdentifier("default"), + return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent), ts.createIdentifier("default")), /*location*/ node); } else if (ts.isImportSpecifier(importDeclaration)) { - return ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent.parent.parent), ts.getSynthesizedClone(importDeclaration.propertyName || importDeclaration.name), - /*location*/ node); - } - } - } - return node; - } - /** - * Substitution for a BinaryExpression that may contain an imported or exported symbol. - * - * @param node The node to substitute. - */ - function substituteBinaryExpression(node) { - // When we see an assignment expression whose left-hand side is an exported symbol, - // we should ensure all exports of that symbol are updated with the correct value. - // - // - We do not substitute generated identifiers for any reason. - // - We do not substitute identifiers tagged with the LocalName flag. - // - We do not substitute identifiers that were originally the name of an enum or - // namespace due to how they are transformed in TypeScript. - // - We only substitute identifiers that are exported at the top level. - if (ts.isAssignmentOperator(node.operatorToken.kind) - && ts.isIdentifier(node.left) - && !ts.isGeneratedIdentifier(node.left) - && !ts.isLocalName(node.left) - && !ts.isDeclarationNameOfEnumOrNamespace(node.left)) { - var exportedNames = getExports(node.left); - if (exportedNames) { - // For each additional export of the declaration, apply an export assignment. - var expression = node; - for (var _i = 0, exportedNames_1 = exportedNames; _i < exportedNames_1.length; _i++) { - var exportName = exportedNames_1[_i]; - expression = createExportExpression(exportName, preventSubstitution(expression)); - } - return expression; - } - } - return node; - } - /** - * Substitution for a UnaryExpression that may contain an imported or exported symbol. - * - * @param node The node to substitute. - */ - function substituteUnaryExpression(node) { - // When we see a prefix or postfix increment expression whose operand is an exported - // symbol, we should ensure all exports of that symbol are updated with the correct - // value. - // - // - We do not substitute generated identifiers for any reason. - // - We do not substitute identifiers tagged with the LocalName flag. - // - We do not substitute identifiers that were originally the name of an enum or - // namespace due to how they are transformed in TypeScript. - // - We only substitute identifiers that are exported at the top level. - if ((node.operator === 42 /* PlusPlusToken */ || node.operator === 43 /* MinusMinusToken */) - && ts.isIdentifier(node.operand) - && !ts.isGeneratedIdentifier(node.operand) - && !ts.isLocalName(node.operand) - && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { - var exportedNames = getExports(node.operand); - if (exportedNames) { - var expression = node.kind === 191 /* PostfixUnaryExpression */ - ? ts.createPrefix(node.operator, node.operand, - /*location*/ node) - : node; - for (var _i = 0, exportedNames_2 = exportedNames; _i < exportedNames_2.length; _i++) { - var exportName = exportedNames_2[_i]; - expression = createExportExpression(exportName, preventSubstitution(expression)); - } - if (node.kind === 191 /* PostfixUnaryExpression */) { - expression = node.operator === 42 /* PlusPlusToken */ - ? ts.createSubtract(preventSubstitution(expression), ts.createLiteral(1)) - : ts.createAdd(preventSubstitution(expression), ts.createLiteral(1)); - } - return expression; - } - } - return node; - } - /** - * Gets the exports of a name. - * - * @param name The name. - */ - function getExports(name) { - var exportedNames; - if (!ts.isGeneratedIdentifier(name)) { - var valueDeclaration = resolver.getReferencedImportDeclaration(name) - || resolver.getReferencedValueDeclaration(name); - if (valueDeclaration) { - var exportContainer = resolver.getReferencedExportContainer(name, /*prefixLocals*/ false); - if (exportContainer && exportContainer.kind === 261 /* SourceFile */) { - exportedNames = ts.append(exportedNames, ts.getDeclarationName(valueDeclaration)); - } - exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]); - } - } - return exportedNames; - } - /** - * Prevent substitution of a node for this transformer. - * - * @param node The node which should not be substituted. - */ - function preventSubstitution(node) { - if (noSubstitution === undefined) - noSubstitution = ts.createMap(); - noSubstitution[ts.getNodeId(node)] = true; - return node; - } - /** - * Determines whether a node should not be substituted. - * - * @param node The node to test. - */ - function isSubstitutionPrevented(node) { - return noSubstitution && node.id && noSubstitution[node.id]; - } - } - ts.transformSystemModule = transformSystemModule; -})(ts || (ts = {})); -/// -/// -/*@internal*/ -var ts; -(function (ts) { - function transformModule(context) { - var transformModuleDelegates = ts.createMap((_a = {}, - _a[ts.ModuleKind.None] = transformCommonJSModule, - _a[ts.ModuleKind.CommonJS] = transformCommonJSModule, - _a[ts.ModuleKind.AMD] = transformAMDModule, - _a[ts.ModuleKind.UMD] = transformUMDModule, - _a)); - var startLexicalEnvironment = context.startLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment; - var compilerOptions = context.getCompilerOptions(); - var resolver = context.getEmitResolver(); - var host = context.getEmitHost(); - var languageVersion = ts.getEmitScriptTarget(compilerOptions); - var moduleKind = ts.getEmitModuleKind(compilerOptions); - var previousOnSubstituteNode = context.onSubstituteNode; - var previousOnEmitNode = context.onEmitNode; - context.onSubstituteNode = onSubstituteNode; - context.onEmitNode = onEmitNode; - context.enableSubstitution(70 /* Identifier */); // Substitutes expression identifiers with imported/exported symbols. - context.enableSubstitution(192 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(190 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(191 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(258 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. - context.enableEmitNotification(261 /* SourceFile */); // Restore state when substituting nodes in a file. - var moduleInfoMap = ts.createMap(); // The ExternalModuleInfo for each file. - var deferredExports = ts.createMap(); // Exports to defer until an EndOfDeclarationMarker is found. - var currentSourceFile; // The current file. - var currentModuleInfo; // The ExternalModuleInfo for the current file. - var noSubstitution; // Set of nodes for which substitution rules should be ignored. - return transformSourceFile; - /** - * Transforms the module aspects of a SourceFile. - * - * @param node The SourceFile node. - */ - function transformSourceFile(node) { - if (ts.isDeclarationFile(node) - || !(ts.isExternalModule(node) - || compilerOptions.isolatedModules)) { - return node; - } - currentSourceFile = node; - currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(node)] = ts.collectExternalModuleInfo(node, resolver, compilerOptions); - // Perform the transformation. - var transformModule = transformModuleDelegates[moduleKind] || transformModuleDelegates[ts.ModuleKind.None]; - var updated = transformModule(node); - currentSourceFile = undefined; - currentModuleInfo = undefined; - return ts.aggregateTransformFlags(updated); - } - /** - * Transforms a SourceFile into a CommonJS module. - * - * @param node The SourceFile node. - */ - function transformCommonJSModule(node) { - startLexicalEnvironment(); - var statements = []; - var statementOffset = ts.addPrologueDirectives(statements, node.statements, /*ensureUseStrict*/ !compilerOptions.noImplicitUseStrict, sourceElementVisitor); - ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement, /*optional*/ true)); - ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset)); - ts.addRange(statements, endLexicalEnvironment()); - addExportEqualsIfNeeded(statements, /*emitAsReturn*/ false); - var updated = ts.updateSourceFileNode(node, ts.createNodeArray(statements, node.statements)); - if (currentModuleInfo.hasExportStarsToExportValues) { - ts.addEmitHelper(updated, exportStarHelper); - } - return updated; - } - /** - * Transforms a SourceFile into an AMD module. - * - * @param node The SourceFile node. - */ - function transformAMDModule(node) { - var define = ts.createIdentifier("define"); - var moduleName = ts.tryGetModuleNameFromFile(node, host, compilerOptions); - // An AMD define function has the following shape: - // - // define(id?, dependencies?, factory); - // - // This has the shape of the following: - // - // define(name, ["module1", "module2"], function (module1Alias) { ... } - // - // The location of the alias in the parameter list in the factory function needs to - // match the position of the module name in the dependency list. - // - // To ensure this is true in cases of modules with no aliases, e.g.: - // - // import "module" - // - // or - // - // /// - // - // we need to add modules without alias names to the end of the dependencies list - var _a = collectAsynchronousDependencies(node, /*includeNonAmdDependencies*/ true), aliasedModuleNames = _a.aliasedModuleNames, unaliasedModuleNames = _a.unaliasedModuleNames, importAliasNames = _a.importAliasNames; - // Create an updated SourceFile: - // - // define(moduleName?, ["module1", "module2"], function ... - return ts.updateSourceFileNode(node, ts.createNodeArray([ - ts.createStatement(ts.createCall(define, - /*typeArguments*/ undefined, (moduleName ? [moduleName] : []).concat([ - // Add the dependency array argument: - // - // ["require", "exports", module1", "module2", ...] - ts.createArrayLiteral([ - ts.createLiteral("require"), - ts.createLiteral("exports") - ].concat(aliasedModuleNames, unaliasedModuleNames)), - // Add the module body function argument: - // - // function (require, exports, module1, module2) ... - ts.createFunctionExpression( - /*modifiers*/ undefined, - /*asteriskToken*/ undefined, - /*name*/ undefined, - /*typeParameters*/ undefined, [ - ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "require"), - ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "exports") - ].concat(importAliasNames), - /*type*/ undefined, transformAsynchronousModuleBody(node)) - ]))) - ], - /*location*/ node.statements)); - } - /** - * Transforms a SourceFile into a UMD module. - * - * @param node The SourceFile node. - */ - function transformUMDModule(node) { - var _a = collectAsynchronousDependencies(node, /*includeNonAmdDependencies*/ false), aliasedModuleNames = _a.aliasedModuleNames, unaliasedModuleNames = _a.unaliasedModuleNames, importAliasNames = _a.importAliasNames; - var umdHeader = ts.createFunctionExpression( - /*modifiers*/ undefined, - /*asteriskToken*/ undefined, - /*name*/ undefined, - /*typeParameters*/ undefined, [ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "factory")], - /*type*/ undefined, ts.createBlock([ - ts.createIf(ts.createLogicalAnd(ts.createTypeCheck(ts.createIdentifier("module"), "object"), ts.createTypeCheck(ts.createPropertyAccess(ts.createIdentifier("module"), "exports"), "object")), ts.createBlock([ - ts.createVariableStatement( - /*modifiers*/ undefined, [ - ts.createVariableDeclaration("v", - /*type*/ undefined, ts.createCall(ts.createIdentifier("factory"), - /*typeArguments*/ undefined, [ - ts.createIdentifier("require"), - ts.createIdentifier("exports") - ])) - ]), - ts.setEmitFlags(ts.createIf(ts.createStrictInequality(ts.createIdentifier("v"), ts.createIdentifier("undefined")), ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("module"), "exports"), ts.createIdentifier("v")))), 1 /* SingleLine */) - ]), ts.createIf(ts.createLogicalAnd(ts.createTypeCheck(ts.createIdentifier("define"), "function"), ts.createPropertyAccess(ts.createIdentifier("define"), "amd")), ts.createBlock([ - ts.createStatement(ts.createCall(ts.createIdentifier("define"), - /*typeArguments*/ undefined, [ - ts.createArrayLiteral([ - ts.createLiteral("require"), - ts.createLiteral("exports") - ].concat(aliasedModuleNames, unaliasedModuleNames)), - ts.createIdentifier("factory") - ])) - ]))) - ], - /*location*/ undefined, - /*multiLine*/ true)); - // Create an updated SourceFile: - // - // (function (factory) { - // if (typeof module === "object" && typeof module.exports === "object") { - // var v = factory(require, exports); - // if (v !== undefined) module.exports = v; - // } - // else if (typeof define === 'function' && define.amd) { - // define(["require", "exports"], factory); - // } - // })(function ...) - return ts.updateSourceFileNode(node, ts.createNodeArray([ - ts.createStatement(ts.createCall(umdHeader, - /*typeArguments*/ undefined, [ - // Add the module body function argument: - // - // function (require, exports) ... - ts.createFunctionExpression( - /*modifiers*/ undefined, - /*asteriskToken*/ undefined, - /*name*/ undefined, - /*typeParameters*/ undefined, [ - ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "require"), - ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "exports") - ].concat(importAliasNames), - /*type*/ undefined, transformAsynchronousModuleBody(node)) - ])) - ], - /*location*/ node.statements)); - } - /** - * Collect the additional asynchronous dependencies for the module. - * - * @param node The source file. - * @param includeNonAmdDependencies A value indicating whether to include non-AMD dependencies. - */ - function collectAsynchronousDependencies(node, includeNonAmdDependencies) { - // names of modules with corresponding parameter in the factory function - var aliasedModuleNames = []; - // names of modules with no corresponding parameters in factory function - var unaliasedModuleNames = []; - // names of the parameters in the factory function; these - // parameters need to match the indexes of the corresponding - // module names in aliasedModuleNames. - var importAliasNames = []; - // Fill in amd-dependency tags - for (var _i = 0, _a = node.amdDependencies; _i < _a.length; _i++) { - var amdDependency = _a[_i]; - if (amdDependency.name) { - aliasedModuleNames.push(ts.createLiteral(amdDependency.path)); - importAliasNames.push(ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, amdDependency.name)); - } - else { - unaliasedModuleNames.push(ts.createLiteral(amdDependency.path)); - } - } - for (var _b = 0, _c = currentModuleInfo.externalImports; _b < _c.length; _b++) { - var importNode = _c[_b]; - // Find the name of the external module - var externalModuleName = ts.getExternalModuleNameLiteral(importNode, currentSourceFile, host, resolver, compilerOptions); - // Find the name of the module alias, if there is one - var importAliasName = ts.getLocalNameForExternalImport(importNode, currentSourceFile); - if (includeNonAmdDependencies && importAliasName) { - // Set emitFlags on the name of the classDeclaration - // This is so that when printer will not substitute the identifier - ts.setEmitFlags(importAliasName, 4 /* NoSubstitution */); - aliasedModuleNames.push(externalModuleName); - importAliasNames.push(ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, importAliasName)); - } - else { - unaliasedModuleNames.push(externalModuleName); - } - } - return { aliasedModuleNames: aliasedModuleNames, unaliasedModuleNames: unaliasedModuleNames, importAliasNames: importAliasNames }; - } - /** - * Transforms a SourceFile into an AMD or UMD module body. - * - * @param node The SourceFile node. - */ - function transformAsynchronousModuleBody(node) { - startLexicalEnvironment(); - var statements = []; - var statementOffset = ts.addPrologueDirectives(statements, node.statements, /*ensureUseStrict*/ !compilerOptions.noImplicitUseStrict, sourceElementVisitor); - // Visit each statement of the module body. - ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement, /*optional*/ true)); - ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset)); - // End the lexical environment for the module body - // and merge any new lexical declarations. - ts.addRange(statements, endLexicalEnvironment()); - // Append the 'export =' statement if provided. - addExportEqualsIfNeeded(statements, /*emitAsReturn*/ true); - var body = ts.createBlock(statements, /*location*/ undefined, /*multiLine*/ true); - if (currentModuleInfo.hasExportStarsToExportValues) { - // If we have any `export * from ...` declarations - // we need to inform the emitter to add the __export helper. - ts.addEmitHelper(body, exportStarHelper); - } - return body; - } - /** - * Adds the down-level representation of `export=` to the statement list if one exists - * in the source file. - * - * @param statements The Statement list to modify. - * @param emitAsReturn A value indicating whether to emit the `export=` statement as a - * return statement. - */ - function addExportEqualsIfNeeded(statements, emitAsReturn) { - if (currentModuleInfo.exportEquals) { - if (emitAsReturn) { - var statement = ts.createReturn(currentModuleInfo.exportEquals.expression, - /*location*/ currentModuleInfo.exportEquals); - ts.setEmitFlags(statement, 384 /* NoTokenSourceMaps */ | 1536 /* NoComments */); - statements.push(statement); - } - else { - var statement = ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("module"), "exports"), currentModuleInfo.exportEquals.expression), - /*location*/ currentModuleInfo.exportEquals); - ts.setEmitFlags(statement, 1536 /* NoComments */); - statements.push(statement); - } - } - } - // - // Top-Level Source Element Visitors - // - /** - * Visits a node at the top level of the source file. - * - * @param node The node to visit. - */ - function sourceElementVisitor(node) { - switch (node.kind) { - case 235 /* ImportDeclaration */: - return visitImportDeclaration(node); - case 234 /* ImportEqualsDeclaration */: - return visitImportEqualsDeclaration(node); - case 241 /* ExportDeclaration */: - return visitExportDeclaration(node); - case 240 /* ExportAssignment */: - return visitExportAssignment(node); - case 205 /* VariableStatement */: - return visitVariableStatement(node); - case 225 /* FunctionDeclaration */: - return visitFunctionDeclaration(node); - case 226 /* ClassDeclaration */: - return visitClassDeclaration(node); - case 295 /* MergeDeclarationMarker */: - return visitMergeDeclarationMarker(node); - case 296 /* EndOfDeclarationMarker */: - return visitEndOfDeclarationMarker(node); - default: - // This visitor does not descend into the tree, as export/import statements - // are only transformed at the top level of a file. - return node; - } - } - /** - * Visits an ImportDeclaration node. - * - * @param node The node to visit. - */ - function visitImportDeclaration(node) { - var statements; - var namespaceDeclaration = ts.getNamespaceDeclarationNode(node); - if (moduleKind !== ts.ModuleKind.AMD) { - if (!node.importClause) { - // import "mod"; - return ts.createStatement(createRequireCall(node), /*location*/ node); - } - else { - var variables = []; - if (namespaceDeclaration && !ts.isDefaultImport(node)) { - // import * as n from "mod"; - variables.push(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), - /*type*/ undefined, createRequireCall(node))); - } - else { - // import d from "mod"; - // import { x, y } from "mod"; - // import d, { x, y } from "mod"; - // import d, * as n from "mod"; - variables.push(ts.createVariableDeclaration(ts.getGeneratedNameForNode(node), - /*type*/ undefined, createRequireCall(node))); - if (namespaceDeclaration && ts.isDefaultImport(node)) { - variables.push(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), - /*type*/ undefined, ts.getGeneratedNameForNode(node))); - } - } - statements = ts.append(statements, ts.createVariableStatement( - /*modifiers*/ undefined, ts.createVariableDeclarationList(variables, - /*location*/ undefined, languageVersion >= 2 /* ES2015 */ ? 2 /* Const */ : 0 /* None */), - /*location*/ node)); - } - } - else if (namespaceDeclaration && ts.isDefaultImport(node)) { - // import d, * as n from "mod"; - statements = ts.append(statements, ts.createVariableStatement( - /*modifiers*/ undefined, ts.createVariableDeclarationList([ - ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), - /*type*/ undefined, ts.getGeneratedNameForNode(node), - /*location*/ node) - ], - /*location*/ undefined, languageVersion >= 2 /* ES2015 */ ? 2 /* Const */ : 0 /* None */))); - } - if (hasAssociatedEndOfDeclarationMarker(node)) { - // Defer exports until we encounter an EndOfDeclarationMarker node - var id = ts.getOriginalNodeId(node); - deferredExports[id] = appendExportsOfImportDeclaration(deferredExports[id], node); - } - else { - statements = appendExportsOfImportDeclaration(statements, node); - } - return ts.singleOrMany(statements); - } - /** - * Creates a `require()` call to import an external module. - * - * @param importNode The declararation to import. - */ - function createRequireCall(importNode) { - var moduleName = ts.getExternalModuleNameLiteral(importNode, currentSourceFile, host, resolver, compilerOptions); - var args = []; - if (moduleName) { - args.push(moduleName); - } - return ts.createCall(ts.createIdentifier("require"), /*typeArguments*/ undefined, args); - } - /** - * Visits an ImportEqualsDeclaration node. - * - * @param node The node to visit. - */ - function visitImportEqualsDeclaration(node) { - ts.Debug.assert(ts.isExternalModuleImportEqualsDeclaration(node), "import= for internal module references should be handled in an earlier transformer."); - var statements; - if (moduleKind !== ts.ModuleKind.AMD) { - if (ts.hasModifier(node, 1 /* Export */)) { - statements = ts.append(statements, ts.createStatement(createExportExpression(node.name, createRequireCall(node)), - /*location*/ node)); - } - else { - statements = ts.append(statements, ts.createVariableStatement( - /*modifiers*/ undefined, ts.createVariableDeclarationList([ - ts.createVariableDeclaration(ts.getSynthesizedClone(node.name), - /*type*/ undefined, createRequireCall(node)) - ], - /*location*/ undefined, - /*flags*/ languageVersion >= 2 /* ES2015 */ ? 2 /* Const */ : 0 /* None */), - /*location*/ node)); - } - } - else { - if (ts.hasModifier(node, 1 /* Export */)) { - statements = ts.append(statements, ts.createStatement(createExportExpression(ts.getExportName(node), ts.getLocalName(node)), - /*location*/ node)); - } - } - if (hasAssociatedEndOfDeclarationMarker(node)) { - // Defer exports until we encounter an EndOfDeclarationMarker node - var id = ts.getOriginalNodeId(node); - deferredExports[id] = appendExportsOfImportEqualsDeclaration(deferredExports[id], node); - } - else { - statements = appendExportsOfImportEqualsDeclaration(statements, node); - } - return ts.singleOrMany(statements); - } - /** - * Visits an ExportDeclaration node. - * - * @param The node to visit. - */ - function visitExportDeclaration(node) { - if (!node.moduleSpecifier) { - // Elide export declarations with no module specifier as they are handled - // elsewhere. - return undefined; - } - var generatedName = ts.getGeneratedNameForNode(node); - if (node.exportClause) { - var statements = []; - // export { x, y } from "mod"; - if (moduleKind !== ts.ModuleKind.AMD) { - statements.push(ts.createVariableStatement( - /*modifiers*/ undefined, ts.createVariableDeclarationList([ - ts.createVariableDeclaration(generatedName, - /*type*/ undefined, createRequireCall(node)) - ]), - /*location*/ node)); - } - for (var _i = 0, _a = node.exportClause.elements; _i < _a.length; _i++) { - var specifier = _a[_i]; - var exportedValue = ts.createPropertyAccess(generatedName, specifier.propertyName || specifier.name); - statements.push(ts.createStatement(createExportExpression(ts.getExportName(specifier), exportedValue), - /*location*/ specifier)); - } - return ts.singleOrMany(statements); - } - else { - // export * from "mod"; - return ts.createStatement(ts.createCall(ts.createIdentifier("__export"), - /*typeArguments*/ undefined, [ - moduleKind !== ts.ModuleKind.AMD - ? createRequireCall(node) - : generatedName - ]), - /*location*/ node); - } - } - /** - * Visits an ExportAssignment node. - * - * @param node The node to visit. - */ - function visitExportAssignment(node) { - if (node.isExportEquals) { - return undefined; - } - var statements; - var original = node.original; - if (original && hasAssociatedEndOfDeclarationMarker(original)) { - // Defer exports until we encounter an EndOfDeclarationMarker node - var id = ts.getOriginalNodeId(node); - deferredExports[id] = appendExportStatement(deferredExports[id], ts.createIdentifier("default"), node.expression, /*location*/ node, /*allowComments*/ true); - } - else { - statements = appendExportStatement(statements, ts.createIdentifier("default"), node.expression, /*location*/ node, /*allowComments*/ true); - } - return ts.singleOrMany(statements); - } - /** - * Visits a FunctionDeclaration node. - * - * @param node The node to visit. - */ - function visitFunctionDeclaration(node) { - var statements; - if (ts.hasModifier(node, 1 /* Export */)) { - statements = ts.append(statements, ts.setOriginalNode(ts.createFunctionDeclaration( - /*decorators*/ undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, ts.getDeclarationName(node, /*allowComments*/ true, /*allowSourceMaps*/ true), - /*typeParameters*/ undefined, node.parameters, - /*type*/ undefined, node.body, - /*location*/ node), - /*original*/ node)); - } - else { - statements = ts.append(statements, node); - } - if (hasAssociatedEndOfDeclarationMarker(node)) { - // Defer exports until we encounter an EndOfDeclarationMarker node - var id = ts.getOriginalNodeId(node); - deferredExports[id] = appendExportsOfHoistedDeclaration(deferredExports[id], node); - } - else { - statements = appendExportsOfHoistedDeclaration(statements, node); - } - return ts.singleOrMany(statements); - } - /** - * Visits a ClassDeclaration node. - * - * @param node The node to visit. - */ - function visitClassDeclaration(node) { - var statements; - if (ts.hasModifier(node, 1 /* Export */)) { - statements = ts.append(statements, ts.setOriginalNode(ts.createClassDeclaration( - /*decorators*/ undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.getDeclarationName(node, /*allowComments*/ true, /*allowSourceMaps*/ true), - /*typeParameters*/ undefined, node.heritageClauses, node.members, - /*location*/ node), - /*original*/ node)); - } - else { - statements = ts.append(statements, node); - } - if (hasAssociatedEndOfDeclarationMarker(node)) { - // Defer exports until we encounter an EndOfDeclarationMarker node - var id = ts.getOriginalNodeId(node); - deferredExports[id] = appendExportsOfHoistedDeclaration(deferredExports[id], node); - } - else { - statements = appendExportsOfHoistedDeclaration(statements, node); - } - return ts.singleOrMany(statements); - } - /** - * Visits a VariableStatement node. - * - * @param node The node to visit. - */ - function visitVariableStatement(node) { - var statements; - var variables; - var expressions; - if (ts.hasModifier(node, 1 /* Export */)) { - var modifiers = void 0; - // If we're exporting these variables, then these just become assignments to 'exports.x'. - // We only want to emit assignments for variables with initializers. - for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { - var variable = _a[_i]; - if (ts.isIdentifier(variable.name) && ts.isLocalName(variable.name)) { - if (!modifiers) { - modifiers = ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier); - } - variables = ts.append(variables, variable); - } - else if (variable.initializer) { - expressions = ts.append(expressions, transformInitializedVariable(variable)); - } - } - if (variables) { - statements = ts.append(statements, ts.updateVariableStatement(node, modifiers, ts.updateVariableDeclarationList(node.declarationList, variables))); - } - if (expressions) { - statements = ts.append(statements, ts.createStatement(ts.inlineExpressions(expressions), /*location*/ node)); - } - } - else { - statements = ts.append(statements, node); - } - if (hasAssociatedEndOfDeclarationMarker(node)) { - // Defer exports until we encounter an EndOfDeclarationMarker node - var id = ts.getOriginalNodeId(node); - deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node); - } - else { - statements = appendExportsOfVariableStatement(statements, node); - } - return ts.singleOrMany(statements); - } - /** - * Transforms an exported variable with an initializer into an expression. - * - * @param node The node to transform. - */ - function transformInitializedVariable(node) { - if (ts.isBindingPattern(node.name)) { - return ts.flattenDestructuringAssignment(node, - /*visitor*/ undefined, context, 0 /* All */, - /*needsValue*/ false, createExportExpression); - } - else { - return ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("exports"), node.name, - /*location*/ node.name), node.initializer); - } - } - /** - * Visits a MergeDeclarationMarker used as a placeholder for the beginning of a merged - * and transformed declaration. - * - * @param node The node to visit. - */ - function visitMergeDeclarationMarker(node) { - // For an EnumDeclaration or ModuleDeclaration that merges with a preceeding - // declaration we do not emit a leading variable declaration. To preserve the - // begin/end semantics of the declararation and to properly handle exports - // we wrapped the leading variable declaration in a `MergeDeclarationMarker`. - // - // To balance the declaration, add the exports of the elided variable - // statement. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 205 /* VariableStatement */) { - var id = ts.getOriginalNodeId(node); - deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); - } - return node; - } - /** - * Determines whether a node has an associated EndOfDeclarationMarker. - * - * @param node The node to test. - */ - function hasAssociatedEndOfDeclarationMarker(node) { - return (ts.getEmitFlags(node) & 2097152 /* HasEndOfDeclarationMarker */) !== 0; - } - /** - * Visits a DeclarationMarker used as a placeholder for the end of a transformed - * declaration. - * - * @param node The node to visit. - */ - function visitEndOfDeclarationMarker(node) { - // For some transformations we emit an `EndOfDeclarationMarker` to mark the actual - // end of the transformed declaration. We use this marker to emit any deferred exports - // of the declaration. - var id = ts.getOriginalNodeId(node); - var statements = deferredExports[id]; - if (statements) { - delete deferredExports[id]; - return ts.append(statements, node); - } - return node; - } - /** - * Appends the exports of an ImportDeclaration to a statement list, returning the - * statement list. - * - * @param statements A statement list to which the down-level export statements are to be - * appended. If `statements` is `undefined`, a new array is allocated if statements are - * appended. - * @param decl The declaration whose exports are to be recorded. - */ - function appendExportsOfImportDeclaration(statements, decl) { - if (currentModuleInfo.exportEquals) { - return statements; - } - var importClause = decl.importClause; - if (!importClause) { - return statements; - } - if (importClause.name) { - statements = appendExportsOfDeclaration(statements, importClause); - } - var namedBindings = importClause.namedBindings; - if (namedBindings) { - switch (namedBindings.kind) { - case 237 /* NamespaceImport */: - statements = appendExportsOfDeclaration(statements, namedBindings); - break; - case 238 /* NamedImports */: - for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { - var importBinding = _a[_i]; - statements = appendExportsOfDeclaration(statements, importBinding); - } - break; - } - } - return statements; - } - /** - * Appends the exports of an ImportEqualsDeclaration to a statement list, returning the - * statement list. - * - * @param statements A statement list to which the down-level export statements are to be - * appended. If `statements` is `undefined`, a new array is allocated if statements are - * appended. - * @param decl The declaration whose exports are to be recorded. - */ - function appendExportsOfImportEqualsDeclaration(statements, decl) { - if (currentModuleInfo.exportEquals) { - return statements; - } - return appendExportsOfDeclaration(statements, decl); - } - /** - * Appends the exports of a VariableStatement to a statement list, returning the statement - * list. - * - * @param statements A statement list to which the down-level export statements are to be - * appended. If `statements` is `undefined`, a new array is allocated if statements are - * appended. - * @param node The VariableStatement whose exports are to be recorded. - */ - function appendExportsOfVariableStatement(statements, node) { - if (currentModuleInfo.exportEquals) { - return statements; - } - for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { - var decl = _a[_i]; - statements = appendExportsOfBindingElement(statements, decl); - } - return statements; - } - /** - * Appends the exports of a VariableDeclaration or BindingElement to a statement list, - * returning the statement list. - * - * @param statements A statement list to which the down-level export statements are to be - * appended. If `statements` is `undefined`, a new array is allocated if statements are - * appended. - * @param decl The declaration whose exports are to be recorded. - */ - function appendExportsOfBindingElement(statements, decl) { - if (currentModuleInfo.exportEquals) { - return statements; - } - if (ts.isBindingPattern(decl.name)) { - for (var _i = 0, _a = decl.name.elements; _i < _a.length; _i++) { - var element = _a[_i]; - if (!ts.isOmittedExpression(element)) { - statements = appendExportsOfBindingElement(statements, element); - } - } - } - else if (!ts.isGeneratedIdentifier(decl.name)) { - statements = appendExportsOfDeclaration(statements, decl); - } - return statements; - } - /** - * Appends the exports of a ClassDeclaration or FunctionDeclaration to a statement list, - * returning the statement list. - * - * @param statements A statement list to which the down-level export statements are to be - * appended. If `statements` is `undefined`, a new array is allocated if statements are - * appended. - * @param decl The declaration whose exports are to be recorded. - */ - function appendExportsOfHoistedDeclaration(statements, decl) { - if (currentModuleInfo.exportEquals) { - return statements; - } - if (ts.hasModifier(decl, 1 /* Export */)) { - var exportName = ts.hasModifier(decl, 512 /* Default */) ? ts.createIdentifier("default") : decl.name; - statements = appendExportStatement(statements, exportName, ts.getLocalName(decl), /*location*/ decl); - } - if (decl.name) { - statements = appendExportsOfDeclaration(statements, decl); - } - return statements; - } - /** - * Appends the exports of a declaration to a statement list, returning the statement list. - * - * @param statements A statement list to which the down-level export statements are to be - * appended. If `statements` is `undefined`, a new array is allocated if statements are - * appended. - * @param decl The declaration to export. - */ - function appendExportsOfDeclaration(statements, decl) { - var name = ts.getDeclarationName(decl); - var exportSpecifiers = currentModuleInfo.exportSpecifiers[name.text]; - if (exportSpecifiers) { - for (var _i = 0, exportSpecifiers_2 = exportSpecifiers; _i < exportSpecifiers_2.length; _i++) { - var exportSpecifier = exportSpecifiers_2[_i]; - statements = appendExportStatement(statements, exportSpecifier.name, name, /*location*/ exportSpecifier.name); - } - } - return statements; - } - /** - * Appends the down-level representation of an export to a statement list, returning the - * statement list. - * - * @param statements A statement list to which the down-level export statements are to be - * appended. If `statements` is `undefined`, a new array is allocated if statements are - * appended. - * @param exportName The name of the export. - * @param expression The expression to export. - * @param location The location to use for source maps and comments for the export. - * @param allowComments Whether to allow comments on the export. - */ - function appendExportStatement(statements, exportName, expression, location, allowComments) { - if (exportName.text === "default") { - var sourceFile = ts.getOriginalNode(currentSourceFile, ts.isSourceFile); - if (sourceFile && !sourceFile.symbol.exports["___esModule"]) { - if (languageVersion === 0 /* ES3 */) { - statements = ts.append(statements, ts.createStatement(createExportExpression(ts.createIdentifier("__esModule"), ts.createLiteral(true)))); - } - else { - statements = ts.append(statements, ts.createStatement(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "defineProperty"), - /*typeArguments*/ undefined, [ - ts.createIdentifier("exports"), - ts.createLiteral("__esModule"), - ts.createObjectLiteral([ - ts.createPropertyAssignment("value", ts.createLiteral(true)) - ]) - ]))); - } - } - } - statements = ts.append(statements, createExportStatement(exportName, expression, location, allowComments)); - return statements; - } - /** - * Creates a call to the current file's export function to export a value. - * - * @param name The bound name of the export. - * @param value The exported value. - * @param location The location to use for source maps and comments for the export. - * @param allowComments An optional value indicating whether to emit comments for the statement. - */ - function createExportStatement(name, value, location, allowComments) { - var statement = ts.createStatement(createExportExpression(name, value), location); - ts.startOnNewLine(statement); - if (!allowComments) { - ts.setEmitFlags(statement, 1536 /* NoComments */); - } - return statement; - } - /** - * Creates a call to the current file's export function to export a value. - * - * @param name The bound name of the export. - * @param value The exported value. - * @param location The location to use for source maps and comments for the export. - */ - function createExportExpression(name, value, location) { - return ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(name)), value, location); - } - // - // Modifier Visitors - // - /** - * Visit nodes to elide module-specific modifiers. - * - * @param node The node to visit. - */ - function modifierVisitor(node) { - // Elide module-specific modifiers. - switch (node.kind) { - case 83 /* ExportKeyword */: - case 78 /* DefaultKeyword */: - return undefined; - } - return node; - } - // - // Emit Notification - // - /** - * Hook for node emit notifications. - * - * @param emitContext A context hint for the emitter. - * @param node The node to emit. - * @param emit A callback used to emit the node in the printer. - */ - function onEmitNode(emitContext, node, emitCallback) { - if (node.kind === 261 /* SourceFile */) { - currentSourceFile = node; - currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)]; - noSubstitution = ts.createMap(); - previousOnEmitNode(emitContext, node, emitCallback); - currentSourceFile = undefined; - currentModuleInfo = undefined; - noSubstitution = undefined; - } - else { - previousOnEmitNode(emitContext, node, emitCallback); - } - } - // - // Substitutions - // - /** - * Hooks node substitutions. - * - * @param emitContext A context hint for the emitter. - * @param node The node to substitute. - */ - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (node.id && noSubstitution[node.id]) { - return node; - } - if (emitContext === 1 /* Expression */) { - return substituteExpression(node); - } - else if (ts.isShorthandPropertyAssignment(node)) { - return substituteShorthandPropertyAssignment(node); - } - return node; - } - /** - * Substitution for a ShorthandPropertyAssignment whose declaration name is an imported - * or exported symbol. - * - * @param node The node to substitute. - */ - function substituteShorthandPropertyAssignment(node) { - var name = node.name; - var exportedOrImportedName = substituteExpressionIdentifier(name); - if (exportedOrImportedName !== name) { - // A shorthand property with an assignment initializer is probably part of a - // destructuring assignment - if (node.objectAssignmentInitializer) { - var initializer = ts.createAssignment(exportedOrImportedName, node.objectAssignmentInitializer); - return ts.createPropertyAssignment(name, initializer, /*location*/ node); - } - return ts.createPropertyAssignment(name, exportedOrImportedName, /*location*/ node); - } - return node; - } - /** - * Substitution for an Expression that may contain an imported or exported symbol. - * - * @param node The node to substitute. - */ - function substituteExpression(node) { - switch (node.kind) { - case 70 /* Identifier */: - return substituteExpressionIdentifier(node); - case 192 /* BinaryExpression */: - return substituteBinaryExpression(node); - case 191 /* PostfixUnaryExpression */: - case 190 /* PrefixUnaryExpression */: - return substituteUnaryExpression(node); - } - return node; - } - /** - * Substitution for an Identifier expression that may contain an imported or exported - * symbol. - * - * @param node The node to substitute. - */ - function substituteExpressionIdentifier(node) { - if (ts.getEmitFlags(node) & 4096 /* HelperName */) { - var externalHelpersModuleName = ts.getExternalHelpersModuleName(currentSourceFile); - if (externalHelpersModuleName) { - return ts.createPropertyAccess(externalHelpersModuleName, node); - } - return node; - } - if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { - var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node)); - if (exportContainer && exportContainer.kind === 261 /* SourceFile */) { - return ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node), - /*location*/ node); - } - var importDeclaration = resolver.getReferencedImportDeclaration(node); - if (importDeclaration) { - if (ts.isImportClause(importDeclaration)) { - return ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent), ts.createIdentifier("default"), - /*location*/ node); - } - else if (ts.isImportSpecifier(importDeclaration)) { - var name_39 = importDeclaration.propertyName || importDeclaration.name; - return ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent.parent.parent), ts.getSynthesizedClone(name_39), + return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent.parent.parent), ts.getSynthesizedClone(importDeclaration.propertyName || importDeclaration.name)), /*location*/ node); } } @@ -57240,9 +61178,7 @@ var ts; var expression = node; for (var _i = 0, exportedNames_3 = exportedNames; _i < exportedNames_3.length; _i++) { var exportName = exportedNames_3[_i]; - // Mark the node to prevent triggering this rule again. - noSubstitution[ts.getNodeId(expression)] = true; - expression = createExportExpression(exportName, expression, /*location*/ node); + expression = createExportExpression(exportName, preventSubstitution(expression)); } return expression; } @@ -57264,22 +61200,24 @@ var ts; // - We do not substitute identifiers that were originally the name of an enum or // namespace due to how they are transformed in TypeScript. // - We only substitute identifiers that are exported at the top level. - if ((node.operator === 42 /* PlusPlusToken */ || node.operator === 43 /* MinusMinusToken */) + if ((node.operator === 43 /* PlusPlusToken */ || node.operator === 44 /* MinusMinusToken */) && ts.isIdentifier(node.operand) && !ts.isGeneratedIdentifier(node.operand) && !ts.isLocalName(node.operand) && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 191 /* PostfixUnaryExpression */ - ? ts.createBinary(node.operand, ts.createToken(node.operator === 42 /* PlusPlusToken */ ? 58 /* PlusEqualsToken */ : 59 /* MinusEqualsToken */), ts.createLiteral(1), - /*location*/ node) + var expression = node.kind === 193 /* 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]; - // Mark the node to prevent triggering this rule again. - noSubstitution[ts.getNodeId(expression)] = true; - expression = createExportExpression(exportName, expression); + expression = createExportExpression(exportName, preventSubstitution(expression)); + } + if (node.kind === 193 /* PostfixUnaryExpression */) { + expression = node.operator === 43 /* PlusPlusToken */ + ? ts.createSubtract(preventSubstitution(expression), ts.createLiteral(1)) + : ts.createAdd(preventSubstitution(expression), ts.createLiteral(1)); } return expression; } @@ -57287,29 +61225,144 @@ var ts; return node; } /** - * Gets the additional exports of a name. + * Gets the exports of a name. * * @param name The name. */ function getExports(name) { + var exportedNames; if (!ts.isGeneratedIdentifier(name)) { var valueDeclaration = resolver.getReferencedImportDeclaration(name) || resolver.getReferencedValueDeclaration(name); if (valueDeclaration) { - return currentModuleInfo - && currentModuleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]; + var exportContainer = resolver.getReferencedExportContainer(name, /*prefixLocals*/ false); + if (exportContainer && exportContainer.kind === 265 /* SourceFile */) { + exportedNames = ts.append(exportedNames, ts.getDeclarationName(valueDeclaration)); + } + exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]); } } + return exportedNames; + } + /** + * Prevent substitution of a node for this transformer. + * + * @param node The node which should not be substituted. + */ + function preventSubstitution(node) { + if (noSubstitution === undefined) + noSubstitution = []; + noSubstitution[ts.getNodeId(node)] = true; + return node; + } + /** + * Determines whether a node should not be substituted. + * + * @param node The node to test. + */ + function isSubstitutionPrevented(node) { + return noSubstitution && node.id && noSubstitution[node.id]; } - var _a; } - ts.transformModule = transformModule; - // emit output for the __export helper function - var exportStarHelper = { - name: "typescript:export-star", - scoped: true, - text: "\n function __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n }" - }; + ts.transformSystemModule = transformSystemModule; +})(ts || (ts = {})); +/// +/// +/*@internal*/ +var ts; +(function (ts) { + function transformES2015Module(context) { + var compilerOptions = context.getCompilerOptions(); + var previousOnEmitNode = context.onEmitNode; + var previousOnSubstituteNode = context.onSubstituteNode; + context.onEmitNode = onEmitNode; + context.onSubstituteNode = onSubstituteNode; + context.enableEmitNotification(265 /* SourceFile */); + context.enableSubstitution(71 /* Identifier */); + var currentSourceFile; + return transformSourceFile; + function transformSourceFile(node) { + if (ts.isDeclarationFile(node)) { + return node; + } + if (ts.isExternalModule(node) || compilerOptions.isolatedModules) { + var externalHelpersModuleName = ts.getOrCreateExternalHelpersModuleNameIfNeeded(node, compilerOptions); + if (externalHelpersModuleName) { + var statements = []; + var statementOffset = ts.addPrologue(statements, node.statements); + ts.append(statements, ts.createImportDeclaration( + /*decorators*/ undefined, + /*modifiers*/ undefined, ts.createImportClause(/*name*/ undefined, ts.createNamespaceImport(externalHelpersModuleName)), ts.createLiteral(ts.externalHelpersModuleNameText))); + ts.addRange(statements, ts.visitNodes(node.statements, visitor, ts.isStatement, statementOffset)); + return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray(statements), node.statements)); + } + else { + return ts.visitEachChild(node, visitor, context); + } + } + return node; + } + function visitor(node) { + switch (node.kind) { + case 237 /* ImportEqualsDeclaration */: + // Elide `import=` as it is not legal with --module ES6 + return undefined; + case 243 /* ExportAssignment */: + return visitExportAssignment(node); + } + return node; + } + function visitExportAssignment(node) { + // Elide `export=` as it is not legal with --module ES6 + return node.isExportEquals ? undefined : node; + } + // + // Emit Notification + // + /** + * Hook for node emit. + * + * @param hint A hint as to the intended usage of the node. + * @param node The node to emit. + * @param emit A callback used to emit the node in the printer. + */ + function onEmitNode(hint, node, emitCallback) { + if (ts.isSourceFile(node)) { + currentSourceFile = node; + previousOnEmitNode(hint, node, emitCallback); + currentSourceFile = undefined; + } + else { + previousOnEmitNode(hint, node, emitCallback); + } + } + // + // Substitutions + // + /** + * Hooks node substitutions. + * + * @param hint A hint as to the intended usage of the node. + * @param node The node to substitute. + */ + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (ts.isIdentifier(node) && hint === 1 /* Expression */) { + return substituteExpressionIdentifier(node); + } + return node; + } + function substituteExpressionIdentifier(node) { + if (ts.getEmitFlags(node) & 4096 /* HelperName */) { + var externalHelpersModuleName = ts.getExternalHelpersModuleName(currentSourceFile); + if (externalHelpersModuleName) { + return ts.createPropertyAccess(externalHelpersModuleName, node); + } + } + return node; + } + } + ts.transformES2015Module = transformES2015Module; })(ts || (ts = {})); /// /// @@ -57326,24 +61379,34 @@ var ts; /* @internal */ var ts; (function (ts) { - var moduleTransformerMap = ts.createMap((_a = {}, - _a[ts.ModuleKind.ES2015] = ts.transformES2015Module, - _a[ts.ModuleKind.System] = ts.transformSystemModule, - _a[ts.ModuleKind.AMD] = ts.transformModule, - _a[ts.ModuleKind.CommonJS] = ts.transformModule, - _a[ts.ModuleKind.UMD] = ts.transformModule, - _a[ts.ModuleKind.None] = ts.transformModule, - _a)); + function getModuleTransformer(moduleKind) { + switch (moduleKind) { + case ts.ModuleKind.ES2015: + return ts.transformES2015Module; + case ts.ModuleKind.System: + return ts.transformSystemModule; + default: + return ts.transformModule; + } + } + var TransformationState; + (function (TransformationState) { + TransformationState[TransformationState["Uninitialized"] = 0] = "Uninitialized"; + TransformationState[TransformationState["Initialized"] = 1] = "Initialized"; + TransformationState[TransformationState["Completed"] = 2] = "Completed"; + TransformationState[TransformationState["Disposed"] = 3] = "Disposed"; + })(TransformationState || (TransformationState = {})); var SyntaxKindFeatureFlags; (function (SyntaxKindFeatureFlags) { SyntaxKindFeatureFlags[SyntaxKindFeatureFlags["Substitution"] = 1] = "Substitution"; SyntaxKindFeatureFlags[SyntaxKindFeatureFlags["EmitNotifications"] = 2] = "EmitNotifications"; })(SyntaxKindFeatureFlags || (SyntaxKindFeatureFlags = {})); - function getTransformers(compilerOptions) { + function getTransformers(compilerOptions, customTransformers) { var jsx = compilerOptions.jsx; var languageVersion = ts.getEmitScriptTarget(compilerOptions); var moduleKind = ts.getEmitModuleKind(compilerOptions); var transformers = []; + ts.addRange(transformers, customTransformers && customTransformers.before); transformers.push(ts.transformTypeScript); if (jsx === 2 /* React */) { transformers.push(ts.transformJsx); @@ -57361,12 +61424,13 @@ var ts; transformers.push(ts.transformES2015); transformers.push(ts.transformGenerators); } - transformers.push(moduleTransformerMap[moduleKind] || moduleTransformerMap[ts.ModuleKind.None]); + transformers.push(getModuleTransformer(moduleKind)); // The ES5 transformer is last so that it can substitute expressions like `exports.default` // for ES3. if (languageVersion < 1 /* ES5 */) { transformers.push(ts.transformES5); } + ts.addRange(transformers, customTransformers && customTransformers.after); return transformers; } ts.getTransformers = getTransformers; @@ -57374,13 +61438,14 @@ var ts; * Transforms an array of SourceFiles by passing them through each transformer. * * @param resolver The emit resolver provided by the checker. - * @param host The emit host. - * @param sourceFiles An array of source files - * @param transforms An array of Transformers. + * @param host The emit host object used to interact with the file system. + * @param options Compiler options to surface in the `TransformationContext`. + * @param nodes An array of nodes to transform. + * @param transforms An array of `TransformerFactory` callbacks. + * @param allowDtsFiles A value indicating whether to allow the transformation of .d.ts files. */ - function transformFiles(resolver, host, sourceFiles, transformers) { - var enabledSyntaxKindFeatures = new Array(297 /* Count */); - var lexicalEnvironmentDisabled = false; + function transformNodes(resolver, host, options, nodes, transformers, allowDtsFiles) { + var enabledSyntaxKindFeatures = new Array(299 /* Count */); var lexicalEnvironmentVariableDeclarations; var lexicalEnvironmentFunctionDeclarations; var lexicalEnvironmentVariableDeclarationsStack = []; @@ -57388,10 +61453,13 @@ var ts; var lexicalEnvironmentStackOffset = 0; var lexicalEnvironmentSuspended = false; var emitHelpers; + var onSubstituteNode = function (_, node) { return node; }; + var onEmitNode = function (hint, node, callback) { return callback(hint, node); }; + var state = 0 /* Uninitialized */; // The transformation context is provided to each transformer as part of transformer // initialization. var context = { - getCompilerOptions: function () { return host.getCompilerOptions(); }, + getCompilerOptions: function () { return options; }, getEmitResolver: function () { return resolver; }, getEmitHost: function () { return host; }, startLexicalEnvironment: startLexicalEnvironment, @@ -57402,39 +61470,53 @@ var ts; hoistFunctionDeclaration: hoistFunctionDeclaration, requestEmitHelper: requestEmitHelper, readEmitHelpers: readEmitHelpers, - onSubstituteNode: function (_emitContext, node) { return node; }, enableSubstitution: enableSubstitution, - isSubstitutionEnabled: isSubstitutionEnabled, - onEmitNode: function (node, emitContext, emitCallback) { return emitCallback(node, emitContext); }, enableEmitNotification: enableEmitNotification, - isEmitNotificationEnabled: isEmitNotificationEnabled + isSubstitutionEnabled: isSubstitutionEnabled, + isEmitNotificationEnabled: isEmitNotificationEnabled, + get onSubstituteNode() { return onSubstituteNode; }, + set onSubstituteNode(value) { + ts.Debug.assert(state < 1 /* Initialized */, "Cannot modify transformation hooks after initialization has completed."); + ts.Debug.assert(value !== undefined, "Value must not be 'undefined'"); + onSubstituteNode = value; + }, + get onEmitNode() { return onEmitNode; }, + set onEmitNode(value) { + ts.Debug.assert(state < 1 /* Initialized */, "Cannot modify transformation hooks after initialization has completed."); + ts.Debug.assert(value !== undefined, "Value must not be 'undefined'"); + onEmitNode = value; + } }; + // Ensure the parse tree is clean before applying transformations + for (var _i = 0, nodes_4 = nodes; _i < nodes_4.length; _i++) { + var node = nodes_4[_i]; + ts.disposeEmitNodes(ts.getSourceFileOfNode(ts.getParseTreeNode(node))); + } + ts.performance.mark("beforeTransform"); // Chain together and initialize each transformer. var transformation = ts.chain.apply(void 0, transformers)(context); - // Transform each source file. - var transformed = ts.map(sourceFiles, transformSourceFile); - // Disable modification of the lexical environment. - lexicalEnvironmentDisabled = true; + // prevent modification of transformation hooks. + state = 1 /* Initialized */; + // Transform each node. + var transformed = ts.map(nodes, allowDtsFiles ? transformation : transformRoot); + // prevent modification of the lexical environment. + state = 2 /* Completed */; + ts.performance.mark("afterTransform"); + ts.performance.measure("transformTime", "beforeTransform", "afterTransform"); return { transformed: transformed, - emitNodeWithSubstitution: emitNodeWithSubstitution, - emitNodeWithNotification: emitNodeWithNotification + substituteNode: substituteNode, + emitNodeWithNotification: emitNodeWithNotification, + dispose: dispose }; - /** - * Transforms a source file. - * - * @param sourceFile The source file to transform. - */ - function transformSourceFile(sourceFile) { - if (ts.isDeclarationFile(sourceFile)) { - return sourceFile; - } - return transformation(sourceFile); + function transformRoot(node) { + return node && (!ts.isSourceFile(node) || !ts.isDeclarationFile(node)) ? transformation(node) : node; } /** * Enables expression substitutions in the pretty printer for the provided SyntaxKind. */ function enableSubstitution(kind) { + ts.Debug.assert(state < 2 /* Completed */, "Cannot modify the transformation context after transformation has completed."); enabledSyntaxKindFeatures[kind] |= 1 /* Substitution */; } /** @@ -57447,26 +61529,19 @@ var ts; /** * Emits a node with possible substitution. * - * @param emitContext The current emit context. + * @param hint A hint as to the intended usage of the node. * @param node The node to emit. * @param emitCallback The callback used to emit the node or its substitute. */ - function emitNodeWithSubstitution(emitContext, node, emitCallback) { - if (node) { - if (isSubstitutionEnabled(node)) { - var substitute = context.onSubstituteNode(emitContext, node); - if (substitute && substitute !== node) { - emitCallback(emitContext, substitute); - return; - } - } - emitCallback(emitContext, node); - } + function substituteNode(hint, node) { + ts.Debug.assert(state < 3 /* Disposed */, "Cannot substitute a node after the result is disposed."); + return node && isSubstitutionEnabled(node) && onSubstituteNode(hint, node) || node; } /** * Enables before/after emit notifications in the pretty printer for the provided SyntaxKind. */ function enableEmitNotification(kind) { + ts.Debug.assert(state < 2 /* Completed */, "Cannot modify the transformation context after transformation has completed."); enabledSyntaxKindFeatures[kind] |= 2 /* EmitNotifications */; } /** @@ -57480,17 +61555,18 @@ var ts; /** * Emits a node with possible emit notification. * - * @param emitContext The current emit context. + * @param hint A hint as to the intended usage of the node. * @param node The node to emit. * @param emitCallback The callback used to emit the node. */ - function emitNodeWithNotification(emitContext, node, emitCallback) { + function emitNodeWithNotification(hint, node, emitCallback) { + ts.Debug.assert(state < 3 /* Disposed */, "Cannot invoke TransformationResult callbacks after the result is disposed."); if (node) { if (isEmitNotificationEnabled(node)) { - context.onEmitNode(emitContext, node, emitCallback); + onEmitNode(hint, node, emitCallback); } else { - emitCallback(emitContext, node); + emitCallback(hint, node); } } } @@ -57498,7 +61574,8 @@ var ts; * Records a hoisted variable declaration for the provided name within a lexical environment. */ function hoistVariableDeclaration(name) { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot modify the lexical environment during the print phase."); + ts.Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the lexical environment during initialization."); + ts.Debug.assert(state < 2 /* Completed */, "Cannot modify the lexical environment after transformation has completed."); var decl = ts.createVariableDeclaration(name); if (!lexicalEnvironmentVariableDeclarations) { lexicalEnvironmentVariableDeclarations = [decl]; @@ -57511,7 +61588,8 @@ var ts; * Records a hoisted function declaration within a lexical environment. */ function hoistFunctionDeclaration(func) { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot modify the lexical environment during the print phase."); + ts.Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the lexical environment during initialization."); + ts.Debug.assert(state < 2 /* Completed */, "Cannot modify the lexical environment after transformation has completed."); if (!lexicalEnvironmentFunctionDeclarations) { lexicalEnvironmentFunctionDeclarations = [func]; } @@ -57524,7 +61602,8 @@ var ts; * are pushed onto a stack, and the related storage variables are reset. */ function startLexicalEnvironment() { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot start a lexical environment during the print phase."); + ts.Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the lexical environment during initialization."); + ts.Debug.assert(state < 2 /* Completed */, "Cannot modify the lexical environment after transformation has completed."); ts.Debug.assert(!lexicalEnvironmentSuspended, "Lexical environment is suspended."); // Save the current lexical environment. Rather than resizing the array we adjust the // stack size variable. This allows us to reuse existing array slots we've @@ -57538,13 +61617,15 @@ var ts; } /** Suspends the current lexical environment, usually after visiting a parameter list. */ function suspendLexicalEnvironment() { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot suspend a lexical environment during the print phase."); + ts.Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the lexical environment during initialization."); + ts.Debug.assert(state < 2 /* Completed */, "Cannot modify the lexical environment after transformation has completed."); ts.Debug.assert(!lexicalEnvironmentSuspended, "Lexical environment is already suspended."); lexicalEnvironmentSuspended = true; } /** Resumes a suspended lexical environment, usually before visiting a function body. */ function resumeLexicalEnvironment() { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot resume a lexical environment during the print phase."); + ts.Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the lexical environment during initialization."); + ts.Debug.assert(state < 2 /* Completed */, "Cannot modify the lexical environment after transformation has completed."); ts.Debug.assert(lexicalEnvironmentSuspended, "Lexical environment is not suspended."); lexicalEnvironmentSuspended = false; } @@ -57553,7 +61634,8 @@ var ts; * any hoisted declarations added in this environment are returned. */ function endLexicalEnvironment() { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot end a lexical environment during the print phase."); + ts.Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the lexical environment during initialization."); + ts.Debug.assert(state < 2 /* Completed */, "Cannot modify the lexical environment after transformation has completed."); ts.Debug.assert(!lexicalEnvironmentSuspended, "Lexical environment is suspended."); var statements; if (lexicalEnvironmentVariableDeclarations || lexicalEnvironmentFunctionDeclarations) { @@ -57582,19 +61664,39 @@ var ts; return statements; } function requestEmitHelper(helper) { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot modify the lexical environment during the print phase."); + ts.Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the transformation context during initialization."); + ts.Debug.assert(state < 2 /* Completed */, "Cannot modify the transformation context after transformation has completed."); ts.Debug.assert(!helper.scoped, "Cannot request a scoped emit helper."); emitHelpers = ts.append(emitHelpers, helper); } function readEmitHelpers() { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot modify the lexical environment during the print phase."); + ts.Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the transformation context during initialization."); + ts.Debug.assert(state < 2 /* Completed */, "Cannot modify the transformation context after transformation has completed."); var helpers = emitHelpers; emitHelpers = undefined; return helpers; } + function dispose() { + if (state < 3 /* Disposed */) { + // Clean up emit nodes on parse tree + for (var _i = 0, nodes_5 = nodes; _i < nodes_5.length; _i++) { + var node = nodes_5[_i]; + ts.disposeEmitNodes(ts.getSourceFileOfNode(ts.getParseTreeNode(node))); + } + // Release references to external entries for GC purposes. + lexicalEnvironmentVariableDeclarations = undefined; + lexicalEnvironmentVariableDeclarationsStack = undefined; + lexicalEnvironmentFunctionDeclarations = undefined; + lexicalEnvironmentFunctionDeclarationsStack = undefined; + onSubstituteNode = undefined; + onEmitNode = undefined; + emitHelpers = undefined; + // Prevent further use of the transformation result. + state = 3 /* Disposed */; + } + } } - ts.transformFiles = transformFiles; - var _a; + ts.transformNodes = transformNodes; })(ts || (ts = {})); /// /* @internal */ @@ -57639,10 +61741,9 @@ var ts; * * @param filePath The path to the generated output file. * @param sourceMapFilePath The path to the output source map file. - * @param sourceFiles The input source files for the program. - * @param isBundledEmit A value indicating whether the generated output file is a bundle. + * @param sourceFileOrBundle The input source file or bundle for the program. */ - function initialize(filePath, sourceMapFilePath, sourceFiles, isBundledEmit) { + function initialize(filePath, sourceMapFilePath, sourceFileOrBundle) { if (disabled) { return; } @@ -57678,11 +61779,10 @@ var ts; } if (compilerOptions.mapRoot) { sourceMapDir = ts.normalizeSlashes(compilerOptions.mapRoot); - if (!isBundledEmit) { - ts.Debug.assert(sourceFiles.length === 1); + if (sourceFileOrBundle.kind === 265 /* SourceFile */) { // 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(sourceFiles[0], host, sourceMapDir)); + sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(sourceFileOrBundle, host, sourceMapDir)); } if (!ts.isRootedDiskPath(sourceMapDir) && !ts.isUrl(sourceMapDir)) { // The relative paths are relative to the common directory @@ -57805,31 +61905,32 @@ var ts; /** * Emits a node with possible leading and trailing source maps. * + * @param hint A hint as to the intended usage of the node. * @param node The node to emit. * @param emitCallback The callback used to emit the node. */ - function emitNodeWithSourceMap(emitContext, node, emitCallback) { + function emitNodeWithSourceMap(hint, node, emitCallback) { if (disabled) { - return emitCallback(emitContext, node); + return emitCallback(hint, node); } if (node) { var emitNode = node.emitNode; var emitFlags = emitNode && emitNode.flags; var _a = emitNode && emitNode.sourceMapRange || node, pos = _a.pos, end = _a.end; - if (node.kind !== 293 /* NotEmittedStatement */ + if (node.kind !== 295 /* NotEmittedStatement */ && (emitFlags & 16 /* NoLeadingSourceMap */) === 0 && pos >= 0) { emitPos(ts.skipTrivia(currentSourceText, pos)); } if (emitFlags & 64 /* NoNestedSourceMaps */) { disabled = true; - emitCallback(emitContext, node); + emitCallback(hint, node); disabled = false; } else { - emitCallback(emitContext, node); + emitCallback(hint, node); } - if (node.kind !== 293 /* NotEmittedStatement */ + if (node.kind !== 295 /* NotEmittedStatement */ && (emitFlags & 32 /* NoTrailingSourceMap */) === 0 && end >= 0) { emitPos(end); @@ -57964,11 +62065,10 @@ var ts; /* @internal */ var ts; (function (ts) { - function createCommentWriter(host, writer, sourceMap) { - var compilerOptions = host.getCompilerOptions(); - var extendedDiagnostics = compilerOptions.extendedDiagnostics; - var newLine = host.getNewLine(); - var emitPos = sourceMap.emitPos; + function createCommentWriter(printerOptions, emitPos) { + var extendedDiagnostics = printerOptions.extendedDiagnostics; + var newLine = ts.getNewLineCharacter(printerOptions); + var writer; var containerPos = -1; var containerEnd = -1; var declarationListContainerEnd = -1; @@ -57977,38 +62077,35 @@ var ts; var currentLineMap; var detachedCommentsInfo; var hasWrittenComment = false; - var disabled = compilerOptions.removeComments; + var disabled = printerOptions.removeComments; return { reset: reset, + setWriter: setWriter, setSourceFile: setSourceFile, emitNodeWithComments: emitNodeWithComments, emitBodyWithDetachedComments: emitBodyWithDetachedComments, emitTrailingCommentsOfPosition: emitTrailingCommentsOfPosition, + emitLeadingCommentsOfPosition: emitLeadingCommentsOfPosition, }; - function emitNodeWithComments(emitContext, node, emitCallback) { + function emitNodeWithComments(hint, node, emitCallback) { if (disabled) { - emitCallback(emitContext, node); + emitCallback(hint, node); return; } if (node) { - var _a = ts.getCommentRange(node), pos = _a.pos, end = _a.end; - var emitFlags = ts.getEmitFlags(node); + hasWrittenComment = false; + var emitNode = node.emitNode; + var emitFlags = emitNode && emitNode.flags; + var _a = emitNode && emitNode.commentRange || node, pos = _a.pos, end = _a.end; if ((pos < 0 && end < 0) || (pos === end)) { // Both pos and end are synthesized, so just emit the node without comments. - if (emitFlags & 2048 /* NoNestedComments */) { - disabled = true; - emitCallback(emitContext, node); - disabled = false; - } - else { - emitCallback(emitContext, node); - } + emitNodeWithSynthesizedComments(hint, node, emitNode, emitFlags, emitCallback); } else { if (extendedDiagnostics) { ts.performance.mark("preEmitNodeWithComment"); } - var isEmittedNode = node.kind !== 293 /* NotEmittedStatement */; + var isEmittedNode = node.kind !== 295 /* NotEmittedStatement */; var skipLeadingComments = pos < 0 || (emitFlags & 512 /* NoLeadingComments */) !== 0; var skipTrailingComments = end < 0 || (emitFlags & 1024 /* NoTrailingComments */) !== 0; // Emit leading comments if the position is not synthesized and the node @@ -58027,23 +62124,16 @@ 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 === 224 /* VariableDeclarationList */) { + if (node.kind === 227 /* VariableDeclarationList */) { declarationListContainerEnd = end; } } if (extendedDiagnostics) { ts.performance.measure("commentTime", "preEmitNodeWithComment"); } - if (emitFlags & 2048 /* NoNestedComments */) { - disabled = true; - emitCallback(emitContext, node); - disabled = false; - } - else { - emitCallback(emitContext, node); - } + emitNodeWithSynthesizedComments(hint, node, emitNode, emitFlags, emitCallback); if (extendedDiagnostics) { - ts.performance.mark("beginEmitNodeWithComment"); + ts.performance.mark("postEmitNodeWithComment"); } // Restore previous container state. containerPos = savedContainerPos; @@ -58055,11 +62145,75 @@ var ts; emitTrailingComments(end); } if (extendedDiagnostics) { - ts.performance.measure("commentTime", "beginEmitNodeWithComment"); + ts.performance.measure("commentTime", "postEmitNodeWithComment"); } } } } + function emitNodeWithSynthesizedComments(hint, node, emitNode, emitFlags, emitCallback) { + var leadingComments = emitNode && emitNode.leadingComments; + if (ts.some(leadingComments)) { + if (extendedDiagnostics) { + ts.performance.mark("preEmitNodeWithSynthesizedComments"); + } + ts.forEach(leadingComments, emitLeadingSynthesizedComment); + if (extendedDiagnostics) { + ts.performance.measure("commentTime", "preEmitNodeWithSynthesizedComments"); + } + } + emitNodeWithNestedComments(hint, node, emitFlags, emitCallback); + var trailingComments = emitNode && emitNode.trailingComments; + if (ts.some(trailingComments)) { + if (extendedDiagnostics) { + ts.performance.mark("postEmitNodeWithSynthesizedComments"); + } + ts.forEach(trailingComments, emitTrailingSynthesizedComment); + if (extendedDiagnostics) { + ts.performance.measure("commentTime", "postEmitNodeWithSynthesizedComments"); + } + } + } + function emitLeadingSynthesizedComment(comment) { + if (comment.kind === 2 /* SingleLineCommentTrivia */) { + writer.writeLine(); + } + writeSynthesizedComment(comment); + if (comment.hasTrailingNewLine || comment.kind === 2 /* SingleLineCommentTrivia */) { + writer.writeLine(); + } + else { + writer.write(" "); + } + } + function emitTrailingSynthesizedComment(comment) { + if (!writer.isAtStartOfLine()) { + writer.write(" "); + } + writeSynthesizedComment(comment); + if (comment.hasTrailingNewLine) { + writer.writeLine(); + } + } + function writeSynthesizedComment(comment) { + var text = formatSynthesizedComment(comment); + var lineMap = comment.kind === 3 /* MultiLineCommentTrivia */ ? ts.computeLineStarts(text) : undefined; + ts.writeCommentRange(text, lineMap, writer, 0, text.length, newLine); + } + function formatSynthesizedComment(comment) { + return comment.kind === 3 /* MultiLineCommentTrivia */ + ? "/*" + comment.text + "*/" + : "//" + comment.text; + } + function emitNodeWithNestedComments(hint, node, emitFlags, emitCallback) { + if (emitFlags & 2048 /* NoNestedComments */) { + disabled = true; + emitCallback(hint, node); + disabled = false; + } + else { + emitCallback(hint, node); + } + } function emitBodyWithDetachedComments(node, detachedRange, emitCallback) { if (extendedDiagnostics) { ts.performance.mark("preEmitBodyWithDetachedComments"); @@ -58123,9 +62277,11 @@ var ts; hasWrittenComment = true; } // Leading comments are emitted at /*leading comment1 */space/*leading comment*/space - emitPos(commentPos); + if (emitPos) + emitPos(commentPos); ts.writeCommentRange(currentText, currentLineMap, writer, commentPos, commentEnd, newLine); - emitPos(commentEnd); + if (emitPos) + emitPos(commentEnd); if (hasTrailingNewLine) { writer.writeLine(); } @@ -58133,6 +62289,12 @@ var ts; writer.write(" "); } } + function emitLeadingCommentsOfPosition(pos) { + if (disabled || pos === -1) { + return; + } + emitLeadingComments(pos, /*isEmittedNode*/ true); + } function emitTrailingComments(pos) { forEachTrailingCommentToEmit(pos, emitTrailingComment); } @@ -58141,9 +62303,11 @@ var ts; if (!writer.isAtStartOfLine()) { writer.write(" "); } - emitPos(commentPos); + if (emitPos) + emitPos(commentPos); ts.writeCommentRange(currentText, currentLineMap, writer, commentPos, commentEnd, newLine); - emitPos(commentEnd); + if (emitPos) + emitPos(commentEnd); if (hasTrailingNewLine) { writer.writeLine(); } @@ -58162,9 +62326,11 @@ var ts; } function emitTrailingCommentOfPosition(commentPos, commentEnd, _kind, hasTrailingNewLine) { // trailing comments of a position are emitted at /*trailing comment1 */space/*trailing comment*/space - emitPos(commentPos); + if (emitPos) + emitPos(commentPos); ts.writeCommentRange(currentText, currentLineMap, writer, commentPos, commentEnd, newLine); - emitPos(commentEnd); + if (emitPos) + emitPos(commentEnd); if (hasTrailingNewLine) { writer.writeLine(); } @@ -58195,6 +62361,9 @@ var ts; currentLineMap = undefined; detachedCommentsInfo = undefined; } + function setWriter(output) { + writer = output; + } function setSourceFile(sourceFile) { currentSourceFile = sourceFile; currentText = currentSourceFile.text; @@ -58227,15 +62396,17 @@ var ts; } } function writeComment(text, lineMap, writer, commentPos, commentEnd, newLine) { - emitPos(commentPos); + if (emitPos) + emitPos(commentPos); ts.writeCommentRange(text, lineMap, writer, commentPos, commentEnd, newLine); - emitPos(commentEnd); + if (emitPos) + emitPos(commentEnd); } /** * Determine if the given comment is a triple-slash * * @return true if the comment is a triple-slash comment else false - **/ + */ function isTripleSlashComment(commentPos, commentEnd) { // Verify this is /// comment, but do the regexp match only when we first can find /// in the comment text // so that we don't end up computing comment string and doing match for all // comments @@ -58258,15 +62429,17 @@ var ts; (function (ts) { function getDeclarationDiagnostics(host, resolver, targetSourceFile) { var declarationDiagnostics = ts.createDiagnosticCollection(); - ts.forEachExpectedEmitFile(host, getDeclarationDiagnosticsFromFile, targetSourceFile); + ts.forEachEmittedFile(host, getDeclarationDiagnosticsFromFile, targetSourceFile); return declarationDiagnostics.getDiagnostics(targetSourceFile ? targetSourceFile.fileName : undefined); - function getDeclarationDiagnosticsFromFile(_a, sources, isBundledEmit) { + function getDeclarationDiagnosticsFromFile(_a, sourceFileOrBundle) { var declarationFilePath = _a.declarationFilePath; - emitDeclarations(host, resolver, declarationDiagnostics, declarationFilePath, sources, isBundledEmit, /*emitOnlyDtsFiles*/ false); + emitDeclarations(host, resolver, declarationDiagnostics, declarationFilePath, sourceFileOrBundle, /*emitOnlyDtsFiles*/ false); } } ts.getDeclarationDiagnostics = getDeclarationDiagnostics; - function emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFiles, isBundledEmit, emitOnlyDtsFiles) { + function emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFileOrBundle, emitOnlyDtsFiles) { + var sourceFiles = sourceFileOrBundle.kind === 266 /* Bundle */ ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; + var isBundledEmit = sourceFileOrBundle.kind === 266 /* Bundle */; var newLine = host.getNewLine(); var compilerOptions = host.getCompilerOptions(); var write; @@ -58286,7 +62459,7 @@ var ts; var errorNameNode; var emitJsDocComments = compilerOptions.removeComments ? ts.noop : writeJsDocComments; var emit = compilerOptions.stripInternal ? stripInternal : emitNode; - var noDeclare; + var needsDeclare = true; var moduleElementDeclarationEmitInfo = []; var asynchronousSubModuleDeclarationEmitInfo; // Contains the reference paths that needs to go in the declaration file. @@ -58322,11 +62495,11 @@ var ts; } resultHasExternalModuleIndicator = false; if (!isBundledEmit || !ts.isExternalModule(sourceFile)) { - noDeclare = false; + needsDeclare = true; emitSourceFile(sourceFile); } else if (ts.isExternalModule(sourceFile)) { - noDeclare = true; + needsDeclare = false; write("declare module \"" + ts.getResolvedExternalModuleName(host, sourceFile) + "\" {"); writeLine(); increaseIndent(); @@ -58340,7 +62513,7 @@ var ts; var oldWriter = writer; ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { if (aliasEmitInfo.isVisible && !aliasEmitInfo.asynchronousOutput) { - ts.Debug.assert(aliasEmitInfo.node.kind === 235 /* ImportDeclaration */); + ts.Debug.assert(aliasEmitInfo.node.kind === 238 /* ImportDeclaration */); createAndSetNewTextWriterWithSymbolWriter(); ts.Debug.assert(aliasEmitInfo.indent === 0 || (aliasEmitInfo.indent === 1 && isBundledEmit)); for (var i = 0; i < aliasEmitInfo.indent; i++) { @@ -58366,9 +62539,9 @@ var ts; } }); if (usedTypeDirectiveReferences) { - for (var directive in usedTypeDirectiveReferences) { + ts.forEachKey(usedTypeDirectiveReferences, function (directive) { referencesOutput += "/// " + newLine; - } + }); } return { reportedDeclarationError: reportedDeclarationError, @@ -58393,6 +62566,7 @@ var ts; var writer = ts.createTextWriter(newLine); writer.trackSymbol = trackSymbol; writer.reportInaccessibleThisError = reportInaccessibleThisError; + writer.reportIllegalExtends = reportIllegalExtends; writer.writeKeyword = writer.write; writer.writeOperator = writer.write; writer.writePunctuation = writer.write; @@ -58415,10 +62589,10 @@ var ts; var oldWriter = writer; ts.forEach(nodes, function (declaration) { var nodeToCheck; - if (declaration.kind === 223 /* VariableDeclaration */) { + if (declaration.kind === 226 /* VariableDeclaration */) { nodeToCheck = declaration.parent.parent; } - else if (declaration.kind === 238 /* NamedImports */ || declaration.kind === 239 /* ImportSpecifier */ || declaration.kind === 236 /* ImportClause */) { + else if (declaration.kind === 241 /* NamedImports */ || declaration.kind === 242 /* ImportSpecifier */ || declaration.kind === 239 /* ImportClause */) { ts.Debug.fail("We should be getting ImportDeclaration instead to write"); } else { @@ -58436,7 +62610,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 === 235 /* ImportDeclaration */) { + if (moduleElementEmitInfo.node.kind === 238 /* 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; @@ -58446,12 +62620,12 @@ var ts; for (var declarationIndent = moduleElementEmitInfo.indent; declarationIndent; declarationIndent--) { increaseIndent(); } - if (nodeToCheck.kind === 230 /* ModuleDeclaration */) { + if (nodeToCheck.kind === 233 /* ModuleDeclaration */) { ts.Debug.assert(asynchronousSubModuleDeclarationEmitInfo === undefined); asynchronousSubModuleDeclarationEmitInfo = []; } writeModuleElement(nodeToCheck); - if (nodeToCheck.kind === 230 /* ModuleDeclaration */) { + if (nodeToCheck.kind === 233 /* ModuleDeclaration */) { moduleElementEmitInfo.subModuleElementDeclarationEmitInfo = asynchronousSubModuleDeclarationEmitInfo; asynchronousSubModuleDeclarationEmitInfo = undefined; } @@ -58470,8 +62644,8 @@ var ts; } for (var _i = 0, typeReferenceDirectives_1 = typeReferenceDirectives; _i < typeReferenceDirectives_1.length; _i++) { var directive = typeReferenceDirectives_1[_i]; - if (!(directive in usedTypeDirectiveReferences)) { - usedTypeDirectiveReferences[directive] = directive; + if (!usedTypeDirectiveReferences.has(directive)) { + usedTypeDirectiveReferences.set(directive, directive); } } } @@ -58500,6 +62674,12 @@ var ts; handleSymbolAccessibilityError(resolver.isSymbolAccessible(symbol, enclosingDeclaration, meaning, /*shouldComputeAliasesToMakeVisible*/ true)); recordTypeReferenceDirectivesIfNecessary(resolver.getTypeReferenceDirectivesForSymbol(symbol, meaning)); } + function reportIllegalExtends() { + if (errorNameNode) { + reportedDeclarationError = true; + emitterDiagnostics.add(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.extends_clause_of_exported_class_0_refers_to_a_type_whose_name_cannot_be_referenced, ts.declarationNameToString(errorNameNode))); + } + } function reportInaccessibleThisError() { if (errorNameNode) { reportedDeclarationError = true; @@ -58509,13 +62689,19 @@ var ts; function writeTypeOfDeclaration(declaration, type, getSymbolAccessibilityDiagnostic) { writer.getSymbolAccessibilityDiagnostic = getSymbolAccessibilityDiagnostic; write(": "); - if (type) { + // use the checker's type, not the declared type, + // for non-optional initialized parameters that aren't a parameter property + var shouldUseResolverType = declaration.kind === 146 /* Parameter */ && + resolver.isRequiredInitializedParameter(declaration); + if (type && !shouldUseResolverType) { // Write the type emitType(type); } else { errorNameNode = declaration.name; - resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, 2 /* UseTypeOfFunction */ | 1024 /* UseTypeAliasValue */, writer); + var format = 2 /* UseTypeOfFunction */ | 1024 /* UseTypeAliasValue */ | + (shouldUseResolverType ? 4096 /* AddUndefined */ : 0); + resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, format, writer); errorNameNode = undefined; } } @@ -58533,15 +62719,15 @@ var ts; } } function emitLines(nodes) { - for (var _i = 0, nodes_4 = nodes; _i < nodes_4.length; _i++) { - var node = nodes_4[_i]; + for (var _i = 0, nodes_6 = nodes; _i < nodes_6.length; _i++) { + var node = nodes_6[_i]; emit(node); } } function emitSeparatedList(nodes, separator, eachNodeEmitFn, canEmitFn) { var currentWriterPos = writer.getTextPos(); - for (var _i = 0, nodes_5 = nodes; _i < nodes_5.length; _i++) { - var node = nodes_5[_i]; + for (var _i = 0, nodes_7 = nodes; _i < nodes_7.length; _i++) { + var node = nodes_7[_i]; if (!canEmitFn || canEmitFn(node)) { if (currentWriterPos !== writer.getTextPos()) { write(separator); @@ -58568,59 +62754,60 @@ var ts; } function emitType(type) { switch (type.kind) { - case 118 /* AnyKeyword */: - case 134 /* StringKeyword */: - case 132 /* NumberKeyword */: - case 121 /* BooleanKeyword */: - case 135 /* SymbolKeyword */: - case 104 /* VoidKeyword */: - case 137 /* UndefinedKeyword */: - case 94 /* NullKeyword */: - case 129 /* NeverKeyword */: - case 167 /* ThisType */: - case 171 /* LiteralType */: + case 119 /* AnyKeyword */: + case 136 /* StringKeyword */: + case 133 /* NumberKeyword */: + case 122 /* BooleanKeyword */: + case 134 /* ObjectKeyword */: + case 137 /* SymbolKeyword */: + case 105 /* VoidKeyword */: + case 139 /* UndefinedKeyword */: + case 95 /* NullKeyword */: + case 130 /* NeverKeyword */: + case 169 /* ThisType */: + case 173 /* LiteralType */: return writeTextOfNode(currentText, type); - case 199 /* ExpressionWithTypeArguments */: + case 201 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(type); - case 157 /* TypeReference */: + case 159 /* TypeReference */: return emitTypeReference(type); - case 160 /* TypeQuery */: + case 162 /* TypeQuery */: return emitTypeQuery(type); - case 162 /* ArrayType */: + case 164 /* ArrayType */: return emitArrayType(type); - case 163 /* TupleType */: + case 165 /* TupleType */: return emitTupleType(type); - case 164 /* UnionType */: + case 166 /* UnionType */: return emitUnionType(type); - case 165 /* IntersectionType */: + case 167 /* IntersectionType */: return emitIntersectionType(type); - case 166 /* ParenthesizedType */: + case 168 /* ParenthesizedType */: return emitParenType(type); - case 168 /* TypeOperator */: + case 170 /* TypeOperator */: return emitTypeOperator(type); - case 169 /* IndexedAccessType */: + case 171 /* IndexedAccessType */: return emitIndexedAccessType(type); - case 170 /* MappedType */: + case 172 /* MappedType */: return emitMappedType(type); - case 158 /* FunctionType */: - case 159 /* ConstructorType */: + case 160 /* FunctionType */: + case 161 /* ConstructorType */: return emitSignatureDeclarationWithJsDocComments(type); - case 161 /* TypeLiteral */: + case 163 /* TypeLiteral */: return emitTypeLiteral(type); - case 70 /* Identifier */: + case 71 /* Identifier */: return emitEntityName(type); - case 141 /* QualifiedName */: + case 143 /* QualifiedName */: return emitEntityName(type); - case 156 /* TypePredicate */: + case 158 /* TypePredicate */: return emitTypePredicate(type); } function writeEntityName(entityName) { - if (entityName.kind === 70 /* Identifier */) { + if (entityName.kind === 71 /* Identifier */) { writeTextOfNode(currentText, entityName); } else { - var left = entityName.kind === 141 /* QualifiedName */ ? entityName.left : entityName.expression; - var right = entityName.kind === 141 /* QualifiedName */ ? entityName.right : entityName.name; + var left = entityName.kind === 143 /* QualifiedName */ ? entityName.left : entityName.expression; + var right = entityName.kind === 143 /* QualifiedName */ ? entityName.right : entityName.name; writeEntityName(left); write("."); writeTextOfNode(currentText, right); @@ -58629,14 +62816,14 @@ var ts; function emitEntityName(entityName) { var visibilityResult = resolver.isEntityNameVisible(entityName, // Aliases can be written asynchronously so use correct enclosing declaration - entityName.parent.kind === 234 /* ImportEqualsDeclaration */ ? entityName.parent : enclosingDeclaration); + entityName.parent.kind === 237 /* 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 === 70 /* Identifier */ || node.expression.kind === 177 /* PropertyAccessExpression */); + ts.Debug.assert(node.expression.kind === 71 /* Identifier */ || node.expression.kind === 179 /* PropertyAccessExpression */); emitEntityName(node.expression); if (node.typeArguments) { write("<"); @@ -58736,62 +62923,61 @@ var ts; currentIdentifiers = node.identifiers; isCurrentFileExternalModule = ts.isExternalModule(node); enclosingDeclaration = node; - ts.emitDetachedComments(currentText, currentLineMap, writer, ts.writeCommentRange, node, newLine, true /* remove comments */); + ts.emitDetachedComments(currentText, currentLineMap, writer, ts.writeCommentRange, node, newLine, /*removeComents*/ true); emitLines(node.statements); } - // Return a temp variable name to be used in `export default` statements. + // Return a temp variable name to be used in `export default`/`export class ... extends` statements. // The temp name will be of the form _default_counter. // Note that export default is only allowed at most once in a module, so we // do not need to keep track of created temp names. - function getExportDefaultTempVariableName() { - var baseName = "_default"; - if (!(baseName in currentIdentifiers)) { + function getExportTempVariableName(baseName) { + if (!currentIdentifiers.has(baseName)) { return baseName; } var count = 0; while (true) { count++; - var name_40 = baseName + "_" + count; - if (!(name_40 in currentIdentifiers)) { - return name_40; + var name = baseName + "_" + count; + if (!currentIdentifiers.has(name)) { + return name; } } } + function emitTempVariableDeclaration(expr, baseName, diagnostic, needsDeclare) { + var tempVarName = getExportTempVariableName(baseName); + if (needsDeclare) { + write("declare "); + } + write("const "); + write(tempVarName); + write(": "); + writer.getSymbolAccessibilityDiagnostic = function () { return diagnostic; }; + resolver.writeTypeOfExpression(expr, enclosingDeclaration, 2 /* UseTypeOfFunction */ | 1024 /* UseTypeAliasValue */, writer); + write(";"); + writeLine(); + return tempVarName; + } function emitExportAssignment(node) { - if (node.expression.kind === 70 /* Identifier */) { + if (node.expression.kind === 71 /* Identifier */) { write(node.isExportEquals ? "export = " : "export default "); writeTextOfNode(currentText, node.expression); } else { - // Expression - var tempVarName = getExportDefaultTempVariableName(); - if (!noDeclare) { - write("declare "); - } - write("var "); - write(tempVarName); - write(": "); - writer.getSymbolAccessibilityDiagnostic = getDefaultExportAccessibilityDiagnostic; - resolver.writeTypeOfExpression(node.expression, enclosingDeclaration, 2 /* UseTypeOfFunction */ | 1024 /* UseTypeAliasValue */, writer); - write(";"); - writeLine(); + var tempVarName = emitTempVariableDeclaration(node.expression, "_default", { + diagnosticMessage: ts.Diagnostics.Default_export_of_the_module_has_or_is_using_private_name_0, + errorNode: node + }, needsDeclare); write(node.isExportEquals ? "export = " : "export default "); write(tempVarName); } write(";"); writeLine(); // Make all the declarations visible for the export name - if (node.expression.kind === 70 /* Identifier */) { + if (node.expression.kind === 71 /* Identifier */) { var nodes = resolver.collectLinkedAliases(node.expression); // write each of these declarations asynchronously writeAsynchronousModuleElements(nodes); } - function getDefaultExportAccessibilityDiagnostic() { - return { - diagnosticMessage: ts.Diagnostics.Default_export_of_the_module_has_or_is_using_private_name_0, - errorNode: node - }; - } } function isModuleElementVisible(node) { return resolver.isDeclarationVisible(node); @@ -58800,10 +62986,10 @@ var ts; if (isModuleElementVisible) { writeModuleElement(node); } - else if (node.kind === 234 /* ImportEqualsDeclaration */ || - (node.parent.kind === 261 /* SourceFile */ && isCurrentFileExternalModule)) { + else if (node.kind === 237 /* ImportEqualsDeclaration */ || + (node.parent.kind === 265 /* SourceFile */ && isCurrentFileExternalModule)) { var isVisible = void 0; - if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 261 /* SourceFile */) { + if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 265 /* SourceFile */) { // Import declaration of another module that is visited async so lets put it in right spot asynchronousSubModuleDeclarationEmitInfo.push({ node: node, @@ -58813,7 +62999,7 @@ var ts; }); } else { - if (node.kind === 235 /* ImportDeclaration */) { + if (node.kind === 238 /* ImportDeclaration */) { var importDeclaration = node; if (importDeclaration.importClause) { isVisible = (importDeclaration.importClause.name && resolver.isDeclarationVisible(importDeclaration.importClause)) || @@ -58831,23 +63017,23 @@ var ts; } function writeModuleElement(node) { switch (node.kind) { - case 225 /* FunctionDeclaration */: + case 228 /* FunctionDeclaration */: return writeFunctionDeclaration(node); - case 205 /* VariableStatement */: + case 208 /* VariableStatement */: return writeVariableStatement(node); - case 227 /* InterfaceDeclaration */: + case 230 /* InterfaceDeclaration */: return writeInterfaceDeclaration(node); - case 226 /* ClassDeclaration */: + case 229 /* ClassDeclaration */: return writeClassDeclaration(node); - case 228 /* TypeAliasDeclaration */: + case 231 /* TypeAliasDeclaration */: return writeTypeAliasDeclaration(node); - case 229 /* EnumDeclaration */: + case 232 /* EnumDeclaration */: return writeEnumDeclaration(node); - case 230 /* ModuleDeclaration */: + case 233 /* ModuleDeclaration */: return writeModuleDeclaration(node); - case 234 /* ImportEqualsDeclaration */: + case 237 /* ImportEqualsDeclaration */: return writeImportEqualsDeclaration(node); - case 235 /* ImportDeclaration */: + case 238 /* ImportDeclaration */: return writeImportDeclaration(node); default: ts.Debug.fail("Unknown symbol kind"); @@ -58855,7 +63041,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 === 261 /* SourceFile */) { + if (node.parent.kind === 265 /* SourceFile */) { var modifiers = ts.getModifierFlags(node); // If the node is exported if (modifiers & 1 /* Export */) { @@ -58864,7 +63050,7 @@ var ts; if (modifiers & 512 /* Default */) { write("default "); } - else if (node.kind !== 227 /* InterfaceDeclaration */ && !noDeclare) { + else if (node.kind !== 230 /* InterfaceDeclaration */ && needsDeclare) { write("declare "); } } @@ -58916,7 +63102,7 @@ var ts; } function isVisibleNamedBinding(namedBindings) { if (namedBindings) { - if (namedBindings.kind === 237 /* NamespaceImport */) { + if (namedBindings.kind === 240 /* NamespaceImport */) { return resolver.isDeclarationVisible(namedBindings); } else { @@ -58940,7 +63126,7 @@ var ts; // If the default binding was emitted, write the separated write(", "); } - if (node.importClause.namedBindings.kind === 237 /* NamespaceImport */) { + if (node.importClause.namedBindings.kind === 240 /* NamespaceImport */) { write("* as "); writeTextOfNode(currentText, node.importClause.namedBindings.name); } @@ -58961,13 +63147,13 @@ 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 !== 230 /* ModuleDeclaration */; + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 233 /* ModuleDeclaration */; var moduleSpecifier; - if (parent.kind === 234 /* ImportEqualsDeclaration */) { + if (parent.kind === 237 /* ImportEqualsDeclaration */) { var node = parent; moduleSpecifier = ts.getExternalModuleImportEqualsDeclarationExpression(node); } - else if (parent.kind === 230 /* ModuleDeclaration */) { + else if (parent.kind === 233 /* ModuleDeclaration */) { moduleSpecifier = parent.name; } else { @@ -59037,7 +63223,7 @@ var ts; writeTextOfNode(currentText, node.name); } } - while (node.body && node.body.kind !== 231 /* ModuleBlock */) { + while (node.body && node.body.kind !== 234 /* ModuleBlock */) { node = node.body; write("."); writeTextOfNode(currentText, node.name); @@ -59107,7 +63293,7 @@ var ts; writeLine(); } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 149 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); + return node.parent.kind === 151 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); } function emitTypeParameters(typeParameters) { function emitTypeParameter(node) { @@ -59118,53 +63304,70 @@ 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 === 158 /* FunctionType */ || - node.parent.kind === 159 /* ConstructorType */ || - (node.parent.parent && node.parent.parent.kind === 161 /* TypeLiteral */)) { - ts.Debug.assert(node.parent.kind === 149 /* MethodDeclaration */ || - node.parent.kind === 148 /* MethodSignature */ || - node.parent.kind === 158 /* FunctionType */ || - node.parent.kind === 159 /* ConstructorType */ || - node.parent.kind === 153 /* CallSignature */ || - node.parent.kind === 154 /* ConstructSignature */); + if (node.parent.kind === 160 /* FunctionType */ || + node.parent.kind === 161 /* ConstructorType */ || + (node.parent.parent && node.parent.parent.kind === 163 /* TypeLiteral */)) { + ts.Debug.assert(node.parent.kind === 151 /* MethodDeclaration */ || + node.parent.kind === 150 /* MethodSignature */ || + node.parent.kind === 160 /* FunctionType */ || + node.parent.kind === 161 /* ConstructorType */ || + node.parent.kind === 155 /* CallSignature */ || + node.parent.kind === 156 /* ConstructSignature */); emitType(node.constraint); } else { emitTypeWithNewGetSymbolAccessibilityDiagnostic(node.constraint, getTypeParameterConstraintVisibilityError); } } + if (node.default && !isPrivateMethodTypeParameter(node)) { + write(" = "); + if (node.parent.kind === 160 /* FunctionType */ || + node.parent.kind === 161 /* ConstructorType */ || + (node.parent.parent && node.parent.parent.kind === 163 /* TypeLiteral */)) { + ts.Debug.assert(node.parent.kind === 151 /* MethodDeclaration */ || + node.parent.kind === 150 /* MethodSignature */ || + node.parent.kind === 160 /* FunctionType */ || + node.parent.kind === 161 /* ConstructorType */ || + node.parent.kind === 155 /* CallSignature */ || + node.parent.kind === 156 /* ConstructSignature */); + emitType(node.default); + } + else { + emitTypeWithNewGetSymbolAccessibilityDiagnostic(node.default, getTypeParameterConstraintVisibilityError); + } + } function getTypeParameterConstraintVisibilityError() { // Type parameter constraints are named by user so we should always be able to name it var diagnosticMessage; switch (node.parent.kind) { - case 226 /* ClassDeclaration */: + case 229 /* ClassDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 227 /* InterfaceDeclaration */: + case 230 /* InterfaceDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 154 /* ConstructSignature */: + case 156 /* ConstructSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 153 /* CallSignature */: + case 155 /* CallSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 151 /* MethodDeclaration */: + case 150 /* 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 === 226 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 229 /* 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 225 /* FunctionDeclaration */: + case 228 /* FunctionDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; - case 228 /* TypeAliasDeclaration */: + case 231 /* TypeAliasDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; break; default: @@ -59192,30 +63395,26 @@ var ts; if (ts.isEntityNameExpression(node.expression)) { emitTypeWithNewGetSymbolAccessibilityDiagnostic(node, getHeritageClauseVisibilityError); } - else if (!isImplementsList && node.expression.kind === 94 /* NullKeyword */) { + else if (!isImplementsList && node.expression.kind === 95 /* NullKeyword */) { write("null"); } - else { - writer.getSymbolAccessibilityDiagnostic = getHeritageClauseVisibilityError; - resolver.writeBaseConstructorTypeOfClass(enclosingDeclaration, enclosingDeclaration, 2 /* UseTypeOfFunction */ | 1024 /* UseTypeAliasValue */, writer); - } function getHeritageClauseVisibilityError() { var diagnosticMessage; // Heritage clause is written by user so it can always be named - if (node.parent.parent.kind === 226 /* ClassDeclaration */) { + if (node.parent.parent.kind === 229 /* 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 : - ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1; + ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1; } else { // interface is inaccessible - diagnosticMessage = ts.Diagnostics.Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1; + diagnosticMessage = ts.Diagnostics.extends_clause_of_exported_interface_0_has_or_is_using_private_name_1; } return { diagnosticMessage: diagnosticMessage, errorNode: node, - typeName: node.parent.parent.name + typeName: ts.getNameOfDeclaration(node.parent.parent) }; } } @@ -59230,6 +63429,19 @@ var ts; }); } } + var prevEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = node; + var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); + var tempVarName; + if (baseTypeNode && !ts.isEntityNameExpression(baseTypeNode.expression)) { + tempVarName = baseTypeNode.expression.kind === 95 /* NullKeyword */ ? + "null" : + emitTempVariableDeclaration(baseTypeNode.expression, node.name.text + "_base", { + 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 === 233 /* ModuleDeclaration */; })); + } emitJsDocComments(node); emitModuleElementDeclarationFlags(node); if (ts.hasModifier(node, 128 /* Abstract */)) { @@ -59237,12 +63449,20 @@ var ts; } write("class "); writeTextOfNode(currentText, node.name); - var prevEnclosingDeclaration = enclosingDeclaration; - enclosingDeclaration = node; emitTypeParameters(node.typeParameters); - var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { - emitHeritageClause([baseTypeNode], /*isImplementsList*/ false); + if (!ts.isEntityNameExpression(baseTypeNode.expression)) { + write(" extends "); + write(tempVarName); + if (baseTypeNode.typeArguments) { + write("<"); + emitCommaList(baseTypeNode.typeArguments, emitType); + write(">"); + } + } + else { + emitHeritageClause([baseTypeNode], /*isImplementsList*/ false); + } } emitHeritageClause(ts.getClassImplementsHeritageClauseElements(node), /*isImplementsList*/ true); write(" {"); @@ -59289,7 +63509,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 !== 223 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { + if (node.kind !== 226 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { if (ts.isBindingPattern(node.name)) { emitBindingPattern(node.name); } @@ -59300,11 +63520,11 @@ var ts; writeTextOfNode(currentText, node.name); // 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 === 147 /* PropertyDeclaration */ || node.kind === 146 /* PropertySignature */ || - (node.kind === 144 /* Parameter */ && !ts.isParameterPropertyDeclaration(node))) && ts.hasQuestionToken(node)) { + if ((node.kind === 149 /* PropertyDeclaration */ || node.kind === 148 /* PropertySignature */ || + (node.kind === 146 /* Parameter */ && !ts.isParameterPropertyDeclaration(node))) && ts.hasQuestionToken(node)) { write("?"); } - if ((node.kind === 147 /* PropertyDeclaration */ || node.kind === 146 /* PropertySignature */) && node.parent.kind === 161 /* TypeLiteral */) { + if ((node.kind === 149 /* PropertyDeclaration */ || node.kind === 148 /* PropertySignature */) && node.parent.kind === 163 /* TypeLiteral */) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (resolver.isLiteralConstDeclaration(node)) { @@ -59317,14 +63537,14 @@ var ts; } } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { - if (node.kind === 223 /* VariableDeclaration */) { + if (node.kind === 226 /* 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 === 147 /* PropertyDeclaration */ || node.kind === 146 /* PropertySignature */) { + else if (node.kind === 149 /* PropertyDeclaration */ || node.kind === 148 /* PropertySignature */) { // TODO(jfreeman): Deal with computed properties in error reporting. if (ts.hasModifier(node, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? @@ -59333,7 +63553,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 === 226 /* ClassDeclaration */) { + else if (node.parent.kind === 229 /* 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 : @@ -59365,7 +63585,7 @@ var ts; var elements = []; for (var _i = 0, _a = bindingPattern.elements; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 198 /* OmittedExpression */) { + if (element.kind !== 200 /* OmittedExpression */) { elements.push(element); } } @@ -59435,7 +63655,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 === 151 /* GetAccessor */ ? accessors.setAccessor : accessors.getAccessor; + var anotherAccessor = node.kind === 153 /* GetAccessor */ ? accessors.setAccessor : accessors.getAccessor; type = getTypeAnnotationFromAccessor(anotherAccessor); if (type) { accessorWithTypeAnnotation = anotherAccessor; @@ -59448,7 +63668,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 151 /* GetAccessor */ + return accessor.kind === 153 /* GetAccessor */ ? accessor.type // Getter - return type : accessor.parameters.length > 0 ? accessor.parameters[0].type // Setter parameter type @@ -59457,7 +63677,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; - if (accessorWithTypeAnnotation.kind === 152 /* SetAccessor */) { + if (accessorWithTypeAnnotation.kind === 154 /* SetAccessor */) { // Setters have to have type named and cannot infer it so, the type should always be named if (ts.hasModifier(accessorWithTypeAnnotation.parent, 32 /* Static */)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? @@ -59507,17 +63727,17 @@ var ts; // so no need to verify if the declaration is visible if (!resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); - if (node.kind === 225 /* FunctionDeclaration */) { + if (node.kind === 228 /* FunctionDeclaration */) { emitModuleElementDeclarationFlags(node); } - else if (node.kind === 149 /* MethodDeclaration */ || node.kind === 150 /* Constructor */) { + else if (node.kind === 151 /* MethodDeclaration */ || node.kind === 152 /* Constructor */) { emitClassMemberDeclarationFlags(ts.getModifierFlags(node)); } - if (node.kind === 225 /* FunctionDeclaration */) { + if (node.kind === 228 /* FunctionDeclaration */) { write("function "); writeTextOfNode(currentText, node.name); } - else if (node.kind === 150 /* Constructor */) { + else if (node.kind === 152 /* Constructor */) { write("constructor"); } else { @@ -59537,17 +63757,17 @@ var ts; var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; var closeParenthesizedFunctionType = false; - if (node.kind === 155 /* IndexSignature */) { + if (node.kind === 157 /* IndexSignature */) { // Index signature can have readonly modifier emitClassMemberDeclarationFlags(ts.getModifierFlags(node)); write("["); } else { // Construct signature or constructor type write new Signature - if (node.kind === 154 /* ConstructSignature */ || node.kind === 159 /* ConstructorType */) { + if (node.kind === 156 /* ConstructSignature */ || node.kind === 161 /* ConstructorType */) { write("new "); } - else if (node.kind === 158 /* FunctionType */) { + else if (node.kind === 160 /* 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 @@ -59562,22 +63782,22 @@ var ts; } // Parameters emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 155 /* IndexSignature */) { + if (node.kind === 157 /* IndexSignature */) { write("]"); } else { write(")"); } // If this is not a constructor and is not private, emit the return type - var isFunctionTypeOrConstructorType = node.kind === 158 /* FunctionType */ || node.kind === 159 /* ConstructorType */; - if (isFunctionTypeOrConstructorType || node.parent.kind === 161 /* TypeLiteral */) { + var isFunctionTypeOrConstructorType = node.kind === 160 /* FunctionType */ || node.kind === 161 /* ConstructorType */; + if (isFunctionTypeOrConstructorType || node.parent.kind === 163 /* TypeLiteral */) { // Emit type literal signature return type only if specified if (node.type) { write(isFunctionTypeOrConstructorType ? " => " : ": "); emitType(node.type); } } - else if (node.kind !== 150 /* Constructor */ && !ts.hasModifier(node, 8 /* Private */)) { + else if (node.kind !== 152 /* Constructor */ && !ts.hasModifier(node, 8 /* Private */)) { writeReturnTypeAtSignature(node, getReturnTypeVisibilityError); } enclosingDeclaration = prevEnclosingDeclaration; @@ -59591,26 +63811,26 @@ var ts; function getReturnTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; switch (node.kind) { - case 154 /* ConstructSignature */: + case 156 /* 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 153 /* CallSignature */: + case 155 /* 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 155 /* IndexSignature */: + case 157 /* 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 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: if (ts.hasModifier(node, 32 /* Static */)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -59618,7 +63838,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 === 226 /* ClassDeclaration */) { + else if (node.parent.kind === 229 /* 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 : @@ -59632,7 +63852,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 225 /* FunctionDeclaration */: + case 228 /* 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 : @@ -59667,9 +63887,9 @@ var ts; write("?"); } decreaseIndent(); - if (node.parent.kind === 158 /* FunctionType */ || - node.parent.kind === 159 /* ConstructorType */ || - node.parent.parent.kind === 161 /* TypeLiteral */) { + if (node.parent.kind === 160 /* FunctionType */ || + node.parent.kind === 161 /* ConstructorType */ || + node.parent.parent.kind === 163 /* TypeLiteral */) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (!ts.hasModifier(node.parent, 8 /* Private */)) { @@ -59685,29 +63905,29 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { switch (node.parent.kind) { - case 150 /* Constructor */: + case 152 /* 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 154 /* ConstructSignature */: + case 156 /* 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 153 /* CallSignature */: + case 155 /* 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 155 /* IndexSignature */: + case 157 /* 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 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: if (ts.hasModifier(node.parent, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -59715,7 +63935,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 === 226 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 229 /* 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 : @@ -59728,7 +63948,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 225 /* FunctionDeclaration */: + case 228 /* 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 : @@ -59740,12 +63960,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 === 172 /* ObjectBindingPattern */) { + if (bindingPattern.kind === 174 /* ObjectBindingPattern */) { write("{"); emitCommaList(bindingPattern.elements, emitBindingElement); write("}"); } - else if (bindingPattern.kind === 173 /* ArrayBindingPattern */) { + else if (bindingPattern.kind === 175 /* ArrayBindingPattern */) { write("["); var elements = bindingPattern.elements; emitCommaList(elements, emitBindingElement); @@ -59756,7 +63976,7 @@ var ts; } } function emitBindingElement(bindingElement) { - if (bindingElement.kind === 198 /* OmittedExpression */) { + if (bindingElement.kind === 200 /* 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) @@ -59765,7 +63985,7 @@ var ts; // emit : function foo([ , x, , ]) {} write(" "); } - else if (bindingElement.kind === 174 /* BindingElement */) { + else if (bindingElement.kind === 176 /* 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" @@ -59788,7 +64008,7 @@ var ts; emitBindingPattern(bindingElement.name); } else { - ts.Debug.assert(bindingElement.name.kind === 70 /* Identifier */); + ts.Debug.assert(bindingElement.name.kind === 71 /* Identifier */); // If the node is just an identifier, we will simply emit the text associated with the node's name // Example: // original: function foo({y = 10, x}) {} @@ -59804,40 +64024,40 @@ var ts; } function emitNode(node) { switch (node.kind) { - case 225 /* FunctionDeclaration */: - case 230 /* ModuleDeclaration */: - case 234 /* ImportEqualsDeclaration */: - case 227 /* InterfaceDeclaration */: - case 226 /* ClassDeclaration */: - case 228 /* TypeAliasDeclaration */: - case 229 /* EnumDeclaration */: + case 228 /* FunctionDeclaration */: + case 233 /* ModuleDeclaration */: + case 237 /* ImportEqualsDeclaration */: + case 230 /* InterfaceDeclaration */: + case 229 /* ClassDeclaration */: + case 231 /* TypeAliasDeclaration */: + case 232 /* EnumDeclaration */: return emitModuleElement(node, isModuleElementVisible(node)); - case 205 /* VariableStatement */: + case 208 /* VariableStatement */: return emitModuleElement(node, isVariableStatementVisible(node)); - case 235 /* ImportDeclaration */: + case 238 /* ImportDeclaration */: // Import declaration without import clause is visible, otherwise it is not visible return emitModuleElement(node, /*isModuleElementVisible*/ !node.importClause); - case 241 /* ExportDeclaration */: + case 244 /* ExportDeclaration */: return emitExportDeclaration(node); - case 150 /* Constructor */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 152 /* Constructor */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: return writeFunctionDeclaration(node); - case 154 /* ConstructSignature */: - case 153 /* CallSignature */: - case 155 /* IndexSignature */: + case 156 /* ConstructSignature */: + case 155 /* CallSignature */: + case 157 /* IndexSignature */: return emitSignatureDeclarationWithJsDocComments(node); - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: return emitAccessorDeclaration(node); - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: + case 149 /* PropertyDeclaration */: + case 148 /* PropertySignature */: return emitPropertyDeclaration(node); - case 260 /* EnumMember */: + case 264 /* EnumMember */: return emitEnumMemberDeclaration(node); - case 240 /* ExportAssignment */: + case 243 /* ExportAssignment */: return emitExportAssignment(node); - case 261 /* SourceFile */: + case 265 /* SourceFile */: return emitSourceFile(node); } } @@ -59855,7 +64075,7 @@ var ts; } else { // Get the declaration file path - ts.forEachExpectedEmitFile(host, getDeclFileName, referencedFile, emitOnlyDtsFiles); + ts.forEachEmittedFile(host, getDeclFileName, referencedFile, emitOnlyDtsFiles); } if (declFileName) { declFileName = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizeSlashes(declarationFilePath)), declFileName, host.getCurrentDirectory(), host.getCanonicalFileName, @@ -59863,8 +64083,9 @@ var ts; referencesOutput += "/// " + newLine; } return addedBundledEmitReference; - function getDeclFileName(emitFileNames, _sourceFiles, isBundledEmit) { + 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 === 266 /* Bundle */; if (isBundledEmit && !addBundledFileReference) { return; } @@ -59875,10 +64096,11 @@ var ts; } } /* @internal */ - function writeDeclarationFile(declarationFilePath, sourceFiles, isBundledEmit, host, resolver, emitterDiagnostics, emitOnlyDtsFiles) { - var emitDeclarationResult = emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFiles, isBundledEmit, emitOnlyDtsFiles); + function writeDeclarationFile(declarationFilePath, sourceFileOrBundle, host, resolver, emitterDiagnostics, emitOnlyDtsFiles) { + var emitDeclarationResult = emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFileOrBundle, emitOnlyDtsFiles); var emitSkipped = emitDeclarationResult.reportedDeclarationError || host.isEmitBlocked(declarationFilePath) || host.getCompilerOptions().noEmit; if (!emitSkipped) { + var sourceFiles = sourceFileOrBundle.kind === 266 /* Bundle */ ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; var declarationOutput = emitDeclarationResult.referencesOutput + getDeclarationOutput(emitDeclarationResult.synchronousDeclarationOutput, emitDeclarationResult.moduleElementDeclarationEmitInfo); ts.writeFile(host, emitterDiagnostics, declarationFilePath, declarationOutput, host.getCompilerOptions().emitBOM, sourceFiles); @@ -59901,83 +64123,73 @@ var ts; } ts.writeDeclarationFile = writeDeclarationFile; })(ts || (ts = {})); -/// +/// /// -/// -/// +/// +/// /// -/* @internal */ var ts; (function (ts) { - // Flags enum to track count of temp variables and a few dedicated names - var TempFlags; - (function (TempFlags) { - TempFlags[TempFlags["Auto"] = 0] = "Auto"; - TempFlags[TempFlags["CountMask"] = 268435455] = "CountMask"; - TempFlags[TempFlags["_i"] = 268435456] = "_i"; - })(TempFlags || (TempFlags = {})); - var id = function (s) { return s; }; - var nullTransformers = [function (_) { return id; }]; + var delimiters = createDelimiterMap(); + var brackets = createBracketsMap(); + /*@internal*/ // targetSourceFile is when users only want one file in entire project to be emitted. This is used in compileOnSave feature - function emitFiles(resolver, host, targetSourceFile, emitOnlyDtsFiles) { - var delimiters = createDelimiterMap(); - var brackets = createBracketsMap(); + function emitFiles(resolver, host, targetSourceFile, emitOnlyDtsFiles, transformers) { var compilerOptions = host.getCompilerOptions(); - var languageVersion = ts.getEmitScriptTarget(compilerOptions); var moduleKind = ts.getEmitModuleKind(compilerOptions); var sourceMapDataList = compilerOptions.sourceMap || compilerOptions.inlineSourceMap ? [] : undefined; var emittedFilesList = compilerOptions.listEmittedFiles ? [] : undefined; var emitterDiagnostics = ts.createDiagnosticCollection(); var newLine = host.getNewLine(); - var transformers = emitOnlyDtsFiles ? nullTransformers : ts.getTransformers(compilerOptions); var writer = ts.createTextWriter(newLine); - var write = writer.write, writeLine = writer.writeLine, increaseIndent = writer.increaseIndent, decreaseIndent = writer.decreaseIndent; var sourceMap = ts.createSourceMapWriter(host, writer); - var emitNodeWithSourceMap = sourceMap.emitNodeWithSourceMap, emitTokenWithSourceMap = sourceMap.emitTokenWithSourceMap; - var comments = ts.createCommentWriter(host, writer, sourceMap); - var emitNodeWithComments = comments.emitNodeWithComments, emitBodyWithDetachedComments = comments.emitBodyWithDetachedComments, emitTrailingCommentsOfPosition = comments.emitTrailingCommentsOfPosition; - var nodeIdToGeneratedName; - var autoGeneratedIdToGeneratedName; - var generatedNameSet; - var tempFlags; var currentSourceFile; - var currentText; - var currentFileIdentifiers; var bundledHelpers; var isOwnFileEmit; var emitSkipped = false; var sourceFiles = ts.getSourceFilesToEmit(host, targetSourceFile); // Transform the source files - ts.performance.mark("beforeTransform"); - var _a = ts.transformFiles(resolver, host, sourceFiles, transformers), transformed = _a.transformed, emitNodeWithSubstitution = _a.emitNodeWithSubstitution, emitNodeWithNotification = _a.emitNodeWithNotification; - ts.performance.measure("transformTime", "beforeTransform"); + var transform = ts.transformNodes(resolver, host, compilerOptions, sourceFiles, transformers, /*allowDtsFiles*/ false); + // Create a printer to print the nodes + var printer = createPrinter(compilerOptions, { + // resolver hooks + hasGlobalName: resolver.hasGlobalName, + // transform hooks + onEmitNode: transform.emitNodeWithNotification, + substituteNode: transform.substituteNode, + // sourcemap hooks + onEmitSourceMapOfNode: sourceMap.emitNodeWithSourceMap, + onEmitSourceMapOfToken: sourceMap.emitTokenWithSourceMap, + onEmitSourceMapOfPosition: sourceMap.emitPos, + // emitter hooks + onEmitHelpers: emitHelpers, + onSetSourceFile: setSourceFile, + }); // Emit each output file ts.performance.mark("beforePrint"); - ts.forEachTransformedEmitFile(host, transformed, emitFile, emitOnlyDtsFiles); + ts.forEachEmittedFile(host, emitSourceFileOrBundle, transform.transformed, emitOnlyDtsFiles); ts.performance.measure("printTime", "beforePrint"); // Clean up emit nodes on parse tree - for (var _b = 0, sourceFiles_4 = sourceFiles; _b < sourceFiles_4.length; _b++) { - var sourceFile = sourceFiles_4[_b]; - ts.disposeEmitNodes(sourceFile); - } + transform.dispose(); return { emitSkipped: emitSkipped, diagnostics: emitterDiagnostics.getDiagnostics(), emittedFiles: emittedFilesList, sourceMaps: sourceMapDataList }; - function emitFile(jsFilePath, sourceMapFilePath, declarationFilePath, sourceFiles, isBundledEmit) { + function emitSourceFileOrBundle(_a, sourceFileOrBundle) { + var jsFilePath = _a.jsFilePath, sourceMapFilePath = _a.sourceMapFilePath, declarationFilePath = _a.declarationFilePath; // Make sure not to write js file and source map file if any of them cannot be written if (!host.isEmitBlocked(jsFilePath) && !compilerOptions.noEmit) { if (!emitOnlyDtsFiles) { - printFile(jsFilePath, sourceMapFilePath, sourceFiles, isBundledEmit); + printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle); } } else { emitSkipped = true; } if (declarationFilePath) { - emitSkipped = ts.writeDeclarationFile(declarationFilePath, ts.getOriginalSourceFiles(sourceFiles), isBundledEmit, host, resolver, emitterDiagnostics, emitOnlyDtsFiles) || emitSkipped; + emitSkipped = ts.writeDeclarationFile(declarationFilePath, ts.getOriginalSourceFileOrBundle(sourceFileOrBundle), host, resolver, emitterDiagnostics, emitOnlyDtsFiles) || emitSkipped; } if (!emitSkipped && emittedFilesList) { if (!emitOnlyDtsFiles) { @@ -59991,26 +64203,24 @@ var ts; } } } - function printFile(jsFilePath, sourceMapFilePath, sourceFiles, isBundledEmit) { - sourceMap.initialize(jsFilePath, sourceMapFilePath, sourceFiles, isBundledEmit); - nodeIdToGeneratedName = []; - autoGeneratedIdToGeneratedName = []; - generatedNameSet = ts.createMap(); - bundledHelpers = isBundledEmit ? ts.createMap() : undefined; - isOwnFileEmit = !isBundledEmit; - // Emit helpers from all the files - if (isBundledEmit && moduleKind) { - for (var _a = 0, sourceFiles_5 = sourceFiles; _a < sourceFiles_5.length; _a++) { - var sourceFile = sourceFiles_5[_a]; - emitHelpers(sourceFile, /*isBundle*/ true); - } + function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle) { + var bundle = sourceFileOrBundle.kind === 266 /* Bundle */ ? sourceFileOrBundle : undefined; + var sourceFile = sourceFileOrBundle.kind === 265 /* SourceFile */ ? sourceFileOrBundle : undefined; + var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; + sourceMap.initialize(jsFilePath, sourceMapFilePath, sourceFileOrBundle); + if (bundle) { + bundledHelpers = ts.createMap(); + isOwnFileEmit = false; + printer.writeBundle(bundle, writer); } - // Print each transformed source file. - ts.forEach(sourceFiles, printSourceFile); - writeLine(); + else { + isOwnFileEmit = true; + printer.writeFile(sourceFile, writer); + } + writer.writeLine(); var sourceMappingURL = sourceMap.getSourceMappingURL(); if (sourceMappingURL) { - write("//# " + "sourceMappingURL" + "=" + sourceMappingURL); // Sometimes tools can sometimes see this line as a source mapping url comment + writer.write("//# " + "sourceMappingURL" + "=" + sourceMappingURL); // Sometimes tools can sometimes see this line as a source mapping url comment } // Write the source map if (compilerOptions.sourceMap && !compilerOptions.inlineSourceMap) { @@ -60024,487 +64234,551 @@ var ts; ts.writeFile(host, emitterDiagnostics, jsFilePath, writer.getText(), compilerOptions.emitBOM, sourceFiles); // Reset state sourceMap.reset(); - comments.reset(); writer.reset(); - tempFlags = 0 /* Auto */; currentSourceFile = undefined; - currentText = undefined; + bundledHelpers = undefined; isOwnFileEmit = false; } - function printSourceFile(node) { + function setSourceFile(node) { currentSourceFile = node; - currentText = node.text; - currentFileIdentifiers = node.identifiers; sourceMap.setSourceFile(node); - comments.setSourceFile(node); - pipelineEmitWithNotification(0 /* SourceFile */, node); } - /** - * Emits a node. - */ + function emitHelpers(node, writeLines) { + var helpersEmitted = false; + var bundle = node.kind === 266 /* Bundle */ ? node : undefined; + if (bundle && moduleKind === ts.ModuleKind.None) { + return; + } + var numNodes = bundle ? bundle.sourceFiles.length : 1; + for (var i = 0; i < numNodes; i++) { + var currentNode = bundle ? bundle.sourceFiles[i] : node; + var sourceFile = ts.isSourceFile(currentNode) ? currentNode : currentSourceFile; + var shouldSkip = compilerOptions.noEmitHelpers || (sourceFile && ts.getExternalHelpersModuleName(sourceFile) !== undefined); + var shouldBundle = ts.isSourceFile(currentNode) && !isOwnFileEmit; + var helpers = ts.getEmitHelpers(currentNode); + if (helpers) { + for (var _a = 0, _b = ts.stableSort(helpers, ts.compareEmitHelpers); _a < _b.length; _a++) { + var helper = _b[_a]; + if (!helper.scoped) { + // Skip the helper if it can be skipped and the noEmitHelpers compiler + // option is set, or if it can be imported and the importHelpers compiler + // option is set. + if (shouldSkip) + continue; + // Skip the helper if it can be bundled but hasn't already been emitted and we + // are emitting a bundled module. + if (shouldBundle) { + if (bundledHelpers.get(helper.name)) { + continue; + } + bundledHelpers.set(helper.name, true); + } + } + else if (bundle) { + // Skip the helper if it is scoped and we are emitting bundled helpers + continue; + } + writeLines(helper.text); + helpersEmitted = true; + } + } + } + return helpersEmitted; + } + } + ts.emitFiles = emitFiles; + function createPrinter(printerOptions, handlers) { + if (printerOptions === void 0) { printerOptions = {}; } + if (handlers === void 0) { handlers = {}; } + var hasGlobalName = handlers.hasGlobalName, onEmitSourceMapOfNode = handlers.onEmitSourceMapOfNode, onEmitSourceMapOfToken = handlers.onEmitSourceMapOfToken, onEmitSourceMapOfPosition = handlers.onEmitSourceMapOfPosition, onEmitNode = handlers.onEmitNode, onEmitHelpers = handlers.onEmitHelpers, onSetSourceFile = handlers.onSetSourceFile, substituteNode = handlers.substituteNode, onBeforeEmitNodeArray = handlers.onBeforeEmitNodeArray, onAfterEmitNodeArray = handlers.onAfterEmitNodeArray; + var newLine = ts.getNewLineCharacter(printerOptions); + var comments = ts.createCommentWriter(printerOptions, onEmitSourceMapOfPosition); + var emitNodeWithComments = comments.emitNodeWithComments, emitBodyWithDetachedComments = comments.emitBodyWithDetachedComments, emitTrailingCommentsOfPosition = comments.emitTrailingCommentsOfPosition, emitLeadingCommentsOfPosition = comments.emitLeadingCommentsOfPosition; + var currentSourceFile; + var nodeIdToGeneratedName; // Map of generated names for specific nodes. + var autoGeneratedIdToGeneratedName; // Map of generated names for temp and loop variables. + var generatedNames; // Set of names generated by the NameGenerator. + var tempFlagsStack; // Stack of enclosing name generation scopes. + var tempFlags; // TempFlags for the current name generation scope. + var writer; + var ownWriter; + reset(); + return { + // public API + printNode: printNode, + printFile: printFile, + printBundle: printBundle, + // internal API + writeNode: writeNode, + writeFile: writeFile, + writeBundle: writeBundle + }; + function printNode(hint, node, sourceFile) { + switch (hint) { + case 0 /* SourceFile */: + ts.Debug.assert(ts.isSourceFile(node), "Expected a SourceFile node."); + break; + case 2 /* IdentifierName */: + ts.Debug.assert(ts.isIdentifier(node), "Expected an Identifier node."); + break; + case 1 /* Expression */: + ts.Debug.assert(ts.isExpression(node), "Expected an Expression node."); + break; + } + switch (node.kind) { + case 265 /* SourceFile */: return printFile(node); + case 266 /* Bundle */: return printBundle(node); + } + writeNode(hint, node, sourceFile, beginPrint()); + return endPrint(); + } + function printBundle(bundle) { + writeBundle(bundle, beginPrint()); + return endPrint(); + } + function printFile(sourceFile) { + writeFile(sourceFile, beginPrint()); + return endPrint(); + } + function writeNode(hint, node, sourceFile, output) { + var previousWriter = writer; + setWriter(output); + print(hint, node, sourceFile); + reset(); + writer = previousWriter; + } + function writeBundle(bundle, output) { + var previousWriter = writer; + setWriter(output); + emitShebangIfNeeded(bundle); + emitPrologueDirectivesIfNeeded(bundle); + emitHelpersIndirect(bundle); + for (var _a = 0, _b = bundle.sourceFiles; _a < _b.length; _a++) { + var sourceFile = _b[_a]; + print(0 /* SourceFile */, sourceFile, sourceFile); + } + reset(); + writer = previousWriter; + } + function writeFile(sourceFile, output) { + var previousWriter = writer; + setWriter(output); + emitShebangIfNeeded(sourceFile); + emitPrologueDirectivesIfNeeded(sourceFile); + print(0 /* SourceFile */, sourceFile, sourceFile); + reset(); + writer = previousWriter; + } + function beginPrint() { + return ownWriter || (ownWriter = ts.createTextWriter(newLine)); + } + function endPrint() { + var text = ownWriter.getText(); + ownWriter.reset(); + return text; + } + function print(hint, node, sourceFile) { + setSourceFile(sourceFile); + pipelineEmitWithNotification(hint, node); + } + function setSourceFile(sourceFile) { + currentSourceFile = sourceFile; + comments.setSourceFile(sourceFile); + if (onSetSourceFile) { + onSetSourceFile(sourceFile); + } + } + function setWriter(output) { + writer = output; + comments.setWriter(output); + } + function reset() { + nodeIdToGeneratedName = []; + autoGeneratedIdToGeneratedName = []; + generatedNames = ts.createMap(); + tempFlagsStack = []; + tempFlags = 0 /* Auto */; + comments.reset(); + setWriter(/*output*/ undefined); + } function emit(node) { pipelineEmitWithNotification(3 /* Unspecified */, node); } - /** - * Emits an IdentifierName. - */ function emitIdentifierName(node) { pipelineEmitWithNotification(2 /* IdentifierName */, node); } - /** - * Emits an expression node. - */ function emitExpression(node) { pipelineEmitWithNotification(1 /* Expression */, node); } - /** - * Emits a node with possible notification. - * - * NOTE: Do not call this method directly. It is part of the emit pipeline - * and should only be called from printSourceFile, emit, emitExpression, or - * emitIdentifierName. - */ - function pipelineEmitWithNotification(emitContext, node) { - emitNodeWithNotification(emitContext, node, pipelineEmitWithComments); + function pipelineEmitWithNotification(hint, node) { + if (onEmitNode) { + onEmitNode(hint, node, pipelineEmitWithComments); + } + else { + pipelineEmitWithComments(hint, node); + } } - /** - * Emits a node with comments. - * - * NOTE: Do not call this method directly. It is part of the emit pipeline - * and should only be called indirectly from pipelineEmitWithNotification. - */ - function pipelineEmitWithComments(emitContext, node) { - // Do not emit comments for SourceFile - if (emitContext === 0 /* SourceFile */) { - pipelineEmitWithSourceMap(emitContext, node); + function pipelineEmitWithComments(hint, node) { + node = trySubstituteNode(hint, node); + if (emitNodeWithComments && hint !== 0 /* SourceFile */) { + emitNodeWithComments(hint, node, pipelineEmitWithSourceMap); + } + else { + pipelineEmitWithSourceMap(hint, node); + } + } + function pipelineEmitWithSourceMap(hint, node) { + if (onEmitSourceMapOfNode && hint !== 0 /* SourceFile */ && hint !== 2 /* IdentifierName */) { + onEmitSourceMapOfNode(hint, node, pipelineEmitWithHint); + } + else { + pipelineEmitWithHint(hint, node); + } + } + function pipelineEmitWithHint(hint, node) { + switch (hint) { + case 0 /* SourceFile */: return pipelineEmitSourceFile(node); + case 2 /* IdentifierName */: return pipelineEmitIdentifierName(node); + case 1 /* Expression */: return pipelineEmitExpression(node); + case 3 /* Unspecified */: return pipelineEmitUnspecified(node); + } + } + function pipelineEmitSourceFile(node) { + ts.Debug.assertNode(node, ts.isSourceFile); + emitSourceFile(node); + } + function pipelineEmitIdentifierName(node) { + ts.Debug.assertNode(node, ts.isIdentifier); + emitIdentifier(node); + } + function pipelineEmitUnspecified(node) { + var kind = node.kind; + // Reserved words + // Strict mode reserved words + // Contextual keywords + if (ts.isKeyword(kind)) { + writeTokenText(kind); return; } - emitNodeWithComments(emitContext, node, pipelineEmitWithSourceMap); - } - /** - * Emits a node with source maps. - * - * NOTE: Do not call this method directly. It is part of the emit pipeline - * and should only be called indirectly from pipelineEmitWithComments. - */ - function pipelineEmitWithSourceMap(emitContext, node) { - // Do not emit source mappings for SourceFile or IdentifierName - if (emitContext === 0 /* SourceFile */ - || emitContext === 2 /* IdentifierName */) { - pipelineEmitWithSubstitution(emitContext, node); - return; - } - emitNodeWithSourceMap(emitContext, node, pipelineEmitWithSubstitution); - } - /** - * Emits a node with possible substitution. - * - * NOTE: Do not call this method directly. It is part of the emit pipeline - * and should only be called indirectly from pipelineEmitWithSourceMap or - * pipelineEmitInUnspecifiedContext (when picking a more specific context). - */ - function pipelineEmitWithSubstitution(emitContext, node) { - emitNodeWithSubstitution(emitContext, node, pipelineEmitForContext); - } - /** - * Emits a node. - * - * NOTE: Do not call this method directly. It is part of the emit pipeline - * and should only be called indirectly from pipelineEmitWithSubstitution. - */ - function pipelineEmitForContext(emitContext, node) { - switch (emitContext) { - case 0 /* SourceFile */: return pipelineEmitInSourceFileContext(node); - case 2 /* IdentifierName */: return pipelineEmitInIdentifierNameContext(node); - case 3 /* Unspecified */: return pipelineEmitInUnspecifiedContext(node); - case 1 /* Expression */: return pipelineEmitInExpressionContext(node); - } - } - /** - * Emits a node in the SourceFile EmitContext. - * - * NOTE: Do not call this method directly. It is part of the emit pipeline - * and should only be called indirectly from pipelineEmitForContext. - */ - function pipelineEmitInSourceFileContext(node) { - var kind = node.kind; - switch (kind) { - // Top-level nodes - case 261 /* SourceFile */: - return emitSourceFile(node); - } - } - /** - * Emits a node in the IdentifierName EmitContext. - * - * NOTE: Do not call this method directly. It is part of the emit pipeline - * and should only be called indirectly from pipelineEmitForContext. - */ - function pipelineEmitInIdentifierNameContext(node) { - var kind = node.kind; - switch (kind) { - // Identifiers - case 70 /* Identifier */: - return emitIdentifier(node); - } - } - /** - * Emits a node in the Unspecified EmitContext. - * - * NOTE: Do not call this method directly. It is part of the emit pipeline - * and should only be called indirectly from pipelineEmitForContext. - */ - function pipelineEmitInUnspecifiedContext(node) { - var kind = node.kind; switch (kind) { // Pseudo-literals - case 13 /* TemplateHead */: - case 14 /* TemplateMiddle */: - case 15 /* TemplateTail */: + case 14 /* TemplateHead */: + case 15 /* TemplateMiddle */: + case 16 /* TemplateTail */: return emitLiteral(node); // Identifiers - case 70 /* Identifier */: + case 71 /* Identifier */: return emitIdentifier(node); - // Reserved words - case 75 /* ConstKeyword */: - case 78 /* DefaultKeyword */: - case 83 /* ExportKeyword */: - case 104 /* VoidKeyword */: - // Strict mode reserved words - case 111 /* PrivateKeyword */: - case 112 /* ProtectedKeyword */: - case 113 /* PublicKeyword */: - case 114 /* StaticKeyword */: - // Contextual keywords - case 116 /* AbstractKeyword */: - case 117 /* AsKeyword */: - case 118 /* AnyKeyword */: - case 119 /* AsyncKeyword */: - case 120 /* AwaitKeyword */: - case 121 /* BooleanKeyword */: - case 122 /* ConstructorKeyword */: - case 123 /* DeclareKeyword */: - case 124 /* GetKeyword */: - case 125 /* IsKeyword */: - case 127 /* ModuleKeyword */: - case 128 /* NamespaceKeyword */: - case 129 /* NeverKeyword */: - case 130 /* ReadonlyKeyword */: - case 131 /* RequireKeyword */: - case 132 /* NumberKeyword */: - case 133 /* SetKeyword */: - case 134 /* StringKeyword */: - case 135 /* SymbolKeyword */: - case 136 /* TypeKeyword */: - case 137 /* UndefinedKeyword */: - case 138 /* FromKeyword */: - case 139 /* GlobalKeyword */: - case 140 /* OfKeyword */: - writeTokenText(kind); - return; // Parse tree nodes // Names - case 141 /* QualifiedName */: + case 143 /* QualifiedName */: return emitQualifiedName(node); - case 142 /* ComputedPropertyName */: + case 144 /* ComputedPropertyName */: return emitComputedPropertyName(node); // Signature elements - case 143 /* TypeParameter */: + case 145 /* TypeParameter */: return emitTypeParameter(node); - case 144 /* Parameter */: + case 146 /* Parameter */: return emitParameter(node); - case 145 /* Decorator */: + case 147 /* Decorator */: return emitDecorator(node); // Type members - case 146 /* PropertySignature */: + case 148 /* PropertySignature */: return emitPropertySignature(node); - case 147 /* PropertyDeclaration */: + case 149 /* PropertyDeclaration */: return emitPropertyDeclaration(node); - case 148 /* MethodSignature */: + case 150 /* MethodSignature */: return emitMethodSignature(node); - case 149 /* MethodDeclaration */: + case 151 /* MethodDeclaration */: return emitMethodDeclaration(node); - case 150 /* Constructor */: + case 152 /* Constructor */: return emitConstructor(node); - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: return emitAccessorDeclaration(node); - case 153 /* CallSignature */: + case 155 /* CallSignature */: return emitCallSignature(node); - case 154 /* ConstructSignature */: + case 156 /* ConstructSignature */: return emitConstructSignature(node); - case 155 /* IndexSignature */: + case 157 /* IndexSignature */: return emitIndexSignature(node); // Types - case 156 /* TypePredicate */: + case 158 /* TypePredicate */: return emitTypePredicate(node); - case 157 /* TypeReference */: + case 159 /* TypeReference */: return emitTypeReference(node); - case 158 /* FunctionType */: + case 160 /* FunctionType */: return emitFunctionType(node); - case 159 /* ConstructorType */: + case 161 /* ConstructorType */: return emitConstructorType(node); - case 160 /* TypeQuery */: + case 162 /* TypeQuery */: return emitTypeQuery(node); - case 161 /* TypeLiteral */: + case 163 /* TypeLiteral */: return emitTypeLiteral(node); - case 162 /* ArrayType */: + case 164 /* ArrayType */: return emitArrayType(node); - case 163 /* TupleType */: + case 165 /* TupleType */: return emitTupleType(node); - case 164 /* UnionType */: + case 166 /* UnionType */: return emitUnionType(node); - case 165 /* IntersectionType */: + case 167 /* IntersectionType */: return emitIntersectionType(node); - case 166 /* ParenthesizedType */: + case 168 /* ParenthesizedType */: return emitParenthesizedType(node); - case 199 /* ExpressionWithTypeArguments */: + case 201 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(node); - case 167 /* ThisType */: + case 169 /* ThisType */: return emitThisType(); - case 168 /* TypeOperator */: + case 170 /* TypeOperator */: return emitTypeOperator(node); - case 169 /* IndexedAccessType */: + case 171 /* IndexedAccessType */: return emitIndexedAccessType(node); - case 170 /* MappedType */: + case 172 /* MappedType */: return emitMappedType(node); - case 171 /* LiteralType */: + case 173 /* LiteralType */: return emitLiteralType(node); // Binding patterns - case 172 /* ObjectBindingPattern */: + case 174 /* ObjectBindingPattern */: return emitObjectBindingPattern(node); - case 173 /* ArrayBindingPattern */: + case 175 /* ArrayBindingPattern */: return emitArrayBindingPattern(node); - case 174 /* BindingElement */: + case 176 /* BindingElement */: return emitBindingElement(node); // Misc - case 202 /* TemplateSpan */: + case 205 /* TemplateSpan */: return emitTemplateSpan(node); - case 203 /* SemicolonClassElement */: + case 206 /* SemicolonClassElement */: return emitSemicolonClassElement(); // Statements - case 204 /* Block */: + case 207 /* Block */: return emitBlock(node); - case 205 /* VariableStatement */: + case 208 /* VariableStatement */: return emitVariableStatement(node); - case 206 /* EmptyStatement */: + case 209 /* EmptyStatement */: return emitEmptyStatement(); - case 207 /* ExpressionStatement */: + case 210 /* ExpressionStatement */: return emitExpressionStatement(node); - case 208 /* IfStatement */: + case 211 /* IfStatement */: return emitIfStatement(node); - case 209 /* DoStatement */: + case 212 /* DoStatement */: return emitDoStatement(node); - case 210 /* WhileStatement */: + case 213 /* WhileStatement */: return emitWhileStatement(node); - case 211 /* ForStatement */: + case 214 /* ForStatement */: return emitForStatement(node); - case 212 /* ForInStatement */: + case 215 /* ForInStatement */: return emitForInStatement(node); - case 213 /* ForOfStatement */: + case 216 /* ForOfStatement */: return emitForOfStatement(node); - case 214 /* ContinueStatement */: + case 217 /* ContinueStatement */: return emitContinueStatement(node); - case 215 /* BreakStatement */: + case 218 /* BreakStatement */: return emitBreakStatement(node); - case 216 /* ReturnStatement */: + case 219 /* ReturnStatement */: return emitReturnStatement(node); - case 217 /* WithStatement */: + case 220 /* WithStatement */: return emitWithStatement(node); - case 218 /* SwitchStatement */: + case 221 /* SwitchStatement */: return emitSwitchStatement(node); - case 219 /* LabeledStatement */: + case 222 /* LabeledStatement */: return emitLabeledStatement(node); - case 220 /* ThrowStatement */: + case 223 /* ThrowStatement */: return emitThrowStatement(node); - case 221 /* TryStatement */: + case 224 /* TryStatement */: return emitTryStatement(node); - case 222 /* DebuggerStatement */: + case 225 /* DebuggerStatement */: return emitDebuggerStatement(node); // Declarations - case 223 /* VariableDeclaration */: + case 226 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 224 /* VariableDeclarationList */: + case 227 /* VariableDeclarationList */: return emitVariableDeclarationList(node); - case 225 /* FunctionDeclaration */: + case 228 /* FunctionDeclaration */: return emitFunctionDeclaration(node); - case 226 /* ClassDeclaration */: + case 229 /* ClassDeclaration */: return emitClassDeclaration(node); - case 227 /* InterfaceDeclaration */: + case 230 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 228 /* TypeAliasDeclaration */: + case 231 /* TypeAliasDeclaration */: return emitTypeAliasDeclaration(node); - case 229 /* EnumDeclaration */: + case 232 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 230 /* ModuleDeclaration */: + case 233 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 231 /* ModuleBlock */: + case 234 /* ModuleBlock */: return emitModuleBlock(node); - case 232 /* CaseBlock */: + case 235 /* CaseBlock */: return emitCaseBlock(node); - case 234 /* ImportEqualsDeclaration */: + case 237 /* ImportEqualsDeclaration */: return emitImportEqualsDeclaration(node); - case 235 /* ImportDeclaration */: + case 238 /* ImportDeclaration */: return emitImportDeclaration(node); - case 236 /* ImportClause */: + case 239 /* ImportClause */: return emitImportClause(node); - case 237 /* NamespaceImport */: + case 240 /* NamespaceImport */: return emitNamespaceImport(node); - case 238 /* NamedImports */: + case 241 /* NamedImports */: return emitNamedImports(node); - case 239 /* ImportSpecifier */: + case 242 /* ImportSpecifier */: return emitImportSpecifier(node); - case 240 /* ExportAssignment */: + case 243 /* ExportAssignment */: return emitExportAssignment(node); - case 241 /* ExportDeclaration */: + case 244 /* ExportDeclaration */: return emitExportDeclaration(node); - case 242 /* NamedExports */: + case 245 /* NamedExports */: return emitNamedExports(node); - case 243 /* ExportSpecifier */: + case 246 /* ExportSpecifier */: return emitExportSpecifier(node); - case 244 /* MissingDeclaration */: + case 247 /* MissingDeclaration */: return; // Module references - case 245 /* ExternalModuleReference */: + case 248 /* ExternalModuleReference */: return emitExternalModuleReference(node); // JSX (non-expression) case 10 /* JsxText */: return emitJsxText(node); - case 248 /* JsxOpeningElement */: + case 251 /* JsxOpeningElement */: return emitJsxOpeningElement(node); - case 249 /* JsxClosingElement */: + case 252 /* JsxClosingElement */: return emitJsxClosingElement(node); - case 250 /* JsxAttribute */: + case 253 /* JsxAttribute */: return emitJsxAttribute(node); - case 251 /* JsxSpreadAttribute */: + case 254 /* JsxAttributes */: + return emitJsxAttributes(node); + case 255 /* JsxSpreadAttribute */: return emitJsxSpreadAttribute(node); - case 252 /* JsxExpression */: + case 256 /* JsxExpression */: return emitJsxExpression(node); // Clauses - case 253 /* CaseClause */: + case 257 /* CaseClause */: return emitCaseClause(node); - case 254 /* DefaultClause */: + case 258 /* DefaultClause */: return emitDefaultClause(node); - case 255 /* HeritageClause */: + case 259 /* HeritageClause */: return emitHeritageClause(node); - case 256 /* CatchClause */: + case 260 /* CatchClause */: return emitCatchClause(node); // Property assignments - case 257 /* PropertyAssignment */: + case 261 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 258 /* ShorthandPropertyAssignment */: + case 262 /* ShorthandPropertyAssignment */: return emitShorthandPropertyAssignment(node); - case 259 /* SpreadAssignment */: + case 263 /* SpreadAssignment */: return emitSpreadAssignment(node); // Enum - case 260 /* EnumMember */: + case 264 /* EnumMember */: return emitEnumMember(node); } // If the node is an expression, try to emit it as an expression with // substitution. if (ts.isExpression(node)) { - return pipelineEmitWithSubstitution(1 /* Expression */, node); + return pipelineEmitExpression(trySubstituteNode(1 /* Expression */, node)); + } + if (ts.isToken(node)) { + writeTokenText(kind); + return; } } - /** - * Emits a node in the Expression EmitContext. - * - * NOTE: Do not call this method directly. It is part of the emit pipeline - * and should only be called indirectly from pipelineEmitForContext. - */ - function pipelineEmitInExpressionContext(node) { + function pipelineEmitExpression(node) { var kind = node.kind; switch (kind) { // Literals case 8 /* NumericLiteral */: return emitNumericLiteral(node); case 9 /* StringLiteral */: - case 11 /* RegularExpressionLiteral */: - case 12 /* NoSubstitutionTemplateLiteral */: + case 12 /* RegularExpressionLiteral */: + case 13 /* NoSubstitutionTemplateLiteral */: return emitLiteral(node); // Identifiers - case 70 /* Identifier */: + case 71 /* Identifier */: return emitIdentifier(node); // Reserved words - case 85 /* FalseKeyword */: - case 94 /* NullKeyword */: - case 96 /* SuperKeyword */: - case 100 /* TrueKeyword */: - case 98 /* ThisKeyword */: + case 86 /* FalseKeyword */: + case 95 /* NullKeyword */: + case 97 /* SuperKeyword */: + case 101 /* TrueKeyword */: + case 99 /* ThisKeyword */: writeTokenText(kind); return; // Expressions - case 175 /* ArrayLiteralExpression */: + case 177 /* ArrayLiteralExpression */: return emitArrayLiteralExpression(node); - case 176 /* ObjectLiteralExpression */: + case 178 /* ObjectLiteralExpression */: return emitObjectLiteralExpression(node); - case 177 /* PropertyAccessExpression */: + case 179 /* PropertyAccessExpression */: return emitPropertyAccessExpression(node); - case 178 /* ElementAccessExpression */: + case 180 /* ElementAccessExpression */: return emitElementAccessExpression(node); - case 179 /* CallExpression */: + case 181 /* CallExpression */: return emitCallExpression(node); - case 180 /* NewExpression */: + case 182 /* NewExpression */: return emitNewExpression(node); - case 181 /* TaggedTemplateExpression */: + case 183 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 182 /* TypeAssertionExpression */: + case 184 /* TypeAssertionExpression */: return emitTypeAssertionExpression(node); - case 183 /* ParenthesizedExpression */: + case 185 /* ParenthesizedExpression */: return emitParenthesizedExpression(node); - case 184 /* FunctionExpression */: + case 186 /* FunctionExpression */: return emitFunctionExpression(node); - case 185 /* ArrowFunction */: + case 187 /* ArrowFunction */: return emitArrowFunction(node); - case 186 /* DeleteExpression */: + case 188 /* DeleteExpression */: return emitDeleteExpression(node); - case 187 /* TypeOfExpression */: + case 189 /* TypeOfExpression */: return emitTypeOfExpression(node); - case 188 /* VoidExpression */: + case 190 /* VoidExpression */: return emitVoidExpression(node); - case 189 /* AwaitExpression */: + case 191 /* AwaitExpression */: return emitAwaitExpression(node); - case 190 /* PrefixUnaryExpression */: + case 192 /* PrefixUnaryExpression */: return emitPrefixUnaryExpression(node); - case 191 /* PostfixUnaryExpression */: + case 193 /* PostfixUnaryExpression */: return emitPostfixUnaryExpression(node); - case 192 /* BinaryExpression */: + case 194 /* BinaryExpression */: return emitBinaryExpression(node); - case 193 /* ConditionalExpression */: + case 195 /* ConditionalExpression */: return emitConditionalExpression(node); - case 194 /* TemplateExpression */: + case 196 /* TemplateExpression */: return emitTemplateExpression(node); - case 195 /* YieldExpression */: + case 197 /* YieldExpression */: return emitYieldExpression(node); - case 196 /* SpreadElement */: + case 198 /* SpreadElement */: return emitSpreadExpression(node); - case 197 /* ClassExpression */: + case 199 /* ClassExpression */: return emitClassExpression(node); - case 198 /* OmittedExpression */: + case 200 /* OmittedExpression */: return; - case 200 /* AsExpression */: + case 202 /* AsExpression */: return emitAsExpression(node); - case 201 /* NonNullExpression */: + case 203 /* NonNullExpression */: return emitNonNullExpression(node); + case 204 /* MetaProperty */: + return emitMetaProperty(node); // JSX - case 246 /* JsxElement */: + case 249 /* JsxElement */: return emitJsxElement(node); - case 247 /* JsxSelfClosingElement */: + case 250 /* JsxSelfClosingElement */: return emitJsxSelfClosingElement(node); // Transformation nodes - case 294 /* PartiallyEmittedExpression */: + case 296 /* PartiallyEmittedExpression */: return emitPartiallyEmittedExpression(node); } } + function trySubstituteNode(hint, node) { + return node && substituteNode && substituteNode(hint, node) || node; + } + function emitHelpersIndirect(node) { + if (onEmitHelpers) { + onEmitHelpers(node, writeLines); + } + } // // Literals/Pseudo-literals // // SyntaxKind.NumericLiteral function emitNumericLiteral(node) { emitLiteral(node); - if (node.trailingComment) { - write(" /*" + node.trailingComment + "*/"); - } } // SyntaxKind.StringLiteral // SyntaxKind.RegularExpressionLiteral @@ -60514,7 +64788,7 @@ var ts; // SyntaxKind.TemplateTail function emitLiteral(node) { var text = getLiteralTextOfNode(node); - if ((compilerOptions.sourceMap || compilerOptions.inlineSourceMap) + if ((printerOptions.sourceMap || printerOptions.inlineSourceMap) && (node.kind === 9 /* StringLiteral */ || ts.isTemplateLiteralKind(node.kind))) { writer.writeLiteral(text); } @@ -60537,7 +64811,7 @@ var ts; emit(node.right); } function emitEntityName(node) { - if (node.kind === 70 /* Identifier */) { + if (node.kind === 71 /* Identifier */) { emitExpression(node); } else { @@ -60562,8 +64836,8 @@ var ts; writeIfPresent(node.dotDotDotToken, "..."); emit(node.name); writeIfPresent(node.questionToken, "?"); - emitExpressionWithPrefix(" = ", node.initializer); emitWithPrefix(": ", node.type); + emitExpressionWithPrefix(" = ", node.initializer); } function emitDecorator(decorator) { write("@"); @@ -60613,7 +64887,7 @@ var ts; function emitAccessorDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - write(node.kind === 151 /* GetAccessor */ ? "get " : "set "); + write(node.kind === 153 /* GetAccessor */ ? "get " : "set "); emit(node.name); emitSignatureAndBody(node, emitSignatureHead); } @@ -60716,17 +64990,13 @@ var ts; write("{"); writeLine(); increaseIndent(); - if (node.readonlyToken) { - write("readonly "); - } + writeIfPresent(node.readonlyToken, "readonly "); write("["); emit(node.typeParameter.name); write(" in "); emit(node.typeParameter.constraint); write("]"); - if (node.questionToken) { - write("?"); - } + writeIfPresent(node.questionToken, "?"); write(": "); emit(node.type); write(";"); @@ -60787,12 +65057,12 @@ var ts; write("{}"); } else { - var indentedFlag = ts.getEmitFlags(node) & 32768 /* Indented */; + var indentedFlag = ts.getEmitFlags(node) & 65536 /* Indented */; if (indentedFlag) { increaseIndent(); } var preferNewLine = node.multiLine ? 32768 /* PreferNewLine */ : 0 /* None */; - var allowTrailingComma = languageVersion >= 1 /* ES5 */ ? 32 /* AllowTrailingComma */ : 0 /* None */; + var allowTrailingComma = currentSourceFile.languageVersion >= 1 /* ES5 */ ? 32 /* AllowTrailingComma */ : 0 /* None */; emitList(node, properties, 978 /* ObjectLiteralExpressionProperties */ | allowTrailingComma | preferNewLine); if (indentedFlag) { decreaseIndent(); @@ -60802,10 +65072,10 @@ var ts; function emitPropertyAccessExpression(node) { var indentBeforeDot = false; var indentAfterDot = false; - if (!(ts.getEmitFlags(node) & 65536 /* NoIndentation */)) { + if (!(ts.getEmitFlags(node) & 131072 /* NoIndentation */)) { var dotRangeStart = node.expression.end; - var dotRangeEnd = ts.skipTrivia(currentText, node.expression.end) + 1; - var dotToken = { kind: 22 /* DotToken */, pos: dotRangeStart, end: dotRangeEnd }; + var dotRangeEnd = ts.skipTrivia(currentSourceFile.text, node.expression.end) + 1; + var dotToken = { kind: 23 /* DotToken */, pos: dotRangeStart, end: dotRangeEnd }; indentBeforeDot = needsIndentation(node, node.expression, dotToken); indentAfterDot = needsIndentation(node, dotToken, node.name); } @@ -60820,10 +65090,12 @@ var ts; // 1..toString is a valid property access, emit a dot after the literal // Also emit a dot if expression is a integer const enum value - it will appear in generated code as numeric literal function needsDotDotForPropertyAccess(expression) { - if (expression.kind === 8 /* NumericLiteral */) { - // check if numeric literal was originally written with a dot + expression = ts.skipPartiallyEmittedExpressions(expression); + if (ts.isNumericLiteral(expression)) { + // check if numeric literal is a decimal literal that was originally written with a dot var text = getLiteralTextOfNode(expression); - return text.indexOf(ts.tokenToString(22 /* DotToken */)) < 0; + return !expression.numericLiteralFlags + && text.indexOf(ts.tokenToString(23 /* DotToken */)) < 0; } else if (ts.isPropertyAccessExpression(expression) || ts.isElementAccessExpression(expression)) { // check if constant enum value is integer @@ -60831,7 +65103,7 @@ var ts; // isFinite handles cases when constantValue is undefined return isFinite(constantValue) && Math.floor(constantValue) === constantValue - && compilerOptions.removeComments; + && printerOptions.removeComments; } } function emitElementAccessExpression(node) { @@ -60857,11 +65129,9 @@ var ts; emitExpression(node.template); } function emitTypeAssertionExpression(node) { - if (node.type) { - write("<"); - emit(node.type); - write(">"); - } + write("<"); + emit(node.type); + write(">"); emitExpression(node.expression); } function emitParenthesizedExpression(node) { @@ -60920,16 +65190,16 @@ 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 === 190 /* PrefixUnaryExpression */ - && ((node.operator === 36 /* PlusToken */ && (operand.operator === 36 /* PlusToken */ || operand.operator === 42 /* PlusPlusToken */)) - || (node.operator === 37 /* MinusToken */ && (operand.operator === 37 /* MinusToken */ || operand.operator === 43 /* MinusMinusToken */))); + return operand.kind === 192 /* 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 */))); } function emitPostfixUnaryExpression(node) { emitExpression(node.operand); writeTokenText(node.operator); } function emitBinaryExpression(node) { - var isCommaOperator = node.operatorToken.kind !== 25 /* CommaToken */; + var isCommaOperator = node.operatorToken.kind !== 26 /* CommaToken */; var indentBeforeOperator = needsIndentation(node, node.left, node.operatorToken); var indentAfterOperator = needsIndentation(node, node.operatorToken, node.right); emitExpression(node.left); @@ -60986,6 +65256,11 @@ var ts; emitExpression(node.expression); write("!"); } + function emitMetaProperty(node) { + writeToken(node.keywordToken, node.pos); + write("."); + emit(node.name); + } // // Misc // @@ -60998,14 +65273,18 @@ var ts; // function emitBlock(node) { if (isSingleLineEmptyBlock(node)) { - writeToken(16 /* OpenBraceToken */, node.pos, /*contextNode*/ node); + writeToken(17 /* OpenBraceToken */, node.pos, /*contextNode*/ node); write(" "); - writeToken(17 /* CloseBraceToken */, node.statements.end, /*contextNode*/ node); + writeToken(18 /* CloseBraceToken */, node.statements.end, /*contextNode*/ node); } else { - writeToken(16 /* OpenBraceToken */, node.pos, /*contextNode*/ node); + writeToken(17 /* OpenBraceToken */, node.pos, /*contextNode*/ node); emitBlockStatements(node); - writeToken(17 /* CloseBraceToken */, node.statements.end, /*contextNode*/ 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, /*contextNode*/ node); } } function emitBlockStatements(node) { @@ -61029,16 +65308,16 @@ var ts; write(";"); } function emitIfStatement(node) { - var openParenPos = writeToken(89 /* IfKeyword */, node.pos, node); + var openParenPos = writeToken(90 /* IfKeyword */, node.pos, node); write(" "); - writeToken(18 /* OpenParenToken */, openParenPos, node); + writeToken(19 /* OpenParenToken */, openParenPos, node); emitExpression(node.expression); - writeToken(19 /* CloseParenToken */, node.expression.end, node); + writeToken(20 /* CloseParenToken */, node.expression.end, node); emitEmbeddedStatement(node, node.thenStatement); if (node.elseStatement) { writeLineOrSpace(node); - writeToken(81 /* ElseKeyword */, node.thenStatement.end, node); - if (node.elseStatement.kind === 208 /* IfStatement */) { + writeToken(82 /* ElseKeyword */, node.thenStatement.end, node); + if (node.elseStatement.kind === 211 /* IfStatement */) { write(" "); emit(node.elseStatement); } @@ -61067,9 +65346,9 @@ var ts; emitEmbeddedStatement(node, node.statement); } function emitForStatement(node) { - var openParenPos = writeToken(87 /* ForKeyword */, node.pos); + var openParenPos = writeToken(88 /* ForKeyword */, node.pos); write(" "); - writeToken(18 /* OpenParenToken */, openParenPos, /*contextNode*/ node); + writeToken(19 /* OpenParenToken */, openParenPos, /*contextNode*/ node); emitForBinding(node.initializer); write(";"); emitExpressionWithPrefix(" ", node.condition); @@ -61079,28 +65358,29 @@ var ts; emitEmbeddedStatement(node, node.statement); } function emitForInStatement(node) { - var openParenPos = writeToken(87 /* ForKeyword */, node.pos); + var openParenPos = writeToken(88 /* ForKeyword */, node.pos); write(" "); - writeToken(18 /* OpenParenToken */, openParenPos); + writeToken(19 /* OpenParenToken */, openParenPos); emitForBinding(node.initializer); write(" in "); emitExpression(node.expression); - writeToken(19 /* CloseParenToken */, node.expression.end); + writeToken(20 /* CloseParenToken */, node.expression.end); emitEmbeddedStatement(node, node.statement); } function emitForOfStatement(node) { - var openParenPos = writeToken(87 /* ForKeyword */, node.pos); + var openParenPos = writeToken(88 /* ForKeyword */, node.pos); write(" "); - writeToken(18 /* OpenParenToken */, openParenPos); + emitWithSuffix(node.awaitModifier, " "); + writeToken(19 /* OpenParenToken */, openParenPos); emitForBinding(node.initializer); write(" of "); emitExpression(node.expression); - writeToken(19 /* CloseParenToken */, node.expression.end); + writeToken(20 /* CloseParenToken */, node.expression.end); emitEmbeddedStatement(node, node.statement); } function emitForBinding(node) { if (node !== undefined) { - if (node.kind === 224 /* VariableDeclarationList */) { + if (node.kind === 227 /* VariableDeclarationList */) { emit(node); } else { @@ -61109,17 +65389,17 @@ var ts; } } function emitContinueStatement(node) { - writeToken(76 /* ContinueKeyword */, node.pos); + writeToken(77 /* ContinueKeyword */, node.pos); emitWithPrefix(" ", node.label); write(";"); } function emitBreakStatement(node) { - writeToken(71 /* BreakKeyword */, node.pos); + writeToken(72 /* BreakKeyword */, node.pos); emitWithPrefix(" ", node.label); write(";"); } function emitReturnStatement(node) { - writeToken(95 /* ReturnKeyword */, node.pos, /*contextNode*/ node); + writeToken(96 /* ReturnKeyword */, node.pos, /*contextNode*/ node); emitExpressionWithPrefix(" ", node.expression); write(";"); } @@ -61130,11 +65410,11 @@ var ts; emitEmbeddedStatement(node, node.statement); } function emitSwitchStatement(node) { - var openParenPos = writeToken(97 /* SwitchKeyword */, node.pos); + var openParenPos = writeToken(98 /* SwitchKeyword */, node.pos); write(" "); - writeToken(18 /* OpenParenToken */, openParenPos); + writeToken(19 /* OpenParenToken */, openParenPos); emitExpression(node.expression); - writeToken(19 /* CloseParenToken */, node.expression.end); + writeToken(20 /* CloseParenToken */, node.expression.end); write(" "); emit(node.caseBlock); } @@ -61162,7 +65442,7 @@ var ts; } } function emitDebuggerStatement(node) { - writeToken(77 /* DebuggerKeyword */, node.pos); + writeToken(78 /* DebuggerKeyword */, node.pos); write(";"); } // @@ -61187,24 +65467,36 @@ var ts; emitIdentifierName(node.name); emitSignatureAndBody(node, emitSignatureHead); } + function emitBlockCallback(_hint, body) { + emitBlockFunctionBody(body); + } function emitSignatureAndBody(node, emitSignatureHead) { var body = node.body; if (body) { if (ts.isBlock(body)) { - var indentedFlag = ts.getEmitFlags(node) & 32768 /* Indented */; + var indentedFlag = ts.getEmitFlags(node) & 65536 /* Indented */; if (indentedFlag) { increaseIndent(); } - if (ts.getEmitFlags(node) & 262144 /* ReuseTempVariableScope */) { + if (ts.getEmitFlags(node) & 524288 /* ReuseTempVariableScope */) { emitSignatureHead(node); - emitBlockFunctionBody(body); + if (onEmitNode) { + onEmitNode(3 /* Unspecified */, body, emitBlockCallback); + } + else { + emitBlockFunctionBody(body); + } } else { - var savedTempFlags = tempFlags; - tempFlags = 0; + pushNameGenerationScope(); emitSignatureHead(node); - emitBlockFunctionBody(body); - tempFlags = savedTempFlags; + if (onEmitNode) { + onEmitNode(3 /* Unspecified */, body, emitBlockCallback); + } + else { + emitBlockFunctionBody(body); + } + popNameGenerationScope(); } if (indentedFlag) { decreaseIndent(); @@ -61259,11 +65551,17 @@ var ts; function emitBlockFunctionBody(body) { write(" {"); increaseIndent(); - emitBodyWithDetachedComments(body, body.statements, shouldEmitBlockFunctionBodyOnSingleLine(body) + var emitBlockFunctionBody = shouldEmitBlockFunctionBodyOnSingleLine(body) ? emitBlockFunctionBodyOnSingleLine - : emitBlockFunctionBodyWorker); + : emitBlockFunctionBodyWorker; + if (emitBodyWithDetachedComments) { + emitBodyWithDetachedComments(body, body.statements, emitBlockFunctionBody); + } + else { + emitBlockFunctionBody(body); + } decreaseIndent(); - writeToken(17 /* CloseBraceToken */, body.statements.end, body); + writeToken(18 /* CloseBraceToken */, body.statements.end, body); } function emitBlockFunctionBodyOnSingleLine(body) { emitBlockFunctionBodyWorker(body, /*emitBlockFunctionBodyOnSingleLine*/ true); @@ -61271,8 +65569,9 @@ var ts; function emitBlockFunctionBodyWorker(body, emitBlockFunctionBodyOnSingleLine) { // Emit all the prologue directives (like "use strict"). var statementOffset = emitPrologueDirectives(body.statements, /*startWithNewLine*/ true); - var helpersEmitted = emitHelpers(body); - if (statementOffset === 0 && !helpersEmitted && emitBlockFunctionBodyOnSingleLine) { + var pos = writer.getTextPos(); + emitHelpersIndirect(body); + if (statementOffset === 0 && pos === writer.getTextPos() && emitBlockFunctionBodyOnSingleLine) { decreaseIndent(); emitList(body, body.statements, 384 /* SingleLineFunctionBodyStatements */); increaseIndent(); @@ -61289,21 +65588,20 @@ var ts; emitModifiers(node, node.modifiers); write("class"); emitNodeWithPrefix(" ", node.name, emitIdentifierName); - var indentedFlag = ts.getEmitFlags(node) & 32768 /* Indented */; + var indentedFlag = ts.getEmitFlags(node) & 65536 /* Indented */; if (indentedFlag) { increaseIndent(); } emitTypeParameters(node, node.typeParameters); emitList(node, node.heritageClauses, 256 /* ClassHeritageClauses */); - var savedTempFlags = tempFlags; - tempFlags = 0; + pushNameGenerationScope(); write(" {"); emitList(node, node.members, 65 /* ClassMembers */); write("}"); + popNameGenerationScope(); if (indentedFlag) { decreaseIndent(); } - tempFlags = savedTempFlags; } function emitInterfaceDeclaration(node) { emitDecorators(node, node.decorators); @@ -61330,19 +65628,18 @@ var ts; emitModifiers(node, node.modifiers); write("enum "); emit(node.name); - var savedTempFlags = tempFlags; - tempFlags = 0; + pushNameGenerationScope(); write(" {"); emitList(node, node.members, 81 /* EnumMembers */); write("}"); - tempFlags = savedTempFlags; + popNameGenerationScope(); } function emitModuleDeclaration(node) { emitModifiers(node, node.modifiers); write(node.flags & 16 /* Namespace */ ? "namespace " : "module "); emit(node.name); var body = node.body; - while (body.kind === 230 /* ModuleDeclaration */) { + while (body.kind === 233 /* ModuleDeclaration */) { write("."); emit(body.name); body = body.body; @@ -61355,19 +65652,17 @@ var ts; write("{ }"); } else { - var savedTempFlags = tempFlags; - tempFlags = 0; + pushNameGenerationScope(); write("{"); - increaseIndent(); emitBlockStatements(node); write("}"); - tempFlags = savedTempFlags; + popNameGenerationScope(); } } function emitCaseBlock(node) { - writeToken(16 /* OpenBraceToken */, node.pos); + writeToken(17 /* OpenBraceToken */, node.pos); emitList(node, node.clauses, 65 /* CaseBlockClauses */); - writeToken(17 /* CloseBraceToken */, node.clauses.end); + writeToken(18 /* CloseBraceToken */, node.clauses.end); } function emitImportEqualsDeclaration(node) { emitModifiers(node, node.modifiers); @@ -61378,7 +65673,7 @@ var ts; write(";"); } function emitModuleReference(node) { - if (node.kind === 70 /* Identifier */) { + if (node.kind === 71 /* Identifier */) { emitExpression(node); } else { @@ -61469,14 +65764,20 @@ var ts; write("<"); emitJsxTagName(node.tagName); write(" "); - emitList(node, node.attributes, 131328 /* JsxElementAttributes */); + // We are checking here so we won't re-enter the emiting pipeline and emit extra sourcemap + if (node.attributes.properties && node.attributes.properties.length > 0) { + emit(node.attributes); + } write("/>"); } function emitJsxOpeningElement(node) { write("<"); emitJsxTagName(node.tagName); - writeIfAny(node.attributes, " "); - emitList(node, node.attributes, 131328 /* JsxElementAttributes */); + writeIfAny(node.attributes.properties, " "); + // We are checking here so we won't re-enter the emitting pipeline and emit extra sourcemap + if (node.attributes.properties && node.attributes.properties.length > 0) { + emit(node.attributes); + } write(">"); } function emitJsxText(node) { @@ -61487,6 +65788,9 @@ var ts; emitJsxTagName(node.tagName); write(">"); } + function emitJsxAttributes(node) { + emitList(node, node.properties, 131328 /* JsxElementAttributes */); + } function emitJsxAttribute(node) { emit(node.name); emitWithPrefix("=", node.initializer); @@ -61499,12 +65803,15 @@ var ts; function emitJsxExpression(node) { if (node.expression) { write("{"); + if (node.dotDotDotToken) { + write("..."); + } emitExpression(node.expression); write("}"); } } function emitJsxTagName(node) { - if (node.kind === 70 /* Identifier */) { + if (node.kind === 71 /* Identifier */) { emitExpression(node); } else { @@ -61546,12 +65853,11 @@ var ts; emitList(node, node.types, 272 /* HeritageClauseTypes */); } function emitCatchClause(node) { - writeLine(); - var openParenPos = writeToken(73 /* CatchKeyword */, node.pos); + var openParenPos = writeToken(74 /* CatchKeyword */, node.pos); write(" "); - writeToken(18 /* OpenParenToken */, openParenPos); + writeToken(19 /* OpenParenToken */, openParenPos); emit(node.variableDeclaration); - writeToken(19 /* CloseParenToken */, node.variableDeclaration ? node.variableDeclaration.end : openParenPos); + writeToken(20 /* CloseParenToken */, node.variableDeclaration ? node.variableDeclaration.end : openParenPos); write(" "); emit(node.block); } @@ -61569,7 +65875,7 @@ var ts; // "comment1" is not considered to be leading comment for node.initializer // but rather a trailing comment on the previous node. var initializer = node.initializer; - if ((ts.getEmitFlags(initializer) & 512 /* NoLeadingComments */) === 0) { + if (emitTrailingCommentsOfPosition && (ts.getEmitFlags(initializer) & 512 /* NoLeadingComments */) === 0) { var commentRange = ts.getCommentRange(initializer); emitTrailingCommentsOfPosition(commentRange.pos); } @@ -61600,17 +65906,27 @@ var ts; // function emitSourceFile(node) { writeLine(); - emitShebang(); - emitBodyWithDetachedComments(node, node.statements, emitSourceFileWorker); + var statements = node.statements; + if (emitBodyWithDetachedComments) { + // Emit detached comment if there are no prologue directives or if the first node is synthesized. + // The synthesized node will have no leading comment so some comments may be missed. + var shouldEmitDetachedComment = statements.length === 0 || + !ts.isPrologueDirective(statements[0]) || + ts.nodeIsSynthesized(statements[0]); + if (shouldEmitDetachedComment) { + emitBodyWithDetachedComments(node, statements, emitSourceFileWorker); + return; + } + } + emitSourceFileWorker(node); } function emitSourceFileWorker(node) { var statements = node.statements; - var statementOffset = emitPrologueDirectives(statements); - var savedTempFlags = tempFlags; - tempFlags = 0; - emitHelpers(node); - emitList(node, statements, 1 /* MultiLine */, statementOffset); - tempFlags = savedTempFlags; + pushNameGenerationScope(); + emitHelpersIndirect(node); + var index = ts.findIndex(statements, function (statement) { return !ts.isPrologueDirective(statement); }); + emitList(node, statements, 1 /* MultiLine */, index === -1 ? statements.length : index); + popNameGenerationScope(); } // Transformation nodes function emitPartiallyEmittedExpression(node) { @@ -61620,13 +65936,20 @@ var ts; * Emits any prologue directives at the start of a Statement list, returning the * number of prologue directives written to the output. */ - function emitPrologueDirectives(statements, startWithNewLine) { + function emitPrologueDirectives(statements, startWithNewLine, seenPrologueDirectives) { for (var i = 0; i < statements.length; i++) { - if (ts.isPrologueDirective(statements[i])) { - if (startWithNewLine || i > 0) { - writeLine(); + var statement = statements[i]; + if (ts.isPrologueDirective(statement)) { + var shouldEmitPrologueDirective = seenPrologueDirectives ? !seenPrologueDirectives.has(statement.expression.text) : true; + if (shouldEmitPrologueDirective) { + if (startWithNewLine || i > 0) { + writeLine(); + } + emit(statement); + if (seenPrologueDirectives) { + seenPrologueDirectives.set(statement.expression.text, statement.expression.text); + } } - emit(statements[i]); } else { // return index of the first non prologue directive @@ -61635,81 +65958,42 @@ var ts; } return statements.length; } - function emitHelpers(node, isBundle) { - var sourceFile = ts.isSourceFile(node) ? node : currentSourceFile; - var shouldSkip = compilerOptions.noEmitHelpers || (sourceFile && ts.getExternalHelpersModuleName(sourceFile) !== undefined); - var shouldBundle = ts.isSourceFile(node) && !isOwnFileEmit; - var helpersEmitted = false; - var helpers = ts.getEmitHelpers(node); - if (helpers) { - for (var _a = 0, _b = ts.stableSort(helpers, ts.compareEmitHelpers); _a < _b.length; _a++) { - var helper = _b[_a]; - if (!helper.scoped) { - // Skip the helper if it can be skipped and the noEmitHelpers compiler - // option is set, or if it can be imported and the importHelpers compiler - // option is set. - if (shouldSkip) - continue; - // Skip the helper if it can be bundled but hasn't already been emitted and we - // are emitting a bundled module. - if (shouldBundle) { - if (bundledHelpers[helper.name]) { - continue; - } - bundledHelpers[helper.name] = true; - } - } - else if (isBundle) { - // Skip the helper if it is scoped and we are emitting bundled helpers - continue; - } - writeLines(helper.text); - helpersEmitted = true; - } + function emitPrologueDirectivesIfNeeded(sourceFileOrBundle) { + if (ts.isSourceFile(sourceFileOrBundle)) { + setSourceFile(sourceFileOrBundle); + emitPrologueDirectives(sourceFileOrBundle.statements); } - if (helpersEmitted) { - writeLine(); - } - return helpersEmitted; - } - function writeLines(text) { - var lines = text.split(/\r\n?|\n/g); - var indentation = guessIndentation(lines); - for (var i = 0; i < lines.length; i++) { - var line = indentation ? lines[i].slice(indentation) : lines[i]; - if (line.length) { - if (i > 0) { - writeLine(); - } - write(line); + else { + var seenPrologueDirectives = ts.createMap(); + for (var _a = 0, _b = sourceFileOrBundle.sourceFiles; _a < _b.length; _a++) { + var sourceFile = _b[_a]; + setSourceFile(sourceFile); + emitPrologueDirectives(sourceFile.statements, /*startWithNewLine*/ true, seenPrologueDirectives); } } } - function guessIndentation(lines) { - var indentation; - for (var _a = 0, lines_1 = lines; _a < lines_1.length; _a++) { - var line = lines_1[_a]; - for (var i = 0; i < line.length && (indentation === undefined || i < indentation); i++) { - if (!ts.isWhiteSpace(line.charCodeAt(i))) { - if (indentation === undefined || i < indentation) { - indentation = i; - break; - } + function emitShebangIfNeeded(sourceFileOrBundle) { + if (ts.isSourceFile(sourceFileOrBundle)) { + var shebang = ts.getShebang(sourceFileOrBundle.text); + if (shebang) { + write(shebang); + writeLine(); + return true; + } + } + else { + for (var _a = 0, _b = sourceFileOrBundle.sourceFiles; _a < _b.length; _a++) { + var sourceFile = _b[_a]; + // Emit only the first encountered shebang + if (emitShebangIfNeeded(sourceFile)) { + break; } } } - return indentation; } // // Helpers // - function emitShebang() { - var shebang = ts.getShebang(currentText); - if (shebang) { - write(shebang); - writeLine(); - } - } function emitModifiers(node, modifiers) { if (modifiers && modifiers.length) { emitList(node, modifiers, 256 /* Modifiers */); @@ -61792,6 +66076,9 @@ var ts; if (format & 7680 /* BracketsMask */) { write(getOpeningBracket(format)); } + if (onBeforeEmitNodeArray) { + onBeforeEmitNodeArray(children); + } if (isEmpty) { // Write a line terminator if the parent node was multi-line if (format & 1 /* MultiLine */) { @@ -61824,6 +66111,15 @@ var ts; var child = children[start + i]; // Write the delimiter if this is not the first node. if (previousSibling) { + // i.e + // function commentedParameters( + // /* Parameter a */ + // a + // /* End of parameter a */ -> this comment isn't considered to be trailing comment of parameter "a" due to newline + // , + if (delimiter && previousSibling.end !== parentNode.end) { + emitLeadingCommentsOfPosition(previousSibling.end); + } write(delimiter); // Write either a line terminator or whitespace to separate the elements. if (shouldWriteSeparatingLineTerminator(previousSibling, child, format)) { @@ -61840,14 +66136,16 @@ var ts; write(" "); } } + // Emit this child. if (shouldEmitInterveningComments) { - var commentRange = ts.getCommentRange(child); - emitTrailingCommentsOfPosition(commentRange.pos); + if (emitTrailingCommentsOfPosition) { + var commentRange = ts.getCommentRange(child); + emitTrailingCommentsOfPosition(commentRange.pos); + } } else { shouldEmitInterveningComments = mayEmitInterveningComments; } - // Emit this child. emit(child); if (shouldDecreaseIndentAfterEmit) { decreaseIndent(); @@ -61860,6 +66158,15 @@ var ts; if (format & 16 /* CommaDelimited */ && hasTrailingComma) { write(","); } + // Emit any trailing comment of the last element in the list + // i.e + // var array = [... + // 2 + // /* end of element 2 */ + // ]; + if (previousSibling && delimiter && previousSibling.end !== parentNode.end) { + emitLeadingCommentsOfPosition(previousSibling.end); + } // Decrease the indent, if requested. if (format & 64 /* Indented */) { decreaseIndent(); @@ -61872,10 +66179,45 @@ var ts; write(" "); } } + if (onAfterEmitNodeArray) { + onAfterEmitNodeArray(children); + } if (format & 7680 /* BracketsMask */) { write(getClosingBracket(format)); } } + function write(s) { + writer.write(s); + } + function writeLine() { + writer.writeLine(); + } + function increaseIndent() { + writer.increaseIndent(); + } + function decreaseIndent() { + writer.decreaseIndent(); + } + function writeIfAny(nodes, text) { + if (ts.some(nodes)) { + write(text); + } + } + function writeIfPresent(node, text) { + if (node) { + write(text); + } + } + function writeToken(token, pos, contextNode) { + return onEmitSourceMapOfToken + ? onEmitSourceMapOfToken(contextNode, token, pos, writeTokenText) + : writeTokenText(token, pos); + } + function writeTokenText(token, pos) { + var tokenString = ts.tokenToString(token); + write(tokenString); + return pos < 0 ? pos : pos + tokenString.length; + } function writeLineOrSpace(node) { if (ts.getEmitFlags(node) & 1 /* SingleLine */) { write(" "); @@ -61884,23 +66226,32 @@ var ts; writeLine(); } } - function writeIfAny(nodes, text) { - if (nodes && nodes.length > 0) { - write(text); + function writeLines(text) { + var lines = text.split(/\r\n?|\n/g); + var indentation = guessIndentation(lines); + for (var i = 0; i < lines.length; i++) { + var line = indentation ? lines[i].slice(indentation) : lines[i]; + if (line.length) { + writeLine(); + write(line); + writeLine(); + } } } - function writeIfPresent(node, text) { - if (node !== undefined) { - write(text); + function guessIndentation(lines) { + var indentation; + for (var _a = 0, lines_1 = lines; _a < lines_1.length; _a++) { + var line = lines_1[_a]; + for (var i = 0; i < line.length && (indentation === undefined || i < indentation); i++) { + if (!ts.isWhiteSpaceLike(line.charCodeAt(i))) { + if (indentation === undefined || i < indentation) { + indentation = i; + break; + } + } + } } - } - function writeToken(token, pos, contextNode) { - return emitTokenWithSourceMap(contextNode, token, pos, writeTokenText); - } - function writeTokenText(token, pos) { - var tokenString = ts.tokenToString(token); - write(tokenString); - return pos < 0 ? pos : pos + tokenString.length; + return indentation; } function increaseIndentIf(value, valueToWriteWhenNotIndenting) { if (value) { @@ -62011,15 +66362,23 @@ var ts; && !ts.nodeIsSynthesized(node2) && !ts.rangeEndIsOnSameLineAsRangeStart(node1, node2, currentSourceFile); } + function isSingleLineEmptyBlock(block) { + return !block.multiLine + && isEmptyBlock(block); + } + function isEmptyBlock(block) { + return block.statements.length === 0 + && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); + } function skipSynthesizedParentheses(node) { - while (node.kind === 183 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { + while (node.kind === 185 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { node = node.expression; } return node; } function getTextOfNode(node, includeTrivia) { if (ts.isGeneratedIdentifier(node)) { - return getGeneratedIdentifier(node); + return generateName(node); } else if (ts.isIdentifier(node) && (ts.nodeIsSynthesized(node) || !node.parent)) { return ts.unescapeIdentifier(node.text); @@ -62042,26 +66401,60 @@ var ts; return getLiteralTextOfNode(textSourceNode); } } - return ts.getLiteralText(node, currentSourceFile, languageVersion); + return ts.getLiteralText(node, currentSourceFile); } - function isSingleLineEmptyBlock(block) { - return !block.multiLine - && isEmptyBlock(block); + /** + * Push a new name generation scope. + */ + function pushNameGenerationScope() { + tempFlagsStack.push(tempFlags); + tempFlags = 0; } - function isEmptyBlock(block) { - return block.statements.length === 0 - && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); + /** + * Pop the current name generation scope. + */ + function popNameGenerationScope() { + tempFlags = tempFlagsStack.pop(); } + /** + * Generate the text for a generated identifier. + */ + function generateName(name) { + if (name.autoGenerateKind === 4 /* Node */) { + // Node names generate unique names based on their original node + // and are cached based on that node's id. + var node = getNodeForGeneratedName(name); + return generateNameCached(node); + } + else { + // Auto, Loop, and Unique names are cached based on their unique + // autoGenerateId. + var autoGenerateId = name.autoGenerateId; + return autoGeneratedIdToGeneratedName[autoGenerateId] || (autoGeneratedIdToGeneratedName[autoGenerateId] = ts.unescapeIdentifier(makeName(name))); + } + } + function generateNameCached(node) { + var nodeId = ts.getNodeId(node); + return nodeIdToGeneratedName[nodeId] || (nodeIdToGeneratedName[nodeId] = ts.unescapeIdentifier(generateNameForNode(node))); + } + /** + * Returns a value indicating whether a name is unique globally, within the current file, + * or within the NameGenerator. + */ function isUniqueName(name) { - return !resolver.hasGlobalName(name) && - !ts.hasProperty(currentFileIdentifiers, name) && - !ts.hasProperty(generatedNameSet, name); + return !(hasGlobalName && hasGlobalName(name)) + && !currentSourceFile.identifiers.has(name) + && !generatedNames.has(name); } + /** + * Returns a value indicating whether a name is unique within a container. + */ function isUniqueLocalName(name, container) { for (var node = container; ts.isNodeDescendantOf(node, container); node = node.nextContainer) { - if (node.locals && ts.hasProperty(node.locals, name)) { + if (node.locals) { + var local = node.locals.get(name); // We conservatively include alias symbols to cover cases where they're emitted as locals - if (node.locals[name].flags & (107455 /* Value */ | 1048576 /* ExportValue */ | 8388608 /* Alias */)) { + if (local && local.flags & (107455 /* Value */ | 1048576 /* ExportValue */ | 8388608 /* Alias */)) { return false; } } @@ -62069,16 +66462,16 @@ var ts; return true; } /** - * Return the next available name in the pattern _a ... _z, _0, _1, ... - * TempFlags._i or TempFlags._n may be used to express a preference for that dedicated name. - * Note that names generated by makeTempVariableName and makeUniqueName will never conflict. - */ + * Return the next available name in the pattern _a ... _z, _0, _1, ... + * TempFlags._i or TempFlags._n may be used to express a preference for that dedicated name. + * Note that names generated by makeTempVariableName and makeUniqueName will never conflict. + */ function makeTempVariableName(flags) { if (flags && !(tempFlags & flags)) { - var name_41 = flags === 268435456 /* _i */ ? "_i" : "_n"; - if (isUniqueName(name_41)) { + var name = flags === 268435456 /* _i */ ? "_i" : "_n"; + if (isUniqueName(name)) { tempFlags |= flags; - return name_41; + return name; } } while (true) { @@ -62086,19 +66479,21 @@ var ts; tempFlags++; // Skip over 'i' and 'n' if (count !== 8 && count !== 13) { - var name_42 = count < 26 + var name = count < 26 ? "_" + String.fromCharCode(97 /* a */ + count) : "_" + (count - 26); - if (isUniqueName(name_42)) { - return name_42; + if (isUniqueName(name)) { + return name; } } } } - // Generate a name that is unique within the current file and doesn't conflict with any names - // in global scope. The name is formed by adding an '_n' suffix to the specified base name, - // where n is a positive integer. Note that names generated by makeTempVariableName and - // makeUniqueName are guaranteed to never conflict. + /** + * Generate a name that is unique within the current file and doesn't conflict with any names + * in global scope. The name is formed by adding an '_n' suffix to the specified base name, + * where n is a positive integer. Note that names generated by makeTempVariableName and + * makeUniqueName are guaranteed to never conflict. + */ function makeUniqueName(baseName) { // Find the first unique 'name_n', where n is a positive number if (baseName.charCodeAt(baseName.length - 1) !== 95 /* _ */) { @@ -62108,73 +66503,90 @@ var ts; while (true) { var generatedName = baseName + i; if (isUniqueName(generatedName)) { - return generatedNameSet[generatedName] = generatedName; + generatedNames.set(generatedName, generatedName); + return generatedName; } i++; } } + /** + * Generates a unique name for a ModuleDeclaration or EnumDeclaration. + */ function generateNameForModuleOrEnum(node) { var name = getTextOfNode(node.name); // Use module/enum name itself if it is unique, otherwise make a unique variation return isUniqueLocalName(name, node) ? name : makeUniqueName(name); } + /** + * Generates a unique name for an ImportDeclaration or ExportDeclaration. + */ function generateNameForImportOrExportDeclaration(node) { var expr = ts.getExternalModuleName(node); var baseName = expr.kind === 9 /* StringLiteral */ ? ts.escapeIdentifier(ts.makeIdentifierFromModuleName(expr.text)) : "module"; return makeUniqueName(baseName); } + /** + * Generates a unique name for a default export. + */ function generateNameForExportDefault() { return makeUniqueName("default"); } + /** + * Generates a unique name for a class expression. + */ function generateNameForClassExpression() { return makeUniqueName("class"); } + function generateNameForMethodOrAccessor(node) { + if (ts.isIdentifier(node.name)) { + return generateNameCached(node.name); + } + return makeTempVariableName(0 /* Auto */); + } /** * Generates a unique name from a node. - * - * @param node A node. */ function generateNameForNode(node) { switch (node.kind) { - case 70 /* Identifier */: + case 71 /* Identifier */: return makeUniqueName(getTextOfNode(node)); - case 230 /* ModuleDeclaration */: - case 229 /* EnumDeclaration */: + case 233 /* ModuleDeclaration */: + case 232 /* EnumDeclaration */: return generateNameForModuleOrEnum(node); - case 235 /* ImportDeclaration */: - case 241 /* ExportDeclaration */: + case 238 /* ImportDeclaration */: + case 244 /* ExportDeclaration */: return generateNameForImportOrExportDeclaration(node); - case 225 /* FunctionDeclaration */: - case 226 /* ClassDeclaration */: - case 240 /* ExportAssignment */: + case 228 /* FunctionDeclaration */: + case 229 /* ClassDeclaration */: + case 243 /* ExportAssignment */: return generateNameForExportDefault(); - case 197 /* ClassExpression */: + case 199 /* ClassExpression */: return generateNameForClassExpression(); + case 151 /* MethodDeclaration */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + return generateNameForMethodOrAccessor(node); default: return makeTempVariableName(0 /* Auto */); } } /** * Generates a unique identifier for a node. - * - * @param name A generated name. */ - function generateName(name) { + function makeName(name) { switch (name.autoGenerateKind) { case 1 /* Auto */: return makeTempVariableName(0 /* Auto */); case 2 /* Loop */: return makeTempVariableName(268435456 /* _i */); case 3 /* Unique */: - return makeUniqueName(name.text); + return makeUniqueName(ts.unescapeIdentifier(name.text)); } ts.Debug.fail("Unsupported GeneratedIdentifierKind."); } /** * Gets the node from which a name should be generated. - * - * @param name A generated name wrapper. */ function getNodeForGeneratedName(name) { var autoGenerateId = name.autoGenerateId; @@ -62194,53 +66606,40 @@ var ts; // otherwise, return the original node for the source; return node; } - /** - * Gets the generated identifier text from a generated identifier. - * - * @param name The generated identifier. - */ - function getGeneratedIdentifier(name) { - if (name.autoGenerateKind === 4 /* Node */) { - // Generated names generate unique names based on their original node - // and are cached based on that node's id - var node = getNodeForGeneratedName(name); - var nodeId = ts.getNodeId(node); - return nodeIdToGeneratedName[nodeId] || (nodeIdToGeneratedName[nodeId] = ts.unescapeIdentifier(generateNameForNode(node))); - } - else { - // Auto, Loop, and Unique names are cached based on their unique - // autoGenerateId. - var autoGenerateId = name.autoGenerateId; - return autoGeneratedIdToGeneratedName[autoGenerateId] || (autoGeneratedIdToGeneratedName[autoGenerateId] = ts.unescapeIdentifier(generateName(name))); - } - } - function createDelimiterMap() { - var delimiters = []; - delimiters[0 /* None */] = ""; - delimiters[16 /* CommaDelimited */] = ","; - delimiters[4 /* BarDelimited */] = " |"; - delimiters[8 /* AmpersandDelimited */] = " &"; - return delimiters; - } - function getDelimiter(format) { - return delimiters[format & 28 /* DelimitersMask */]; - } - function createBracketsMap() { - var brackets = []; - brackets[512 /* Braces */] = ["{", "}"]; - brackets[1024 /* Parenthesis */] = ["(", ")"]; - brackets[2048 /* AngleBrackets */] = ["<", ">"]; - brackets[4096 /* SquareBrackets */] = ["[", "]"]; - return brackets; - } - function getOpeningBracket(format) { - return brackets[format & 7680 /* BracketsMask */][0]; - } - function getClosingBracket(format) { - return brackets[format & 7680 /* BracketsMask */][1]; - } } - ts.emitFiles = emitFiles; + ts.createPrinter = createPrinter; + function createDelimiterMap() { + var delimiters = []; + delimiters[0 /* None */] = ""; + delimiters[16 /* CommaDelimited */] = ","; + delimiters[4 /* BarDelimited */] = " |"; + delimiters[8 /* AmpersandDelimited */] = " &"; + return delimiters; + } + function getDelimiter(format) { + return delimiters[format & 28 /* DelimitersMask */]; + } + function createBracketsMap() { + var brackets = []; + brackets[512 /* Braces */] = ["{", "}"]; + brackets[1024 /* Parenthesis */] = ["(", ")"]; + brackets[2048 /* AngleBrackets */] = ["<", ">"]; + brackets[4096 /* SquareBrackets */] = ["[", "]"]; + return brackets; + } + function getOpeningBracket(format) { + return brackets[format & 7680 /* BracketsMask */][0]; + } + function getClosingBracket(format) { + return brackets[format & 7680 /* BracketsMask */][1]; + } + // Flags enum to track count of temp variables and a few dedicated names + var TempFlags; + (function (TempFlags) { + TempFlags[TempFlags["Auto"] = 0] = "Auto"; + TempFlags[TempFlags["CountMask"] = 268435455] = "CountMask"; + TempFlags[TempFlags["_i"] = 268435456] = "_i"; + })(TempFlags || (TempFlags = {})); var ListFormat; (function (ListFormat) { ListFormat[ListFormat["None"] = 0] = "None"; @@ -62316,6 +66715,7 @@ var ts; var ts; (function (ts) { var emptyArray = []; + var ignoreDiagnosticCommentRegEx = /(^\s*$)|(^\s*\/\/\/?\s*(@ts-ignore)?)/; function findConfigFile(searchPath, fileExists, configName) { if (configName === void 0) { configName = "tsconfig.json"; } while (true) { @@ -62350,7 +66750,8 @@ var ts; commonPathComponents = sourcePathComponents; return; } - for (var i = 0, n = Math.min(commonPathComponents.length, sourcePathComponents.length); i < n; i++) { + var n = Math.min(commonPathComponents.length, sourcePathComponents.length); + for (var i = 0; i < n; i++) { if (getCanonicalFileName(commonPathComponents[i]) !== getCanonicalFileName(sourcePathComponents[i])) { if (i === 0) { // Failed to find any common path component @@ -62383,8 +66784,6 @@ var ts; // otherwise use toLowerCase as a canonical form. return ts.sys.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase(); } - // returned by CScript sys environment - var unsupportedFileEncodingErrorCode = -2147024809; function getSourceFile(fileName, languageVersion, onError) { var text; try { @@ -62395,20 +66794,18 @@ var ts; } catch (e) { if (onError) { - onError(e.number === unsupportedFileEncodingErrorCode - ? ts.createCompilerDiagnostic(ts.Diagnostics.Unsupported_file_encoding).messageText - : e.message); + onError(e.message); } text = ""; } return text !== undefined ? ts.createSourceFile(fileName, text, languageVersion, setParentNodes) : undefined; } function directoryExists(directoryPath) { - if (directoryPath in existingDirectories) { + if (existingDirectories.has(directoryPath)) { return true; } if (ts.sys.directoryExists(directoryPath)) { - existingDirectories[directoryPath] = true; + existingDirectories.set(directoryPath, true); return true; } return false; @@ -62427,10 +66824,11 @@ var ts; } var hash = ts.sys.createHash(data); var mtimeBefore = ts.sys.getModifiedTime(fileName); - if (mtimeBefore && fileName in outputFingerprints) { - var fingerprint = outputFingerprints[fileName]; + if (mtimeBefore) { + var fingerprint = outputFingerprints.get(fileName); // If output has not been changed, and the file has no external modification - if (fingerprint.byteOrderMark === writeByteOrderMark && + if (fingerprint && + fingerprint.byteOrderMark === writeByteOrderMark && fingerprint.hash === hash && fingerprint.mtime.getTime() === mtimeBefore.getTime()) { return; @@ -62438,11 +66836,11 @@ var ts; } ts.sys.writeFile(fileName, data, writeByteOrderMark); var mtimeAfter = ts.sys.getModifiedTime(fileName); - outputFingerprints[fileName] = { + outputFingerprints.set(fileName, { hash: hash, byteOrderMark: writeByteOrderMark, mtime: mtimeAfter - }; + }); } function writeFile(fileName, data, writeByteOrderMark, onError) { try { @@ -62541,10 +66939,14 @@ var ts; var resolutions = []; var cache = ts.createMap(); for (var _i = 0, names_1 = names; _i < names_1.length; _i++) { - var name_43 = names_1[_i]; - var result = name_43 in cache - ? cache[name_43] - : cache[name_43] = loader(name_43, containingFile); + var name = names_1[_i]; + var result = void 0; + if (cache.has(name)) { + result = cache.get(name); + } + else { + cache.set(name, result = loader(name, containingFile)); + } resolutions.push(result); } return resolutions; @@ -62556,6 +66958,8 @@ var ts; var diagnosticsProducingTypeChecker; var noDiagnosticsTypeChecker; var classifiableNames; + var cachedSemanticDiagnosticsForFile = {}; + var cachedDeclarationDiagnosticsForFile = {}; var resolvedTypeReferenceDirectives = ts.createMap(); var fileProcessingDiagnostics = ts.createDiagnosticCollection(); // The below settings are to track if a .js file should be add to the program if loaded via searching under node_modules. @@ -62677,7 +67081,7 @@ var ts; return program; function getCommonSourceDirectory() { if (commonSourceDirectory === undefined) { - var emittedFiles = ts.filterSourceFilesInDirectory(files, isSourceFileFromExternalLibrary); + var emittedFiles = ts.filter(files, function (file) { return ts.sourceFileMayBeEmitted(file, options, isSourceFileFromExternalLibrary); }); if (options.rootDir && checkSourceFilesBelongToPath(emittedFiles, options.rootDir)) { // If a rootDir is specified and is valid use it as the commonSourceDirectory commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, currentDirectory); @@ -62701,7 +67105,7 @@ var ts; classifiableNames = ts.createMap(); for (var _i = 0, files_2 = files; _i < files_2.length; _i++) { var sourceFile = files_2[_i]; - ts.copyProperties(sourceFile.classifiableNames, classifiableNames); + ts.copyEntries(sourceFile.classifiableNames, classifiableNames); } } return classifiableNames; @@ -62775,7 +67179,7 @@ var ts; // combine results of resolutions and predicted results var j = 0; for (var i = 0; i < result.length; i++) { - if (result[i] == predictedToResolveToAmbientModuleMarker) { + if (result[i] === predictedToResolveToAmbientModuleMarker) { result[i] = undefined; } else { @@ -62908,7 +67312,7 @@ var ts; newSourceFile.resolvedTypeReferenceDirectiveNames = oldSourceFile.resolvedTypeReferenceDirectiveNames; } // update fileName -> file mapping - for (var i = 0, len = newSourceFiles.length; i < len; i++) { + for (var i = 0; i < newSourceFiles.length; i++) { filesByName.set(filePaths[i], newSourceFiles[i]); } files = newSourceFiles; @@ -62937,7 +67341,7 @@ var ts; }; } function isSourceFileFromExternalLibrary(file) { - return sourceFilesFoundSearchingNodeModules[file.path]; + return sourceFilesFoundSearchingNodeModules.get(file.path); } function getDiagnosticsProducingTypeChecker() { return diagnosticsProducingTypeChecker || (diagnosticsProducingTypeChecker = ts.createTypeChecker(program, /*produceDiagnostics:*/ true)); @@ -62948,13 +67352,13 @@ var ts; function getTypeChecker() { return noDiagnosticsTypeChecker || (noDiagnosticsTypeChecker = ts.createTypeChecker(program, /*produceDiagnostics:*/ false)); } - function emit(sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles) { - return runWithCancellationToken(function () { return emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles); }); + function emit(sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers) { + return runWithCancellationToken(function () { return emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers); }); } function isEmitBlocked(emitFileName) { return hasEmitBlockingDiagnostics.contains(ts.toPath(emitFileName, currentDirectory, getCanonicalFileName)); } - function emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles) { + function emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, customTransformers) { var declarationDiagnostics = []; if (options.noEmit) { return { diagnostics: declarationDiagnostics, sourceMaps: undefined, emittedFiles: undefined, emitSkipped: true }; @@ -62986,7 +67390,8 @@ var ts; // checked is to not pass the file to getEmitResolver. var emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver((options.outFile || options.out) ? undefined : sourceFile); ts.performance.mark("beforeEmit"); - var emitResult = ts.emitFiles(emitResolver, getEmitHost(writeFileCallback), sourceFile, emitOnlyDtsFiles); + var transformers = emitOnlyDtsFiles ? [] : ts.getTransformers(options, customTransformers); + var emitResult = ts.emitFiles(emitResolver, getEmitHost(writeFileCallback), sourceFile, emitOnlyDtsFiles, transformers); ts.performance.mark("afterEmit"); ts.performance.measure("Emit", "beforeEmit", "afterEmit"); return emitResult; @@ -63059,19 +67464,54 @@ var ts; } } function getSemanticDiagnosticsForFile(sourceFile, cancellationToken) { + return getAndCacheDiagnostics(sourceFile, cancellationToken, cachedSemanticDiagnosticsForFile, getSemanticDiagnosticsForFileNoCache); + } + function getSemanticDiagnosticsForFileNoCache(sourceFile, cancellationToken) { return runWithCancellationToken(function () { + // If skipLibCheck is enabled, skip reporting errors if file is a declaration file. + // If skipDefaultLibCheck is enabled, skip reporting errors if file contains a + // '/// ' directive. + if (options.skipLibCheck && sourceFile.isDeclarationFile || options.skipDefaultLibCheck && sourceFile.hasNoDefaultLib) { + return emptyArray; + } var typeChecker = getDiagnosticsProducingTypeChecker(); ts.Debug.assert(!!sourceFile.bindDiagnostics); var bindDiagnostics = sourceFile.bindDiagnostics; - // For JavaScript files, we don't want to report semantic errors. - // Instead, we'll report errors for using TypeScript-only constructs from within a - // JavaScript file when we get syntactic diagnostics for the file. - var checkDiagnostics = ts.isSourceFileJavaScript(sourceFile) ? [] : typeChecker.getDiagnostics(sourceFile, cancellationToken); + // For JavaScript files, we don't want to report semantic errors unless explicitly requested. + var includeCheckDiagnostics = !ts.isSourceFileJavaScript(sourceFile) || ts.isCheckJsEnabledForFile(sourceFile, options); + var checkDiagnostics = includeCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : []; var fileProcessingDiagnosticsInFile = fileProcessingDiagnostics.getDiagnostics(sourceFile.fileName); var programDiagnosticsInFile = programDiagnostics.getDiagnostics(sourceFile.fileName); - return bindDiagnostics.concat(checkDiagnostics, fileProcessingDiagnosticsInFile, programDiagnosticsInFile); + var diagnostics = bindDiagnostics.concat(checkDiagnostics, fileProcessingDiagnosticsInFile, programDiagnosticsInFile); + return ts.isSourceFileJavaScript(sourceFile) + ? ts.filter(diagnostics, shouldReportDiagnostic) + : diagnostics; }); } + /** + * Skip errors if previous line start with '// @ts-ignore' comment, not counting non-empty non-comment lines + */ + function shouldReportDiagnostic(diagnostic) { + var file = diagnostic.file, start = diagnostic.start; + if (file) { + var lineStarts = ts.getLineStarts(file); + var line = ts.computeLineAndCharacterOfPosition(lineStarts, start).line; + while (line > 0) { + var previousLineText = file.text.slice(lineStarts[line - 1], lineStarts[line]); + var result = ignoreDiagnosticCommentRegEx.exec(previousLineText); + if (!result) { + // non-empty line + return true; + } + if (result[3]) { + // @ts-ignore + return false; + } + line--; + } + } + return true; + } function getJavaScriptSyntacticDiagnosticsForFile(sourceFile) { return runWithCancellationToken(function () { var diagnostics = []; @@ -63082,23 +67522,23 @@ 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 144 /* Parameter */: - case 147 /* PropertyDeclaration */: + case 146 /* Parameter */: + case 149 /* PropertyDeclaration */: if (parent.questionToken === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, "?")); return; } - // Pass through - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 184 /* FunctionExpression */: - case 225 /* FunctionDeclaration */: - case 185 /* ArrowFunction */: - case 225 /* FunctionDeclaration */: - case 223 /* VariableDeclaration */: + // falls through + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: + case 152 /* Constructor */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + case 186 /* FunctionExpression */: + case 228 /* FunctionDeclaration */: + case 187 /* ArrowFunction */: + case 228 /* FunctionDeclaration */: + case 226 /* VariableDeclaration */: // type annotation if (parent.type === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.types_can_only_be_used_in_a_ts_file)); @@ -63106,35 +67546,35 @@ var ts; } } switch (node.kind) { - case 234 /* ImportEqualsDeclaration */: + case 237 /* ImportEqualsDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file)); return; - case 240 /* ExportAssignment */: + case 243 /* ExportAssignment */: if (node.isExportEquals) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file)); return; } break; - case 255 /* HeritageClause */: + case 259 /* HeritageClause */: var heritageClause = node; - if (heritageClause.token === 107 /* ImplementsKeyword */) { + if (heritageClause.token === 108 /* ImplementsKeyword */) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file)); return; } break; - case 227 /* InterfaceDeclaration */: + case 230 /* InterfaceDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file)); return; - case 230 /* ModuleDeclaration */: + case 233 /* ModuleDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file)); return; - case 228 /* TypeAliasDeclaration */: + case 231 /* TypeAliasDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file)); return; - case 229 /* EnumDeclaration */: + case 232 /* EnumDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file)); return; - case 182 /* TypeAssertionExpression */: + case 184 /* TypeAssertionExpression */: var typeAssertionExpression = node; diagnostics.push(createDiagnosticForNode(typeAssertionExpression.type, ts.Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file)); return; @@ -63149,50 +67589,50 @@ 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 226 /* ClassDeclaration */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 184 /* FunctionExpression */: - case 225 /* FunctionDeclaration */: - case 185 /* ArrowFunction */: - case 225 /* FunctionDeclaration */: + case 229 /* ClassDeclaration */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: + case 152 /* Constructor */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + case 186 /* FunctionExpression */: + case 228 /* FunctionDeclaration */: + case 187 /* ArrowFunction */: + case 228 /* FunctionDeclaration */: // 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; } - // pass through - case 205 /* VariableStatement */: + // falls through + case 208 /* VariableStatement */: // Check modifiers if (nodes === parent.modifiers) { - return checkModifiers(nodes, parent.kind === 205 /* VariableStatement */); + return checkModifiers(nodes, parent.kind === 208 /* VariableStatement */); } break; - case 147 /* PropertyDeclaration */: + case 149 /* PropertyDeclaration */: // Check modifiers of property declaration if (nodes === parent.modifiers) { for (var _i = 0, _a = nodes; _i < _a.length; _i++) { var modifier = _a[_i]; - if (modifier.kind !== 114 /* StaticKeyword */) { + if (modifier.kind !== 115 /* StaticKeyword */) { diagnostics.push(createDiagnosticForNode(modifier, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, ts.tokenToString(modifier.kind))); } } return; } break; - case 144 /* Parameter */: + case 146 /* 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 179 /* CallExpression */: - case 180 /* NewExpression */: - case 199 /* ExpressionWithTypeArguments */: + case 181 /* CallExpression */: + case 182 /* NewExpression */: + case 201 /* ExpressionWithTypeArguments */: // Check type arguments if (nodes === parent.typeArguments) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.type_arguments_can_only_be_used_in_a_ts_file)); @@ -63200,8 +67640,8 @@ var ts; } break; } - for (var _b = 0, nodes_6 = nodes; _b < nodes_6.length; _b++) { - var node = nodes_6[_b]; + for (var _b = 0, nodes_8 = nodes; _b < nodes_8.length; _b++) { + var node = nodes_8[_b]; walk(node); } } @@ -63209,23 +67649,24 @@ var ts; for (var _i = 0, modifiers_1 = modifiers; _i < modifiers_1.length; _i++) { var modifier = modifiers_1[_i]; switch (modifier.kind) { - case 75 /* ConstKeyword */: + case 76 /* ConstKeyword */: if (isConstValid) { continue; } - // Fallthrough to report error - case 113 /* PublicKeyword */: - case 111 /* PrivateKeyword */: - case 112 /* ProtectedKeyword */: - case 130 /* ReadonlyKeyword */: - case 123 /* DeclareKeyword */: - case 116 /* AbstractKeyword */: + // to report error, + // falls through + case 114 /* PublicKeyword */: + case 112 /* PrivateKeyword */: + case 113 /* ProtectedKeyword */: + case 131 /* 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))); break; // These are all legal modifiers. - case 114 /* StaticKeyword */: - case 83 /* ExportKeyword */: - case 78 /* DefaultKeyword */: + case 115 /* StaticKeyword */: + case 84 /* ExportKeyword */: + case 79 /* DefaultKeyword */: } } } @@ -63241,12 +67682,34 @@ var ts; }); } function getDeclarationDiagnosticsWorker(sourceFile, cancellationToken) { + return getAndCacheDiagnostics(sourceFile, cancellationToken, cachedDeclarationDiagnosticsForFile, getDeclarationDiagnosticsForFileNoCache); + } + function getDeclarationDiagnosticsForFileNoCache(sourceFile, cancellationToken) { return runWithCancellationToken(function () { var resolver = getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile, cancellationToken); // Don't actually write any files since we're just getting diagnostics. return ts.getDeclarationDiagnostics(getEmitHost(ts.noop), resolver, sourceFile); }); } + function getAndCacheDiagnostics(sourceFile, cancellationToken, cache, getDiagnostics) { + var cachedResult = sourceFile + ? cache.perFile && cache.perFile.get(sourceFile.path) + : cache.allDiagnostics; + if (cachedResult) { + return cachedResult; + } + var result = getDiagnostics(sourceFile, cancellationToken) || emptyArray; + if (sourceFile) { + if (!cache.perFile) { + cache.perFile = ts.createFileMap(); + } + cache.perFile.set(sourceFile.path, result); + } + else { + cache.allDiagnostics = result; + } + return result; + } function getDeclarationDiagnosticsForFile(sourceFile, cancellationToken) { return ts.isDeclarationFile(sourceFile) ? [] : getDeclarationDiagnosticsWorker(sourceFile, cancellationToken); } @@ -63289,11 +67752,10 @@ var ts; && (options.isolatedModules || isExternalModuleFile) && !file.isDeclarationFile) { // synthesize 'import "tslib"' declaration - var externalHelpersModuleReference = ts.createSynthesizedNode(9 /* StringLiteral */); - externalHelpersModuleReference.text = ts.externalHelpersModuleNameText; - var importDecl = ts.createSynthesizedNode(235 /* ImportDeclaration */); - importDecl.parent = file; + var externalHelpersModuleReference = ts.createLiteral(ts.externalHelpersModuleNameText); + var importDecl = ts.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*importClause*/ undefined); externalHelpersModuleReference.parent = importDecl; + importDecl.parent = file; imports = [externalHelpersModuleReference]; } for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { @@ -63309,9 +67771,9 @@ var ts; return; function collectModuleReferences(node, inAmbientModule) { switch (node.kind) { - case 235 /* ImportDeclaration */: - case 234 /* ImportEqualsDeclaration */: - case 241 /* ExportDeclaration */: + case 238 /* ImportDeclaration */: + case 237 /* ImportEqualsDeclaration */: + case 244 /* ExportDeclaration */: var moduleNameExpr = ts.getExternalModuleName(node); if (!moduleNameExpr || moduleNameExpr.kind !== 9 /* StringLiteral */) { break; @@ -63326,7 +67788,7 @@ var ts; (imports || (imports = [])).push(moduleNameExpr); } break; - case 230 /* ModuleDeclaration */: + case 233 /* ModuleDeclaration */: if (ts.isAmbientModule(node) && (inAmbientModule || ts.hasModifier(node, 2 /* Ambient */) || ts.isDeclarationFile(file))) { var moduleName = node.name; // Ambient module declarations can be interpreted as augmentations for some existing external modules. @@ -63426,18 +67888,18 @@ var ts; } // If the file was previously found via a node_modules search, but is now being processed as a root file, // then everything it sucks in may also be marked incorrectly, and needs to be checked again. - if (file_1 && sourceFilesFoundSearchingNodeModules[file_1.path] && currentNodeModulesDepth == 0) { - sourceFilesFoundSearchingNodeModules[file_1.path] = false; + if (file_1 && sourceFilesFoundSearchingNodeModules.get(file_1.path) && currentNodeModulesDepth === 0) { + sourceFilesFoundSearchingNodeModules.set(file_1.path, false); if (!options.noResolve) { processReferencedFiles(file_1, isDefaultLib); processTypeReferenceDirectives(file_1); } - modulesWithElidedImports[file_1.path] = false; + modulesWithElidedImports.set(file_1.path, false); processImportedModules(file_1); } - else if (file_1 && modulesWithElidedImports[file_1.path]) { + else if (file_1 && modulesWithElidedImports.get(file_1.path)) { if (currentNodeModulesDepth < maxNodeModuleJsDepth) { - modulesWithElidedImports[file_1.path] = false; + modulesWithElidedImports.set(file_1.path, false); processImportedModules(file_1); } } @@ -63454,7 +67916,7 @@ var ts; }); filesByName.set(path, file); if (file) { - sourceFilesFoundSearchingNodeModules[path] = (currentNodeModulesDepth > 0); + sourceFilesFoundSearchingNodeModules.set(path, currentNodeModulesDepth > 0); file.path = path; if (host.useCaseSensitiveFileNames()) { // for case-sensitive file systems check if we've already seen some file with similar filename ignoring case @@ -63503,7 +67965,7 @@ var ts; } function processTypeReferenceDirective(typeReferenceDirective, resolvedTypeReferenceDirective, refFile, refPos, refEnd) { // If we already found this library as a primary reference - nothing to do - var previousResolution = resolvedTypeReferenceDirectives[typeReferenceDirective]; + var previousResolution = resolvedTypeReferenceDirectives.get(typeReferenceDirective); if (previousResolution && previousResolution.primary) { return; } @@ -63537,7 +67999,7 @@ var ts; fileProcessingDiagnostics.add(createDiagnostic(refFile, refPos, refEnd, ts.Diagnostics.Cannot_find_type_definition_file_for_0, typeReferenceDirective)); } if (saveResolution) { - resolvedTypeReferenceDirectives[typeReferenceDirective] = resolvedTypeReferenceDirective; + resolvedTypeReferenceDirectives.set(typeReferenceDirective, resolvedTypeReferenceDirective); } } function createDiagnostic(refFile, refPos, refEnd, message) { @@ -63586,7 +68048,7 @@ var ts; // This may still end up being an untyped module -- the file won't be included but imports will be allowed. var shouldAddFile = resolvedFileName && !getResolutionDiagnostic(options, resolution) && !options.noResolve && i < file.imports.length && !elideImport; if (elideImport) { - modulesWithElidedImports[file.path] = true; + modulesWithElidedImports.set(file.path, true); } else if (shouldAddFile) { var path = ts.toPath(resolvedFileName, currentDirectory, getCanonicalFileName); @@ -63605,8 +68067,8 @@ var ts; } function computeCommonSourceDirectory(sourceFiles) { var fileNames = []; - for (var _i = 0, sourceFiles_6 = sourceFiles; _i < sourceFiles_6.length; _i++) { - var file = sourceFiles_6[_i]; + for (var _i = 0, sourceFiles_2 = sourceFiles; _i < sourceFiles_2.length; _i++) { + var file = sourceFiles_2[_i]; if (!file.isDeclarationFile) { fileNames.push(file.fileName); } @@ -63617,8 +68079,8 @@ var ts; var allFilesBelongToPath = true; if (sourceFiles) { var absoluteRootDirectoryPath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(rootDirectory, currentDirectory)); - for (var _i = 0, sourceFiles_7 = sourceFiles; _i < sourceFiles_7.length; _i++) { - var sourceFile = sourceFiles_7[_i]; + for (var _i = 0, sourceFiles_3 = sourceFiles; _i < sourceFiles_3.length; _i++) { + var sourceFile = sourceFiles_3[_i]; if (!ts.isDeclarationFile(sourceFile)) { var absoluteSourceFilePath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory)); if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) { @@ -63712,7 +68174,7 @@ var ts; if (options.lib && options.noLib) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "lib", "noLib")); } - if (options.noImplicitUseStrict && options.alwaysStrict) { + if (options.noImplicitUseStrict && (options.alwaysStrict === undefined ? options.strict : options.alwaysStrict)) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "noImplicitUseStrict", "alwaysStrict")); } var languageVersion = options.target || 0 /* ES3 */; @@ -63758,6 +68220,9 @@ var ts; if (!options.noEmit && options.allowJs && options.declaration) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "allowJs", "declaration")); } + if (options.checkJs && !options.allowJs) { + programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "checkJs", "allowJs")); + } if (options.emitDecoratorMetadata && !options.experimentalDecorators) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDecoratorMetadata", "experimentalDecorators")); @@ -63777,7 +68242,7 @@ var ts; if (!options.noEmit && !options.suppressOutputPathCheck) { var emitHost = getEmitHost(); var emitFilesSeen_1 = ts.createFileMap(!host.useCaseSensitiveFileNames() ? function (key) { return key.toLocaleLowerCase(); } : undefined); - ts.forEachExpectedEmitFile(emitHost, function (emitFileNames) { + ts.forEachEmittedFile(emitHost, function (emitFileNames) { verifyEmitFilePath(emitFileNames.jsFilePath, emitFilesSeen_1); verifyEmitFilePath(emitFileNames.declarationFilePath, emitFilesSeen_1); }); @@ -63853,40 +68318,13 @@ var ts; ts.compileOnSaveCommandLineOption = { name: "compileOnSave", type: "boolean" }; /* @internal */ ts.optionDeclarations = [ - { - name: "charset", - type: "string", - }, - ts.compileOnSaveCommandLineOption, - { - name: "declaration", - shortName: "d", - type: "boolean", - description: ts.Diagnostics.Generates_corresponding_d_ts_file, - }, - { - name: "declarationDir", - type: "string", - isFilePath: true, - paramType: ts.Diagnostics.DIRECTORY, - }, - { - name: "diagnostics", - type: "boolean", - }, - { - name: "extendedDiagnostics", - type: "boolean", - experimental: true - }, - { - name: "emitBOM", - type: "boolean" - }, + // CommandLine only options { name: "help", shortName: "h", type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, description: ts.Diagnostics.Print_this_message, }, { @@ -63894,220 +68332,58 @@ var ts; shortName: "?", type: "boolean" }, + { + name: "all", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + description: ts.Diagnostics.Show_all_compiler_options, + }, + { + name: "version", + shortName: "v", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + description: ts.Diagnostics.Print_the_compiler_s_version, + }, { name: "init", type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, description: ts.Diagnostics.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file, }, - { - name: "inlineSourceMap", - type: "boolean", - }, - { - name: "inlineSources", - type: "boolean", - }, - { - name: "jsx", - type: ts.createMap({ - "preserve": 1 /* Preserve */, - "react": 2 /* React */ - }), - paramType: ts.Diagnostics.KIND, - description: ts.Diagnostics.Specify_JSX_code_generation_Colon_preserve_or_react, - }, - { - name: "reactNamespace", - type: "string", - description: ts.Diagnostics.Specify_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit - }, - { - name: "jsxFactory", - type: "string", - description: ts.Diagnostics.Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h - }, - { - name: "listFiles", - type: "boolean", - }, - { - name: "locale", - type: "string", - }, - { - name: "mapRoot", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations, - paramType: ts.Diagnostics.LOCATION, - }, - { - name: "module", - shortName: "m", - type: ts.createMap({ - "none": ts.ModuleKind.None, - "commonjs": ts.ModuleKind.CommonJS, - "amd": ts.ModuleKind.AMD, - "system": ts.ModuleKind.System, - "umd": ts.ModuleKind.UMD, - "es6": ts.ModuleKind.ES2015, - "es2015": ts.ModuleKind.ES2015, - }), - description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015, - paramType: ts.Diagnostics.KIND, - }, - { - name: "newLine", - type: ts.createMap({ - "crlf": 0 /* CarriageReturnLineFeed */, - "lf": 1 /* LineFeed */ - }), - description: ts.Diagnostics.Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix, - paramType: ts.Diagnostics.NEWLINE, - }, - { - name: "noEmit", - type: "boolean", - description: ts.Diagnostics.Do_not_emit_outputs, - }, - { - name: "noEmitHelpers", - type: "boolean" - }, - { - name: "noEmitOnError", - type: "boolean", - description: ts.Diagnostics.Do_not_emit_outputs_if_any_errors_were_reported, - }, - { - name: "noErrorTruncation", - type: "boolean" - }, - { - name: "noImplicitAny", - type: "boolean", - description: ts.Diagnostics.Raise_error_on_expressions_and_declarations_with_an_implied_any_type, - }, - { - name: "noImplicitThis", - type: "boolean", - description: ts.Diagnostics.Raise_error_on_this_expressions_with_an_implied_any_type, - }, - { - name: "noUnusedLocals", - type: "boolean", - description: ts.Diagnostics.Report_errors_on_unused_locals, - }, - { - name: "noUnusedParameters", - type: "boolean", - description: ts.Diagnostics.Report_errors_on_unused_parameters, - }, - { - name: "noLib", - type: "boolean", - }, - { - name: "noResolve", - type: "boolean", - }, - { - name: "skipDefaultLibCheck", - type: "boolean", - }, - { - name: "skipLibCheck", - type: "boolean", - description: ts.Diagnostics.Skip_type_checking_of_declaration_files, - }, - { - name: "out", - type: "string", - isFilePath: false, - // for correct behaviour, please use outFile - paramType: ts.Diagnostics.FILE, - }, - { - name: "outFile", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Concatenate_and_emit_output_to_single_file, - paramType: ts.Diagnostics.FILE, - }, - { - name: "outDir", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Redirect_output_structure_to_the_directory, - paramType: ts.Diagnostics.DIRECTORY, - }, - { - name: "preserveConstEnums", - type: "boolean", - description: ts.Diagnostics.Do_not_erase_const_enum_declarations_in_generated_code - }, - { - name: "pretty", - description: ts.Diagnostics.Stylize_errors_and_messages_using_color_and_context_experimental, - type: "boolean" - }, { name: "project", shortName: "p", type: "string", isFilePath: true, - description: ts.Diagnostics.Compile_the_project_in_the_given_directory, - paramType: ts.Diagnostics.DIRECTORY + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + paramType: ts.Diagnostics.FILE_OR_DIRECTORY, + description: ts.Diagnostics.Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json, }, { - name: "removeComments", + name: "pretty", type: "boolean", - description: ts.Diagnostics.Do_not_emit_comments_to_output, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + description: ts.Diagnostics.Stylize_errors_and_messages_using_color_and_context_experimental }, { - name: "rootDir", - type: "string", - isFilePath: true, - paramType: ts.Diagnostics.LOCATION, - description: ts.Diagnostics.Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir, - }, - { - name: "isolatedModules", + name: "watch", + shortName: "w", type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + description: ts.Diagnostics.Watch_input_files, }, - { - name: "sourceMap", - type: "boolean", - description: ts.Diagnostics.Generates_corresponding_map_file, - }, - { - name: "sourceRoot", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations, - paramType: ts.Diagnostics.LOCATION, - }, - { - name: "suppressExcessPropertyErrors", - type: "boolean", - description: ts.Diagnostics.Suppress_excess_property_checks_for_object_literals, - experimental: true - }, - { - name: "suppressImplicitAnyIndexErrors", - type: "boolean", - description: ts.Diagnostics.Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures, - }, - { - name: "stripInternal", - type: "boolean", - description: ts.Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation, - experimental: true - }, + // Basic { name: "target", shortName: "t", - type: ts.createMap({ + type: ts.createMapFromTemplate({ "es3": 0 /* ES3 */, "es5": 1 /* ES5 */, "es6": 2 /* ES2015 */, @@ -64116,144 +68392,34 @@ var ts; "es2017": 4 /* ES2017 */, "esnext": 5 /* ESNext */, }), - description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT, paramType: ts.Diagnostics.VERSION, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT, }, { - name: "version", - shortName: "v", - type: "boolean", - description: ts.Diagnostics.Print_the_compiler_s_version, - }, - { - name: "watch", - shortName: "w", - type: "boolean", - description: ts.Diagnostics.Watch_input_files, - }, - { - name: "experimentalDecorators", - type: "boolean", - description: ts.Diagnostics.Enables_experimental_support_for_ES7_decorators - }, - { - name: "emitDecoratorMetadata", - type: "boolean", - experimental: true, - description: ts.Diagnostics.Enables_experimental_support_for_emitting_type_metadata_for_decorators - }, - { - name: "moduleResolution", - type: ts.createMap({ - "node": ts.ModuleResolutionKind.NodeJs, - "classic": ts.ModuleResolutionKind.Classic, + name: "module", + shortName: "m", + type: ts.createMapFromTemplate({ + "none": ts.ModuleKind.None, + "commonjs": ts.ModuleKind.CommonJS, + "amd": ts.ModuleKind.AMD, + "system": ts.ModuleKind.System, + "umd": ts.ModuleKind.UMD, + "es6": ts.ModuleKind.ES2015, + "es2015": ts.ModuleKind.ES2015, }), - description: ts.Diagnostics.Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6, - paramType: ts.Diagnostics.STRATEGY, - }, - { - name: "allowUnusedLabels", - type: "boolean", - description: ts.Diagnostics.Do_not_report_errors_on_unused_labels - }, - { - name: "noImplicitReturns", - type: "boolean", - description: ts.Diagnostics.Report_error_when_not_all_code_paths_in_function_return_a_value - }, - { - name: "noFallthroughCasesInSwitch", - type: "boolean", - description: ts.Diagnostics.Report_errors_for_fallthrough_cases_in_switch_statement - }, - { - name: "allowUnreachableCode", - type: "boolean", - description: ts.Diagnostics.Do_not_report_errors_on_unreachable_code - }, - { - name: "forceConsistentCasingInFileNames", - type: "boolean", - description: ts.Diagnostics.Disallow_inconsistently_cased_references_to_the_same_file - }, - { - name: "baseUrl", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Base_directory_to_resolve_non_absolute_module_names - }, - { - // this option can only be specified in tsconfig.json - // use type = object to copy the value as-is - name: "paths", - type: "object", - isTSConfigOnly: true - }, - { - // this option can only be specified in tsconfig.json - // use type = object to copy the value as-is - name: "rootDirs", - type: "list", - isTSConfigOnly: true, - element: { - name: "rootDirs", - type: "string", - isFilePath: true - } - }, - { - name: "typeRoots", - type: "list", - element: { - name: "typeRoots", - type: "string", - isFilePath: true - } - }, - { - name: "types", - type: "list", - element: { - name: "types", - type: "string" - }, - description: ts.Diagnostics.Type_declaration_files_to_be_included_in_compilation - }, - { - name: "traceResolution", - type: "boolean", - description: ts.Diagnostics.Enable_tracing_of_the_name_resolution_process - }, - { - name: "allowJs", - type: "boolean", - description: ts.Diagnostics.Allow_javascript_files_to_be_compiled - }, - { - name: "allowSyntheticDefaultImports", - type: "boolean", - description: ts.Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking - }, - { - name: "noImplicitUseStrict", - type: "boolean", - description: ts.Diagnostics.Do_not_emit_use_strict_directives_in_module_output - }, - { - name: "maxNodeModuleJsDepth", - type: "number", - description: ts.Diagnostics.The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files - }, - { - name: "listEmittedFiles", - type: "boolean" + paramType: ts.Diagnostics.KIND, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015, }, { name: "lib", type: "list", element: { name: "lib", - type: ts.createMap({ + type: ts.createMapFromTemplate({ // JavaScript only "es5": "lib.es5.d.ts", "es6": "lib.es2015.d.ts", @@ -64261,6 +68427,7 @@ var ts; "es7": "lib.es2016.d.ts", "es2016": "lib.es2016.d.ts", "es2017": "lib.es2017.d.ts", + "esnext": "lib.esnext.d.ts", // Host only "dom": "lib.dom.d.ts", "dom.iterable": "lib.dom.iterable.d.ts", @@ -64280,28 +68447,487 @@ var ts; "es2017.object": "lib.es2017.object.d.ts", "es2017.sharedmemory": "lib.es2017.sharedmemory.d.ts", "es2017.string": "lib.es2017.string.d.ts", + "esnext.asynciterable": "lib.esnext.asynciterable.d.ts", }), }, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, description: ts.Diagnostics.Specify_library_files_to_be_included_in_the_compilation_Colon }, { - name: "disableSizeLimit", - type: "boolean" + name: "allowJs", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Allow_javascript_files_to_be_compiled }, { - name: "strictNullChecks", + name: "checkJs", type: "boolean", - description: ts.Diagnostics.Enable_strict_null_checks + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Report_errors_in_js_files + }, + { + name: "jsx", + type: ts.createMapFromTemplate({ + "preserve": 1 /* Preserve */, + "react-native": 3 /* ReactNative */, + "react": 2 /* React */ + }), + paramType: ts.Diagnostics.KIND, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Specify_JSX_code_generation_Colon_preserve_react_native_or_react, + }, + { + name: "declaration", + shortName: "d", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Generates_corresponding_d_ts_file, + }, + { + name: "sourceMap", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Generates_corresponding_map_file, + }, + { + name: "outFile", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.FILE, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Concatenate_and_emit_output_to_single_file, + }, + { + name: "outDir", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.DIRECTORY, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Redirect_output_structure_to_the_directory, + }, + { + name: "rootDir", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.LOCATION, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir, + }, + { + name: "removeComments", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Do_not_emit_comments_to_output, + }, + { + name: "noEmit", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Do_not_emit_outputs, }, { name: "importHelpers", type: "boolean", + category: ts.Diagnostics.Basic_Options, description: ts.Diagnostics.Import_emit_helpers_from_tslib }, + { + name: "downlevelIteration", + type: "boolean", + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3 + }, + { + name: "isolatedModules", + type: "boolean", + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule + }, + // Strict Type Checks + { + name: "strict", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Strict_Type_Checking_Options, + description: ts.Diagnostics.Enable_all_strict_type_checking_options + }, + { + name: "noImplicitAny", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Strict_Type_Checking_Options, + description: ts.Diagnostics.Raise_error_on_expressions_and_declarations_with_an_implied_any_type, + }, + { + name: "strictNullChecks", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Strict_Type_Checking_Options, + description: ts.Diagnostics.Enable_strict_null_checks + }, + { + name: "noImplicitThis", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Strict_Type_Checking_Options, + description: ts.Diagnostics.Raise_error_on_this_expressions_with_an_implied_any_type, + }, { name: "alwaysStrict", type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Strict_Type_Checking_Options, description: ts.Diagnostics.Parse_in_strict_mode_and_emit_use_strict_for_each_source_file + }, + // Additional Checks + { + name: "noUnusedLocals", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Additional_Checks, + description: ts.Diagnostics.Report_errors_on_unused_locals, + }, + { + name: "noUnusedParameters", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Additional_Checks, + description: ts.Diagnostics.Report_errors_on_unused_parameters, + }, + { + name: "noImplicitReturns", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Additional_Checks, + description: ts.Diagnostics.Report_error_when_not_all_code_paths_in_function_return_a_value + }, + { + name: "noFallthroughCasesInSwitch", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Additional_Checks, + description: ts.Diagnostics.Report_errors_for_fallthrough_cases_in_switch_statement + }, + // Module Resolution + { + name: "moduleResolution", + type: ts.createMapFromTemplate({ + "node": ts.ModuleResolutionKind.NodeJs, + "classic": ts.ModuleResolutionKind.Classic, + }), + paramType: ts.Diagnostics.STRATEGY, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6, + }, + { + name: "baseUrl", + type: "string", + isFilePath: true, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Base_directory_to_resolve_non_absolute_module_names + }, + { + // this option can only be specified in tsconfig.json + // use type = object to copy the value as-is + name: "paths", + type: "object", + isTSConfigOnly: true, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl + }, + { + // this option can only be specified in tsconfig.json + // use type = object to copy the value as-is + name: "rootDirs", + type: "list", + isTSConfigOnly: true, + element: { + name: "rootDirs", + type: "string", + isFilePath: true + }, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime + }, + { + name: "typeRoots", + type: "list", + element: { + name: "typeRoots", + type: "string", + isFilePath: true + }, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.List_of_folders_to_include_type_definitions_from + }, + { + name: "types", + type: "list", + element: { + name: "types", + type: "string" + }, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Type_declaration_files_to_be_included_in_compilation + }, + { + name: "allowSyntheticDefaultImports", + type: "boolean", + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking + }, + // Source Maps + { + name: "sourceRoot", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.LOCATION, + category: ts.Diagnostics.Source_Map_Options, + description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations, + }, + { + name: "mapRoot", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.LOCATION, + category: ts.Diagnostics.Source_Map_Options, + description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations, + }, + { + name: "inlineSourceMap", + type: "boolean", + category: ts.Diagnostics.Source_Map_Options, + description: ts.Diagnostics.Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file + }, + { + name: "inlineSources", + type: "boolean", + category: ts.Diagnostics.Source_Map_Options, + description: ts.Diagnostics.Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set + }, + // Experimental + { + name: "experimentalDecorators", + type: "boolean", + category: ts.Diagnostics.Experimental_Options, + description: ts.Diagnostics.Enables_experimental_support_for_ES7_decorators + }, + { + name: "emitDecoratorMetadata", + type: "boolean", + category: ts.Diagnostics.Experimental_Options, + description: ts.Diagnostics.Enables_experimental_support_for_emitting_type_metadata_for_decorators + }, + // Advanced + { + name: "jsxFactory", + type: "string", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h + }, + { + name: "diagnostics", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Show_diagnostic_information + }, + { + name: "extendedDiagnostics", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Show_verbose_diagnostic_information + }, + { + name: "traceResolution", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Enable_tracing_of_the_name_resolution_process + }, + { + name: "listFiles", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Print_names_of_files_part_of_the_compilation + }, + { + name: "listEmittedFiles", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Print_names_of_generated_files_part_of_the_compilation + }, + { + name: "out", + type: "string", + isFilePath: false, + // for correct behaviour, please use outFile + category: ts.Diagnostics.Advanced_Options, + paramType: ts.Diagnostics.FILE, + description: ts.Diagnostics.Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file, + }, + { + name: "reactNamespace", + type: "string", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit + }, + { + name: "skipDefaultLibCheck", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files + }, + { + name: "charset", + type: "string", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.The_character_set_of_the_input_files + }, + { + name: "emitBOM", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files + }, + { + name: "locale", + type: "string", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.The_locale_used_when_displaying_messages_to_the_user_e_g_en_us + }, + { + name: "newLine", + type: ts.createMapFromTemplate({ + "crlf": 0 /* CarriageReturnLineFeed */, + "lf": 1 /* LineFeed */ + }), + paramType: ts.Diagnostics.NEWLINE, + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix, + }, + { + name: "noErrorTruncation", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_truncate_error_messages + }, + { + name: "noLib", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_include_the_default_library_file_lib_d_ts + }, + { + name: "noResolve", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files + }, + { + name: "stripInternal", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation, + }, + { + name: "disableSizeLimit", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Disable_size_limitations_on_JavaScript_projects + }, + { + name: "noImplicitUseStrict", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_emit_use_strict_directives_in_module_output + }, + { + name: "noEmitHelpers", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_generate_custom_helper_functions_like_extends_in_compiled_output + }, + { + name: "noEmitOnError", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_emit_outputs_if_any_errors_were_reported, + }, + { + name: "preserveConstEnums", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_erase_const_enum_declarations_in_generated_code + }, + { + name: "declarationDir", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.DIRECTORY, + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Output_directory_for_generated_declaration_files + }, + { + name: "skipLibCheck", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Skip_type_checking_of_declaration_files, + }, + { + name: "allowUnusedLabels", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_report_errors_on_unused_labels + }, + { + name: "allowUnreachableCode", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_report_errors_on_unreachable_code + }, + { + name: "suppressExcessPropertyErrors", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Suppress_excess_property_checks_for_object_literals, + }, + { + name: "suppressImplicitAnyIndexErrors", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures, + }, + { + name: "forceConsistentCasingInFileNames", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Disallow_inconsistently_cased_references_to_the_same_file + }, + { + name: "maxNodeModuleJsDepth", + type: "number", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files + }, + { + // A list of plugins to load in the language service + name: "plugins", + type: "list", + isTSConfigOnly: true, + element: { + name: "plugin", + type: "object" + }, + description: ts.Diagnostics.List_of_language_service_plugins } ]; /* @internal */ @@ -64338,8 +68964,7 @@ var ts; ts.defaultInitCompilerOptions = { module: ts.ModuleKind.CommonJS, target: 1 /* ES5 */, - noImplicitAny: false, - sourceMap: false, + strict: true }; var optionNameMapCache; /* @internal */ @@ -64356,7 +68981,6 @@ var ts; return typeAcquisition; } ts.convertEnableAutoDiscoveryToEnable = convertEnableAutoDiscoveryToEnable; - /* @internal */ function getOptionNameMap() { if (optionNameMapCache) { return optionNameMapCache; @@ -64364,18 +68988,17 @@ var ts; var optionNameMap = ts.createMap(); var shortOptionNames = ts.createMap(); ts.forEach(ts.optionDeclarations, function (option) { - optionNameMap[option.name.toLowerCase()] = option; + optionNameMap.set(option.name.toLowerCase(), option); if (option.shortName) { - shortOptionNames[option.shortName] = option.name; + shortOptionNames.set(option.shortName, option.name); } }); optionNameMapCache = { optionNameMap: optionNameMap, shortOptionNames: shortOptionNames }; return optionNameMapCache; } - ts.getOptionNameMap = getOptionNameMap; /* @internal */ function createCompilerDiagnosticForInvalidCustomType(opt) { - var namesOfType = Object.keys(opt.type).map(function (key) { return "'" + key + "'"; }).join(", "); + var namesOfType = ts.arrayFrom(opt.type.keys()).map(function (key) { return "'" + key + "'"; }).join(", "); return ts.createCompilerDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--" + opt.name, namesOfType); } ts.createCompilerDiagnosticForInvalidCustomType = createCompilerDiagnosticForInvalidCustomType; @@ -64409,7 +69032,6 @@ var ts; var options = {}; var fileNames = []; var errors = []; - var _a = getOptionNameMap(), optionNameMap = _a.optionNameMap, shortOptionNames = _a.shortOptionNames; parseStrings(commandLine); return { options: options, @@ -64425,13 +69047,8 @@ var ts; parseResponseFile(s.slice(1)); } else if (s.charCodeAt(0) === 45 /* minus */) { - s = s.slice(s.charCodeAt(1) === 45 /* minus */ ? 2 : 1).toLowerCase(); - // Try to translate short option names to their full equivalents. - if (s in shortOptionNames) { - s = shortOptionNames[s]; - } - if (s in optionNameMap) { - var opt = optionNameMap[s]; + var opt = getOptionFromName(s.slice(s.charCodeAt(1) === 45 /* minus */ ? 2 : 1), /*allowShort*/ true); + if (opt) { if (opt.isTSConfigOnly) { errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file, opt.name)); } @@ -64518,10 +69135,23 @@ var ts; } } ts.parseCommandLine = parseCommandLine; + function getOptionFromName(optionName, allowShort) { + if (allowShort === void 0) { allowShort = false; } + optionName = optionName.toLowerCase(); + var _a = getOptionNameMap(), optionNameMap = _a.optionNameMap, shortOptionNames = _a.shortOptionNames; + // Try to translate short option names to their full equivalents. + if (allowShort) { + var short = shortOptionNames.get(optionName); + if (short !== undefined) { + optionName = short; + } + } + return optionNameMap.get(optionName); + } /** - * Read tsconfig.json file - * @param fileName The path to the config file - */ + * Read tsconfig.json file + * @param fileName The path to the config file + */ function readConfigFile(fileName, readFile) { var text = ""; try { @@ -64534,10 +69164,10 @@ var ts; } ts.readConfigFile = readConfigFile; /** - * Parse the text of the tsconfig.json file - * @param fileName The path to the config file - * @param jsonText The text of the config file - */ + * Parse the text of the tsconfig.json file + * @param fileName The path to the config file + * @param jsonText The text of the config file + */ function parseConfigFileTextToJson(fileName, jsonText, stripComments) { if (stripComments === void 0) { stripComments = true; } try { @@ -64555,7 +69185,7 @@ var ts; * @param fileNames array of filenames to be generated into tsconfig.json */ /* @internal */ - function generateTSConfig(options, fileNames) { + function generateTSConfig(options, fileNames, newLine) { var compilerOptions = ts.extend(options, ts.defaultInitCompilerOptions); var configurations = { compilerOptions: serializeCompilerOptions(compilerOptions) @@ -64564,7 +69194,7 @@ var ts; // only set the files property if we have at least one file configurations.files = fileNames; } - return configurations; + return writeConfigurations(); function getCustomTypeMapOfCommandLineOption(optionDefinition) { if (optionDefinition.type === "string" || optionDefinition.type === "number" || optionDefinition.type === "boolean") { // this is of a type CommandLineOptionOfPrimitiveType @@ -64579,58 +69209,130 @@ var ts; } function getNameOfCompilerOptionValue(value, customTypeMap) { // There is a typeMap associated with this command-line option so use it to map value back to its name - for (var key in customTypeMap) { - if (customTypeMap[key] === value) { + return ts.forEachEntry(customTypeMap, function (mapValue, key) { + if (mapValue === value) { return key; } - } - return undefined; + }); } function serializeCompilerOptions(options) { - var result = ts.createMap(); + var result = {}; var optionsNameMap = getOptionNameMap().optionNameMap; - for (var name_44 in options) { - if (ts.hasProperty(options, name_44)) { + for (var name in options) { + if (ts.hasProperty(options, name)) { // tsconfig only options cannot be specified via command line, // so we can assume that only types that can appear here string | number | boolean - switch (name_44) { - case "init": - case "watch": - case "version": - case "help": - case "project": - break; - default: - var value = options[name_44]; - var optionDefinition = optionsNameMap[name_44.toLowerCase()]; - if (optionDefinition) { - var customTypeMap = getCustomTypeMapOfCommandLineOption(optionDefinition); - if (!customTypeMap) { - // There is no map associated with this compiler option then use the value as-is - // This is the case if the value is expect to be string, number, boolean or list of string - result[name_44] = value; - } - else { - if (optionDefinition.type === "list") { - var convertedValue = []; - for (var _i = 0, _a = value; _i < _a.length; _i++) { - var element = _a[_i]; - convertedValue.push(getNameOfCompilerOptionValue(element, customTypeMap)); - } - result[name_44] = convertedValue; - } - else { - // There is a typeMap associated with this command-line option so use it to map value back to its name - result[name_44] = getNameOfCompilerOptionValue(value, customTypeMap); - } + if (optionsNameMap.has(name) && optionsNameMap.get(name).category === ts.Diagnostics.Command_line_Options) { + continue; + } + var value = options[name]; + var optionDefinition = optionsNameMap.get(name.toLowerCase()); + if (optionDefinition) { + var customTypeMap = getCustomTypeMapOfCommandLineOption(optionDefinition); + if (!customTypeMap) { + // There is no map associated with this compiler option then use the value as-is + // This is the case if the value is expect to be string, number, boolean or list of string + result[name] = value; + } + else { + if (optionDefinition.type === "list") { + var convertedValue = []; + for (var _i = 0, _a = value; _i < _a.length; _i++) { + var element = _a[_i]; + convertedValue.push(getNameOfCompilerOptionValue(element, customTypeMap)); } + result[name] = convertedValue; } - break; + else { + // There is a typeMap associated with this command-line option so use it to map value back to its name + result[name] = getNameOfCompilerOptionValue(value, customTypeMap); + } + } } } } return result; } + function getDefaultValueForOption(option) { + switch (option.type) { + case "number": + return 1; + case "boolean": + return true; + case "string": + return option.isFilePath ? "./" : ""; + case "list": + return []; + case "object": + return {}; + default: + return ts.arrayFrom(option.type.keys())[0]; + } + } + function makePadding(paddingLength) { + return Array(paddingLength + 1).join(" "); + } + function writeConfigurations() { + // Filter applicable options to place in the file + var categorizedOptions = ts.reduceLeft(ts.filter(ts.optionDeclarations, function (o) { return o.category !== ts.Diagnostics.Command_line_Options && o.category !== ts.Diagnostics.Advanced_Options; }), function (memo, value) { + if (value.category) { + var name = ts.getLocaleSpecificMessage(value.category); + (memo[name] || (memo[name] = [])).push(value); + } + return memo; + }, {}); + // Serialize all options and thier descriptions + var marginLength = 0; + var seenKnownKeys = 0; + var nameColumn = []; + var descriptionColumn = []; + var knownKeysCount = ts.getOwnKeys(configurations.compilerOptions).length; + for (var category in categorizedOptions) { + if (nameColumn.length !== 0) { + nameColumn.push(""); + descriptionColumn.push(""); + } + nameColumn.push("/* " + category + " */"); + descriptionColumn.push(""); + for (var _i = 0, _a = categorizedOptions[category]; _i < _a.length; _i++) { + var option = _a[_i]; + var optionName = void 0; + if (ts.hasProperty(configurations.compilerOptions, option.name)) { + optionName = "\"" + option.name + "\": " + JSON.stringify(configurations.compilerOptions[option.name]) + ((seenKnownKeys += 1) === knownKeysCount ? "" : ","); + } + else { + optionName = "// \"" + option.name + "\": " + JSON.stringify(getDefaultValueForOption(option)) + ","; + } + nameColumn.push(optionName); + descriptionColumn.push("/* " + (option.description && ts.getLocaleSpecificMessage(option.description) || option.name) + " */"); + marginLength = Math.max(optionName.length, marginLength); + } + } + // Write the output + var tab = makePadding(2); + var result = []; + result.push("{"); + result.push(tab + "\"compilerOptions\": {"); + // Print out each row, aligning all the descriptions on the same column. + for (var i = 0; i < nameColumn.length; i++) { + var optionName = nameColumn[i]; + var description = descriptionColumn[i]; + result.push(tab + tab + optionName + makePadding(marginLength - optionName.length + 2) + description); + } + if (configurations.files && configurations.files.length) { + result.push(tab + "},"); + result.push(tab + "\"files\": ["); + for (var i = 0; i < configurations.files.length; i++) { + result.push("" + tab + tab + JSON.stringify(configurations.files[i]) + (i === configurations.files.length - 1 ? "" : ",")); + } + result.push(tab + "]"); + } + else { + result.push(tab + "}"); + } + result.push("}"); + return result.join(newLine); + } } ts.generateTSConfig = generateTSConfig; /** @@ -64658,17 +69360,18 @@ var ts; return output; } /** - * Parse the contents of a config file (tsconfig.json). - * @param json The contents of the config file to parse - * @param host Instance of ParseConfigHost used to enumerate files in folder. - * @param basePath A root directory to resolve relative path entries in the config - * file to. e.g. outDir - */ + * Parse the contents of a config file (tsconfig.json). + * @param json The contents of the config file to parse + * @param host Instance of ParseConfigHost used to enumerate files in folder. + * @param basePath A root directory to resolve relative path entries in the config + * file to. e.g. outDir + */ function parseJsonConfigFileContent(json, host, basePath, existingOptions, configFileName, resolutionStack, extraFileExtensions) { if (existingOptions === void 0) { existingOptions = {}; } if (resolutionStack === void 0) { resolutionStack = []; } if (extraFileExtensions === void 0) { extraFileExtensions = []; } var errors = []; + basePath = ts.normalizeSlashes(basePath); var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames); var resolvedPath = ts.toPath(configFileName || "", basePath, getCanonicalFileName); if (resolutionStack.indexOf(resolvedPath) >= 0) { @@ -64686,10 +69389,11 @@ var ts; // It should be removed in future releases - use typeAcquisition instead. var jsonOptions = json["typeAcquisition"] || json["typingOptions"]; var typeAcquisition = convertTypeAcquisitionFromJsonWorker(jsonOptions, basePath, errors, configFileName); + var baseCompileOnSave; if (json["extends"]) { var _a = [undefined, undefined, undefined, {}], include = _a[0], exclude = _a[1], files = _a[2], baseOptions = _a[3]; if (typeof json["extends"] === "string") { - _b = (tryExtendsName(json["extends"]) || [include, exclude, files, baseOptions]), include = _b[0], exclude = _b[1], files = _b[2], baseOptions = _b[3]; + _b = (tryExtendsName(json["extends"]) || [include, exclude, files, baseCompileOnSave, baseOptions]), include = _b[0], exclude = _b[1], files = _b[2], baseCompileOnSave = _b[3], baseOptions = _b[4]; } else { errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "extends", "string")); @@ -64709,6 +69413,9 @@ var ts; options.configFilePath = configFileName; var _c = getFileNames(errors), fileNames = _c.fileNames, wildcardDirectories = _c.wildcardDirectories; var compileOnSave = convertCompileOnSaveOptionFromJson(json, basePath, errors); + if (baseCompileOnSave && json[ts.compileOnSaveCommandLineOption.name] === undefined) { + compileOnSave = baseCompileOnSave; + } return { options: options, fileNames: fileNames, @@ -64748,7 +69455,7 @@ var ts; return ts.map(extendedResult.config[key], updatePath); } }), include = _a[0], exclude = _a[1], files = _a[2]; - return [include, exclude, files, result.options]; + return [include, exclude, files, result.compileOnSave, result.options]; } function getFileNames(errors) { var fileNames; @@ -64846,8 +69553,8 @@ var ts; } var optionNameMap = ts.arrayToMap(optionDeclarations, function (opt) { return opt.name; }); for (var id in jsonOptions) { - if (id in optionNameMap) { - var opt = optionNameMap[id]; + var opt = optionNameMap.get(id); + if (opt) { defaultOptions[opt.name] = convertJsonOption(opt, jsonOptions[id], basePath, errors); } else { @@ -64881,8 +69588,9 @@ var ts; } function convertJsonOptionOfCustomType(opt, value, errors) { var key = value.toLowerCase(); - if (key in opt.type) { - return opt.type[key]; + var val = opt.type.get(key); + if (val !== undefined) { + return val; } else { errors.push(createCompilerDiagnosticForInvalidCustomType(opt)); @@ -65006,7 +69714,7 @@ var ts; for (var _i = 0, fileNames_1 = fileNames; _i < fileNames_1.length; _i++) { var fileName = fileNames_1[_i]; var file = ts.combinePaths(basePath, fileName); - literalFileMap[keyMapper(file)] = file; + literalFileMap.set(keyMapper(file), file); } } if (include && include.length > 0) { @@ -65027,14 +69735,13 @@ var ts; // same directory, we should remove it. removeWildcardFilesWithLowerPriorityExtension(file, wildcardFileMap, supportedExtensions, keyMapper); var key = keyMapper(file); - if (!(key in literalFileMap) && !(key in wildcardFileMap)) { - wildcardFileMap[key] = file; + if (!literalFileMap.has(key) && !wildcardFileMap.has(key)) { + wildcardFileMap.set(key, file); } } } - var literalFiles = ts.reduceProperties(literalFileMap, addFileToOutput, []); - var wildcardFiles = ts.reduceProperties(wildcardFileMap, addFileToOutput, []); - wildcardFiles.sort(host.useCaseSensitiveFileNames ? ts.compareStrings : ts.compareStringsCaseInsensitive); + var literalFiles = ts.arrayFrom(literalFileMap.values()); + var wildcardFiles = ts.arrayFrom(wildcardFileMap.values()); return { fileNames: literalFiles.concat(wildcardFiles), wildcardDirectories: wildcardDirectories @@ -65042,8 +69749,8 @@ var ts; } function validateSpecs(specs, errors, allowTrailingRecursion) { var validSpecs = []; - for (var _i = 0, specs_2 = specs; _i < specs_2.length; _i++) { - var spec = specs_2[_i]; + for (var _i = 0, specs_1 = specs; _i < specs_1.length; _i++) { + var spec = specs_1[_i]; if (!allowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec)); } @@ -65077,7 +69784,7 @@ var ts; // /a/b/a?z - Watch /a/b directly to catch any new file matching a?z var rawExcludeRegex = ts.getRegularExpressionForWildcard(exclude, path, "exclude"); var excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex, useCaseSensitiveFileNames ? "" : "i"); - var wildcardDirectories = ts.createMap(); + var wildcardDirectories = {}; if (include !== undefined) { var recursiveKeys = []; for (var _i = 0, include_1 = include; _i < include_1.length; _i++) { @@ -65099,14 +69806,15 @@ var ts; } } // Remove any subpaths under an existing recursively watched directory. - for (var key in wildcardDirectories) { - for (var _a = 0, recursiveKeys_1 = recursiveKeys; _a < recursiveKeys_1.length; _a++) { - var recursiveKey = recursiveKeys_1[_a]; - if (key !== recursiveKey && ts.containsPath(recursiveKey, key, path, !useCaseSensitiveFileNames)) { - delete wildcardDirectories[key]; + for (var key in wildcardDirectories) + if (ts.hasProperty(wildcardDirectories, key)) { + for (var _a = 0, recursiveKeys_1 = recursiveKeys; _a < recursiveKeys_1.length; _a++) { + var recursiveKey = recursiveKeys_1[_a]; + if (key !== recursiveKey && ts.containsPath(recursiveKey, key, path, !useCaseSensitiveFileNames)) { + delete wildcardDirectories[key]; + } } } - } } return wildcardDirectories; } @@ -65133,11 +69841,11 @@ var ts; */ function hasFileWithHigherPriorityExtension(file, literalFiles, wildcardFiles, extensions, keyMapper) { var extensionPriority = ts.getExtensionPriority(file, extensions); - var adjustedExtensionPriority = ts.adjustExtensionPriority(extensionPriority); + var adjustedExtensionPriority = ts.adjustExtensionPriority(extensionPriority, extensions); for (var i = 0 /* Highest */; i < adjustedExtensionPriority; i++) { var higherPriorityExtension = extensions[i]; var higherPriorityPath = keyMapper(ts.changeExtension(file, higherPriorityExtension)); - if (higherPriorityPath in literalFiles || higherPriorityPath in wildcardFiles) { + if (literalFiles.has(higherPriorityPath) || wildcardFiles.has(higherPriorityPath)) { return true; } } @@ -65153,23 +69861,13 @@ var ts; */ function removeWildcardFilesWithLowerPriorityExtension(file, wildcardFiles, extensions, keyMapper) { var extensionPriority = ts.getExtensionPriority(file, extensions); - var nextExtensionPriority = ts.getNextLowestExtensionPriority(extensionPriority); + var nextExtensionPriority = ts.getNextLowestExtensionPriority(extensionPriority, extensions); for (var i = nextExtensionPriority; i < extensions.length; i++) { var lowerPriorityExtension = extensions[i]; var lowerPriorityPath = keyMapper(ts.changeExtension(file, lowerPriorityExtension)); - delete wildcardFiles[lowerPriorityPath]; + wildcardFiles.delete(lowerPriorityPath); } } - /** - * Adds a file to an array of files. - * - * @param output The output array. - * @param file The file path. - */ - function addFileToOutput(output, file) { - output.push(file); - return output; - } /** * Gets a case sensitive key. * @@ -65186,6 +69884,44 @@ var ts; 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. + */ + /* @internal */ + function convertCompilerOptionsForTelemetry(opts) { + var out = {}; + for (var key in opts) + if (opts.hasOwnProperty(key)) { + var type = getOptionFromName(key); + if (type !== undefined) { + out[key] = getOptionValueWithEmptyStrings(opts[key], type); + } + } + return out; + } + ts.convertCompilerOptionsForTelemetry = convertCompilerOptionsForTelemetry; + function getOptionValueWithEmptyStrings(value, option) { + switch (option.type) { + case "object": + return ""; + case "string": + return ""; + case "number": + return typeof value === "number" ? value : ""; + case "boolean": + return typeof value === "boolean" ? value : ""; + case "list": + var elementType_1 = option.element; + return ts.isArray(value) ? value.map(function (v) { return getOptionValueWithEmptyStrings(v, elementType_1); }) : ""; + default: + return ts.forEachEntry(option.type, function (optionEnumValue, optionStringValue) { + if (optionEnumValue === value) { + return optionStringValue; + } + }); + } + } })(ts || (ts = {})); var ts; (function (ts) { @@ -65308,8 +70044,7 @@ var ts; ScriptElementKind.typeElement = "type"; /** enum E */ ScriptElementKind.enumElement = "enum"; - // TODO: GH#9983 - ScriptElementKind.enumMemberElement = "const"; + ScriptElementKind.enumMemberElement = "enum member"; /** * Inside module and script only * const v = .. @@ -65352,6 +70087,10 @@ var ts; ScriptElementKind.letElement = "let"; ScriptElementKind.directory = "directory"; ScriptElementKind.externalModuleName = "external module name"; + /** + * + */ + ScriptElementKind.jsxAttribute = "JSX attribute"; })(ScriptElementKind = ts.ScriptElementKind || (ts.ScriptElementKind = {})); var ScriptElementKindModifier; (function (ScriptElementKindModifier) { @@ -65437,33 +70176,34 @@ var ts; })(SemanticMeaning = ts.SemanticMeaning || (ts.SemanticMeaning = {})); function getMeaningFromDeclaration(node) { switch (node.kind) { - case 144 /* Parameter */: - case 223 /* VariableDeclaration */: - case 174 /* BindingElement */: - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 257 /* PropertyAssignment */: - case 258 /* ShorthandPropertyAssignment */: - case 260 /* EnumMember */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - case 256 /* CatchClause */: + case 146 /* Parameter */: + case 226 /* VariableDeclaration */: + case 176 /* BindingElement */: + case 149 /* PropertyDeclaration */: + case 148 /* PropertySignature */: + case 261 /* PropertyAssignment */: + case 262 /* ShorthandPropertyAssignment */: + case 264 /* EnumMember */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: + case 152 /* Constructor */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + case 228 /* FunctionDeclaration */: + case 186 /* FunctionExpression */: + case 187 /* ArrowFunction */: + case 260 /* CatchClause */: + case 253 /* JsxAttribute */: return 1 /* Value */; - case 143 /* TypeParameter */: - case 227 /* InterfaceDeclaration */: - case 228 /* TypeAliasDeclaration */: - case 161 /* TypeLiteral */: + case 145 /* TypeParameter */: + case 230 /* InterfaceDeclaration */: + case 231 /* TypeAliasDeclaration */: + case 163 /* TypeLiteral */: return 2 /* Type */; - case 226 /* ClassDeclaration */: - case 229 /* EnumDeclaration */: + case 229 /* ClassDeclaration */: + case 232 /* EnumDeclaration */: return 1 /* Value */ | 2 /* Type */; - case 230 /* ModuleDeclaration */: + case 233 /* ModuleDeclaration */: if (ts.isAmbientModule(node)) { return 4 /* Namespace */ | 1 /* Value */; } @@ -65473,22 +70213,25 @@ var ts; else { return 4 /* Namespace */; } - case 238 /* NamedImports */: - case 239 /* ImportSpecifier */: - case 234 /* ImportEqualsDeclaration */: - case 235 /* ImportDeclaration */: - case 240 /* ExportAssignment */: - case 241 /* ExportDeclaration */: + case 241 /* NamedImports */: + case 242 /* ImportSpecifier */: + case 237 /* ImportEqualsDeclaration */: + case 238 /* ImportDeclaration */: + case 243 /* ExportAssignment */: + case 244 /* ExportDeclaration */: return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; // An external module can be a Value - case 261 /* SourceFile */: + case 265 /* SourceFile */: return 4 /* Namespace */ | 1 /* Value */; } return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; } ts.getMeaningFromDeclaration = getMeaningFromDeclaration; function getMeaningFromLocation(node) { - if (node.parent.kind === 240 /* ExportAssignment */) { + if (node.kind === 265 /* SourceFile */) { + return 1 /* Value */; + } + else if (node.parent.kind === 243 /* ExportAssignment */) { return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; } else if (isInRightSideOfImport(node)) { @@ -65509,19 +70252,19 @@ var ts; } ts.getMeaningFromLocation = getMeaningFromLocation; function getMeaningFromRightHandSideOfImportEquals(node) { - ts.Debug.assert(node.kind === 70 /* Identifier */); + 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 === 141 /* QualifiedName */ && + if (node.parent.kind === 143 /* QualifiedName */ && node.parent.right === node && - node.parent.parent.kind === 234 /* ImportEqualsDeclaration */) { + node.parent.parent.kind === 237 /* ImportEqualsDeclaration */) { return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; } return 4 /* Namespace */; } function isInRightSideOfImport(node) { - while (node.parent.kind === 141 /* QualifiedName */) { + while (node.parent.kind === 143 /* QualifiedName */) { node = node.parent; } return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; @@ -65532,27 +70275,27 @@ var ts; function isQualifiedNameNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 141 /* QualifiedName */) { - while (root.parent && root.parent.kind === 141 /* QualifiedName */) { + if (root.parent.kind === 143 /* QualifiedName */) { + while (root.parent && root.parent.kind === 143 /* QualifiedName */) { root = root.parent; } isLastClause = root.right === node; } - return root.parent.kind === 157 /* TypeReference */ && !isLastClause; + return root.parent.kind === 159 /* TypeReference */ && !isLastClause; } function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 177 /* PropertyAccessExpression */) { - while (root.parent && root.parent.kind === 177 /* PropertyAccessExpression */) { + if (root.parent.kind === 179 /* PropertyAccessExpression */) { + while (root.parent && root.parent.kind === 179 /* PropertyAccessExpression */) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 199 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 255 /* HeritageClause */) { + if (!isLastClause && root.parent.kind === 201 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 259 /* HeritageClause */) { var decl = root.parent.parent.parent; - return (decl.kind === 226 /* ClassDeclaration */ && root.parent.parent.token === 107 /* ImplementsKeyword */) || - (decl.kind === 227 /* InterfaceDeclaration */ && root.parent.parent.token === 84 /* ExtendsKeyword */); + return (decl.kind === 229 /* ClassDeclaration */ && root.parent.parent.token === 108 /* ImplementsKeyword */) || + (decl.kind === 230 /* InterfaceDeclaration */ && root.parent.parent.token === 85 /* ExtendsKeyword */); } return false; } @@ -65560,17 +70303,17 @@ var ts; if (ts.isRightSideOfQualifiedNameOrPropertyAccess(node)) { node = node.parent; } - return node.parent.kind === 157 /* TypeReference */ || - (node.parent.kind === 199 /* ExpressionWithTypeArguments */ && !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent)) || - (node.kind === 98 /* ThisKeyword */ && !ts.isPartOfExpression(node)) || - node.kind === 167 /* ThisType */; + return node.parent.kind === 159 /* TypeReference */ || + (node.parent.kind === 201 /* ExpressionWithTypeArguments */ && !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent)) || + (node.kind === 99 /* ThisKeyword */ && !ts.isPartOfExpression(node)) || + node.kind === 169 /* ThisType */; } function isCallExpressionTarget(node) { - return isCallOrNewExpressionTarget(node, 179 /* CallExpression */); + return isCallOrNewExpressionTarget(node, 181 /* CallExpression */); } ts.isCallExpressionTarget = isCallExpressionTarget; function isNewExpressionTarget(node) { - return isCallOrNewExpressionTarget(node, 180 /* NewExpression */); + return isCallOrNewExpressionTarget(node, 182 /* NewExpression */); } ts.isNewExpressionTarget = isNewExpressionTarget; function isCallOrNewExpressionTarget(node, kind) { @@ -65583,7 +70326,7 @@ var ts; ts.climbPastPropertyAccess = climbPastPropertyAccess; function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 219 /* LabeledStatement */ && referenceNode.label.text === labelName) { + if (referenceNode.kind === 222 /* LabeledStatement */ && referenceNode.label.text === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -65592,14 +70335,14 @@ var ts; } ts.getTargetLabel = getTargetLabel; function isJumpStatementTarget(node) { - return node.kind === 70 /* Identifier */ && - (node.parent.kind === 215 /* BreakStatement */ || node.parent.kind === 214 /* ContinueStatement */) && + return node.kind === 71 /* Identifier */ && + (node.parent.kind === 218 /* BreakStatement */ || node.parent.kind === 217 /* ContinueStatement */) && node.parent.label === node; } ts.isJumpStatementTarget = isJumpStatementTarget; function isLabelOfLabeledStatement(node) { - return node.kind === 70 /* Identifier */ && - node.parent.kind === 219 /* LabeledStatement */ && + return node.kind === 71 /* Identifier */ && + node.parent.kind === 222 /* LabeledStatement */ && node.parent.label === node; } function isLabelName(node) { @@ -65607,38 +70350,38 @@ var ts; } ts.isLabelName = isLabelName; function isRightSideOfQualifiedName(node) { - return node.parent.kind === 141 /* QualifiedName */ && node.parent.right === node; + return node.parent.kind === 143 /* QualifiedName */ && node.parent.right === node; } ts.isRightSideOfQualifiedName = isRightSideOfQualifiedName; function isRightSideOfPropertyAccess(node) { - return node && node.parent && node.parent.kind === 177 /* PropertyAccessExpression */ && node.parent.name === node; + return node && node.parent && node.parent.kind === 179 /* PropertyAccessExpression */ && node.parent.name === node; } ts.isRightSideOfPropertyAccess = isRightSideOfPropertyAccess; function isNameOfModuleDeclaration(node) { - return node.parent.kind === 230 /* ModuleDeclaration */ && node.parent.name === node; + return node.parent.kind === 233 /* ModuleDeclaration */ && node.parent.name === node; } ts.isNameOfModuleDeclaration = isNameOfModuleDeclaration; function isNameOfFunctionDeclaration(node) { - return node.kind === 70 /* Identifier */ && + return node.kind === 71 /* Identifier */ && ts.isFunctionLike(node.parent) && node.parent.name === node; } ts.isNameOfFunctionDeclaration = isNameOfFunctionDeclaration; function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { if (node.kind === 9 /* StringLiteral */ || node.kind === 8 /* NumericLiteral */) { switch (node.parent.kind) { - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 257 /* PropertyAssignment */: - case 260 /* EnumMember */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 230 /* ModuleDeclaration */: - return node.parent.name === node; - case 178 /* ElementAccessExpression */: + case 149 /* PropertyDeclaration */: + case 148 /* PropertySignature */: + case 261 /* PropertyAssignment */: + case 264 /* EnumMember */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + case 233 /* ModuleDeclaration */: + return ts.getNameOfDeclaration(node.parent) === node; + case 180 /* ElementAccessExpression */: return node.parent.argumentExpression === node; - case 142 /* ComputedPropertyName */: + case 144 /* ComputedPropertyName */: return true; } } @@ -65687,17 +70430,17 @@ var ts; return undefined; } switch (node.kind) { - case 261 /* SourceFile */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 226 /* ClassDeclaration */: - case 227 /* InterfaceDeclaration */: - case 229 /* EnumDeclaration */: - case 230 /* ModuleDeclaration */: + case 265 /* SourceFile */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: + case 228 /* FunctionDeclaration */: + case 186 /* FunctionExpression */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + case 229 /* ClassDeclaration */: + case 230 /* InterfaceDeclaration */: + case 232 /* EnumDeclaration */: + case 233 /* ModuleDeclaration */: return node; } } @@ -65705,46 +70448,46 @@ var ts; ts.getContainerNode = getContainerNode; function getNodeKind(node) { switch (node.kind) { - case 261 /* SourceFile */: + case 265 /* SourceFile */: return ts.isExternalModule(node) ? ts.ScriptElementKind.moduleElement : ts.ScriptElementKind.scriptElement; - case 230 /* ModuleDeclaration */: + case 233 /* ModuleDeclaration */: return ts.ScriptElementKind.moduleElement; - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: + case 229 /* ClassDeclaration */: + case 199 /* ClassExpression */: return ts.ScriptElementKind.classElement; - case 227 /* InterfaceDeclaration */: return ts.ScriptElementKind.interfaceElement; - case 228 /* TypeAliasDeclaration */: return ts.ScriptElementKind.typeElement; - case 229 /* EnumDeclaration */: return ts.ScriptElementKind.enumElement; - case 223 /* VariableDeclaration */: + case 230 /* InterfaceDeclaration */: return ts.ScriptElementKind.interfaceElement; + case 231 /* TypeAliasDeclaration */: return ts.ScriptElementKind.typeElement; + case 232 /* EnumDeclaration */: return ts.ScriptElementKind.enumElement; + case 226 /* VariableDeclaration */: return getKindOfVariableDeclaration(node); - case 174 /* BindingElement */: + case 176 /* BindingElement */: return getKindOfVariableDeclaration(ts.getRootDeclaration(node)); - case 185 /* ArrowFunction */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: + case 187 /* ArrowFunction */: + case 228 /* FunctionDeclaration */: + case 186 /* FunctionExpression */: return ts.ScriptElementKind.functionElement; - case 151 /* GetAccessor */: return ts.ScriptElementKind.memberGetAccessorElement; - case 152 /* SetAccessor */: return ts.ScriptElementKind.memberSetAccessorElement; - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 153 /* GetAccessor */: return ts.ScriptElementKind.memberGetAccessorElement; + case 154 /* SetAccessor */: return ts.ScriptElementKind.memberSetAccessorElement; + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: return ts.ScriptElementKind.memberFunctionElement; - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: + case 149 /* PropertyDeclaration */: + case 148 /* PropertySignature */: return ts.ScriptElementKind.memberVariableElement; - case 155 /* IndexSignature */: return ts.ScriptElementKind.indexSignatureElement; - case 154 /* ConstructSignature */: return ts.ScriptElementKind.constructSignatureElement; - case 153 /* CallSignature */: return ts.ScriptElementKind.callSignatureElement; - case 150 /* Constructor */: return ts.ScriptElementKind.constructorImplementationElement; - case 143 /* TypeParameter */: return ts.ScriptElementKind.typeParameterElement; - case 260 /* EnumMember */: return ts.ScriptElementKind.enumMemberElement; - case 144 /* Parameter */: return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) ? ts.ScriptElementKind.memberVariableElement : ts.ScriptElementKind.parameterElement; - case 234 /* ImportEqualsDeclaration */: - case 239 /* ImportSpecifier */: - case 236 /* ImportClause */: - case 243 /* ExportSpecifier */: - case 237 /* NamespaceImport */: + case 157 /* IndexSignature */: return ts.ScriptElementKind.indexSignatureElement; + case 156 /* ConstructSignature */: return ts.ScriptElementKind.constructSignatureElement; + case 155 /* CallSignature */: return ts.ScriptElementKind.callSignatureElement; + case 152 /* Constructor */: return ts.ScriptElementKind.constructorImplementationElement; + case 145 /* TypeParameter */: return ts.ScriptElementKind.typeParameterElement; + case 264 /* EnumMember */: return ts.ScriptElementKind.enumMemberElement; + case 146 /* Parameter */: return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) ? ts.ScriptElementKind.memberVariableElement : ts.ScriptElementKind.parameterElement; + case 237 /* ImportEqualsDeclaration */: + case 242 /* ImportSpecifier */: + case 239 /* ImportClause */: + case 246 /* ExportSpecifier */: + case 240 /* NamespaceImport */: return ts.ScriptElementKind.alias; - case 285 /* JSDocTypedefTag */: + case 290 /* JSDocTypedefTag */: return ts.ScriptElementKind.typeElement; default: return ts.ScriptElementKind.unknown; @@ -65758,23 +70501,14 @@ var ts; } } ts.getNodeKind = getNodeKind; - function getStringLiteralTypeForNode(node, typeChecker) { - var searchNode = node.parent.kind === 171 /* LiteralType */ ? node.parent : node; - var type = typeChecker.getTypeAtLocation(searchNode); - if (type && type.flags & 32 /* StringLiteral */) { - return type; - } - return undefined; - } - ts.getStringLiteralTypeForNode = getStringLiteralTypeForNode; function isThis(node) { switch (node.kind) { - case 98 /* ThisKeyword */: + case 99 /* ThisKeyword */: // case SyntaxKind.ThisType: TODO: GH#9267 return true; - case 70 /* Identifier */: + case 71 /* Identifier */: // 'this' as a parameter - return ts.identifierIsThisKeyword(node) && node.parent.kind === 144 /* Parameter */; + return ts.identifierIsThisKeyword(node) && node.parent.kind === 146 /* Parameter */; default: return false; } @@ -65783,7 +70517,7 @@ var ts; // Matches the beginning of a triple slash directive var tripleSlashDirectivePrefixRegex = /^\/\/\/\s*= node.end) { + if (c.kind === 294 /* SyntaxList */ && c.pos <= node.pos && c.end >= node.end) { return c; } }); @@ -66022,7 +70756,7 @@ var ts; if (includeJsDocComment === void 0) { includeJsDocComment = false; } var current = sourceFile; outer: while (true) { - if (isToken(current)) { + if (ts.isToken(current)) { // exit early return current; } @@ -66047,8 +70781,8 @@ var ts; } } // find the child that contains 'position' - for (var i = 0, n = current.getChildCount(sourceFile); i < n; i++) { - var child = current.getChildAt(i); + for (var _a = 0, _b = current.getChildren(); _a < _b.length; _a++) { + var child = _b[_a]; // all jsDocComment nodes were already visited if (ts.isJSDocNode(child)) { continue; @@ -66072,18 +70806,18 @@ var ts; } } /** - * The token on the left of the position is the token that strictly includes the position - * or sits to the left of the cursor if it is on a boundary. For example - * - * fo|o -> will return foo - * foo |bar -> will return foo - * - */ + * The token on the left of the position is the token that strictly includes the position + * or sits to the left of the cursor if it is on a boundary. For example + * + * fo|o -> will return foo + * foo |bar -> will return foo + * + */ function findTokenOnLeftOfPosition(file, position) { // Ideally, getTokenAtPosition should return a token. However, it is currently // broken, so we do a check to make sure the result was indeed a token. var tokenAtPosition = getTokenAtPosition(file, position); - if (isToken(tokenAtPosition) && position > tokenAtPosition.getStart(file) && position < tokenAtPosition.getEnd()) { + if (ts.isToken(tokenAtPosition) && position > tokenAtPosition.getStart(file) && position < tokenAtPosition.getEnd()) { return tokenAtPosition; } return findPrecedingToken(position, file); @@ -66092,7 +70826,7 @@ var ts; function findNextToken(previousToken, parent) { return find(parent); function find(n) { - if (isToken(n) && n.pos === previousToken.end) { + if (ts.isToken(n) && n.pos === previousToken.end) { // this is token that starts at the end of previous token - return it return n; } @@ -66115,7 +70849,7 @@ var ts; function findPrecedingToken(position, sourceFile, startNode) { return find(startNode || sourceFile); function findRightmostToken(n) { - if (isToken(n)) { + if (ts.isToken(n)) { return n; } var children = n.getChildren(); @@ -66123,11 +70857,11 @@ var ts; return candidate && findRightmostToken(candidate); } function find(n) { - if (isToken(n)) { + if (ts.isToken(n)) { return n; } var children = n.getChildren(); - for (var i = 0, len = children.length; i < len; i++) { + for (var i = 0; i < children.length; i++) { var child = children[i]; // condition 'position < child.end' checks if child node end after the position // in the example below this condition will be false for 'aaaa' and 'bbbb' and true for 'ccc' @@ -66152,7 +70886,7 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 261 /* SourceFile */); + ts.Debug.assert(startNode !== undefined || n.kind === 265 /* SourceFile */); // 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. @@ -66207,21 +70941,21 @@ var ts; return true; } //
Hello |
- if (token.kind === 26 /* LessThanToken */ && token.parent.kind === 10 /* JsxText */) { + if (token.kind === 27 /* LessThanToken */ && token.parent.kind === 10 /* JsxText */) { return true; } //
{ |
or
- if (token.kind === 26 /* LessThanToken */ && token.parent.kind === 252 /* JsxExpression */) { + if (token.kind === 27 /* LessThanToken */ && token.parent.kind === 256 /* JsxExpression */) { return true; } //
{ // | // } < /div> - if (token && token.kind === 17 /* CloseBraceToken */ && token.parent.kind === 252 /* JsxExpression */) { + if (token && token.kind === 18 /* CloseBraceToken */ && token.parent.kind === 256 /* JsxExpression */) { return true; } //
|
- if (token.kind === 26 /* LessThanToken */ && token.parent.kind === 249 /* JsxClosingElement */) { + if (token.kind === 27 /* LessThanToken */ && token.parent.kind === 252 /* JsxClosingElement */) { return true; } return false; @@ -66252,10 +70986,10 @@ var ts; // Internally, we represent the end of the comment at the newline and closing '/', respectively. return predicate ? ts.forEach(commentRanges, function (c) { return c.pos < position && - (c.kind == 2 /* SingleLineCommentTrivia */ ? position <= c.end : position < c.end) && + (c.kind === 2 /* SingleLineCommentTrivia */ ? position <= c.end : position < c.end) && predicate(c); }) : ts.forEach(commentRanges, function (c) { return c.pos < position && - (c.kind == 2 /* SingleLineCommentTrivia */ ? position <= c.end : position < c.end); }); + (c.kind === 2 /* SingleLineCommentTrivia */ ? position <= c.end : position < c.end); }); } return false; } @@ -66276,11 +71010,11 @@ var ts; */ function getJsDocTagAtPosition(sourceFile, position) { var node = ts.getTokenAtPosition(sourceFile, position); - if (isToken(node)) { + if (ts.isToken(node)) { switch (node.kind) { - case 103 /* VarKeyword */: - case 109 /* LetKeyword */: - case 75 /* ConstKeyword */: + case 104 /* VarKeyword */: + case 110 /* LetKeyword */: + case 76 /* ConstKeyword */: // if the current token is var, let or const, skip the VariableDeclarationList node = node.parent === undefined ? undefined : node.parent.parent; break; @@ -66333,21 +71067,17 @@ var ts; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 157 /* TypeReference */ || node.kind === 179 /* CallExpression */) { + if (node.kind === 159 /* TypeReference */ || node.kind === 181 /* CallExpression */) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 226 /* ClassDeclaration */ || node.kind === 227 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(node) || node.kind === 229 /* ClassDeclaration */ || node.kind === 230 /* InterfaceDeclaration */) { return node.typeParameters; } return undefined; } ts.getTypeArgumentOrTypeParameterList = getTypeArgumentOrTypeParameterList; - function isToken(n) { - return n.kind >= 0 /* FirstToken */ && n.kind <= 140 /* LastToken */; - } - ts.isToken = isToken; function isWord(kind) { - return kind === 70 /* Identifier */ || ts.isKeyword(kind); + return kind === 71 /* Identifier */ || ts.isKeyword(kind); } ts.isWord = isWord; function isPropertyName(kind) { @@ -66359,7 +71089,7 @@ var ts; ts.isComment = isComment; function isStringOrRegularExpressionOrTemplateLiteral(kind) { if (kind === 9 /* StringLiteral */ - || kind === 11 /* RegularExpressionLiteral */ + || kind === 12 /* RegularExpressionLiteral */ || ts.isTemplateLiteralKind(kind)) { return true; } @@ -66367,7 +71097,7 @@ var ts; } ts.isStringOrRegularExpressionOrTemplateLiteral = isStringOrRegularExpressionOrTemplateLiteral; function isPunctuation(kind) { - return 16 /* FirstPunctuation */ <= kind && kind <= 69 /* LastPunctuation */; + return 17 /* FirstPunctuation */ <= kind && kind <= 70 /* LastPunctuation */; } ts.isPunctuation = isPunctuation; function isInsideTemplateLiteral(node, position) { @@ -66377,15 +71107,18 @@ var ts; ts.isInsideTemplateLiteral = isInsideTemplateLiteral; function isAccessibilityModifier(kind) { switch (kind) { - case 113 /* PublicKeyword */: - case 111 /* PrivateKeyword */: - case 112 /* ProtectedKeyword */: + case 114 /* PublicKeyword */: + case 112 /* PrivateKeyword */: + case 113 /* ProtectedKeyword */: return true; } return false; } ts.isAccessibilityModifier = isAccessibilityModifier; function compareDataObjects(dst, src) { + if (!dst || !src || Object.keys(dst).length !== Object.keys(src).length) { + return false; + } for (var e in dst) { if (typeof dst[e] === "object") { if (!compareDataObjects(dst[e], src[e])) { @@ -66402,18 +71135,18 @@ var ts; } ts.compareDataObjects = compareDataObjects; function isArrayLiteralOrObjectLiteralDestructuringPattern(node) { - if (node.kind === 175 /* ArrayLiteralExpression */ || - node.kind === 176 /* ObjectLiteralExpression */) { + if (node.kind === 177 /* ArrayLiteralExpression */ || + node.kind === 178 /* ObjectLiteralExpression */) { // [a,b,c] from: // [a, b, c] = someExpression; - if (node.parent.kind === 192 /* BinaryExpression */ && + if (node.parent.kind === 194 /* BinaryExpression */ && node.parent.left === node && - node.parent.operatorToken.kind === 57 /* EqualsToken */) { + node.parent.operatorToken.kind === 58 /* EqualsToken */) { return true; } // [a, b, c] from: // for([a, b, c] of expression) - if (node.parent.kind === 213 /* ForOfStatement */ && + if (node.parent.kind === 216 /* ForOfStatement */ && node.parent.initializer === node) { return true; } @@ -66421,7 +71154,7 @@ var ts; // [x, [a, b, c] ] = someExpression // or // {x, a: {a, b, c} } = someExpression - if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 257 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 261 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { return true; } } @@ -66449,12 +71182,47 @@ var ts; } } ts.isInNonReferenceComment = isInNonReferenceComment; + function createTextSpanFromNode(node, sourceFile) { + return ts.createTextSpanFromBounds(node.getStart(sourceFile), node.getEnd()); + } + ts.createTextSpanFromNode = createTextSpanFromNode; + function isTypeKeyword(kind) { + switch (kind) { + case 119 /* AnyKeyword */: + case 122 /* BooleanKeyword */: + case 130 /* NeverKeyword */: + case 133 /* NumberKeyword */: + case 134 /* ObjectKeyword */: + case 136 /* StringKeyword */: + case 137 /* SymbolKeyword */: + case 105 /* VoidKeyword */: + return true; + default: + return false; + } + } + ts.isTypeKeyword = isTypeKeyword; + /** True if the symbol is for an external module, as opposed to a namespace. */ + function isExternalModuleSymbol(moduleSymbol) { + ts.Debug.assert(!!(moduleSymbol.flags & 1536 /* Module */)); + return moduleSymbol.name.charCodeAt(0) === 34 /* doubleQuote */; + } + ts.isExternalModuleSymbol = isExternalModuleSymbol; + /** Returns `true` the first time it encounters a node and `false` afterwards. */ + function nodeSeenTracker() { + var seen = []; + return function (node) { + var id = ts.getNodeId(node); + return !seen[id] && (seen[id] = true); + }; + } + ts.nodeSeenTracker = nodeSeenTracker; })(ts || (ts = {})); // Display-part writer helpers /* @internal */ (function (ts) { function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 144 /* Parameter */; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 146 /* Parameter */; } ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; var displayPartWriter = getDisplayPartWriter(); @@ -66478,7 +71246,8 @@ var ts; decreaseIndent: function () { indent--; }, clear: resetWriter, trackSymbol: ts.noop, - reportInaccessibleThisError: ts.noop + reportInaccessibleThisError: ts.noop, + reportIllegalExtends: ts.noop }; function writeIndent() { if (lineStart) { @@ -66631,23 +71400,18 @@ var ts; function getDeclaredName(typeChecker, symbol, location) { // If this is an export or import specifier it could have been renamed using the 'as' syntax. // If so we want to search for whatever is under the cursor. - if (isImportOrExportSpecifierName(location)) { - return location.getText(); - } - else if (ts.isStringOrNumericLiteral(location) && - location.parent.kind === 142 /* ComputedPropertyName */) { + if (isImportOrExportSpecifierName(location) || ts.isStringOrNumericLiteral(location) && location.parent.kind === 144 /* ComputedPropertyName */) { return location.text; } // Try to get the local symbol if we're dealing with an 'export default' // since that symbol has the "true" name. var localExportDefaultSymbol = ts.getLocalSymbolForExportDefault(symbol); - var name = typeChecker.symbolToString(localExportDefaultSymbol || symbol); - return name; + return typeChecker.symbolToString(localExportDefaultSymbol || symbol); } ts.getDeclaredName = getDeclaredName; function isImportOrExportSpecifierName(location) { return location.parent && - (location.parent.kind === 239 /* ImportSpecifier */ || location.parent.kind === 243 /* ExportSpecifier */) && + (location.parent.kind === 242 /* ImportSpecifier */ || location.parent.kind === 246 /* ExportSpecifier */) && location.parent.propertyName === location; } ts.isImportOrExportSpecifierName = isImportOrExportSpecifierName; @@ -66663,7 +71427,6 @@ var ts; (name.charCodeAt(0) === 34 /* doubleQuote */ || name.charCodeAt(0) === 39 /* singleQuote */)) { return name.substring(1, length - 1); } - ; return name; } ts.stripQuotes = stripQuotes; @@ -66714,6 +71477,22 @@ var ts; }; } ts.sanitizeConfigFile = sanitizeConfigFile; + function getFirstNonSpaceCharacterPosition(text, position) { + while (ts.isWhiteSpaceLike(text.charCodeAt(position))) { + position += 1; + } + return position; + } + ts.getFirstNonSpaceCharacterPosition = getFirstNonSpaceCharacterPosition; + function getOpenBrace(constructor, sourceFile) { + // First token is the open curly, this is where we want to put the 'super' call. + return constructor.body.getFirstToken(sourceFile); + } + ts.getOpenBrace = getOpenBrace; + function getOpenBraceOfClassLike(declaration, sourceFile) { + return ts.getTokenAtPosition(sourceFile, declaration.members.pos - 1); + } + ts.getOpenBraceOfClassLike = getOpenBraceOfClassLike; })(ts || (ts = {})); var ts; (function (ts) { @@ -66725,18 +71504,18 @@ var ts; /// we have a series of divide operator. this list allows us to be more accurate by ruling out /// locations where a regexp cannot exist. var noRegexTable = []; - noRegexTable[70 /* Identifier */] = true; + noRegexTable[71 /* Identifier */] = true; noRegexTable[9 /* StringLiteral */] = true; noRegexTable[8 /* NumericLiteral */] = true; - noRegexTable[11 /* RegularExpressionLiteral */] = true; - noRegexTable[98 /* ThisKeyword */] = true; - noRegexTable[42 /* PlusPlusToken */] = true; - noRegexTable[43 /* MinusMinusToken */] = true; - noRegexTable[19 /* CloseParenToken */] = true; - noRegexTable[21 /* CloseBracketToken */] = true; - noRegexTable[17 /* CloseBraceToken */] = true; - noRegexTable[100 /* TrueKeyword */] = true; - noRegexTable[85 /* FalseKeyword */] = true; + noRegexTable[12 /* RegularExpressionLiteral */] = true; + noRegexTable[99 /* ThisKeyword */] = true; + noRegexTable[43 /* PlusPlusToken */] = true; + noRegexTable[44 /* MinusMinusToken */] = true; + noRegexTable[20 /* CloseParenToken */] = true; + noRegexTable[22 /* CloseBracketToken */] = true; + noRegexTable[18 /* CloseBraceToken */] = true; + noRegexTable[101 /* TrueKeyword */] = true; + noRegexTable[86 /* FalseKeyword */] = true; // Just a stack of TemplateHeads and OpenCurlyBraces, used to perform rudimentary (inexact) // classification on template strings. Because of the context free nature of templates, // the only precise way to classify a template portion would be by propagating the stack across @@ -66761,10 +71540,10 @@ var ts; /** Returns true if 'keyword2' can legally follow 'keyword1' in any language construct. */ function canFollow(keyword1, keyword2) { if (ts.isAccessibilityModifier(keyword1)) { - if (keyword2 === 124 /* GetKeyword */ || - keyword2 === 133 /* SetKeyword */ || - keyword2 === 122 /* ConstructorKeyword */ || - keyword2 === 114 /* StaticKeyword */) { + if (keyword2 === 125 /* GetKeyword */ || + keyword2 === 135 /* SetKeyword */ || + keyword2 === 123 /* ConstructorKeyword */ || + keyword2 === 115 /* StaticKeyword */) { // Allow things like "public get", "public constructor" and "public static". // These are all legal. return true; @@ -66781,9 +71560,9 @@ var ts; var entries = []; var dense = classifications.spans; var lastEnd = 0; - for (var i = 0, n = dense.length; i < n; i += 3) { + for (var i = 0; i < dense.length; i += 3) { var start = dense[i]; - var length_4 = dense[i + 1]; + var length_5 = dense[i + 1]; var type = dense[i + 2]; // Make a whitespace entry between the last item and this one. if (lastEnd >= 0) { @@ -66792,8 +71571,8 @@ var ts; entries.push({ length: whitespaceLength_1, classification: ts.TokenClass.Whitespace }); } } - entries.push({ length: length_4, classification: convertClassification(type) }); - lastEnd = start + length_4; + entries.push({ length: length_5, classification: convertClassification(type) }); + lastEnd = start + length_5; } var whitespaceLength = text.length - lastEnd; if (whitespaceLength > 0) { @@ -66861,9 +71640,9 @@ var ts; case 5 /* InTemplateMiddleOrTail */: text = "}\n" + text; offset = 2; - // fallthrough + // falls through case 6 /* InTemplateSubstitutionPosition */: - templateStack.push(13 /* TemplateHead */); + templateStack.push(14 /* TemplateHead */); break; } scanner.setText(text); @@ -66894,71 +71673,71 @@ var ts; do { token = scanner.scan(); if (!ts.isTrivia(token)) { - if ((token === 40 /* SlashToken */ || token === 62 /* SlashEqualsToken */) && !noRegexTable[lastNonTriviaToken]) { - if (scanner.reScanSlashToken() === 11 /* RegularExpressionLiteral */) { - token = 11 /* RegularExpressionLiteral */; + if ((token === 41 /* SlashToken */ || token === 63 /* SlashEqualsToken */) && !noRegexTable[lastNonTriviaToken]) { + if (scanner.reScanSlashToken() === 12 /* RegularExpressionLiteral */) { + token = 12 /* RegularExpressionLiteral */; } } - else if (lastNonTriviaToken === 22 /* DotToken */ && isKeyword(token)) { - token = 70 /* Identifier */; + else if (lastNonTriviaToken === 23 /* DotToken */ && isKeyword(token)) { + token = 71 /* Identifier */; } else if (isKeyword(lastNonTriviaToken) && isKeyword(token) && !canFollow(lastNonTriviaToken, token)) { // We have two keywords in a row. Only treat the second as a keyword if // it's a sequence that could legally occur in the language. Otherwise // treat it as an identifier. This way, if someone writes "private var" // we recognize that 'var' is actually an identifier here. - token = 70 /* Identifier */; + token = 71 /* Identifier */; } - else if (lastNonTriviaToken === 70 /* Identifier */ && - token === 26 /* LessThanToken */) { + else if (lastNonTriviaToken === 71 /* Identifier */ && + token === 27 /* LessThanToken */) { // Could be the start of something generic. Keep track of that by bumping // up the current count of generic contexts we may be in. angleBracketStack++; } - else if (token === 28 /* GreaterThanToken */ && angleBracketStack > 0) { + else if (token === 29 /* GreaterThanToken */ && angleBracketStack > 0) { // If we think we're currently in something generic, then mark that that // generic entity is complete. angleBracketStack--; } - else if (token === 118 /* AnyKeyword */ || - token === 134 /* StringKeyword */ || - token === 132 /* NumberKeyword */ || - token === 121 /* BooleanKeyword */ || - token === 135 /* SymbolKeyword */) { + else if (token === 119 /* AnyKeyword */ || + token === 136 /* StringKeyword */ || + token === 133 /* NumberKeyword */ || + token === 122 /* BooleanKeyword */ || + token === 137 /* 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, // causing a noisy experience for the user. - token = 70 /* Identifier */; + token = 71 /* Identifier */; } } - else if (token === 13 /* TemplateHead */) { + else if (token === 14 /* TemplateHead */) { templateStack.push(token); } - else if (token === 16 /* OpenBraceToken */) { + else if (token === 17 /* OpenBraceToken */) { // If we don't have anything on the template stack, // then we aren't trying to keep track of a previously scanned template head. if (templateStack.length > 0) { templateStack.push(token); } } - else if (token === 17 /* CloseBraceToken */) { + else if (token === 18 /* CloseBraceToken */) { // If we don't have anything on the template stack, // then we aren't trying to keep track of a previously scanned template head. if (templateStack.length > 0) { var lastTemplateStackToken = ts.lastOrUndefined(templateStack); - if (lastTemplateStackToken === 13 /* TemplateHead */) { + if (lastTemplateStackToken === 14 /* TemplateHead */) { token = scanner.reScanTemplateToken(); // Only pop on a TemplateTail; a TemplateMiddle indicates there is more for us. - if (token === 15 /* TemplateTail */) { + if (token === 16 /* TemplateTail */) { templateStack.pop(); } else { - ts.Debug.assert(token === 14 /* TemplateMiddle */, "Should have been a template middle. Was " + token); + ts.Debug.assert(token === 15 /* TemplateMiddle */, "Should have been a template middle. Was " + token); } } else { - ts.Debug.assert(lastTemplateStackToken === 16 /* OpenBraceToken */, "Should have been an open brace. Was: " + token); + ts.Debug.assert(lastTemplateStackToken === 17 /* OpenBraceToken */, "Should have been an open brace. Was: " + token); templateStack.pop(); } } @@ -66999,10 +71778,10 @@ var ts; } else if (ts.isTemplateLiteralKind(token)) { if (scanner.isUnterminated()) { - if (token === 15 /* TemplateTail */) { + if (token === 16 /* TemplateTail */) { result.endOfLineState = 5 /* InTemplateMiddleOrTail */; } - else if (token === 12 /* NoSubstitutionTemplateLiteral */) { + else if (token === 13 /* NoSubstitutionTemplateLiteral */) { result.endOfLineState = 4 /* InTemplateHeadOrNoSubstitutionTemplate */; } else { @@ -67010,7 +71789,7 @@ var ts; } } } - else if (templateStack.length > 0 && ts.lastOrUndefined(templateStack) === 13 /* TemplateHead */) { + else if (templateStack.length > 0 && ts.lastOrUndefined(templateStack) === 14 /* TemplateHead */) { result.endOfLineState = 6 /* InTemplateSubstitutionPosition */; } } @@ -67040,43 +71819,43 @@ var ts; } function isBinaryExpressionOperatorToken(token) { switch (token) { - case 38 /* AsteriskToken */: - case 40 /* SlashToken */: - case 41 /* PercentToken */: - case 36 /* PlusToken */: - case 37 /* MinusToken */: - case 44 /* LessThanLessThanToken */: - case 45 /* GreaterThanGreaterThanToken */: - case 46 /* GreaterThanGreaterThanGreaterThanToken */: - case 26 /* LessThanToken */: - case 28 /* GreaterThanToken */: - case 29 /* LessThanEqualsToken */: - case 30 /* GreaterThanEqualsToken */: - case 92 /* InstanceOfKeyword */: - case 91 /* InKeyword */: - case 117 /* AsKeyword */: - case 31 /* EqualsEqualsToken */: - case 32 /* ExclamationEqualsToken */: - case 33 /* EqualsEqualsEqualsToken */: - case 34 /* ExclamationEqualsEqualsToken */: - case 47 /* AmpersandToken */: - case 49 /* CaretToken */: - case 48 /* BarToken */: - case 52 /* AmpersandAmpersandToken */: - case 53 /* BarBarToken */: - case 68 /* BarEqualsToken */: - case 67 /* AmpersandEqualsToken */: - case 69 /* CaretEqualsToken */: - case 64 /* LessThanLessThanEqualsToken */: - case 65 /* GreaterThanGreaterThanEqualsToken */: - case 66 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - case 58 /* PlusEqualsToken */: - case 59 /* MinusEqualsToken */: - case 60 /* AsteriskEqualsToken */: - case 62 /* SlashEqualsToken */: - case 63 /* PercentEqualsToken */: - case 57 /* EqualsToken */: - case 25 /* CommaToken */: + case 39 /* AsteriskToken */: + case 41 /* SlashToken */: + case 42 /* PercentToken */: + case 37 /* PlusToken */: + case 38 /* MinusToken */: + case 45 /* LessThanLessThanToken */: + case 46 /* GreaterThanGreaterThanToken */: + case 47 /* GreaterThanGreaterThanGreaterThanToken */: + case 27 /* LessThanToken */: + case 29 /* GreaterThanToken */: + case 30 /* LessThanEqualsToken */: + case 31 /* GreaterThanEqualsToken */: + case 93 /* InstanceOfKeyword */: + case 92 /* InKeyword */: + case 118 /* AsKeyword */: + case 32 /* EqualsEqualsToken */: + case 33 /* ExclamationEqualsToken */: + case 34 /* EqualsEqualsEqualsToken */: + case 35 /* ExclamationEqualsEqualsToken */: + case 48 /* AmpersandToken */: + case 50 /* CaretToken */: + case 49 /* BarToken */: + case 53 /* AmpersandAmpersandToken */: + case 54 /* BarBarToken */: + case 69 /* BarEqualsToken */: + case 68 /* AmpersandEqualsToken */: + case 70 /* CaretEqualsToken */: + case 65 /* LessThanLessThanEqualsToken */: + case 66 /* GreaterThanGreaterThanEqualsToken */: + case 67 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 59 /* PlusEqualsToken */: + case 60 /* MinusEqualsToken */: + case 61 /* AsteriskEqualsToken */: + case 63 /* SlashEqualsToken */: + case 64 /* PercentEqualsToken */: + case 58 /* EqualsToken */: + case 26 /* CommaToken */: return true; default: return false; @@ -67084,19 +71863,19 @@ var ts; } function isPrefixUnaryExpressionOperatorToken(token) { switch (token) { - case 36 /* PlusToken */: - case 37 /* MinusToken */: - case 51 /* TildeToken */: - case 50 /* ExclamationToken */: - case 42 /* PlusPlusToken */: - case 43 /* MinusMinusToken */: + case 37 /* PlusToken */: + case 38 /* MinusToken */: + case 52 /* TildeToken */: + case 51 /* ExclamationToken */: + case 43 /* PlusPlusToken */: + case 44 /* MinusMinusToken */: return true; default: return false; } } function isKeyword(token) { - return token >= 71 /* FirstKeyword */ && token <= 140 /* LastKeyword */; + return token >= 72 /* FirstKeyword */ && token <= 142 /* LastKeyword */; } function classFromKind(token) { if (isKeyword(token)) { @@ -67105,7 +71884,7 @@ var ts; else if (isBinaryExpressionOperatorToken(token) || isPrefixUnaryExpressionOperatorToken(token)) { return 5 /* operator */; } - else if (token >= 16 /* FirstPunctuation */ && token <= 69 /* LastPunctuation */) { + else if (token >= 17 /* FirstPunctuation */ && token <= 70 /* LastPunctuation */) { return 10 /* punctuation */; } switch (token) { @@ -67113,7 +71892,7 @@ var ts; return 4 /* numericLiteral */; case 9 /* StringLiteral */: return 6 /* stringLiteral */; - case 11 /* RegularExpressionLiteral */: + case 12 /* RegularExpressionLiteral */: return 7 /* regularExpressionLiteral */; case 7 /* ConflictMarkerTrivia */: case 3 /* MultiLineCommentTrivia */: @@ -67122,7 +71901,7 @@ var ts; case 5 /* WhitespaceTrivia */: case 4 /* NewLineTrivia */: return 8 /* whiteSpace */; - case 70 /* Identifier */: + case 71 /* Identifier */: default: if (ts.isTemplateLiteralKind(token)) { return 6 /* stringLiteral */; @@ -67153,10 +71932,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 230 /* ModuleDeclaration */: - case 226 /* ClassDeclaration */: - case 227 /* InterfaceDeclaration */: - case 225 /* FunctionDeclaration */: + case 233 /* ModuleDeclaration */: + case 229 /* ClassDeclaration */: + case 230 /* InterfaceDeclaration */: + case 228 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } @@ -67207,7 +71986,7 @@ var ts; */ function hasValueSideModule(symbol) { return ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 230 /* ModuleDeclaration */ && + return declaration.kind === 233 /* ModuleDeclaration */ && ts.getModuleInstanceState(declaration) === 1 /* Instantiated */; }); } @@ -67217,12 +71996,12 @@ var ts; if (node && ts.textSpanIntersectsWith(span, node.getFullStart(), node.getFullWidth())) { var kind = node.kind; checkForClassificationCancellation(cancellationToken, kind); - if (kind === 70 /* Identifier */ && !ts.nodeIsMissing(node)) { + if (kind === 71 /* Identifier */ && !ts.nodeIsMissing(node)) { var identifier = node; // Only bother calling into the typechecker if this is an identifier that // could possibly resolve to a type name. This makes classification run // in a third of the time it would normally take. - if (classifiableNames[identifier.text]) { + if (classifiableNames.get(identifier.text)) { var symbol = typeChecker.getSymbolAtLocation(node); if (symbol) { var type = classifySymbol(symbol, ts.getMeaningFromLocation(node)); @@ -67268,7 +72047,7 @@ var ts; ts.Debug.assert(classifications.spans.length % 3 === 0); var dense = classifications.spans; var result = []; - for (var i = 0, n = dense.length; i < n; i += 3) { + for (var i = 0; i < dense.length; i += 3) { result.push({ textSpan: ts.createTextSpan(dense[i], dense[i + 1]), classificationType: getClassificationTypeName(dense[i + 2]) @@ -67371,16 +72150,16 @@ var ts; pushClassification(tag.tagName.pos, tag.tagName.end - tag.tagName.pos, 18 /* docCommentTagName */); pos = tag.tagName.end; switch (tag.kind) { - case 281 /* JSDocParameterTag */: + case 286 /* JSDocParameterTag */: processJSDocParameterTag(tag); break; - case 284 /* JSDocTemplateTag */: + case 289 /* JSDocTemplateTag */: processJSDocTemplateTag(tag); break; - case 283 /* JSDocTypeTag */: + case 288 /* JSDocTypeTag */: processElement(tag.typeExpression); break; - case 282 /* JSDocReturnTag */: + case 287 /* JSDocReturnTag */: processElement(tag.typeExpression); break; } @@ -67467,22 +72246,22 @@ var ts; } function tryClassifyJsxElementName(token) { switch (token.parent && token.parent.kind) { - case 248 /* JsxOpeningElement */: + case 251 /* JsxOpeningElement */: if (token.parent.tagName === token) { return 19 /* jsxOpenTagName */; } break; - case 249 /* JsxClosingElement */: + case 252 /* JsxClosingElement */: if (token.parent.tagName === token) { return 20 /* jsxCloseTagName */; } break; - case 247 /* JsxSelfClosingElement */: + case 250 /* JsxSelfClosingElement */: if (token.parent.tagName === token) { return 21 /* jsxSelfClosingTagName */; } break; - case 250 /* JsxAttribute */: + case 253 /* JsxAttribute */: if (token.parent.name === token) { return 22 /* jsxAttribute */; } @@ -67499,7 +72278,7 @@ var ts; } // Special case < and > If they appear in a generic context they are punctuation, // not operators. - if (tokenKind === 26 /* LessThanToken */ || tokenKind === 28 /* GreaterThanToken */) { + if (tokenKind === 27 /* LessThanToken */ || tokenKind === 29 /* GreaterThanToken */) { // If the node owning the token has a type argument list or type parameter list, then // we can effectively assume that a '<' and '>' belong to those lists. if (token && ts.getTypeArgumentOrTypeParameterList(token.parent)) { @@ -67508,19 +72287,19 @@ var ts; } if (ts.isPunctuation(tokenKind)) { if (token) { - if (tokenKind === 57 /* EqualsToken */) { + if (tokenKind === 58 /* EqualsToken */) { // the '=' in a variable declaration is special cased here. - if (token.parent.kind === 223 /* VariableDeclaration */ || - token.parent.kind === 147 /* PropertyDeclaration */ || - token.parent.kind === 144 /* Parameter */ || - token.parent.kind === 250 /* JsxAttribute */) { + if (token.parent.kind === 226 /* VariableDeclaration */ || + token.parent.kind === 149 /* PropertyDeclaration */ || + token.parent.kind === 146 /* Parameter */ || + token.parent.kind === 253 /* JsxAttribute */) { return 5 /* operator */; } } - if (token.parent.kind === 192 /* BinaryExpression */ || - token.parent.kind === 190 /* PrefixUnaryExpression */ || - token.parent.kind === 191 /* PostfixUnaryExpression */ || - token.parent.kind === 193 /* ConditionalExpression */) { + if (token.parent.kind === 194 /* BinaryExpression */ || + token.parent.kind === 192 /* PrefixUnaryExpression */ || + token.parent.kind === 193 /* PostfixUnaryExpression */ || + token.parent.kind === 195 /* ConditionalExpression */) { return 5 /* operator */; } } @@ -67530,9 +72309,9 @@ var ts; return 4 /* numericLiteral */; } else if (tokenKind === 9 /* StringLiteral */) { - return token.parent.kind === 250 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; + return token.parent.kind === 253 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; } - else if (tokenKind === 11 /* RegularExpressionLiteral */) { + else if (tokenKind === 12 /* RegularExpressionLiteral */) { // TODO: we should get another classification type for these literals. return 6 /* stringLiteral */; } @@ -67543,35 +72322,35 @@ var ts; else if (tokenKind === 10 /* JsxText */) { return 23 /* jsxText */; } - else if (tokenKind === 70 /* Identifier */) { + else if (tokenKind === 71 /* Identifier */) { if (token) { switch (token.parent.kind) { - case 226 /* ClassDeclaration */: + case 229 /* ClassDeclaration */: if (token.parent.name === token) { return 11 /* className */; } return; - case 143 /* TypeParameter */: + case 145 /* TypeParameter */: if (token.parent.name === token) { return 15 /* typeParameterName */; } return; - case 227 /* InterfaceDeclaration */: + case 230 /* InterfaceDeclaration */: if (token.parent.name === token) { return 13 /* interfaceName */; } return; - case 229 /* EnumDeclaration */: + case 232 /* EnumDeclaration */: if (token.parent.name === token) { return 12 /* enumName */; } return; - case 230 /* ModuleDeclaration */: + case 233 /* ModuleDeclaration */: if (token.parent.name === token) { return 14 /* moduleName */; } return; - case 144 /* Parameter */: + case 146 /* Parameter */: if (token.parent.name === token) { return ts.isThisIdentifier(token) ? 3 /* keyword */ : 17 /* parameterName */; } @@ -67588,9 +72367,8 @@ var ts; // Ignore nodes that don't intersect the original span to classify. if (ts.decodedTextSpanIntersectsWith(spanStart, spanLength, element.pos, element.getFullWidth())) { checkForClassificationCancellation(cancellationToken, element.kind); - var children = element.getChildren(sourceFile); - for (var i = 0, n = children.length; i < n; i++) { - var child = children[i]; + for (var _i = 0, _a = element.getChildren(sourceFile); _i < _a.length; _i++) { + var child = _a[_i]; if (!tryClassifyNode(child)) { // Recurse into our child nodes. processElement(child); @@ -67601,259 +72379,31 @@ var ts; } ts.getEncodedSyntacticClassifications = getEncodedSyntacticClassifications; })(ts || (ts = {})); -/// /* @internal */ var ts; (function (ts) { var Completions; (function (Completions) { - function getCompletionsAtPosition(host, typeChecker, log, compilerOptions, sourceFile, position) { - if (ts.isInReferenceComment(sourceFile, position)) { - return getTripleSlashReferenceCompletion(sourceFile, position); - } - if (ts.isInString(sourceFile, position)) { - return getStringLiteralCompletionEntries(sourceFile, position); - } - var completionData = getCompletionData(typeChecker, log, sourceFile, position); - if (!completionData) { - return undefined; - } - var symbols = completionData.symbols, isGlobalCompletion = completionData.isGlobalCompletion, isMemberCompletion = completionData.isMemberCompletion, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location = completionData.location, isJsDocTagName = completionData.isJsDocTagName; - if (isJsDocTagName) { - // If the current position is a jsDoc tag name, only tag names should be provided for completion - return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: ts.JsDoc.getAllJsDocCompletionEntries() }; - } - var entries = []; - if (ts.isSourceFileJavaScript(sourceFile)) { - var uniqueNames = getCompletionEntriesFromSymbols(symbols, entries, location, /*performCharacterChecks*/ true); - ts.addRange(entries, getJavaScriptCompletionEntries(sourceFile, location.pos, uniqueNames)); - } - else { - if (!symbols || symbols.length === 0) { - if (sourceFile.languageVariant === 1 /* JSX */ && - location.parent && location.parent.kind === 249 /* JsxClosingElement */) { - // 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. - // For example: - // var x =
completion list at "1" will contain "div" with type any - var tagName = location.parent.parent.openingElement.tagName; - entries.push({ - name: tagName.text, - kind: undefined, - kindModifiers: undefined, - sortText: "0", - }); - } - else { - return undefined; - } - } - getCompletionEntriesFromSymbols(symbols, entries, location, /*performCharacterChecks*/ true); - } - // Add keywords if this is not a member completion list - if (!isMemberCompletion && !isJsDocTagName) { - ts.addRange(entries, keywordCompletions); - } - return { isGlobalCompletion: isGlobalCompletion, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, entries: entries }; - function getJavaScriptCompletionEntries(sourceFile, position, uniqueNames) { - var entries = []; - var nameTable = ts.getNameTable(sourceFile); - for (var name_45 in nameTable) { - // Skip identifiers produced only from the current location - if (nameTable[name_45] === position) { - continue; - } - if (!uniqueNames[name_45]) { - uniqueNames[name_45] = name_45; - var displayName = getCompletionEntryDisplayName(ts.unescapeIdentifier(name_45), compilerOptions.target, /*performCharacterChecks*/ true); - if (displayName) { - var entry = { - name: displayName, - kind: ts.ScriptElementKind.warning, - kindModifiers: "", - sortText: "1" - }; - entries.push(entry); - } - } - } - return entries; - } - function createCompletionEntry(symbol, location, performCharacterChecks) { - // Try to get a valid display name for this symbol, if we could not find one, then ignore it. - // We would like to only show things that can be added after a dot, so for instance numeric properties can - // not be accessed with a dot (a.1 <- invalid) - var displayName = getCompletionEntryDisplayNameForSymbol(typeChecker, symbol, compilerOptions.target, performCharacterChecks, location); - if (!displayName) { - return undefined; - } - // TODO(drosen): Right now we just permit *all* semantic meanings when calling - // 'getSymbolKind' which is permissible given that it is backwards compatible; but - // really we should consider passing the meaning for the node so that we don't report - // that a suggestion for a value is an interface. We COULD also just do what - // 'getSymbolModifiers' does, which is to use the first declaration. - // Use a 'sortText' of 0' so that all symbol completion entries come before any other - // entries (like JavaScript identifier entries). - return { - name: displayName, - kind: ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, location), - kindModifiers: ts.SymbolDisplay.getSymbolModifiers(symbol), - sortText: "0", - }; - } - function getCompletionEntriesFromSymbols(symbols, entries, location, performCharacterChecks) { - var start = ts.timestamp(); - var uniqueNames = ts.createMap(); - if (symbols) { - for (var _i = 0, symbols_4 = symbols; _i < symbols_4.length; _i++) { - var symbol = symbols_4[_i]; - var entry = createCompletionEntry(symbol, location, performCharacterChecks); - if (entry) { - var id = ts.escapeIdentifier(entry.name); - if (!uniqueNames[id]) { - entries.push(entry); - uniqueNames[id] = id; - } - } - } - } - log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (ts.timestamp() - start)); - return uniqueNames; - } - function getStringLiteralCompletionEntries(sourceFile, position) { - var node = ts.findPrecedingToken(position, sourceFile); - if (!node || node.kind !== 9 /* StringLiteral */) { - return undefined; - } - if (node.parent.kind === 257 /* PropertyAssignment */ && - node.parent.parent.kind === 176 /* 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); - } - else if (ts.isElementAccessExpression(node.parent) && node.parent.argumentExpression === node) { - // Get all names of properties on the expression - // i.e. interface A { - // 'prop1': string - // } - // let a: A; - // a['/*completion position*/'] - return getStringLiteralCompletionEntriesFromElementAccess(node.parent); - } - else if (node.parent.kind === 235 /* ImportDeclaration */ || ts.isExpressionOfExternalModuleImportEqualsDeclaration(node) || ts.isRequireCall(node.parent, false)) { - // Get all known external module names or complete a path to a module - // i.e. import * as ns from "/*completion position*/"; - // import x = require("/*completion position*/"); - // var y = require("/*completion position*/"); - return getStringLiteralCompletionEntriesFromModuleNames(node); - } - else { - var argumentInfo = ts.SignatureHelp.getContainingArgumentInfo(node, position, sourceFile); - if (argumentInfo) { - // Get string literal completions from specialized signatures of the target - // i.e. declare function f(a: 'A'); - // f("/*completion position*/") - return getStringLiteralCompletionEntriesFromCallExpression(argumentInfo); - } - // Get completion for string literal from string literal type - // i.e. var x: "hi" | "hello" = "/*completion position*/" - return getStringLiteralCompletionEntriesFromContextualType(node); - } - } - function getStringLiteralCompletionEntriesFromPropertyAssignment(element) { - var type = typeChecker.getContextualType(element.parent); - var entries = []; - if (type) { - getCompletionEntriesFromSymbols(type.getApparentProperties(), entries, element, /*performCharacterChecks*/ false); - if (entries.length) { - return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: true, entries: entries }; - } - } - } - function getStringLiteralCompletionEntriesFromCallExpression(argumentInfo) { - var candidates = []; - var entries = []; - typeChecker.getResolvedSignature(argumentInfo.invocation, candidates); - for (var _i = 0, candidates_3 = candidates; _i < candidates_3.length; _i++) { - var candidate = candidates_3[_i]; - if (candidate.parameters.length > argumentInfo.argumentIndex) { - var parameter = candidate.parameters[argumentInfo.argumentIndex]; - addStringLiteralCompletionsFromType(typeChecker.getTypeAtLocation(parameter.valueDeclaration), entries); - } - } - if (entries.length) { - return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: true, entries: entries }; - } - return undefined; - } - function getStringLiteralCompletionEntriesFromElementAccess(node) { - var type = typeChecker.getTypeAtLocation(node.expression); - var entries = []; - if (type) { - getCompletionEntriesFromSymbols(type.getApparentProperties(), entries, node, /*performCharacterChecks*/ false); - if (entries.length) { - return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: true, entries: entries }; - } - } - return undefined; - } - function getStringLiteralCompletionEntriesFromContextualType(node) { - var type = typeChecker.getContextualType(node); - if (type) { - var entries_2 = []; - addStringLiteralCompletionsFromType(type, entries_2); - if (entries_2.length) { - return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: entries_2 }; - } - } - return undefined; - } - function addStringLiteralCompletionsFromType(type, result) { - if (!type) { - return; - } - if (type.flags & 65536 /* Union */) { - ts.forEach(type.types, function (t) { return addStringLiteralCompletionsFromType(t, result); }); - } - else { - if (type.flags & 32 /* StringLiteral */) { - result.push({ - name: type.text, - kindModifiers: ts.ScriptElementKindModifier.none, - kind: ts.ScriptElementKind.variableElement, - sortText: "0" - }); - } - } - } - function getStringLiteralCompletionEntriesFromModuleNames(node) { + var PathCompletions; + (function (PathCompletions) { + function getStringLiteralCompletionEntriesFromModuleNames(node, compilerOptions, host, typeChecker) { var literalValue = ts.normalizeSlashes(node.text); var scriptPath = node.getSourceFile().path; var scriptDirectory = ts.getDirectoryPath(scriptPath); var span = getDirectoryFragmentTextSpan(node.text, node.getStart() + 1); var entries; if (isPathRelativeToScript(literalValue) || ts.isRootedDiskPath(literalValue)) { + var extensions = ts.getSupportedExtensions(compilerOptions); if (compilerOptions.rootDirs) { - entries = getCompletionEntriesForDirectoryFragmentWithRootDirs(compilerOptions.rootDirs, literalValue, scriptDirectory, ts.getSupportedExtensions(compilerOptions), /*includeExtensions*/ false, span, scriptPath); + entries = getCompletionEntriesForDirectoryFragmentWithRootDirs(compilerOptions.rootDirs, literalValue, scriptDirectory, extensions, /*includeExtensions*/ false, span, compilerOptions, host, scriptPath); } else { - entries = getCompletionEntriesForDirectoryFragment(literalValue, scriptDirectory, ts.getSupportedExtensions(compilerOptions), /*includeExtensions*/ false, span, scriptPath); + entries = getCompletionEntriesForDirectoryFragment(literalValue, scriptDirectory, extensions, /*includeExtensions*/ false, span, host, scriptPath); } } else { // Check for node modules - entries = getCompletionEntriesForNonRelativeModules(literalValue, scriptDirectory, span); + entries = getCompletionEntriesForNonRelativeModules(literalValue, scriptDirectory, span, compilerOptions, host, typeChecker); } return { isGlobalCompletion: false, @@ -67862,6 +72412,7 @@ var ts; entries: entries }; } + PathCompletions.getStringLiteralCompletionEntriesFromModuleNames = getStringLiteralCompletionEntriesFromModuleNames; /** * Takes a script path and returns paths for all potential folders that could be merged with its * containing folder via the "rootDirs" compiler option @@ -67881,21 +72432,21 @@ var ts; // Now find a path for each potential directory that is to be merged with the one containing the script return ts.deduplicate(ts.map(rootDirs, function (rootDirectory) { return ts.combinePaths(rootDirectory, relativeDirectory); })); } - function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs, fragment, scriptPath, extensions, includeExtensions, span, exclude) { + function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs, fragment, scriptPath, extensions, includeExtensions, span, compilerOptions, host, exclude) { var basePath = compilerOptions.project || host.getCurrentDirectory(); var ignoreCase = !(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames()); var baseDirectories = getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptPath, ignoreCase); var result = []; for (var _i = 0, baseDirectories_1 = baseDirectories; _i < baseDirectories_1.length; _i++) { var baseDirectory = baseDirectories_1[_i]; - getCompletionEntriesForDirectoryFragment(fragment, baseDirectory, extensions, includeExtensions, span, exclude, result); + getCompletionEntriesForDirectoryFragment(fragment, baseDirectory, extensions, includeExtensions, span, host, exclude, result); } return result; } /** * Given a path ending at a directory, gets the completions for the path, and filters for those entries containing the basename. */ - function getCompletionEntriesForDirectoryFragment(fragment, scriptPath, extensions, includeExtensions, span, exclude, result) { + function getCompletionEntriesForDirectoryFragment(fragment, scriptPath, extensions, includeExtensions, span, host, exclude, result) { if (result === void 0) { result = []; } if (fragment === undefined) { fragment = ""; @@ -67931,13 +72482,13 @@ var ts; continue; } var foundFileName = includeExtensions ? ts.getBaseFileName(filePath) : ts.removeFileExtension(ts.getBaseFileName(filePath)); - if (!foundFiles[foundFileName]) { - foundFiles[foundFileName] = true; + if (!foundFiles.get(foundFileName)) { + foundFiles.set(foundFileName, true); } } - for (var foundFile in foundFiles) { + ts.forEachKey(foundFiles, function (foundFile) { result.push(createCompletionEntryForModule(foundFile, ts.ScriptElementKind.scriptElement, span)); - } + }); } // If possible, get folder completion as well var directories = tryGetDirectories(host, baseDirectory); @@ -67958,14 +72509,14 @@ var ts; * Modules from node_modules (i.e. those listed in package.json) * This includes all files that are found in node_modules/moduleName/ with acceptable file extensions */ - function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, span) { + function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, span, compilerOptions, host, typeChecker) { var baseUrl = compilerOptions.baseUrl, paths = compilerOptions.paths; var result; if (baseUrl) { var fileExtensions = ts.getSupportedExtensions(compilerOptions); var projectDir = compilerOptions.project || host.getCurrentDirectory(); var absolute = ts.isRootedDiskPath(baseUrl) ? baseUrl : ts.combinePaths(projectDir, baseUrl); - result = getCompletionEntriesForDirectoryFragment(fragment, ts.normalizePath(absolute), fileExtensions, /*includeExtensions*/ false, span); + result = getCompletionEntriesForDirectoryFragment(fragment, ts.normalizePath(absolute), fileExtensions, /*includeExtensions*/ false, span, host); if (paths) { for (var path in paths) { if (paths.hasOwnProperty(path)) { @@ -67973,7 +72524,7 @@ var ts; if (paths[path]) { for (var _i = 0, _a = paths[path]; _i < _a.length; _i++) { var pattern = _a[_i]; - for (var _b = 0, _c = getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions); _b < _c.length; _b++) { + for (var _b = 0, _c = getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions, host); _b < _c.length; _b++) { var match = _c[_b]; result.push(createCompletionEntryForModule(match, ts.ScriptElementKind.externalModuleName, span)); } @@ -67994,13 +72545,13 @@ var ts; result = []; } getCompletionEntriesFromTypings(host, compilerOptions, scriptPath, span, result); - for (var _d = 0, _e = enumeratePotentialNonRelativeModules(fragment, scriptPath, compilerOptions); _d < _e.length; _d++) { + for (var _d = 0, _e = enumeratePotentialNonRelativeModules(fragment, scriptPath, compilerOptions, typeChecker, host); _d < _e.length; _d++) { var moduleName = _e[_d]; result.push(createCompletionEntryForModule(moduleName, ts.ScriptElementKind.externalModuleName, span)); } return result; } - function getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions) { + function getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions, host) { if (host.readDirectory) { var parsed = ts.hasZeroOrOneAsteriskCharacter(pattern) ? ts.tryParsePattern(pattern) : undefined; if (parsed) { @@ -68019,7 +72570,7 @@ var ts; // that encodes the suffix, but we would have to escape the character "?" which readDirectory // doesn't support. For now, this is safer but slower var includeGlob = normalizedSuffix ? "**/*" : "./*"; - var matches = tryReadDirectory(host, baseDirectory, fileExtensions, undefined, [includeGlob]); + var matches = tryReadDirectory(host, baseDirectory, fileExtensions, /*exclude*/ undefined, [includeGlob]); if (matches) { var result = []; // Trim away prefix and suffix @@ -68030,8 +72581,8 @@ var ts; continue; } var start = completePrefix.length; - var length_5 = normalizedMatch.length - start - normalizedSuffix.length; - result.push(ts.removeFileExtension(normalizedMatch.substr(start, length_5))); + var length_6 = normalizedMatch.length - start - normalizedSuffix.length; + result.push(ts.removeFileExtension(normalizedMatch.substr(start, length_6))); } return result; } @@ -68039,7 +72590,7 @@ var ts; } return undefined; } - function enumeratePotentialNonRelativeModules(fragment, scriptPath, options) { + function enumeratePotentialNonRelativeModules(fragment, scriptPath, options, typeChecker, host) { // Check If this is a nested module var isNestedModule = fragment.indexOf(ts.directorySeparator) !== -1; var moduleNameFragment = isNestedModule ? fragment.substr(0, fragment.lastIndexOf(ts.directorySeparator)) : undefined; @@ -68079,7 +72630,7 @@ var ts; } return ts.deduplicate(nonRelativeModules); } - function getTripleSlashReferenceCompletion(sourceFile, position) { + function getTripleSlashReferenceCompletion(sourceFile, position, compilerOptions, host) { var token = ts.getTokenAtPosition(sourceFile, position); if (!token) { return undefined; @@ -68115,7 +72666,7 @@ var ts; if (kind === "path") { // Give completions for a relative path var span_10 = getDirectoryFragmentTextSpan(toComplete, range.pos + prefix.length); - completionInfo.entries = getCompletionEntriesForDirectoryFragment(toComplete, scriptPath, ts.getSupportedExtensions(compilerOptions), /*includeExtensions*/ true, span_10, sourceFile.path); + completionInfo.entries = getCompletionEntriesForDirectoryFragment(toComplete, scriptPath, ts.getSupportedExtensions(compilerOptions), /*includeExtensions*/ true, span_10, host, sourceFile.path); } else { // Give completions based on the typings available @@ -68125,6 +72676,7 @@ var ts; } return completionInfo; } + PathCompletions.getTripleSlashReferenceCompletion = getTripleSlashReferenceCompletion; function getCompletionEntriesFromTypings(host, options, scriptPath, span, result) { if (result === void 0) { result = []; } // Check for typings specified in compiler options @@ -68150,7 +72702,7 @@ var ts; } if (host.getDirectories) { // Also get all @types typings installed in visible node_modules directories - for (var _c = 0, _d = findPackageJsons(scriptPath); _c < _d.length; _c++) { + for (var _c = 0, _d = findPackageJsons(scriptPath, host); _c < _d.length; _c++) { var packageJson = _d[_c]; var typesDir = ts.combinePaths(ts.getDirectoryPath(packageJson), "node_modules/@types"); getCompletionEntriesFromDirectories(host, typesDir, span, result); @@ -68170,7 +72722,7 @@ var ts; } } } - function findPackageJsons(currentDir) { + function findPackageJsons(currentDir, host) { var paths = []; var currentConfigPath; while (true) { @@ -68178,11 +72730,11 @@ var ts; if (currentConfigPath) { paths.push(currentConfigPath); currentDir = ts.getDirectoryPath(currentConfigPath); - var parent_14 = ts.getDirectoryPath(currentDir); - if (currentDir === parent_14) { + var parent = ts.getDirectoryPath(currentDir); + if (currentDir === parent) { break; } - currentDir = parent_14; + currentDir = parent; } else { break; @@ -68193,7 +72745,7 @@ var ts; function enumerateNodeModulesVisibleToScript(host, scriptPath) { var result = []; if (host.readFile && host.fileExists) { - for (var _i = 0, _a = findPackageJsons(scriptPath); _i < _a.length; _i++) { + for (var _i = 0, _a = findPackageJsons(scriptPath, host); _i < _a.length; _i++) { var packageJson = _a[_i]; var contents = tryReadingPackageJson(packageJson); if (!contents) { @@ -68257,20 +72809,319 @@ var ts; function normalizeAndPreserveTrailingSlash(path) { return ts.hasTrailingDirectorySeparator(path) ? ts.ensureTrailingDirectorySeparator(ts.normalizePath(path)) : ts.normalizePath(path); } + /** + * Matches a triple slash reference directive with an incomplete string literal for its path. Used + * to determine if the caret is currently within the string literal and capture the literal fragment + * for completions. + * For example, this matches + * + * /// +/* @internal */ +var ts; +(function (ts) { + var Completions; + (function (Completions) { + function getCompletionsAtPosition(host, typeChecker, log, compilerOptions, sourceFile, position) { + if (ts.isInReferenceComment(sourceFile, position)) { + return Completions.PathCompletions.getTripleSlashReferenceCompletion(sourceFile, position, compilerOptions, host); + } + if (ts.isInString(sourceFile, position)) { + return getStringLiteralCompletionEntries(sourceFile, position, typeChecker, compilerOptions, host, log); + } + var completionData = getCompletionData(typeChecker, log, sourceFile, position); + if (!completionData) { + return undefined; + } + var symbols = completionData.symbols, isGlobalCompletion = completionData.isGlobalCompletion, isMemberCompletion = completionData.isMemberCompletion, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location = completionData.location, requestJsDocTagName = completionData.requestJsDocTagName, requestJsDocTag = completionData.requestJsDocTag; + if (requestJsDocTagName) { + // If the current position is a jsDoc tag name, only tag names should be provided for completion + return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: ts.JsDoc.getJSDocTagNameCompletions() }; + } + if (requestJsDocTag) { + // If the current position is a jsDoc tag, only tags should be provided for completion + return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: ts.JsDoc.getJSDocTagCompletions() }; + } + var entries = []; + if (ts.isSourceFileJavaScript(sourceFile)) { + var uniqueNames = getCompletionEntriesFromSymbols(symbols, entries, location, /*performCharacterChecks*/ true, typeChecker, compilerOptions.target, log); + ts.addRange(entries, getJavaScriptCompletionEntries(sourceFile, location.pos, uniqueNames, compilerOptions.target)); + } + else { + if (!symbols || symbols.length === 0) { + if (sourceFile.languageVariant === 1 /* JSX */ && + location.parent && location.parent.kind === 252 /* JsxClosingElement */) { + // 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. + // For example: + // var x =
completion list at "1" will contain "div" with type any + var tagName = location.parent.parent.openingElement.tagName; + entries.push({ + name: tagName.text, + kind: undefined, + kindModifiers: undefined, + sortText: "0", + }); + } + else { + return undefined; + } + } + getCompletionEntriesFromSymbols(symbols, entries, location, /*performCharacterChecks*/ true, typeChecker, compilerOptions.target, log); + } + // Add keywords if this is not a member completion list + if (!isMemberCompletion && !requestJsDocTag && !requestJsDocTagName) { + ts.addRange(entries, keywordCompletions); + } + return { isGlobalCompletion: isGlobalCompletion, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, entries: entries }; } Completions.getCompletionsAtPosition = getCompletionsAtPosition; + function getJavaScriptCompletionEntries(sourceFile, position, uniqueNames, target) { + var entries = []; + var nameTable = ts.getNameTable(sourceFile); + nameTable.forEach(function (pos, name) { + // Skip identifiers produced only from the current location + if (pos === position) { + return; + } + if (!uniqueNames.get(name)) { + uniqueNames.set(name, name); + var displayName = getCompletionEntryDisplayName(ts.unescapeIdentifier(name), target, /*performCharacterChecks*/ true); + if (displayName) { + var entry = { + name: displayName, + kind: ts.ScriptElementKind.warning, + kindModifiers: "", + sortText: "1" + }; + entries.push(entry); + } + } + }); + return entries; + } + function createCompletionEntry(symbol, location, performCharacterChecks, typeChecker, target) { + // Try to get a valid display name for this symbol, if we could not find one, then ignore it. + // We would like to only show things that can be added after a dot, so for instance numeric properties can + // not be accessed with a dot (a.1 <- invalid) + var displayName = getCompletionEntryDisplayNameForSymbol(typeChecker, symbol, target, performCharacterChecks, location); + if (!displayName) { + return undefined; + } + // TODO(drosen): Right now we just permit *all* semantic meanings when calling + // 'getSymbolKind' which is permissible given that it is backwards compatible; but + // really we should consider passing the meaning for the node so that we don't report + // that a suggestion for a value is an interface. We COULD also just do what + // 'getSymbolModifiers' does, which is to use the first declaration. + // Use a 'sortText' of 0' so that all symbol completion entries come before any other + // entries (like JavaScript identifier entries). + return { + name: displayName, + kind: ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, location), + kindModifiers: ts.SymbolDisplay.getSymbolModifiers(symbol), + sortText: "0", + }; + } + function getCompletionEntriesFromSymbols(symbols, entries, location, performCharacterChecks, typeChecker, target, log) { + var start = ts.timestamp(); + var uniqueNames = ts.createMap(); + if (symbols) { + for (var _i = 0, symbols_4 = symbols; _i < symbols_4.length; _i++) { + var symbol = symbols_4[_i]; + var entry = createCompletionEntry(symbol, location, performCharacterChecks, typeChecker, target); + if (entry) { + var id = ts.escapeIdentifier(entry.name); + if (!uniqueNames.get(id)) { + entries.push(entry); + uniqueNames.set(id, id); + } + } + } + } + log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (ts.timestamp() - start)); + return uniqueNames; + } + function getStringLiteralCompletionEntries(sourceFile, position, typeChecker, compilerOptions, host, log) { + var node = ts.findPrecedingToken(position, sourceFile); + if (!node || node.kind !== 9 /* StringLiteral */) { + return undefined; + } + if (node.parent.kind === 261 /* PropertyAssignment */ && + node.parent.parent.kind === 178 /* 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, typeChecker, compilerOptions.target, log); + } + else if (ts.isElementAccessExpression(node.parent) && node.parent.argumentExpression === node) { + // Get all names of properties on the expression + // i.e. interface A { + // 'prop1': string + // } + // let a: A; + // a['/*completion position*/'] + return getStringLiteralCompletionEntriesFromElementAccess(node.parent, typeChecker, compilerOptions.target, log); + } + else if (node.parent.kind === 238 /* ImportDeclaration */ || ts.isExpressionOfExternalModuleImportEqualsDeclaration(node) || ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteral*/ false)) { + // Get all known external module names or complete a path to a module + // i.e. import * as ns from "/*completion position*/"; + // import x = require("/*completion position*/"); + // var y = require("/*completion position*/"); + return Completions.PathCompletions.getStringLiteralCompletionEntriesFromModuleNames(node, compilerOptions, host, typeChecker); + } + else if (isEqualityExpression(node.parent)) { + // Get completions from the type of the other operand + // i.e. switch (a) { + // case '/*completion position*/' + // } + return getStringLiteralCompletionEntriesFromType(typeChecker.getTypeAtLocation(node.parent.left === node ? node.parent.right : node.parent.left), typeChecker); + } + else if (ts.isCaseOrDefaultClause(node.parent)) { + // Get completions from the type of the switch expression + // i.e. x === '/*completion position' + return getStringLiteralCompletionEntriesFromType(typeChecker.getTypeAtLocation(node.parent.parent.parent.expression), typeChecker); + } + else { + var argumentInfo = ts.SignatureHelp.getImmediatelyContainingArgumentInfo(node, position, sourceFile); + if (argumentInfo) { + // Get string literal completions from specialized signatures of the target + // i.e. declare function f(a: 'A'); + // f("/*completion position*/") + return getStringLiteralCompletionEntriesFromCallExpression(argumentInfo, typeChecker); + } + // Get completion for string literal from string literal type + // i.e. var x: "hi" | "hello" = "/*completion position*/" + return getStringLiteralCompletionEntriesFromType(typeChecker.getContextualType(node), typeChecker); + } + } + function getStringLiteralCompletionEntriesFromPropertyAssignment(element, typeChecker, target, log) { + var type = typeChecker.getContextualType(element.parent); + var entries = []; + if (type) { + getCompletionEntriesFromSymbols(type.getApparentProperties(), entries, element, /*performCharacterChecks*/ false, typeChecker, target, log); + if (entries.length) { + return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: true, entries: entries }; + } + } + } + function getStringLiteralCompletionEntriesFromCallExpression(argumentInfo, typeChecker) { + var candidates = []; + var entries = []; + typeChecker.getResolvedSignature(argumentInfo.invocation, candidates); + for (var _i = 0, candidates_3 = candidates; _i < candidates_3.length; _i++) { + var candidate = candidates_3[_i]; + addStringLiteralCompletionsFromType(typeChecker.getParameterType(candidate, argumentInfo.argumentIndex), entries, typeChecker); + } + if (entries.length) { + return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: true, entries: entries }; + } + return undefined; + } + function getStringLiteralCompletionEntriesFromElementAccess(node, typeChecker, target, log) { + var type = typeChecker.getTypeAtLocation(node.expression); + var entries = []; + if (type) { + getCompletionEntriesFromSymbols(type.getApparentProperties(), entries, node, /*performCharacterChecks*/ false, typeChecker, target, log); + 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 addStringLiteralCompletionsFromType(type, result, typeChecker) { + if (type && type.flags & 16384 /* TypeParameter */) { + type = typeChecker.getApparentType(type); + } + if (!type) { + return; + } + if (type.flags & 65536 /* Union */) { + for (var _i = 0, _a = type.types; _i < _a.length; _i++) { + var t = _a[_i]; + addStringLiteralCompletionsFromType(t, result, typeChecker); + } + } + else if (type.flags & 32 /* StringLiteral */) { + result.push({ + name: type.text, + kindModifiers: ts.ScriptElementKindModifier.none, + kind: ts.ScriptElementKind.variableElement, + sortText: "0" + }); + } + } function getCompletionEntryDetails(typeChecker, log, compilerOptions, sourceFile, position, entryName) { // Compute all the completion symbols again. var completionData = getCompletionData(typeChecker, log, sourceFile, position); if (completionData) { - var symbols = completionData.symbols, location_3 = completionData.location; + var symbols = completionData.symbols, location_1 = completionData.location; // Find the symbol with the matching entry name. // We don't need to perform character checks here because we're only comparing the // name against 'entryName' (which is known to be good), not building a new // completion entry. - var symbol = ts.forEach(symbols, function (s) { return getCompletionEntryDisplayNameForSymbol(typeChecker, s, compilerOptions.target, /*performCharacterChecks*/ false, location_3) === entryName ? s : undefined; }); + var symbol = ts.forEach(symbols, function (s) { return getCompletionEntryDisplayNameForSymbol(typeChecker, s, compilerOptions.target, /*performCharacterChecks*/ false, location_1) === entryName ? s : undefined; }); if (symbol) { - var _a = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, location_3, location_3, 7 /* All */), displayParts = _a.displayParts, documentation = _a.documentation, symbolKind = _a.symbolKind, tags = _a.tags; + var _a = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, location_1, location_1, 7 /* All */), displayParts = _a.displayParts, documentation = _a.documentation, symbolKind = _a.symbolKind, tags = _a.tags; return { name: entryName, kindModifiers: ts.SymbolDisplay.getSymbolModifiers(symbol), @@ -68300,19 +73151,22 @@ var ts; // Compute all the completion symbols again. var completionData = getCompletionData(typeChecker, log, sourceFile, position); if (completionData) { - var symbols = completionData.symbols, location_4 = completionData.location; + var symbols = completionData.symbols, location_2 = completionData.location; // Find the symbol with the matching entry name. // We don't need to perform character checks here because we're only comparing the // name against 'entryName' (which is known to be good), not building a new // completion entry. - return ts.forEach(symbols, function (s) { return getCompletionEntryDisplayNameForSymbol(typeChecker, s, compilerOptions.target, /*performCharacterChecks*/ false, location_4) === entryName ? s : undefined; }); + return ts.forEach(symbols, function (s) { return getCompletionEntryDisplayNameForSymbol(typeChecker, s, compilerOptions.target, /*performCharacterChecks*/ false, location_2) === entryName ? s : undefined; }); } return undefined; } Completions.getCompletionEntrySymbol = getCompletionEntrySymbol; function getCompletionData(typeChecker, log, sourceFile, position) { var isJavaScriptFile = ts.isSourceFileJavaScript(sourceFile); - var isJsDocTagName = false; + // JsDoc tag-name is just the name of the JSDoc tagname (exclude "@") + var requestJsDocTagName = false; + // JsDoc tag includes both "@" and tag-name + var requestJsDocTag = false; var start = ts.timestamp(); var currentToken = ts.getTokenAtPosition(sourceFile, position); log("getCompletionData: Get current token: " + (ts.timestamp() - start)); @@ -68321,10 +73175,32 @@ var ts; var insideComment = ts.isInsideComment(sourceFile, currentToken, position); log("getCompletionData: Is inside comment: " + (ts.timestamp() - start)); if (insideComment) { - // The current position is next to the '@' sign, when no tag name being provided yet. - // Provide a full list of tag names - if (ts.hasDocComment(sourceFile, position) && sourceFile.text.charCodeAt(position - 1) === 64 /* at */) { - isJsDocTagName = true; + if (ts.hasDocComment(sourceFile, position)) { + // The current position is next to the '@' sign, when no tag name being provided yet. + // Provide a full list of tag names + if (sourceFile.text.charCodeAt(position - 1) === 64 /* at */) { + requestJsDocTagName = true; + } + else { + // When completion is requested without "@", we will have check to make sure that + // there are no comments prefix the request position. We will only allow "*" and space. + // e.g + // /** |c| /* + // + // /** + // |c| + // */ + // + // /** + // * |c| + // */ + // + // /** + // * |c| + // */ + var lineStart = ts.getLineStartPositionForPosition(position, sourceFile); + requestJsDocTag = !(sourceFile.text.substring(lineStart, position).match(/[^\*|\s|(/\*\*)]/)); + } } // Completion should work inside certain JsDoc tags. For example: // /** @type {number | string} */ @@ -68333,12 +73209,12 @@ var ts; var tag = ts.getJsDocTagAtPosition(sourceFile, position); if (tag) { if (tag.tagName.pos <= position && position <= tag.tagName.end) { - isJsDocTagName = true; + requestJsDocTagName = true; } switch (tag.kind) { - case 283 /* JSDocTypeTag */: - case 281 /* JSDocParameterTag */: - case 282 /* JSDocReturnTag */: + case 288 /* JSDocTypeTag */: + case 286 /* JSDocParameterTag */: + case 287 /* JSDocReturnTag */: var tagWithExpression = tag; if (tagWithExpression.typeExpression) { insideJsDocTagExpression = tagWithExpression.typeExpression.pos < position && position < tagWithExpression.typeExpression.end; @@ -68346,8 +73222,8 @@ var ts; break; } } - if (isJsDocTagName) { - return { symbols: undefined, isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, location: undefined, isRightOfDot: false, isJsDocTagName: isJsDocTagName }; + if (requestJsDocTagName || requestJsDocTag) { + return { symbols: undefined, isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, location: undefined, isRightOfDot: false, requestJsDocTagName: requestJsDocTagName, requestJsDocTag: requestJsDocTag }; } if (!insideJsDocTagExpression) { // Proceed if the current position is in jsDoc tag expression; otherwise it is a normal @@ -68383,13 +73259,13 @@ var ts; log("Returning an empty list because completion was requested in an invalid position."); return undefined; } - var parent_15 = contextToken.parent, kind = contextToken.kind; - if (kind === 22 /* DotToken */) { - if (parent_15.kind === 177 /* PropertyAccessExpression */) { + var parent = contextToken.parent; + if (contextToken.kind === 23 /* DotToken */) { + if (parent.kind === 179 /* PropertyAccessExpression */) { node = contextToken.parent.expression; isRightOfDot = true; } - else if (parent_15.kind === 141 /* QualifiedName */) { + else if (parent.kind === 143 /* QualifiedName */) { node = contextToken.parent.left; isRightOfDot = true; } @@ -68400,13 +73276,34 @@ var ts; } } else if (sourceFile.languageVariant === 1 /* JSX */) { - if (kind === 26 /* LessThanToken */) { - isRightOfOpenTag = true; - location = contextToken; + // + // 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 === 179 /* PropertyAccessExpression */) { + contextToken = parent; + parent = parent.parent; } - else if (kind === 40 /* SlashToken */ && contextToken.parent.kind === 249 /* JsxClosingElement */) { - isStartingCloseTag = true; - location = contextToken; + switch (parent.kind) { + case 252 /* JsxClosingElement */: + if (contextToken.kind === 41 /* SlashToken */) { + isStartingCloseTag = true; + location = contextToken; + } + break; + case 194 /* 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 250 /* JsxSelfClosingElement */: + case 249 /* JsxElement */: + case 251 /* JsxOpeningElement */: + if (contextToken.kind === 27 /* LessThanToken */) { + isRightOfOpenTag = true; + location = contextToken; + } + break; } } } @@ -68447,13 +73344,13 @@ var ts; } } log("getCompletionData: Semantic work: " + (ts.timestamp() - semanticStart)); - return { symbols: symbols, isGlobalCompletion: isGlobalCompletion, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, location: location, isRightOfDot: (isRightOfDot || isRightOfOpenTag), isJsDocTagName: isJsDocTagName }; + return { symbols: symbols, isGlobalCompletion: isGlobalCompletion, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, location: location, isRightOfDot: (isRightOfDot || isRightOfOpenTag), requestJsDocTagName: requestJsDocTagName, requestJsDocTag: requestJsDocTag }; function getTypeScriptMemberSymbols() { // Right of dot member completion list isGlobalCompletion = false; isMemberCompletion = true; isNewIdentifierLocation = false; - if (node.kind === 70 /* Identifier */ || node.kind === 141 /* QualifiedName */ || node.kind === 177 /* PropertyAccessExpression */) { + if (node.kind === 71 /* Identifier */ || node.kind === 143 /* QualifiedName */ || node.kind === 179 /* PropertyAccessExpression */) { var symbol = typeChecker.getSymbolAtLocation(node); // This is an alias, follow what it aliases if (symbol && symbol.flags & 8388608 /* Alias */) { @@ -68509,11 +73406,11 @@ var ts; } if (jsxContainer = tryGetContainingJsxElement(contextToken)) { var attrsType = void 0; - if ((jsxContainer.kind === 247 /* JsxSelfClosingElement */) || (jsxContainer.kind === 248 /* JsxOpeningElement */)) { + if ((jsxContainer.kind === 250 /* JsxSelfClosingElement */) || (jsxContainer.kind === 251 /* JsxOpeningElement */)) { // Cursor is inside a JSX self-closing element or opening element - attrsType = typeChecker.getJsxElementAttributesType(jsxContainer); + attrsType = typeChecker.getAllAttributesTypeFromJsxOpeningLikeElement(jsxContainer); if (attrsType) { - symbols = filterJsxAttributes(typeChecker.getPropertiesOfType(attrsType), jsxContainer.attributes); + symbols = filterJsxAttributes(typeChecker.getPropertiesOfType(attrsType), jsxContainer.attributes.properties); isMemberCompletion = true; isNewIdentifierLocation = false; return true; @@ -68557,9 +73454,9 @@ var ts; var scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile) || sourceFile; if (scopeNode) { isGlobalCompletion = - scopeNode.kind === 261 /* SourceFile */ || - scopeNode.kind === 194 /* TemplateExpression */ || - scopeNode.kind === 252 /* JsxExpression */ || + scopeNode.kind === 265 /* SourceFile */ || + scopeNode.kind === 196 /* TemplateExpression */ || + scopeNode.kind === 256 /* JsxExpression */ || ts.isStatement(scopeNode); } /// TODO filter meaning based on the current context @@ -68591,12 +73488,12 @@ var ts; if (contextToken.kind === 10 /* JsxText */) { return true; } - if (contextToken.kind === 28 /* GreaterThanToken */ && contextToken.parent) { - if (contextToken.parent.kind === 248 /* JsxOpeningElement */) { + if (contextToken.kind === 29 /* GreaterThanToken */ && contextToken.parent) { + if (contextToken.parent.kind === 251 /* JsxOpeningElement */) { return true; } - if (contextToken.parent.kind === 249 /* JsxClosingElement */ || contextToken.parent.kind === 247 /* JsxSelfClosingElement */) { - return contextToken.parent.parent && contextToken.parent.parent.kind === 246 /* JsxElement */; + if (contextToken.parent.kind === 252 /* JsxClosingElement */ || contextToken.parent.kind === 250 /* JsxSelfClosingElement */) { + return contextToken.parent.parent && contextToken.parent.parent.kind === 249 /* JsxElement */; } } return false; @@ -68605,41 +73502,41 @@ var ts; if (previousToken) { var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { - case 25 /* CommaToken */: - return containingNodeKind === 179 /* CallExpression */ // func( a, | - || containingNodeKind === 150 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ - || containingNodeKind === 180 /* NewExpression */ // new C(a, | - || containingNodeKind === 175 /* ArrayLiteralExpression */ // [a, | - || containingNodeKind === 192 /* BinaryExpression */ // const x = (a, | - || containingNodeKind === 158 /* FunctionType */; // var x: (s: string, list| - case 18 /* OpenParenToken */: - return containingNodeKind === 179 /* CallExpression */ // func( | - || containingNodeKind === 150 /* Constructor */ // constructor( | - || containingNodeKind === 180 /* NewExpression */ // new C(a| - || containingNodeKind === 183 /* ParenthesizedExpression */ // const x = (a| - || containingNodeKind === 166 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ - case 20 /* OpenBracketToken */: - return containingNodeKind === 175 /* ArrayLiteralExpression */ // [ | - || containingNodeKind === 155 /* IndexSignature */ // [ | : string ] - || containingNodeKind === 142 /* ComputedPropertyName */; // [ | /* this can become an index signature */ - case 127 /* ModuleKeyword */: // module | - case 128 /* NamespaceKeyword */: + case 26 /* CommaToken */: + return containingNodeKind === 181 /* CallExpression */ // func( a, | + || containingNodeKind === 152 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ + || containingNodeKind === 182 /* NewExpression */ // new C(a, | + || containingNodeKind === 177 /* ArrayLiteralExpression */ // [a, | + || containingNodeKind === 194 /* BinaryExpression */ // const x = (a, | + || containingNodeKind === 160 /* FunctionType */; // var x: (s: string, list| + case 19 /* OpenParenToken */: + return containingNodeKind === 181 /* CallExpression */ // func( | + || containingNodeKind === 152 /* Constructor */ // constructor( | + || containingNodeKind === 182 /* NewExpression */ // new C(a| + || containingNodeKind === 185 /* ParenthesizedExpression */ // const x = (a| + || containingNodeKind === 168 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ + case 21 /* OpenBracketToken */: + return containingNodeKind === 177 /* ArrayLiteralExpression */ // [ | + || containingNodeKind === 157 /* IndexSignature */ // [ | : string ] + || containingNodeKind === 144 /* ComputedPropertyName */; // [ | /* this can become an index signature */ + case 128 /* ModuleKeyword */: // module | + case 129 /* NamespaceKeyword */: return true; - case 22 /* DotToken */: - return containingNodeKind === 230 /* ModuleDeclaration */; // module A.| - case 16 /* OpenBraceToken */: - return containingNodeKind === 226 /* ClassDeclaration */; // class A{ | - case 57 /* EqualsToken */: - return containingNodeKind === 223 /* VariableDeclaration */ // const x = a| - || containingNodeKind === 192 /* BinaryExpression */; // x = a| - case 13 /* TemplateHead */: - return containingNodeKind === 194 /* TemplateExpression */; // `aa ${| - case 14 /* TemplateMiddle */: - return containingNodeKind === 202 /* TemplateSpan */; // `aa ${10} dd ${| - case 113 /* PublicKeyword */: - case 111 /* PrivateKeyword */: - case 112 /* ProtectedKeyword */: - return containingNodeKind === 147 /* PropertyDeclaration */; // class A{ public | + case 23 /* DotToken */: + return containingNodeKind === 233 /* ModuleDeclaration */; // module A.| + case 17 /* OpenBraceToken */: + return containingNodeKind === 229 /* ClassDeclaration */; // class A{ | + case 58 /* EqualsToken */: + return containingNodeKind === 226 /* VariableDeclaration */ // const x = a| + || containingNodeKind === 194 /* BinaryExpression */; // x = a| + case 14 /* TemplateHead */: + return containingNodeKind === 196 /* TemplateExpression */; // `aa ${| + case 15 /* TemplateMiddle */: + return containingNodeKind === 205 /* TemplateSpan */; // `aa ${10} dd ${| + case 114 /* PublicKeyword */: + case 112 /* PrivateKeyword */: + case 113 /* ProtectedKeyword */: + return containingNodeKind === 149 /* PropertyDeclaration */; // class A{ public | } // Previous token may have been a keyword that was converted to an identifier. switch (previousToken.getText()) { @@ -68653,7 +73550,7 @@ var ts; } function isInStringOrRegularExpressionOrTemplateLiteral(contextToken) { if (contextToken.kind === 9 /* StringLiteral */ - || contextToken.kind === 11 /* RegularExpressionLiteral */ + || contextToken.kind === 12 /* RegularExpressionLiteral */ || ts.isTemplateLiteralKind(contextToken.kind)) { var start_3 = contextToken.getStart(); var end = contextToken.getEnd(); @@ -68666,7 +73563,7 @@ var ts; } if (position === end) { return !!contextToken.isUnterminated - || contextToken.kind === 11 /* RegularExpressionLiteral */; + || contextToken.kind === 12 /* RegularExpressionLiteral */; } } return false; @@ -68682,7 +73579,7 @@ var ts; isMemberCompletion = true; var typeForObject; var existingMembers; - if (objectLikeContainer.kind === 176 /* ObjectLiteralExpression */) { + if (objectLikeContainer.kind === 178 /* ObjectLiteralExpression */) { // We are completing on contextual types, but may also include properties // other than those within the declared type. isNewIdentifierLocation = true; @@ -68692,7 +73589,7 @@ var ts; typeForObject = typeForObject && typeForObject.getNonNullableType(); existingMembers = objectLikeContainer.properties; } - else if (objectLikeContainer.kind === 172 /* ObjectBindingPattern */) { + else if (objectLikeContainer.kind === 174 /* ObjectBindingPattern */) { // We are *only* completing on properties from the type being destructured. isNewIdentifierLocation = false; var rootDeclaration = ts.getRootDeclaration(objectLikeContainer.parent); @@ -68703,11 +73600,11 @@ var ts; // 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 = !!(rootDeclaration.initializer || rootDeclaration.type); - if (!canGetType && rootDeclaration.kind === 144 /* Parameter */) { + if (!canGetType && rootDeclaration.kind === 146 /* Parameter */) { if (ts.isExpression(rootDeclaration.parent)) { canGetType = !!typeChecker.getContextualType(rootDeclaration.parent); } - else if (rootDeclaration.parent.kind === 149 /* MethodDeclaration */ || rootDeclaration.parent.kind === 152 /* SetAccessor */) { + else if (rootDeclaration.parent.kind === 151 /* MethodDeclaration */ || rootDeclaration.parent.kind === 154 /* SetAccessor */) { canGetType = ts.isExpression(rootDeclaration.parent.parent) && !!typeChecker.getContextualType(rootDeclaration.parent.parent); } } @@ -68749,9 +73646,9 @@ var ts; * @returns true if 'symbols' was successfully populated; false otherwise. */ function tryGetImportOrExportClauseCompletionSymbols(namedImportsOrExports) { - var declarationKind = namedImportsOrExports.kind === 238 /* NamedImports */ ? - 235 /* ImportDeclaration */ : - 241 /* ExportDeclaration */; + var declarationKind = namedImportsOrExports.kind === 241 /* NamedImports */ ? + 238 /* ImportDeclaration */ : + 244 /* ExportDeclaration */; var importOrExportDeclaration = ts.getAncestor(namedImportsOrExports, declarationKind); var moduleSpecifier = importOrExportDeclaration.moduleSpecifier; if (!moduleSpecifier) { @@ -68759,12 +73656,13 @@ var ts; } isMemberCompletion = true; isNewIdentifierLocation = false; - var exports; - var moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(importOrExportDeclaration.moduleSpecifier); - if (moduleSpecifierSymbol) { - exports = typeChecker.getExportsOfModule(moduleSpecifierSymbol); + var moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(moduleSpecifier); + if (!moduleSpecifierSymbol) { + symbols = ts.emptyArray; + return true; } - symbols = exports ? filterNamedImportOrExportCompletionItems(exports, namedImportsOrExports.elements) : ts.emptyArray; + var exports = typeChecker.getExportsAndPropertiesOfModule(moduleSpecifierSymbol); + symbols = filterNamedImportOrExportCompletionItems(exports, namedImportsOrExports.elements); return true; } /** @@ -68774,11 +73672,11 @@ var ts; function tryGetObjectLikeCompletionContainer(contextToken) { if (contextToken) { switch (contextToken.kind) { - case 16 /* OpenBraceToken */: // const x = { | - case 25 /* CommaToken */: - var parent_16 = contextToken.parent; - if (parent_16 && (parent_16.kind === 176 /* ObjectLiteralExpression */ || parent_16.kind === 172 /* ObjectBindingPattern */)) { - return parent_16; + case 17 /* OpenBraceToken */: // const x = { | + case 26 /* CommaToken */: + var parent = contextToken.parent; + if (parent && (parent.kind === 178 /* ObjectLiteralExpression */ || parent.kind === 174 /* ObjectBindingPattern */)) { + return parent; } break; } @@ -68792,11 +73690,11 @@ var ts; function tryGetNamedImportsOrExportsForCompletion(contextToken) { if (contextToken) { switch (contextToken.kind) { - case 16 /* OpenBraceToken */: // import { | - case 25 /* CommaToken */: + case 17 /* OpenBraceToken */: // import { | + case 26 /* CommaToken */: switch (contextToken.parent.kind) { - case 238 /* NamedImports */: - case 242 /* NamedExports */: + case 241 /* NamedImports */: + case 245 /* NamedExports */: return contextToken.parent; } } @@ -68805,37 +73703,55 @@ var ts; } function tryGetContainingJsxElement(contextToken) { if (contextToken) { - var parent_17 = contextToken.parent; + var parent = contextToken.parent; switch (contextToken.kind) { - case 27 /* LessThanSlashToken */: - case 40 /* SlashToken */: - case 70 /* Identifier */: - case 250 /* JsxAttribute */: - case 251 /* JsxSpreadAttribute */: - if (parent_17 && (parent_17.kind === 247 /* JsxSelfClosingElement */ || parent_17.kind === 248 /* JsxOpeningElement */)) { - return parent_17; + case 28 /* LessThanSlashToken */: + case 41 /* SlashToken */: + case 71 /* Identifier */: + case 179 /* PropertyAccessExpression */: + case 254 /* JsxAttributes */: + case 253 /* JsxAttribute */: + case 255 /* JsxSpreadAttribute */: + if (parent && (parent.kind === 250 /* JsxSelfClosingElement */ || parent.kind === 251 /* JsxOpeningElement */)) { + return parent; } - else if (parent_17.kind === 250 /* JsxAttribute */) { - return parent_17.parent; + else if (parent.kind === 253 /* JsxAttribute */) { + // Currently we parse JsxOpeningLikeElement as: + // JsxOpeningLikeElement + // attributes: JsxAttributes + // properties: NodeArray + return parent.parent.parent; } break; // The context token is the closing } or " of an attribute, which means // its parent is a JsxExpression, whose parent is a JsxAttribute, // whose parent is a JsxOpeningLikeElement case 9 /* StringLiteral */: - if (parent_17 && ((parent_17.kind === 250 /* JsxAttribute */) || (parent_17.kind === 251 /* JsxSpreadAttribute */))) { - return parent_17.parent; + if (parent && ((parent.kind === 253 /* JsxAttribute */) || (parent.kind === 255 /* JsxSpreadAttribute */))) { + // Currently we parse JsxOpeningLikeElement as: + // JsxOpeningLikeElement + // attributes: JsxAttributes + // properties: NodeArray + return parent.parent.parent; } break; - case 17 /* CloseBraceToken */: - if (parent_17 && - parent_17.kind === 252 /* JsxExpression */ && - parent_17.parent && - (parent_17.parent.kind === 250 /* JsxAttribute */)) { - return parent_17.parent.parent; + case 18 /* CloseBraceToken */: + if (parent && + parent.kind === 256 /* JsxExpression */ && + parent.parent && parent.parent.kind === 253 /* JsxAttribute */) { + // Currently we parse JsxOpeningLikeElement as: + // JsxOpeningLikeElement + // attributes: JsxAttributes + // properties: NodeArray + // each JsxAttribute can have initializer as JsxExpression + return parent.parent.parent.parent; } - if (parent_17 && parent_17.kind === 251 /* JsxSpreadAttribute */) { - return parent_17.parent; + if (parent && parent.kind === 255 /* JsxSpreadAttribute */) { + // Currently we parse JsxOpeningLikeElement as: + // JsxOpeningLikeElement + // attributes: JsxAttributes + // properties: NodeArray + return parent.parent.parent; } break; } @@ -68843,20 +73759,17 @@ var ts; return undefined; } function isFunction(kind) { + if (!ts.isFunctionLikeKind(kind)) { + return false; + } switch (kind) { - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - case 225 /* FunctionDeclaration */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: + case 152 /* Constructor */: + case 161 /* ConstructorType */: + case 160 /* FunctionType */: + return false; + default: return true; } - return false; } /** * @returns true if we are certain that the currently edited location must define a new location; false otherwise. @@ -68864,67 +73777,67 @@ var ts; function isSolelyIdentifierDefinitionLocation(contextToken) { var containingNodeKind = contextToken.parent.kind; switch (contextToken.kind) { - case 25 /* CommaToken */: - return containingNodeKind === 223 /* VariableDeclaration */ || - containingNodeKind === 224 /* VariableDeclarationList */ || - containingNodeKind === 205 /* VariableStatement */ || - containingNodeKind === 229 /* EnumDeclaration */ || + case 26 /* CommaToken */: + return containingNodeKind === 226 /* VariableDeclaration */ || + containingNodeKind === 227 /* VariableDeclarationList */ || + containingNodeKind === 208 /* VariableStatement */ || + containingNodeKind === 232 /* EnumDeclaration */ || isFunction(containingNodeKind) || - containingNodeKind === 226 /* ClassDeclaration */ || - containingNodeKind === 197 /* ClassExpression */ || - containingNodeKind === 227 /* InterfaceDeclaration */ || - containingNodeKind === 173 /* ArrayBindingPattern */ || - containingNodeKind === 228 /* TypeAliasDeclaration */; // type Map, K, | - case 22 /* DotToken */: - return containingNodeKind === 173 /* ArrayBindingPattern */; // var [.| - case 55 /* ColonToken */: - return containingNodeKind === 174 /* BindingElement */; // var {x :html| - case 20 /* OpenBracketToken */: - return containingNodeKind === 173 /* ArrayBindingPattern */; // var [x| - case 18 /* OpenParenToken */: - return containingNodeKind === 256 /* CatchClause */ || + containingNodeKind === 229 /* ClassDeclaration */ || + containingNodeKind === 199 /* ClassExpression */ || + containingNodeKind === 230 /* InterfaceDeclaration */ || + containingNodeKind === 175 /* ArrayBindingPattern */ || + containingNodeKind === 231 /* TypeAliasDeclaration */; // type Map, K, | + case 23 /* DotToken */: + return containingNodeKind === 175 /* ArrayBindingPattern */; // var [.| + case 56 /* ColonToken */: + return containingNodeKind === 176 /* BindingElement */; // var {x :html| + case 21 /* OpenBracketToken */: + return containingNodeKind === 175 /* ArrayBindingPattern */; // var [x| + case 19 /* OpenParenToken */: + return containingNodeKind === 260 /* CatchClause */ || isFunction(containingNodeKind); - case 16 /* OpenBraceToken */: - return containingNodeKind === 229 /* EnumDeclaration */ || - containingNodeKind === 227 /* InterfaceDeclaration */ || - containingNodeKind === 161 /* TypeLiteral */; // const x : { | - case 24 /* SemicolonToken */: - return containingNodeKind === 146 /* PropertySignature */ && + case 17 /* OpenBraceToken */: + return containingNodeKind === 232 /* EnumDeclaration */ || + containingNodeKind === 230 /* InterfaceDeclaration */ || + containingNodeKind === 163 /* TypeLiteral */; // const x : { | + case 25 /* SemicolonToken */: + return containingNodeKind === 148 /* PropertySignature */ && contextToken.parent && contextToken.parent.parent && - (contextToken.parent.parent.kind === 227 /* InterfaceDeclaration */ || - contextToken.parent.parent.kind === 161 /* TypeLiteral */); // const x : { a; | - case 26 /* LessThanToken */: - return containingNodeKind === 226 /* ClassDeclaration */ || - containingNodeKind === 197 /* ClassExpression */ || - containingNodeKind === 227 /* InterfaceDeclaration */ || - containingNodeKind === 228 /* TypeAliasDeclaration */ || + (contextToken.parent.parent.kind === 230 /* InterfaceDeclaration */ || + contextToken.parent.parent.kind === 163 /* TypeLiteral */); // const x : { a; | + case 27 /* LessThanToken */: + return containingNodeKind === 229 /* ClassDeclaration */ || + containingNodeKind === 199 /* ClassExpression */ || + containingNodeKind === 230 /* InterfaceDeclaration */ || + containingNodeKind === 231 /* TypeAliasDeclaration */ || isFunction(containingNodeKind); - case 114 /* StaticKeyword */: - return containingNodeKind === 147 /* PropertyDeclaration */; - case 23 /* DotDotDotToken */: - return containingNodeKind === 144 /* Parameter */ || + case 115 /* StaticKeyword */: + return containingNodeKind === 149 /* PropertyDeclaration */; + case 24 /* DotDotDotToken */: + return containingNodeKind === 146 /* Parameter */ || (contextToken.parent && contextToken.parent.parent && - contextToken.parent.parent.kind === 173 /* ArrayBindingPattern */); // var [...z| - case 113 /* PublicKeyword */: - case 111 /* PrivateKeyword */: - case 112 /* ProtectedKeyword */: - return containingNodeKind === 144 /* Parameter */; - case 117 /* AsKeyword */: - return containingNodeKind === 239 /* ImportSpecifier */ || - containingNodeKind === 243 /* ExportSpecifier */ || - containingNodeKind === 237 /* NamespaceImport */; - case 74 /* ClassKeyword */: - case 82 /* EnumKeyword */: - case 108 /* InterfaceKeyword */: - case 88 /* FunctionKeyword */: - case 103 /* VarKeyword */: - case 124 /* GetKeyword */: - case 133 /* SetKeyword */: - case 90 /* ImportKeyword */: - case 109 /* LetKeyword */: - case 75 /* ConstKeyword */: - case 115 /* YieldKeyword */: - case 136 /* TypeKeyword */: + contextToken.parent.parent.kind === 175 /* ArrayBindingPattern */); // var [...z| + case 114 /* PublicKeyword */: + case 112 /* PrivateKeyword */: + case 113 /* ProtectedKeyword */: + return containingNodeKind === 146 /* Parameter */; + case 118 /* AsKeyword */: + return containingNodeKind === 242 /* ImportSpecifier */ || + containingNodeKind === 246 /* ExportSpecifier */ || + containingNodeKind === 240 /* NamespaceImport */; + case 75 /* ClassKeyword */: + case 83 /* EnumKeyword */: + case 109 /* InterfaceKeyword */: + case 89 /* FunctionKeyword */: + case 104 /* VarKeyword */: + case 125 /* GetKeyword */: + case 135 /* SetKeyword */: + case 91 /* ImportKeyword */: + case 110 /* LetKeyword */: + case 76 /* ConstKeyword */: + case 116 /* YieldKeyword */: + case 138 /* TypeKeyword */: return true; } // Previous token may have been a keyword that was converted to an identifier. @@ -68972,13 +73885,13 @@ var ts; if (element.getStart() <= position && position <= element.getEnd()) { continue; } - var name_46 = element.propertyName || element.name; - existingImportsOrExports[name_46.text] = true; + var name = element.propertyName || element.name; + existingImportsOrExports.set(name.text, true); } - if (!ts.someProperties(existingImportsOrExports)) { + if (existingImportsOrExports.size === 0) { return ts.filter(exportsOfModule, function (e) { return e.name !== "default"; }); } - return ts.filter(exportsOfModule, function (e) { return e.name !== "default" && !existingImportsOrExports[e.name]; }); + return ts.filter(exportsOfModule, function (e) { return e.name !== "default" && !existingImportsOrExports.get(e.name); }); } /** * Filters out completion suggestions for named imports or exports. @@ -68994,12 +73907,12 @@ var ts; 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 !== 257 /* PropertyAssignment */ && - m.kind !== 258 /* ShorthandPropertyAssignment */ && - m.kind !== 174 /* BindingElement */ && - m.kind !== 149 /* MethodDeclaration */ && - m.kind !== 151 /* GetAccessor */ && - m.kind !== 152 /* SetAccessor */) { + if (m.kind !== 261 /* PropertyAssignment */ && + m.kind !== 262 /* ShorthandPropertyAssignment */ && + m.kind !== 176 /* BindingElement */ && + m.kind !== 151 /* MethodDeclaration */ && + m.kind !== 153 /* GetAccessor */ && + m.kind !== 154 /* SetAccessor */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -69007,9 +73920,9 @@ var ts; continue; } var existingName = void 0; - if (m.kind === 174 /* BindingElement */ && m.propertyName) { + if (m.kind === 176 /* BindingElement */ && m.propertyName) { // include only identifiers in completion list - if (m.propertyName.kind === 70 /* Identifier */) { + if (m.propertyName.kind === 71 /* Identifier */) { existingName = m.propertyName.text; } } @@ -69017,11 +73930,11 @@ var ts; // TODO(jfreeman): Account for computed property name // NOTE: if one only performs this step when m.name is an identifier, // things like '__proto__' are not filtered out. - existingName = m.name.text; + existingName = ts.getNameOfDeclaration(m).text; } - existingMemberNames[existingName] = true; + existingMemberNames.set(existingName, true); } - return ts.filter(contextualMemberSymbols, function (m) { return !existingMemberNames[m.name]; }); + return ts.filter(contextualMemberSymbols, function (m) { return !existingMemberNames.get(m.name); }); } /** * Filters out completion suggestions from 'symbols' according to existing JSX attributes. @@ -69037,11 +73950,11 @@ var ts; if (attr.getStart() <= position && position <= attr.getEnd()) { continue; } - if (attr.kind === 250 /* JsxAttribute */) { - seenNames[attr.name.text] = true; + if (attr.kind === 253 /* JsxAttribute */) { + seenNames.set(attr.name.text, true); } } - return ts.filter(symbols, function (a) { return !seenNames[a.name]; }); + return ts.filter(symbols, function (a) { return !seenNames.get(a.name); }); } } /** @@ -69087,7 +74000,7 @@ var ts; } // A cache of completion entries for keywords, these do not change between sessions var keywordCompletions = []; - for (var i = 71 /* FirstKeyword */; i <= 140 /* LastKeyword */; i++) { + for (var i = 72 /* FirstKeyword */; i <= 142 /* LastKeyword */; i++) { keywordCompletions.push({ name: ts.tokenToString(i), kind: ts.ScriptElementKind.keyword, @@ -69095,49 +74008,14 @@ var ts; sortText: "0" }); } - /** - * Matches a triple slash reference directive with an incomplete string literal for its path. Used - * to determine if the caret is currently within the string literal and capture the literal fragment - * for completions. - * For example, this matches - * - * /// = 0; i--) { - if (pushKeywordIf(keywords, loopTokens[i], 105 /* WhileKeyword */)) { - break; - } - } - } - } - var breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); - ts.forEach(breaksAndContinues, function (statement) { - if (ownsBreakOrContinueStatement(loopNode, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), 71 /* BreakKeyword */, 76 /* ContinueKeyword */); - } - }); - return ts.map(keywords, getHighlightSpanForNode); - } - function getBreakOrContinueStatementOccurrences(breakOrContinueStatement) { - var owner = getBreakOrContinueOwner(breakOrContinueStatement); - if (owner) { - switch (owner.kind) { - case 211 /* ForStatement */: - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: - case 209 /* DoStatement */: - case 210 /* WhileStatement */: - return getLoopBreakContinueOccurrences(owner); - case 218 /* SwitchStatement */: - return getSwitchCaseDefaultOccurrences(owner); - } - } - return undefined; - } - function getSwitchCaseDefaultOccurrences(switchStatement) { - var keywords = []; - pushKeywordIf(keywords, switchStatement.getFirstToken(), 97 /* SwitchKeyword */); - // Go through each clause in the switch statement, collecting the 'case'/'default' keywords. - ts.forEach(switchStatement.caseBlock.clauses, function (clause) { - pushKeywordIf(keywords, clause.getFirstToken(), 72 /* CaseKeyword */, 78 /* DefaultKeyword */); - var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); - ts.forEach(breaksAndContinues, function (statement) { - if (ownsBreakOrContinueStatement(switchStatement, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), 71 /* BreakKeyword */); - } - }); - }); - return ts.map(keywords, getHighlightSpanForNode); - } - function getTryCatchFinallyOccurrences(tryStatement) { - var keywords = []; - pushKeywordIf(keywords, tryStatement.getFirstToken(), 101 /* TryKeyword */); - if (tryStatement.catchClause) { - pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), 73 /* CatchKeyword */); + // Exceptions thrown within a try block lacking a catch clause + // are "owned" in the current context. + aggregate(tryStatement.tryBlock); } if (tryStatement.finallyBlock) { - var finallyKeyword = ts.findChildOfKind(tryStatement, 86 /* FinallyKeyword */, sourceFile); - pushKeywordIf(keywords, finallyKeyword, 86 /* FinallyKeyword */); + aggregate(tryStatement.finallyBlock); } - return ts.map(keywords, getHighlightSpanForNode); } - function getThrowOccurrences(throwStatement) { - var owner = getThrowStatementOwner(throwStatement); - if (!owner) { - return undefined; - } - var keywords = []; - ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 99 /* ThrowKeyword */); - }); - // 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(), 95 /* ReturnKeyword */); - }); - } - return ts.map(keywords, getHighlightSpanForNode); - } - function getReturnOccurrences(returnStatement) { - var func = ts.getContainingFunction(returnStatement); - // If we didn't find a containing function with a block body, bail out. - if (!(func && hasKind(func.body, 204 /* Block */))) { - return undefined; - } - var keywords = []; - ts.forEachReturnStatement(func.body, function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 95 /* ReturnKeyword */); - }); - // Include 'throw' statements that do not occur within a try block. - ts.forEach(aggregateOwnedThrowStatements(func.body), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 99 /* ThrowKeyword */); - }); - return ts.map(keywords, getHighlightSpanForNode); - } - function getIfElseOccurrences(ifStatement) { - var keywords = []; - // Traverse upwards through all parent if-statements linked by their else-branches. - while (hasKind(ifStatement.parent, 208 /* IfStatement */) && ifStatement.parent.elseStatement === ifStatement) { - ifStatement = ifStatement.parent; - } - // Now traverse back down through the else branches, aggregating if/else keywords of if-statements. - while (ifStatement) { - var children = ifStatement.getChildren(); - pushKeywordIf(keywords, children[0], 89 /* IfKeyword */); - // Generally the 'else' keyword is second-to-last, so we traverse backwards. - for (var i = children.length - 1; i >= 0; i--) { - if (pushKeywordIf(keywords, children[i], 81 /* ElseKeyword */)) { - break; - } - } - if (!hasKind(ifStatement.elseStatement, 208 /* IfStatement */)) { - break; - } - ifStatement = ifStatement.elseStatement; - } - var result = []; - // We'd like to highlight else/ifs together if they are only separated by whitespace - // (i.e. the keywords are separated by no comments, no newlines). - for (var i = 0; i < keywords.length; i++) { - if (keywords[i].kind === 81 /* ElseKeyword */ && i < keywords.length - 1) { - var elseKeyword = keywords[i]; - var ifKeyword = keywords[i + 1]; // this *should* always be an 'if' keyword. - var shouldCombindElseAndIf = true; - // Avoid recalculating getStart() by iterating backwards. - for (var j = ifKeyword.getStart() - 1; j >= elseKeyword.end; j--) { - if (!ts.isWhiteSpaceSingleLine(sourceFile.text.charCodeAt(j))) { - shouldCombindElseAndIf = false; - break; - } - } - if (shouldCombindElseAndIf) { - result.push({ - fileName: fileName, - textSpan: ts.createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), - kind: ts.HighlightSpanKind.reference - }); - i++; // skip the next keyword - continue; - } - } - // Ordinary case: just highlight the keyword. - result.push(getHighlightSpanForNode(keywords[i])); - } - return result; + else if (!ts.isFunctionLike(node)) { + ts.forEachChild(node, aggregate); } } } - DocumentHighlights.getDocumentHighlights = getDocumentHighlights; + /** + * For lack of a better name, this function takes a throw statement and returns the + * nearest ancestor that is a try-block (whose try statement has a catch clause), + * function-block, or source file. + */ + function getThrowStatementOwner(throwStatement) { + var child = throwStatement; + while (child.parent) { + var parent_2 = child.parent; + if (ts.isFunctionBlock(parent_2) || parent_2.kind === 265 /* SourceFile */) { + return parent_2; + } + // 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_2.kind === 224 /* TryStatement */) { + var tryStatement = parent_2; + if (tryStatement.tryBlock === child && tryStatement.catchClause) { + return child; + } + } + child = parent_2; + } + return undefined; + } + function aggregateAllBreakAndContinueStatements(node) { + var statementAccumulator = []; + aggregate(node); + return statementAccumulator; + function aggregate(node) { + if (node.kind === 218 /* BreakStatement */ || node.kind === 217 /* ContinueStatement */) { + statementAccumulator.push(node); + } + else if (!ts.isFunctionLike(node)) { + ts.forEachChild(node, aggregate); + } + } + } + function ownsBreakOrContinueStatement(owner, statement) { + var actualOwner = getBreakOrContinueOwner(statement); + return actualOwner && actualOwner === owner; + } + function getBreakOrContinueOwner(statement) { + for (var node = statement.parent; node; node = node.parent) { + switch (node.kind) { + case 221 /* SwitchStatement */: + if (statement.kind === 217 /* ContinueStatement */) { + continue; + } + // falls through + case 214 /* ForStatement */: + case 215 /* ForInStatement */: + case 216 /* ForOfStatement */: + case 213 /* WhileStatement */: + case 212 /* DoStatement */: + if (!statement.label || isLabeledBy(node, statement.label.text)) { + return node; + } + break; + default: + // Don't cross function boundaries. + if (ts.isFunctionLike(node)) { + return undefined; + } + break; + } + } + return undefined; + } + function getModifierOccurrences(modifier, declaration) { + var container = declaration.parent; + // Make sure we only highlight the keyword when it makes sense to do so. + if (ts.isAccessibilityModifier(modifier)) { + if (!(container.kind === 229 /* ClassDeclaration */ || + container.kind === 199 /* ClassExpression */ || + (declaration.kind === 146 /* Parameter */ && hasKind(container, 152 /* Constructor */)))) { + return undefined; + } + } + else if (modifier === 115 /* StaticKeyword */) { + if (!(container.kind === 229 /* ClassDeclaration */ || container.kind === 199 /* ClassExpression */)) { + return undefined; + } + } + else if (modifier === 84 /* ExportKeyword */ || modifier === 124 /* DeclareKeyword */) { + if (!(container.kind === 234 /* ModuleBlock */ || container.kind === 265 /* SourceFile */)) { + return undefined; + } + } + else if (modifier === 117 /* AbstractKeyword */) { + if (!(container.kind === 229 /* ClassDeclaration */ || declaration.kind === 229 /* ClassDeclaration */)) { + return undefined; + } + } + else { + // unsupported modifier + return undefined; + } + var keywords = []; + var modifierFlag = getFlagFromModifier(modifier); + var nodes; + switch (container.kind) { + case 234 /* ModuleBlock */: + case 265 /* SourceFile */: + // Container is either a class declaration or the declaration is a classDeclaration + if (modifierFlag & 128 /* Abstract */) { + nodes = declaration.members.concat(declaration); + } + else { + nodes = container.statements; + } + break; + case 152 /* Constructor */: + nodes = container.parameters.concat(container.parent.members); + break; + case 229 /* ClassDeclaration */: + case 199 /* ClassExpression */: + 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. + if (modifierFlag & 28 /* AccessibilityModifier */) { + var constructor = ts.forEach(container.members, function (member) { + return member.kind === 152 /* Constructor */ && member; + }); + if (constructor) { + nodes = nodes.concat(constructor.parameters); + } + } + else if (modifierFlag & 128 /* Abstract */) { + nodes = nodes.concat(container); + } + break; + default: + ts.Debug.fail("Invalid container kind."); + } + ts.forEach(nodes, function (node) { + if (ts.getModifierFlags(node) & modifierFlag) { + ts.forEach(node.modifiers, function (child) { return pushKeywordIf(keywords, child, modifier); }); + } + }); + return keywords; + function getFlagFromModifier(modifier) { + switch (modifier) { + case 114 /* PublicKeyword */: + return 4 /* Public */; + case 112 /* PrivateKeyword */: + return 8 /* Private */; + case 113 /* ProtectedKeyword */: + return 16 /* Protected */; + case 115 /* StaticKeyword */: + return 32 /* Static */; + case 84 /* ExportKeyword */: + return 1 /* Export */; + case 124 /* DeclareKeyword */: + return 2 /* Ambient */; + case 117 /* AbstractKeyword */: + return 128 /* Abstract */; + default: + ts.Debug.fail(); + } + } + } + function pushKeywordIf(keywordList, token) { + var expected = []; + for (var _i = 2; _i < arguments.length; _i++) { + expected[_i - 2] = arguments[_i]; + } + if (token && ts.contains(expected, token.kind)) { + keywordList.push(token); + return true; + } + return false; + } + function getGetAndSetOccurrences(accessorDeclaration) { + var keywords = []; + tryPushAccessorKeyword(accessorDeclaration.symbol, 153 /* GetAccessor */); + tryPushAccessorKeyword(accessorDeclaration.symbol, 154 /* 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 === 212 /* DoStatement */) { + var loopTokens = loopNode.getChildren(); + for (var i = loopTokens.length - 1; i >= 0; i--) { + if (pushKeywordIf(keywords, loopTokens[i], 106 /* WhileKeyword */)) { + break; + } + } + } + } + var breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); + ts.forEach(breaksAndContinues, function (statement) { + if (ownsBreakOrContinueStatement(loopNode, statement)) { + pushKeywordIf(keywords, statement.getFirstToken(), 72 /* BreakKeyword */, 77 /* ContinueKeyword */); + } + }); + return keywords; + } + function getBreakOrContinueStatementOccurrences(breakOrContinueStatement) { + var owner = getBreakOrContinueOwner(breakOrContinueStatement); + if (owner) { + switch (owner.kind) { + case 214 /* ForStatement */: + case 215 /* ForInStatement */: + case 216 /* ForOfStatement */: + case 212 /* DoStatement */: + case 213 /* WhileStatement */: + return getLoopBreakContinueOccurrences(owner); + case 221 /* SwitchStatement */: + return getSwitchCaseDefaultOccurrences(owner); + } + } + return undefined; + } + function getSwitchCaseDefaultOccurrences(switchStatement) { + var keywords = []; + pushKeywordIf(keywords, switchStatement.getFirstToken(), 98 /* SwitchKeyword */); + // 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) { + if (ownsBreakOrContinueStatement(switchStatement, statement)) { + pushKeywordIf(keywords, statement.getFirstToken(), 72 /* BreakKeyword */); + } + }); + }); + return keywords; + } + function getTryCatchFinallyOccurrences(tryStatement, sourceFile) { + var keywords = []; + pushKeywordIf(keywords, tryStatement.getFirstToken(), 102 /* TryKeyword */); + if (tryStatement.catchClause) { + pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), 74 /* CatchKeyword */); + } + if (tryStatement.finallyBlock) { + var finallyKeyword = ts.findChildOfKind(tryStatement, 87 /* FinallyKeyword */, sourceFile); + pushKeywordIf(keywords, finallyKeyword, 87 /* FinallyKeyword */); + } + return keywords; + } + function getThrowOccurrences(throwStatement) { + var owner = getThrowStatementOwner(throwStatement); + if (!owner) { + return undefined; + } + var keywords = []; + ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) { + pushKeywordIf(keywords, throwStatement.getFirstToken(), 100 /* ThrowKeyword */); + }); + // 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 */); + }); + } + return keywords; + } + function getReturnOccurrences(returnStatement) { + var func = ts.getContainingFunction(returnStatement); + // If we didn't find a containing function with a block body, bail out. + if (!(func && hasKind(func.body, 207 /* Block */))) { + return undefined; + } + var keywords = []; + ts.forEachReturnStatement(func.body, function (returnStatement) { + pushKeywordIf(keywords, returnStatement.getFirstToken(), 96 /* ReturnKeyword */); + }); + // Include 'throw' statements that do not occur within a try block. + ts.forEach(aggregateOwnedThrowStatements(func.body), function (throwStatement) { + pushKeywordIf(keywords, throwStatement.getFirstToken(), 100 /* ThrowKeyword */); + }); + return keywords; + } + function getIfElseOccurrences(ifStatement, sourceFile) { + var keywords = []; + // Traverse upwards through all parent if-statements linked by their else-branches. + while (hasKind(ifStatement.parent, 211 /* IfStatement */) && ifStatement.parent.elseStatement === ifStatement) { + ifStatement = ifStatement.parent; + } + // Now traverse back down through the else branches, aggregating if/else keywords of if-statements. + while (ifStatement) { + var children = ifStatement.getChildren(); + pushKeywordIf(keywords, children[0], 90 /* IfKeyword */); + // Generally the 'else' keyword is second-to-last, so we traverse backwards. + for (var i = children.length - 1; i >= 0; i--) { + if (pushKeywordIf(keywords, children[i], 82 /* ElseKeyword */)) { + break; + } + } + if (!hasKind(ifStatement.elseStatement, 211 /* IfStatement */)) { + break; + } + ifStatement = ifStatement.elseStatement; + } + var result = []; + // We'd like to highlight else/ifs together if they are only separated by whitespace + // (i.e. the keywords are separated by no comments, no newlines). + for (var i = 0; i < keywords.length; i++) { + if (keywords[i].kind === 82 /* ElseKeyword */ && i < keywords.length - 1) { + var elseKeyword = keywords[i]; + var ifKeyword = keywords[i + 1]; // this *should* always be an 'if' keyword. + var shouldCombindElseAndIf = true; + // Avoid recalculating getStart() by iterating backwards. + for (var j = ifKeyword.getStart() - 1; j >= elseKeyword.end; j--) { + if (!ts.isWhiteSpaceSingleLine(sourceFile.text.charCodeAt(j))) { + shouldCombindElseAndIf = false; + break; + } + } + if (shouldCombindElseAndIf) { + result.push({ + fileName: sourceFile.fileName, + textSpan: ts.createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), + kind: ts.HighlightSpanKind.reference + }); + i++; // skip the next keyword + continue; + } + } + // Ordinary case: just highlight the keyword. + result.push(getHighlightSpanForNode(keywords[i], sourceFile)); + } + return result; + } /** * Whether or not a 'node' is preceded by a label of the given string. * Note: 'node' cannot be a SourceFile. */ function isLabeledBy(node, labelName) { - for (var owner = node.parent; owner.kind === 219 /* LabeledStatement */; owner = owner.parent) { + for (var owner = node.parent; owner.kind === 222 /* LabeledStatement */; owner = owner.parent) { if (owner.label.text === labelName) { return true; } @@ -69696,15 +74553,15 @@ var ts; return "_" + settings.target + "|" + settings.module + "|" + settings.noResolve + "|" + settings.jsx + "|" + settings.allowJs + "|" + settings.baseUrl + "|" + JSON.stringify(settings.typeRoots) + "|" + JSON.stringify(settings.rootDirs) + "|" + JSON.stringify(settings.paths); } function getBucketForCompilationSettings(key, createIfMissing) { - var bucket = buckets[key]; + var bucket = buckets.get(key); if (!bucket && createIfMissing) { - buckets[key] = bucket = ts.createFileMap(); + buckets.set(key, bucket = ts.createFileMap()); } return bucket; } function reportStats() { - var bucketInfoArray = Object.keys(buckets).filter(function (name) { return name && name.charAt(0) === "_"; }).map(function (name) { - var entries = buckets[name]; + var bucketInfoArray = ts.arrayFrom(buckets.keys()).filter(function (name) { return name && name.charAt(0) === "_"; }).map(function (name) { + var entries = buckets.get(name); var sourceFiles = []; entries.forEachValue(function (key, entry) { sourceFiles.push({ @@ -69797,41 +74654,777 @@ var ts; } ts.createDocumentRegistry = createDocumentRegistry; })(ts || (ts = {})); +/* Code for finding imports of an exported symbol. Used only by FindAllReferences. */ /* @internal */ var ts; (function (ts) { var FindAllReferences; (function (FindAllReferences) { - function findReferencedSymbols(typeChecker, cancellationToken, sourceFiles, sourceFile, position, findInStrings, findInComments) { - var node = ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); - if (node === sourceFile) { + /** Creates the imports map and returns an ImportTracker that uses it. Call this lazily to avoid calling `getDirectImportsMap` unnecessarily. */ + function createImportTracker(sourceFiles, checker, cancellationToken) { + var allDirectImports = getDirectImportsMap(sourceFiles, checker, cancellationToken); + return function (exportSymbol, exportInfo, isForRename) { + var _a = getImportersForExport(sourceFiles, allDirectImports, exportInfo, checker, cancellationToken), directImports = _a.directImports, indirectUsers = _a.indirectUsers; + return __assign({ indirectUsers: indirectUsers }, getSearchesFromDirectImports(directImports, exportSymbol, exportInfo.exportKind, checker, isForRename)); + }; + } + FindAllReferences.createImportTracker = createImportTracker; + var ExportKind; + (function (ExportKind) { + ExportKind[ExportKind["Named"] = 0] = "Named"; + ExportKind[ExportKind["Default"] = 1] = "Default"; + ExportKind[ExportKind["ExportEquals"] = 2] = "ExportEquals"; + })(ExportKind = FindAllReferences.ExportKind || (FindAllReferences.ExportKind = {})); + var ImportExport; + (function (ImportExport) { + ImportExport[ImportExport["Import"] = 0] = "Import"; + ImportExport[ImportExport["Export"] = 1] = "Export"; + })(ImportExport = FindAllReferences.ImportExport || (FindAllReferences.ImportExport = {})); + /** Returns import statements that directly reference the exporting module, and a list of files that may access the module through a namespace. */ + function getImportersForExport(sourceFiles, allDirectImports, _a, checker, cancellationToken) { + var exportingModuleSymbol = _a.exportingModuleSymbol, exportKind = _a.exportKind; + var markSeenDirectImport = ts.nodeSeenTracker(); + var markSeenIndirectUser = ts.nodeSeenTracker(); + var directImports = []; + var isAvailableThroughGlobal = !!exportingModuleSymbol.globalExports; + var indirectUserDeclarations = isAvailableThroughGlobal ? undefined : []; + handleDirectImports(exportingModuleSymbol); + return { directImports: directImports, indirectUsers: getIndirectUsers() }; + function getIndirectUsers() { + if (isAvailableThroughGlobal) { + // It has `export as namespace`, so anything could potentially use it. + return sourceFiles; + } + // Module augmentations may use this module's exports without importing it. + for (var _i = 0, _a = exportingModuleSymbol.declarations; _i < _a.length; _i++) { + var decl = _a[_i]; + if (ts.isExternalModuleAugmentation(decl)) { + addIndirectUser(decl); + } + } + // This may return duplicates (if there are multiple module declarations in a single source file, all importing the same thing as a namespace), but `State.markSearchedSymbol` will handle that. + return indirectUserDeclarations.map(ts.getSourceFileOfNode); + } + function handleDirectImports(exportingModuleSymbol) { + var theseDirectImports = getDirectImports(exportingModuleSymbol); + if (theseDirectImports) + for (var _i = 0, theseDirectImports_1 = theseDirectImports; _i < theseDirectImports_1.length; _i++) { + var direct = theseDirectImports_1[_i]; + if (!markSeenDirectImport(direct)) { + continue; + } + cancellationToken.throwIfCancellationRequested(); + switch (direct.kind) { + case 181 /* CallExpression */: + if (!isAvailableThroughGlobal) { + var parent = direct.parent; + if (exportKind === 2 /* ExportEquals */ && parent.kind === 226 /* VariableDeclaration */) { + var name = parent.name; + if (name.kind === 71 /* Identifier */) { + directImports.push(name); + break; + } + } + // Don't support re-exporting 'require()' calls, so just add a single indirect user. + addIndirectUser(direct.getSourceFile()); + } + break; + case 237 /* ImportEqualsDeclaration */: + handleNamespaceImport(direct, direct.name, ts.hasModifier(direct, 1 /* Export */)); + break; + case 238 /* ImportDeclaration */: + var namedBindings = direct.importClause && direct.importClause.namedBindings; + if (namedBindings && namedBindings.kind === 240 /* NamespaceImport */) { + handleNamespaceImport(direct, namedBindings.name); + } + else { + directImports.push(direct); + } + break; + case 244 /* ExportDeclaration */: + if (!direct.exportClause) { + // This is `export * from "foo"`, so imports of this module may import the export too. + handleDirectImports(getContainingModuleSymbol(direct, checker)); + } + else { + // This is `export { foo } from "foo"` and creates an alias symbol, so recursive search will get handle re-exports. + directImports.push(direct); + } + break; + } + } + } + function handleNamespaceImport(importDeclaration, name, isReExport) { + if (exportKind === 2 /* ExportEquals */) { + // This is a direct import, not import-as-namespace. + directImports.push(importDeclaration); + } + else if (!isAvailableThroughGlobal) { + var sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration); + ts.Debug.assert(sourceFileLike.kind === 265 /* SourceFile */ || sourceFileLike.kind === 233 /* ModuleDeclaration */); + if (isReExport || findNamespaceReExports(sourceFileLike, name, checker)) { + addIndirectUsers(sourceFileLike); + } + else { + addIndirectUser(sourceFileLike); + } + } + } + function addIndirectUser(sourceFileLike) { + ts.Debug.assert(!isAvailableThroughGlobal); + var isNew = markSeenIndirectUser(sourceFileLike); + if (isNew) { + indirectUserDeclarations.push(sourceFileLike); + } + return isNew; + } + /** Adds a module and all of its transitive dependencies as possible indirect users. */ + function addIndirectUsers(sourceFileLike) { + if (!addIndirectUser(sourceFileLike)) { + return; + } + var moduleSymbol = checker.getMergedSymbol(sourceFileLike.symbol); + ts.Debug.assert(!!(moduleSymbol.flags & 1536 /* Module */)); + var directImports = getDirectImports(moduleSymbol); + if (directImports) + for (var _i = 0, directImports_1 = directImports; _i < directImports_1.length; _i++) { + var directImport = directImports_1[_i]; + addIndirectUsers(getSourceFileLikeForImportDeclaration(directImport)); + } + } + function getDirectImports(moduleSymbol) { + return allDirectImports.get(ts.getSymbolId(moduleSymbol).toString()); + } + } + /** + * Given the set of direct imports of a module, we need to find which ones import the particular exported symbol. + * The returned `importSearches` will result in the entire source file being searched. + * But re-exports will be placed in 'singleReferences' since they cannot be locally referenced. + */ + function getSearchesFromDirectImports(directImports, exportSymbol, exportKind, checker, isForRename) { + var exportName = exportSymbol.name; + var importSearches = []; + var singleReferences = []; + function addSearch(location, symbol) { + importSearches.push([location, symbol]); + } + if (directImports) + for (var _i = 0, directImports_2 = directImports; _i < directImports_2.length; _i++) { + var decl = directImports_2[_i]; + handleImport(decl); + } + return { importSearches: importSearches, singleReferences: singleReferences }; + function handleImport(decl) { + if (decl.kind === 237 /* ImportEqualsDeclaration */) { + if (isExternalModuleImportEquals(decl)) { + handleNamespaceImportLike(decl.name); + } + return; + } + if (decl.kind === 71 /* Identifier */) { + handleNamespaceImportLike(decl); + return; + } + // Ignore if there's a grammar error + if (decl.moduleSpecifier.kind !== 9 /* StringLiteral */) { + return; + } + if (decl.kind === 244 /* ExportDeclaration */) { + searchForNamedImport(decl.exportClause); + return; + } + if (!decl.importClause) { + return; + } + var importClause = decl.importClause; + var namedBindings = importClause.namedBindings; + if (namedBindings && namedBindings.kind === 240 /* NamespaceImport */) { + handleNamespaceImportLike(namedBindings.name); + return; + } + if (exportKind === 0 /* Named */) { + searchForNamedImport(namedBindings); + } + else { + // `export =` might be imported by a default import if `--allowSyntheticDefaultImports` is on, so this handles both ExportKind.Default and ExportKind.ExportEquals + var name = importClause.name; + // If a default import has the same name as the default export, allow to rename it. + // Given `import f` and `export default function f`, we will rename both, but for `import g` we will rename just that. + if (name && (!isForRename || name.text === symbolName(exportSymbol))) { + var defaultImportAlias = checker.getSymbolAtLocation(name); + addSearch(name, defaultImportAlias); + } + // 'default' might be accessed as a named import `{ default as foo }`. + if (!isForRename && exportKind === 1 /* Default */) { + ts.Debug.assert(exportName === "default"); + searchForNamedImport(namedBindings); + } + } + } + /** + * `import x = require("./x") or `import * as x from "./x"`. + * An `export =` may be imported by this syntax, so it may be a direct import. + * If it's not a direct import, it will be in `indirectUsers`, so we don't have to do anything here. + */ + function handleNamespaceImportLike(importName) { + // Don't rename an import that already has a different name than the export. + if (exportKind === 2 /* ExportEquals */ && (!isForRename || importName.text === exportName)) { + addSearch(importName, checker.getSymbolAtLocation(importName)); + } + } + function searchForNamedImport(namedBindings) { + if (namedBindings) + for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { + var element = _a[_i]; + var name = element.name, propertyName = element.propertyName; + if ((propertyName || name).text !== exportName) { + continue; + } + 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) { + // Search locally for `bar`. + addSearch(name, checker.getSymbolAtLocation(name)); + } + } + else { + var localSymbol = element.kind === 246 /* 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); + } + } + } + } + /** Returns 'true' is the namespace 'name' is re-exported from this module, and 'false' if it is only used locally. */ + function findNamespaceReExports(sourceFileLike, name, checker) { + var namespaceImportSymbol = checker.getSymbolAtLocation(name); + return forEachPossibleImportOrExportStatement(sourceFileLike, function (statement) { + if (statement.kind !== 244 /* ExportDeclaration */) + return; + var _a = statement, exportClause = _a.exportClause, moduleSpecifier = _a.moduleSpecifier; + if (moduleSpecifier || !exportClause) + return; + for (var _i = 0, _b = exportClause.elements; _i < _b.length; _i++) { + var element = _b[_i]; + if (checker.getExportSpecifierLocalTargetSymbol(element) === namespaceImportSymbol) { + return true; + } + } + }); + } + /** Returns a map from a module symbol Id to all import statements that directly reference the module. */ + function getDirectImportsMap(sourceFiles, checker, cancellationToken) { + var map = ts.createMap(); + for (var _i = 0, sourceFiles_4 = sourceFiles; _i < sourceFiles_4.length; _i++) { + var sourceFile = sourceFiles_4[_i]; + cancellationToken.throwIfCancellationRequested(); + forEachImport(sourceFile, function (importDecl, moduleSpecifier) { + var moduleSymbol = checker.getSymbolAtLocation(moduleSpecifier); + if (moduleSymbol) { + var id = ts.getSymbolId(moduleSymbol).toString(); + var imports = map.get(id); + if (!imports) { + map.set(id, imports = []); + } + imports.push(importDecl); + } + }); + } + return map; + } + /** 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 === 265 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { + return action(statement) || (isAmbientModuleDeclaration(statement) && ts.forEach(statement.body && statement.body.statements, action)); + }); + } + /** Calls `action` for each import, re-export, or require() in a file. */ + function forEachImport(sourceFile, action) { + if (sourceFile.externalModuleIndicator) { + for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) { + var moduleSpecifier = _a[_i]; + action(importerFromModuleSpecifier(moduleSpecifier), moduleSpecifier); + } + } + else { + forEachPossibleImportOrExportStatement(sourceFile, function (statement) { + switch (statement.kind) { + case 244 /* ExportDeclaration */: + case 238 /* ImportDeclaration */: { + var decl = statement; + if (decl.moduleSpecifier && decl.moduleSpecifier.kind === 9 /* StringLiteral */) { + action(decl, decl.moduleSpecifier); + } + break; + } + case 237 /* ImportEqualsDeclaration */: { + var decl = statement; + var moduleReference = decl.moduleReference; + if (moduleReference.kind === 248 /* ExternalModuleReference */ && + moduleReference.expression.kind === 9 /* StringLiteral */) { + action(decl, moduleReference.expression); + } + break; + } + } + }); + if (sourceFile.flags & 65536 /* JavaScriptFile */) { + // Find all 'require()' calls. + sourceFile.forEachChild(function recur(node) { + if (ts.isRequireCall(node, /*checkArgumentIsStringLiteral*/ true)) { + action(node, node.arguments[0]); + } + else { + node.forEachChild(recur); + } + }); + } + } + } + function importerFromModuleSpecifier(moduleSpecifier) { + var decl = moduleSpecifier.parent; + if (decl.kind === 238 /* ImportDeclaration */ || decl.kind === 244 /* ExportDeclaration */) { + return decl; + } + ts.Debug.assert(decl.kind === 248 /* ExternalModuleReference */); + return decl.parent; + } + /** + * Given a local reference, we might notice that it's an import/export and recursively search for references of that. + * If at an import, look locally for the symbol it imports. + * If an an export, look for all imports of it. + * This doesn't handle export specifiers; that is done in `getReferencesAtExportSpecifier`. + * @param comingFromExport If we are doing a search for all exports, don't bother looking backwards for the imported symbol, since that's the reason we're here. + */ + function getImportOrExportSymbol(node, symbol, checker, comingFromExport) { + return comingFromExport ? getExport() : getExport() || getImport(); + function getExport() { + var parent = node.parent; + if (symbol.flags & 7340032 /* Export */) { + if (parent.kind === 179 /* 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; }) && parent.parent.kind === 194 /* BinaryExpression */ + ? getSpecialPropertyExport(parent.parent, /*useLhsSymbol*/ false) + : undefined; + } + else { + var exportSymbol = symbol.exportSymbol; + ts.Debug.assert(!!exportSymbol); + return exportInfo(exportSymbol, getExportKindForDeclaration(parent)); + } + } + else { + var exportNode = getExportNode(parent); + if (exportNode && ts.hasModifier(exportNode, 1 /* Export */)) { + if (exportNode.kind === 237 /* ImportEqualsDeclaration */ && exportNode.moduleReference === node) { + // We're at `Y` in `export import X = Y`. This is not the exported symbol, the left-hand-side is. So treat this as an import statement. + if (comingFromExport) { + return undefined; + } + var lhsSymbol = checker.getSymbolAtLocation(exportNode.name); + return { kind: 0 /* Import */, symbol: lhsSymbol, isNamedImport: false }; + } + else { + return exportInfo(symbol, getExportKindForDeclaration(exportNode)); + } + } + else if (parent.kind === 243 /* ExportAssignment */) { + // Get the symbol for the `export =` node; its parent is the module it's the export of. + var exportingModuleSymbol = parent.symbol.parent; + ts.Debug.assert(!!exportingModuleSymbol); + return { kind: 1 /* Export */, symbol: symbol, exportInfo: { exportingModuleSymbol: exportingModuleSymbol, exportKind: 2 /* ExportEquals */ } }; + } + else if (parent.kind === 194 /* BinaryExpression */) { + return getSpecialPropertyExport(parent, /*useLhsSymbol*/ true); + } + else if (parent.parent.kind === 194 /* BinaryExpression */) { + return getSpecialPropertyExport(parent.parent, /*useLhsSymbol*/ true); + } + } + function getSpecialPropertyExport(node, useLhsSymbol) { + var kind; + switch (ts.getSpecialPropertyAssignmentKind(node)) { + case 1 /* ExportsProperty */: + kind = 0 /* Named */; + break; + case 2 /* ModuleExports */: + kind = 2 /* ExportEquals */; + break; + default: + return undefined; + } + var sym = useLhsSymbol ? checker.getSymbolAtLocation(node.left.name) : symbol; + return sym && exportInfo(sym, kind); + } + } + function getImport() { + var isImport = isNodeImport(node); + if (!isImport) + return; + // A symbol being imported is always an alias. So get what that aliases to find the local symbol. + var importedSymbol = checker.getImmediateAliasedSymbol(symbol); + if (importedSymbol) { + // Search on the local symbol in the exporting module, not the exported symbol. + importedSymbol = skipExportSpecifierSymbol(importedSymbol, checker); + // Similarly, skip past the symbol for 'export =' + if (importedSymbol.name === "export=") { + importedSymbol = checker.getImmediateAliasedSymbol(importedSymbol); + } + if (symbolName(importedSymbol) === symbol.name) { + return __assign({ kind: 0 /* Import */, symbol: importedSymbol }, isImport); + } + } + } + function exportInfo(symbol, kind) { + var exportInfo = getExportInfo(symbol, kind, checker); + return exportInfo && { kind: 1 /* Export */, symbol: symbol, exportInfo: exportInfo }; + } + // Not meant for use with export specifiers or export assignment. + function getExportKindForDeclaration(node) { + return ts.hasModifier(node, 512 /* Default */) ? 1 /* Default */ : 0 /* Named */; + } + } + FindAllReferences.getImportOrExportSymbol = getImportOrExportSymbol; + // If a reference is a variable declaration, the exported node would be the variable statement. + function getExportNode(parent) { + if (parent.kind === 226 /* VariableDeclaration */) { + var p = parent; + return p.parent.kind === 260 /* CatchClause */ ? undefined : p.parent.parent.kind === 208 /* VariableStatement */ ? p.parent.parent : undefined; + } + else { + return parent; + } + } + function isNodeImport(node) { + var parent = node.parent; + switch (parent.kind) { + case 237 /* ImportEqualsDeclaration */: + return parent.name === node && isExternalModuleImportEquals(parent) + ? { isNamedImport: false } + : undefined; + case 242 /* 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 239 /* ImportClause */: + case 240 /* NamespaceImport */: + ts.Debug.assert(parent.name === node); + return { isNamedImport: false }; + default: + return undefined; + } + } + function getExportInfo(exportSymbol, exportKind, checker) { + var exportingModuleSymbol = checker.getMergedSymbol(exportSymbol.parent); // 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; + } + FindAllReferences.getExportInfo = getExportInfo; + function symbolName(symbol) { + if (symbol.name !== "default") { + return symbol.name; + } + var name = ts.forEach(symbol.declarations, function (decl) { + var name = ts.getNameOfDeclaration(decl); + return name && name.kind === 71 /* Identifier */ && name.text; + }); + ts.Debug.assert(!!name); + return name; + } + /** If at an export specifier, go to the symbol it refers to. */ + function skipExportSpecifierSymbol(symbol, checker) { + // For `export { foo } from './bar", there's nothing to skip, because it does not create a new alias. But `export { foo } does. + if (symbol.declarations) + for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { + var declaration = _a[_i]; + if (ts.isExportSpecifier(declaration) && !declaration.propertyName && !declaration.parent.parent.moduleSpecifier) { + return checker.getExportSpecifierLocalTargetSymbol(declaration); + } + } + return symbol; + } + function getContainingModuleSymbol(importer, checker) { + return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol); + } + function getSourceFileLikeForImportDeclaration(node) { + if (node.kind === 181 /* CallExpression */) { + return node.getSourceFile(); + } + var parent = node.parent; + if (parent.kind === 265 /* SourceFile */) { + return parent; + } + ts.Debug.assert(parent.kind === 234 /* ModuleBlock */ && isAmbientModuleDeclaration(parent.parent)); + return parent.parent; + } + function isAmbientModuleDeclaration(node) { + return node.kind === 233 /* ModuleDeclaration */ && node.name.kind === 9 /* StringLiteral */; + } + function isExternalModuleImportEquals(_a) { + var moduleReference = _a.moduleReference; + return moduleReference.kind === 248 /* ExternalModuleReference */ && moduleReference.expression.kind === 9 /* StringLiteral */; + } + })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {})); +})(ts || (ts = {})); +/// +/* @internal */ +var ts; +(function (ts) { + var FindAllReferences; + (function (FindAllReferences) { + function nodeEntry(node, isInString) { + return { type: "node", node: node, isInString: isInString }; + } + FindAllReferences.nodeEntry = nodeEntry; + function findReferencedSymbols(checker, cancellationToken, sourceFiles, sourceFile, position) { + var referencedSymbols = findAllReferencedSymbols(checker, cancellationToken, sourceFiles, sourceFile, position); + if (!referencedSymbols || !referencedSymbols.length) { return undefined; } - switch (node.kind) { - case 8 /* NumericLiteral */: - if (!ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node)) { - break; - } - // Fallthrough - case 70 /* Identifier */: - case 98 /* ThisKeyword */: - // case SyntaxKind.SuperKeyword: TODO:GH#9268 - case 122 /* ConstructorKeyword */: - case 9 /* StringLiteral */: - return getReferencedSymbolsForNode(typeChecker, cancellationToken, node, sourceFiles, findInStrings, findInComments, /*implementations*/ false); + var out = []; + for (var _i = 0, referencedSymbols_1 = referencedSymbols; _i < referencedSymbols_1.length; _i++) { + var _a = referencedSymbols_1[_i], definition = _a.definition, references = _a.references; + // Only include referenced symbols that have a valid definition. + if (definition) { + out.push({ definition: definitionToReferencedSymbolDefinitionInfo(definition, checker), references: references.map(toReferenceEntry) }); + } } - return undefined; + return out; } FindAllReferences.findReferencedSymbols = findReferencedSymbols; - function getReferencedSymbolsForNode(typeChecker, cancellationToken, node, sourceFiles, findInStrings, findInComments, implementations) { - if (!implementations) { + function getImplementationsAtPosition(checker, cancellationToken, sourceFiles, sourceFile, position) { + var node = ts.getTouchingPropertyName(sourceFile, position); + var referenceEntries = getImplementationReferenceEntries(checker, cancellationToken, sourceFiles, node); + return ts.map(referenceEntries, function (entry) { return toImplementationLocation(entry, checker); }); + } + FindAllReferences.getImplementationsAtPosition = getImplementationsAtPosition; + function getImplementationReferenceEntries(typeChecker, cancellationToken, sourceFiles, node) { + // 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 === 262 /* ShorthandPropertyAssignment */) { + var result_4 = []; + FindAllReferences.Core.getReferenceEntriesForShorthandPropertyAssignment(node, typeChecker, function (node) { return result_4.push(nodeEntry(node)); }); + return result_4; + } + else if (node.kind === 97 /* SuperKeyword */ || ts.isSuperProperty(node.parent)) { + // References to and accesses on the super keyword only have one possible implementation, so no + // need to "Find all References" + var symbol = typeChecker.getSymbolAtLocation(node); + return symbol.valueDeclaration && [nodeEntry(symbol.valueDeclaration)]; + } + else { + // Perform "Find all References" and retrieve only those that are implementations + return getReferenceEntriesForNode(node, sourceFiles, typeChecker, cancellationToken, { implementations: true }); + } + } + function findReferencedEntries(checker, cancellationToken, sourceFiles, sourceFile, position, options) { + var x = flattenEntries(findAllReferencedSymbols(checker, cancellationToken, sourceFiles, sourceFile, position, options)); + return ts.map(x, toReferenceEntry); + } + FindAllReferences.findReferencedEntries = findReferencedEntries; + function getReferenceEntriesForNode(node, sourceFiles, checker, cancellationToken, options) { + if (options === void 0) { options = {}; } + return flattenEntries(FindAllReferences.Core.getReferencedSymbolsForNode(node, sourceFiles, checker, cancellationToken, options)); + } + FindAllReferences.getReferenceEntriesForNode = getReferenceEntriesForNode; + function findAllReferencedSymbols(checker, cancellationToken, sourceFiles, sourceFile, position, options) { + var node = ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); + return FindAllReferences.Core.getReferencedSymbolsForNode(node, sourceFiles, checker, cancellationToken, options); + } + function flattenEntries(referenceSymbols) { + return referenceSymbols && ts.flatMap(referenceSymbols, function (r) { return r.references; }); + } + function definitionToReferencedSymbolDefinitionInfo(def, checker) { + var info = (function () { + switch (def.type) { + case "symbol": { + var symbol = def.symbol, node_2 = def.node; + var declarations = symbol.declarations; + if (!declarations || declarations.length === 0) { + return undefined; + } + var _a = getDefinitionKindAndDisplayParts(symbol, node_2, checker), displayParts_1 = _a.displayParts, kind_1 = _a.kind; + var name_3 = displayParts_1.map(function (p) { return p.text; }).join(""); + return { node: node_2, name: name_3, kind: kind_1, displayParts: displayParts_1 }; + } + case "label": { + var node_3 = def.node; + return { node: node_3, name: node_3.text, kind: ts.ScriptElementKind.label, displayParts: [ts.displayPart(node_3.text, ts.SymbolDisplayPartKind.text)] }; + } + case "keyword": { + var node_4 = def.node; + var name_4 = ts.tokenToString(node_4.kind); + return { node: node_4, name: name_4, kind: ts.ScriptElementKind.keyword, displayParts: [{ text: name_4, kind: ts.ScriptElementKind.keyword }] }; + } + case "this": { + 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: ts.ScriptElementKind.variableElement, displayParts: displayParts_2 }; + } + case "string": { + var node_6 = def.node; + return { node: node_6, name: node_6.text, kind: ts.ScriptElementKind.variableElement, displayParts: [ts.displayPart(ts.getTextOfNode(node_6), ts.SymbolDisplayPartKind.stringLiteral)] }; + } + } + })(); + if (!info) { + return undefined; + } + var node = info.node, name = info.name, kind = info.kind, displayParts = info.displayParts; + var sourceFile = node.getSourceFile(); + return { + containerKind: "", + containerName: "", + fileName: sourceFile.fileName, + kind: kind, + name: name, + textSpan: ts.createTextSpanFromNode(node, sourceFile), + 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; + return { displayParts: displayParts, kind: symbolKind }; + } + function toReferenceEntry(entry) { + if (entry.type === "span") { + return { textSpan: entry.textSpan, fileName: entry.fileName, isWriteAccess: false, isDefinition: false }; + } + var node = entry.node, isInString = entry.isInString; + return { + fileName: node.getSourceFile().fileName, + textSpan: getTextSpan(node), + isWriteAccess: isWriteAccess(node), + isDefinition: ts.isDeclarationName(node) || ts.isLiteralComputedPropertyDeclarationName(node), + isInString: isInString + }; + } + function toImplementationLocation(entry, checker) { + if (entry.type === "node") { + var node = entry.node; + return __assign({ textSpan: getTextSpan(node), fileName: node.getSourceFile().fileName }, implementationKindDisplayParts(node, checker)); + } + else { + var textSpan = entry.textSpan, fileName = entry.fileName; + return { textSpan: textSpan, fileName: fileName, kind: ts.ScriptElementKind.unknown, displayParts: [] }; + } + } + function implementationKindDisplayParts(node, checker) { + var symbol = checker.getSymbolAtLocation(ts.isDeclaration(node) && node.name ? node.name : node); + if (symbol) { + return getDefinitionKindAndDisplayParts(symbol, node, checker); + } + else if (node.kind === 178 /* ObjectLiteralExpression */) { + return { + kind: ts.ScriptElementKind.interfaceElement, + displayParts: [ts.punctuationPart(19 /* OpenParenToken */), ts.textPart("object literal"), ts.punctuationPart(20 /* CloseParenToken */)] + }; + } + else if (node.kind === 199 /* ClassExpression */) { + return { + kind: ts.ScriptElementKind.localClassElement, + displayParts: [ts.punctuationPart(19 /* OpenParenToken */), ts.textPart("anonymous local class"), ts.punctuationPart(20 /* CloseParenToken */)] + }; + } + else { + return { kind: ts.getNodeKind(node), displayParts: [] }; + } + } + function toHighlightSpan(entry) { + if (entry.type === "span") { + var fileName_1 = entry.fileName, textSpan = entry.textSpan; + return { fileName: fileName_1, span: { textSpan: textSpan, kind: ts.HighlightSpanKind.reference } }; + } + var node = entry.node, isInString = entry.isInString; + var fileName = entry.node.getSourceFile().fileName; + var writeAccess = isWriteAccess(node); + var span = { + textSpan: getTextSpan(node), + kind: writeAccess ? ts.HighlightSpanKind.writtenReference : ts.HighlightSpanKind.reference, + isInString: isInString + }; + return { fileName: fileName, span: span }; + } + FindAllReferences.toHighlightSpan = toHighlightSpan; + function getTextSpan(node) { + var start = node.getStart(); + var end = node.getEnd(); + if (node.kind === 9 /* StringLiteral */) { + start += 1; + end -= 1; + } + return ts.createTextSpanFromBounds(start, end); + } + /** A node is considered a writeAccess iff it is a name of a declaration or a target of an assignment */ + function isWriteAccess(node) { + if (node.kind === 71 /* Identifier */ && ts.isDeclarationName(node)) { + return true; + } + var parent = node.parent; + if (parent) { + if (parent.kind === 193 /* PostfixUnaryExpression */ || parent.kind === 192 /* PrefixUnaryExpression */) { + return true; + } + else if (parent.kind === 194 /* BinaryExpression */ && parent.left === node) { + var operator = parent.operatorToken.kind; + return 58 /* FirstAssignment */ <= operator && operator <= 70 /* LastAssignment */; + } + } + return false; + } + })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {})); +})(ts || (ts = {})); +/** Encapsulates the core find-all-references algorithm. */ +/* @internal */ +(function (ts) { + var FindAllReferences; + (function (FindAllReferences) { + var Core; + (function (Core) { + /** Core find-all-references algorithm. Handles special cases before delegating to `getReferencedSymbolsForSymbol`. */ + function getReferencedSymbolsForNode(node, sourceFiles, checker, cancellationToken, options) { + if (options === void 0) { options = {}; } + if (node.kind === 265 /* SourceFile */) { + return undefined; + } + if (!options.implementations) { + var special = getReferencedSymbolsSpecial(node, sourceFiles, cancellationToken); + if (special) { + return special; + } + } + var symbol = checker.getSymbolAtLocation(node); + // Could not find a symbol e.g. unknown identifier + if (!symbol) { + // String literal might be a property (and thus have a symbol), so do this here rather than in getReferencedSymbolsSpecial. + if (!options.implementations && node.kind === 9 /* StringLiteral */) { + return getReferencesForStringLiteral(node, sourceFiles, cancellationToken); + } + // Can't have references to something that we have no symbol for. + return undefined; + } + // The symbol was an internal symbol and does not have a declaration e.g. undefined symbol + if (!symbol.declarations || !symbol.declarations.length) { + return undefined; + } + return getReferencedSymbolsForSymbol(symbol, node, sourceFiles, checker, cancellationToken, options); + } + Core.getReferencedSymbolsForNode = getReferencedSymbolsForNode; + /** getReferencedSymbols for special node kinds. */ + function getReferencedSymbolsSpecial(node, sourceFiles, cancellationToken) { + if (ts.isTypeKeyword(node.kind)) { + 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) : undefined; + return labelDefinition && getLabelReferencesInNode(labelDefinition.parent, labelDefinition); } else { // it is a label definition and not a target, search within the parent labeledStatement @@ -69839,129 +75432,164 @@ var ts; } } if (ts.isThis(node)) { - return getReferencesForThisKeyword(node, sourceFiles); + return getReferencesForThisKeyword(node, sourceFiles, cancellationToken); } - if (node.kind === 96 /* SuperKeyword */) { + if (node.kind === 97 /* SuperKeyword */) { return getReferencesForSuperKeyword(node); } - } - // `getSymbolAtLocation` normally returns the symbol of the class when given the constructor keyword, - // so we have to specify that we want the constructor symbol. - var symbol = typeChecker.getSymbolAtLocation(node); - if (!implementations && !symbol && node.kind === 9 /* StringLiteral */) { - return getReferencesForStringLiteral(node, sourceFiles); - } - // Could not find a symbol e.g. unknown identifier - if (!symbol) { - // Can't have references to something that we have no symbol for. return undefined; } - var declarations = symbol.declarations; - // The symbol was an internal symbol and does not have a declaration e.g. undefined symbol - if (!declarations || !declarations.length) { - return undefined; + /** Core find-all-references algorithm for a normal symbol. */ + function getReferencedSymbolsForSymbol(symbol, node, sourceFiles, checker, cancellationToken, options) { + symbol = skipPastExportOrImportSpecifier(symbol, node, checker); + // Compute the meaning from the location and the symbol it references + var searchMeaning = getIntersectingMeaningFromDeclarations(ts.getMeaningFromLocation(node), symbol.declarations); + var result = []; + var state = createState(sourceFiles, node, checker, cancellationToken, searchMeaning, options, result); + var search = state.createSearch(node, symbol, /*comingFrom*/ undefined, { allSearchSymbols: populateSearchSymbolSet(symbol, node, checker, options.implementations) }); + // Try to get the smallest valid scope that we can limit our search to; + // otherwise we'll need to search globally (i.e. include each file). + var scope = getSymbolScope(symbol); + if (scope) { + getReferencesInContainer(scope, scope.getSourceFile(), search, state); + } + else { + // Global search + for (var _i = 0, _a = state.sourceFiles; _i < _a.length; _i++) { + var sourceFile = _a[_i]; + state.cancellationToken.throwIfCancellationRequested(); + searchForName(sourceFile, search, state); + } + } + return result; } - var result; - // Compute the meaning from the location and the symbol it references - var searchMeaning = getIntersectingMeaningFromDeclarations(ts.getMeaningFromLocation(node), declarations); - // Get the text to search for. - // Note: if this is an external module symbol, the name doesn't include quotes. - var declaredName = ts.stripQuotes(ts.getDeclaredName(typeChecker, symbol, node)); - // Try to get the smallest valid scope that we can limit our search to; - // otherwise we'll need to search globally (i.e. include each file). - var scope = getSymbolScope(symbol); - // Maps from a symbol ID to the ReferencedSymbol entry in 'result'. - var symbolToIndex = []; - if (scope) { - result = []; - getReferencesInNode(scope, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex); + /** Handle a few special cases relating to export/import specifiers. */ + function skipPastExportOrImportSpecifier(symbol, node, checker) { + var parent = node.parent; + if (ts.isExportSpecifier(parent)) { + return getLocalSymbolForExportSpecifier(node, symbol, parent, checker); + } + if (ts.isImportSpecifier(parent) && parent.propertyName === node) { + // We're at `foo` in `import { foo as bar }`. Probably intended to find all refs on the original, not just on the import. + return checker.getImmediateAliasedSymbol(symbol); + } + return symbol; } - else { - var internedName = getInternedName(symbol, node); - for (var _i = 0, sourceFiles_8 = sourceFiles; _i < sourceFiles_8.length; _i++) { - var sourceFile = sourceFiles_8[_i]; - cancellationToken.throwIfCancellationRequested(); - var nameTable = ts.getNameTable(sourceFile); - if (nameTable[internedName] !== undefined) { - result = result || []; - getReferencesInNode(sourceFile, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex); + function createState(sourceFiles, originalLocation, checker, cancellationToken, searchMeaning, options, result) { + var symbolIdToReferences = []; + var inheritsFromCache = ts.createMap(); + // Source file ID → symbol ID → Whether the symbol has been searched for in the source file. + var sourceFileToSeenSymbols = []; + var isForConstructor = originalLocation.kind === 123 /* ConstructorKeyword */; + var importTracker; + return __assign({}, options, { sourceFiles: sourceFiles, isForConstructor: isForConstructor, checker: checker, cancellationToken: cancellationToken, searchMeaning: searchMeaning, inheritsFromCache: inheritsFromCache, getImportSearches: getImportSearches, createSearch: createSearch, referenceAdder: referenceAdder, addStringOrCommentReference: addStringOrCommentReference, + markSearchedSymbol: markSearchedSymbol, markSeenContainingTypeReference: ts.nodeSeenTracker(), markSeenReExportRHS: ts.nodeSeenTracker() }); + function getImportSearches(exportSymbol, exportInfo) { + if (!importTracker) + importTracker = FindAllReferences.createImportTracker(sourceFiles, checker, cancellationToken); + return importTracker(exportSymbol, exportInfo, options.isForRename); + } + function createSearch(location, symbol, comingFrom, searchOptions) { + if (searchOptions === void 0) { searchOptions = {}; } + // Note: if this is an external module symbol, the name doesn't include quotes. + var _a = searchOptions.text, text = _a === void 0 ? ts.stripQuotes(ts.getDeclaredName(checker, symbol, location)) : _a, _b = searchOptions.allSearchSymbols, allSearchSymbols = _b === void 0 ? undefined : _b; + var escapedText = ts.escapeIdentifier(text); + var parents = options.implementations && getParentSymbolsOfPropertyAccess(location, symbol, checker); + return { location: location, symbol: symbol, comingFrom: comingFrom, text: text, escapedText: escapedText, parents: parents, includes: includes }; + function includes(referenceSymbol) { + return allSearchSymbols ? ts.contains(allSearchSymbols, referenceSymbol) : referenceSymbol === symbol; + } + } + function referenceAdder(referenceSymbol, searchLocation) { + var symbolId = ts.getSymbolId(referenceSymbol); + var references = symbolIdToReferences[symbolId]; + if (!references) { + references = symbolIdToReferences[symbolId] = []; + result.push({ definition: { type: "symbol", symbol: referenceSymbol, node: searchLocation }, references: references }); + } + return function (node) { return references.push(FindAllReferences.nodeEntry(node)); }; + } + function addStringOrCommentReference(fileName, textSpan) { + result.push({ + definition: undefined, + references: [{ type: "span", fileName: fileName, textSpan: textSpan }] + }); + } + function markSearchedSymbol(sourceFile, symbol) { + var sourceId = ts.getNodeId(sourceFile); + var symbolId = ts.getSymbolId(symbol); + var seenSymbols = sourceFileToSeenSymbols[sourceId] || (sourceFileToSeenSymbols[sourceId] = []); + return !seenSymbols[symbolId] && (seenSymbols[symbolId] = true); + } + } + /** Search for all imports of a given exported symbol using `State.getImportSearches`. */ + function searchForImportsOfExport(exportLocation, exportSymbol, exportInfo, state) { + 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); + for (var _i = 0, singleReferences_1 = singleReferences; _i < singleReferences_1.length; _i++) { + var singleRef = singleReferences_1[_i]; + addRef(singleRef); + } + } + // For each import, find all references to that import in its source file. + for (var _b = 0, importSearches_1 = importSearches; _b < importSearches_1.length; _b++) { + var _c = importSearches_1[_b], importLocation = _c[0], importSymbol = _c[1]; + getReferencesInSourceFile(importLocation.getSourceFile(), state.createSearch(importLocation, importSymbol, 1 /* Export */), state); + } + if (indirectUsers.length) { + var indirectSearch = void 0; + switch (exportInfo.exportKind) { + case 0 /* Named */: + indirectSearch = state.createSearch(exportLocation, exportSymbol, 1 /* Export */); + break; + case 1 /* Default */: + // Search for a property access to '.default'. This can't be renamed. + indirectSearch = state.isForRename ? undefined : state.createSearch(exportLocation, exportSymbol, 1 /* Export */, { text: "default" }); + break; + case 2 /* ExportEquals */: + break; + } + if (indirectSearch) { + for (var _d = 0, indirectUsers_1 = indirectUsers; _d < indirectUsers_1.length; _d++) { + var indirectUser = indirectUsers_1[_d]; + searchForName(indirectUser, indirectSearch, state); + } } } } - return result; - function getDefinition(symbol) { - var info = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, node.getSourceFile(), ts.getContainerNode(node), node); - var name = ts.map(info.displayParts, function (p) { return p.text; }).join(""); - var declarations = symbol.declarations; - if (!declarations || declarations.length === 0) { - return undefined; + // Go to the symbol we imported from and find references for it. + 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); } - return { - containerKind: "", - containerName: "", - name: name, - kind: info.symbolKind, - fileName: declarations[0].getSourceFile().fileName, - textSpan: ts.createTextSpan(declarations[0].getStart(), 0), - displayParts: info.displayParts - }; } - function getAliasSymbolForPropertyNameSymbol(symbol, location) { - if (symbol.flags & 8388608 /* Alias */) { - // Default import get alias - var defaultImport = ts.getDeclarationOfKind(symbol, 236 /* ImportClause */); - if (defaultImport) { - return typeChecker.getAliasedSymbol(symbol); - } - var importOrExportSpecifier = ts.forEach(symbol.declarations, function (declaration) { return (declaration.kind === 239 /* ImportSpecifier */ || - declaration.kind === 243 /* ExportSpecifier */) ? declaration : undefined; }); - if (importOrExportSpecifier && - // export { a } - (!importOrExportSpecifier.propertyName || - // export {a as class } where a is location - importOrExportSpecifier.propertyName === location)) { - // If Import specifier -> get alias - // else Export specifier -> get local target - return importOrExportSpecifier.kind === 239 /* ImportSpecifier */ ? - typeChecker.getAliasedSymbol(symbol) : - typeChecker.getExportSpecifierLocalTargetSymbol(importOrExportSpecifier); - } + /** Search for all occurences of an identifier in a source file (and filter out the ones that match). */ + function searchForName(sourceFile, search, state) { + if (ts.getNameTable(sourceFile).get(search.escapedText) !== undefined) { + getReferencesInSourceFile(sourceFile, search, state); } - return undefined; } - function followAliasIfNecessary(symbol, location) { - return getAliasSymbolForPropertyNameSymbol(symbol, location) || symbol; - } - function getPropertySymbolOfDestructuringAssignment(location) { + function getPropertySymbolOfDestructuringAssignment(location, checker) { return ts.isArrayLiteralOrObjectLiteralDestructuringPattern(location.parent.parent) && - typeChecker.getPropertySymbolOfDestructuringAssignment(location); + checker.getPropertySymbolOfDestructuringAssignment(location); } function isObjectBindingPatternElementWithoutPropertyName(symbol) { - var bindingElement = ts.getDeclarationOfKind(symbol, 174 /* BindingElement */); + var bindingElement = ts.getDeclarationOfKind(symbol, 176 /* BindingElement */); return bindingElement && - bindingElement.parent.kind === 172 /* ObjectBindingPattern */ && + bindingElement.parent.kind === 174 /* ObjectBindingPattern */ && !bindingElement.propertyName; } - function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol) { + function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker) { if (isObjectBindingPatternElementWithoutPropertyName(symbol)) { - var bindingElement = ts.getDeclarationOfKind(symbol, 174 /* BindingElement */); - var typeOfPattern = typeChecker.getTypeAtLocation(bindingElement.parent); - return typeOfPattern && typeChecker.getPropertyOfType(typeOfPattern, bindingElement.name.text); + var bindingElement = ts.getDeclarationOfKind(symbol, 176 /* BindingElement */); + var typeOfPattern = checker.getTypeAtLocation(bindingElement.parent); + return typeOfPattern && checker.getPropertyOfType(typeOfPattern, bindingElement.name.text); } return undefined; } - function getInternedName(symbol, location) { - // If this is an export or import specifier it could have been renamed using the 'as' syntax. - // If so we want to search for whatever under the cursor. - if (ts.isImportOrExportSpecifierName(location)) { - return location.getText(); - } - // Try to get the local symbol if we're dealing with an 'export default' - // since that symbol has the "true" name. - var localExportDefaultSymbol = ts.getLocalSymbolForExportDefault(symbol); - symbol = localExportDefaultSymbol || symbol; - return ts.stripQuotes(symbol.name); - } /** * Determines the smallest scope in which a symbol may have named references. * Note that not every construct has been accounted for. This function can @@ -69973,55 +75601,57 @@ var ts; function getSymbolScope(symbol) { // If this is the symbol of a named function expression or named class expression, // then named references are limited to its own scope. - var valueDeclaration = symbol.valueDeclaration; - if (valueDeclaration && (valueDeclaration.kind === 184 /* FunctionExpression */ || valueDeclaration.kind === 197 /* ClassExpression */)) { + var declarations = symbol.declarations, flags = symbol.flags, parent = symbol.parent, valueDeclaration = symbol.valueDeclaration; + if (valueDeclaration && (valueDeclaration.kind === 186 /* FunctionExpression */ || valueDeclaration.kind === 199 /* ClassExpression */)) { return valueDeclaration; } - // If this is private property or method, the scope is the containing class - if (symbol.flags & (4 /* Property */ | 8192 /* Method */)) { - var privateDeclaration = ts.forEach(symbol.getDeclarations(), function (d) { return (ts.getModifierFlags(d) & 8 /* Private */) ? d : undefined; }); - if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 226 /* ClassDeclaration */); - } - } - // If the symbol is an import we would like to find it if we are looking for what it imports. - // So consider it visible outside its declaration scope. - if (symbol.flags & 8388608 /* Alias */) { + if (!declarations) { return undefined; } + // If this is private property or method, the scope is the containing class + if (flags & (4 /* Property */ | 8192 /* Method */)) { + var privateDeclaration = ts.find(declarations, function (d) { return !!(ts.getModifierFlags(d) & 8 /* Private */); }); + if (privateDeclaration) { + return ts.getAncestor(privateDeclaration, 229 /* ClassDeclaration */); + } + } // If symbol is of object binding pattern element without property name we would want to // look for property too and that could be anywhere if (isObjectBindingPatternElementWithoutPropertyName(symbol)) { return undefined; } - // if this symbol is visible from its parent container, e.g. exported, then bail out - // if symbol correspond to the union property - bail out - if (symbol.parent || (symbol.flags & 268435456 /* SyntheticProperty */)) { + // If the symbol has a parent, it's globally visible. + // Unless that parent is an external module, then we should only search in the module (and recurse on the export later). + // But if the parent is a module that has `export as namespace`, then the symbol *is* globally visible. + if (parent && !((parent.flags & 1536 /* Module */) && ts.isExternalModuleSymbol(parent) && !parent.globalExports)) { + return undefined; + } + // If this is a synthetic property, it's a property and must be searched for globally. + if ((flags & 134217728 /* Transient */ && symbol.checkFlags & 6 /* Synthetic */)) { return undefined; } var scope; - var declarations = symbol.getDeclarations(); - if (declarations) { - for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) { - var declaration = declarations_7[_i]; - var container = ts.getContainerNode(declaration); - if (!container) { - return undefined; - } - if (scope && scope !== container) { - // Different declarations have different containers, bail out - return undefined; - } - if (container.kind === 261 /* SourceFile */ && !ts.isExternalModule(container)) { - // This is a global variable and not an external module, any declaration defined - // within this scope is visible outside the file - return undefined; - } - // The search scope is the container node - scope = container; + for (var _i = 0, declarations_10 = declarations; _i < declarations_10.length; _i++) { + var declaration = declarations_10[_i]; + var container = ts.getContainerNode(declaration); + if (scope && scope !== container) { + // Different declarations have different containers, bail out + return undefined; } + if (!container || container.kind === 265 /* 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; + } + // The search scope is the container node + scope = container; } - return scope; + // If symbol.parent, this means we are in an export of an external module. (Otherwise we would have returned `undefined` above.) + // For an export of a module, we may be in a declaration file, and it may be accessed elsewhere. E.g.: + // declare module "a" { export type T = number; } + // declare module "b" { import { T } from "a"; export const x: T; } + // 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 parent ? scope.getSourceFile() : scope; } function getPossibleSymbolReferencePositions(sourceFile, symbolName, start, end) { var positions = []; @@ -70036,7 +75666,6 @@ var ts; var symbolNameLength = symbolName.length; var position = text.indexOf(symbolName, start); while (position >= 0) { - cancellationToken.throwIfCancellationRequested(); // If we are past the end, stop looking if (position > end) break; @@ -70057,279 +75686,320 @@ var ts; var sourceFile = container.getSourceFile(); var labelName = targetLabel.text; var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, labelName, container.getStart(), container.getEnd()); - ts.forEach(possiblePositions, function (position) { - cancellationToken.throwIfCancellationRequested(); + for (var _i = 0, possiblePositions_1 = possiblePositions; _i < possiblePositions_1.length; _i++) { + var position = possiblePositions_1[_i]; var node = ts.getTouchingWord(sourceFile, position); if (!node || node.getWidth() !== labelName.length) { - return; + continue; } // Only pick labels that are either the target label, or have a target that is the target label if (node === targetLabel || (ts.isJumpStatementTarget(node) && ts.getTargetLabel(node, labelName) === targetLabel)) { - references.push(getReferenceEntryFromNode(node)); + references.push(FindAllReferences.nodeEntry(node)); } - }); - var definition = { - containerKind: "", - containerName: "", - fileName: targetLabel.getSourceFile().fileName, - kind: ts.ScriptElementKind.label, - name: labelName, - textSpan: ts.createTextSpanFromBounds(targetLabel.getStart(), targetLabel.getEnd()), - displayParts: [ts.displayPart(labelName, ts.SymbolDisplayPartKind.text)] - }; - return [{ definition: definition, references: references }]; + } + return [{ definition: { type: "label", node: targetLabel }, references: references }]; } function isValidReferencePosition(node, searchSymbolName) { - if (node) { - // Compare the length so we filter out strict superstrings of the symbol we are looking for - switch (node.kind) { - case 70 /* Identifier */: - return node.getWidth() === searchSymbolName.length; - case 9 /* StringLiteral */: - if (ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || - isNameOfExternalModuleImportOrDeclaration(node)) { - // For string literals we have two additional chars for the quotes - return node.getWidth() === searchSymbolName.length + 2; - } - break; - case 8 /* NumericLiteral */: - if (ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node)) { - return node.getWidth() === searchSymbolName.length; - } - break; - } + // Compare the length so we filter out strict superstrings of the symbol we are looking for + switch (node && node.kind) { + case 71 /* Identifier */: + return node.getWidth() === searchSymbolName.length; + case 9 /* StringLiteral */: + return (ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) && + // For string literals we have two additional chars for the quotes + node.getWidth() === searchSymbolName.length + 2; + case 8 /* NumericLiteral */: + return ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node) && node.getWidth() === searchSymbolName.length; + default: + return false; } - return false; } - /** Search within node "container" for references for a search value, where the search value is defined as a - * tuple of(searchSymbol, searchText, searchLocation, and searchMeaning). - * searchLocation: a node where the search value - */ - function getReferencesInNode(container, searchSymbol, searchText, searchLocation, searchMeaning, findInStrings, findInComments, result, symbolToIndex) { - var sourceFile = container.getSourceFile(); - var start = findInComments ? container.getFullStart() : container.getStart(); - var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, searchText, start, container.getEnd()); - var parents = getParentSymbolsOfPropertyAccess(); - var inheritsFromCache = ts.createMap(); - if (possiblePositions.length) { - // Build the set of symbols to search for, initially it has only the current symbol - var searchSymbols_1 = populateSearchSymbolSet(searchSymbol, searchLocation); - ts.forEach(possiblePositions, function (position) { - cancellationToken.throwIfCancellationRequested(); - var referenceLocation = ts.getTouchingPropertyName(sourceFile, position); - if (!isValidReferencePosition(referenceLocation, searchText)) { - // This wasn't the start of a token. Check to see if it might be a - // match in a comment or string if that's what the caller is asking - // for. - if (!implementations && ((findInStrings && ts.isInString(sourceFile, position)) || - (findInComments && ts.isInNonReferenceComment(sourceFile, position)))) { - // In the case where we're looking inside comments/strings, we don't have - // an actual definition. So just use 'undefined' here. Features like - // 'Rename' won't care (as they ignore the definitions), and features like - // 'FindReferences' will just filter out these results. - result.push({ - definition: undefined, - references: [{ - fileName: sourceFile.fileName, - textSpan: ts.createTextSpan(position, searchText.length), - isWriteAccess: false, - isDefinition: false - }] - }); - } - return; - } - if (!(ts.getMeaningFromLocation(referenceLocation) & searchMeaning)) { - return; - } - var referenceSymbol = typeChecker.getSymbolAtLocation(referenceLocation); - if (referenceSymbol) { - var referenceSymbolDeclaration = referenceSymbol.valueDeclaration; - var shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(referenceSymbolDeclaration); - var relatedSymbol = getRelatedSymbol(searchSymbols_1, referenceSymbol, referenceLocation, - /*searchLocationIsConstructor*/ searchLocation.kind === 122 /* ConstructorKeyword */, parents, inheritsFromCache); - if (relatedSymbol) { - addReferenceToRelatedSymbol(referenceLocation, relatedSymbol); - } - else if (!(referenceSymbol.flags & 67108864 /* Transient */) && searchSymbols_1.indexOf(shorthandValueSymbol) >= 0) { - addReferenceToRelatedSymbol(referenceSymbolDeclaration.name, shorthandValueSymbol); - } - else if (searchLocation.kind === 122 /* ConstructorKeyword */) { - findAdditionalConstructorReferences(referenceSymbol, referenceLocation); - } - } - }); + function getAllReferencesForKeyword(sourceFiles, keywordKind, cancellationToken) { + var references = []; + for (var _i = 0, sourceFiles_5 = sourceFiles; _i < sourceFiles_5.length; _i++) { + var sourceFile = sourceFiles_5[_i]; + cancellationToken.throwIfCancellationRequested(); + addReferencesForKeywordInFile(sourceFile, keywordKind, ts.tokenToString(keywordKind), references); } - return; - /* If we are just looking for implementations and this is a property access expression, we need to get the - * symbol of the local type of the symbol the property is being accessed on. This is because our search - * symbol may have a different parent symbol if the local type's symbol does not declare the property - * being accessed (i.e. it is declared in some parent class or interface) + 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.getStart(), sourceFile.getEnd()); + for (var _i = 0, possiblePositions_2 = possiblePositions; _i < possiblePositions_2.length; _i++) { + var position = possiblePositions_2[_i]; + var referenceLocation = ts.getTouchingPropertyName(sourceFile, position); + if (referenceLocation.kind === kind) { + references.push(FindAllReferences.nodeEntry(referenceLocation)); + } + } + } + function getReferencesInSourceFile(sourceFile, search, state) { + state.cancellationToken.throwIfCancellationRequested(); + return getReferencesInContainer(sourceFile, sourceFile, search, state); + } + /** + * Search within node "container" for references for a search value, where the search value is defined as a + * tuple of(searchSymbol, searchText, searchLocation, and searchMeaning). + * searchLocation: a node where the search value + */ + function getReferencesInContainer(container, sourceFile, search, state) { + if (!state.markSearchedSymbol(sourceFile, search.symbol)) { + return; + } + var start = state.findInComments ? container.getFullStart() : container.getStart(); + var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, search.text, start, container.getEnd()); + for (var _i = 0, possiblePositions_3 = possiblePositions; _i < possiblePositions_3.length; _i++) { + var position = possiblePositions_3[_i]; + getReferencesAtLocation(sourceFile, position, search, state); + } + } + function getReferencesAtLocation(sourceFile, position, search, state) { + var referenceLocation = ts.getTouchingPropertyName(sourceFile, position); + if (!isValidReferencePosition(referenceLocation, search.text)) { + // This wasn't the start of a token. Check to see if it might be a + // match in a comment or string if that's what the caller is asking + // for. + if (!state.implementations && (state.findInStrings && ts.isInString(sourceFile, position) || state.findInComments && ts.isInNonReferenceComment(sourceFile, position))) { + // In the case where we're looking inside comments/strings, we don't have + // an actual definition. So just use 'undefined' here. Features like + // 'Rename' won't care (as they ignore the definitions), and features like + // 'FindReferences' will just filter out these results. + state.addStringOrCommentReference(sourceFile.fileName, ts.createTextSpan(position, search.text.length)); + } + return; + } + if (!(ts.getMeaningFromLocation(referenceLocation) & state.searchMeaning)) { + return; + } + var referenceSymbol = state.checker.getSymbolAtLocation(referenceLocation); + if (!referenceSymbol) { + return; + } + var parent = referenceLocation.parent; + if (ts.isImportSpecifier(parent) && parent.propertyName === referenceLocation) { + // This is added through `singleReferences` in ImportsResult. If we happen to see it again, don't add it again. + return; + } + if (ts.isExportSpecifier(parent)) { + ts.Debug.assert(referenceLocation.kind === 71 /* Identifier */); + getReferencesAtExportSpecifier(referenceLocation, referenceSymbol, parent, search, state); + return; + } + var relatedSymbol = getRelatedSymbol(search, referenceSymbol, referenceLocation, state); + if (!relatedSymbol) { + getReferenceForShorthandProperty(referenceSymbol, search, state); + return; + } + if (state.isForConstructor) { + findConstructorReferences(referenceLocation, sourceFile, search, state); + } + else { + addReference(referenceLocation, relatedSymbol, search.location, state); + } + getImportOrExportReferences(referenceLocation, referenceSymbol, search, state); + } + function getReferencesAtExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, search, state) { + var parent = exportSpecifier.parent, propertyName = exportSpecifier.propertyName, name = exportSpecifier.name; + var exportDeclaration = parent.parent; + var localSymbol = getLocalSymbolForExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, state.checker); + if (!search.includes(localSymbol)) { + return; + } + if (!propertyName) { + addRef(); + } + else if (referenceLocation === propertyName) { + // For `export { foo as bar } from "baz"`, "`foo`" will be added from the singleReferences for import searches of the original export. + // For `export { foo as bar };`, where `foo` is a local, so add it now. + if (!exportDeclaration.moduleSpecifier) { + addRef(); + } + if (!state.isForRename && state.markSeenReExportRHS(name)) { + addReference(name, referenceSymbol, name, state); + } + } + else { + if (state.markSeenReExportRHS(referenceLocation)) { + addRef(); + } + } + // For `export { foo as bar }`, rename `foo`, but not `bar`. + if (!(referenceLocation === propertyName && state.isForRename)) { + var exportKind = referenceLocation.originalKeywordKind === 79 /* DefaultKeyword */ ? 1 /* Default */ : 0 /* Named */; + var exportInfo = FindAllReferences.getExportInfo(referenceSymbol, exportKind, state.checker); + ts.Debug.assert(!!exportInfo); + searchForImportsOfExport(referenceLocation, referenceSymbol, exportInfo, state); + } + // 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); + } + function addRef() { + addReference(referenceLocation, localSymbol, search.location, state); + } + } + function getLocalSymbolForExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, checker) { + return isExportSpecifierAlias(referenceLocation, exportSpecifier) ? checker.getExportSpecifierLocalTargetSymbol(exportSpecifier) : referenceSymbol; + } + function isExportSpecifierAlias(referenceLocation, exportSpecifier) { + var parent = exportSpecifier.parent, propertyName = exportSpecifier.propertyName, name = exportSpecifier.name; + ts.Debug.assert(propertyName === referenceLocation || name === referenceLocation); + if (propertyName) { + // Given `export { foo as bar } [from "someModule"]`: It's an alias at `foo`, but at `bar` it's a new symbol. + return propertyName === referenceLocation; + } + else { + // `export { foo } from "foo"` is a re-export. + // `export { foo };` is not a re-export, it creates an alias for the local variable `foo`. + return !parent.parent.moduleSpecifier; + } + } + function getImportOrExportReferences(referenceLocation, referenceSymbol, search, state) { + var importOrExport = FindAllReferences.getImportOrExportSymbol(referenceLocation, referenceSymbol, state.checker, search.comingFrom === 1 /* Export */); + if (!importOrExport) + return; + var symbol = importOrExport.symbol; + if (importOrExport.kind === 0 /* Import */) { + if (!state.isForRename || importOrExport.isNamedImport) { + searchForImportedSymbol(symbol, state); + } + } + else { + // We don't check for `state.isForRename`, even for default exports, because importers that previously matched the export name should be updated to continue matching. + searchForImportsOfExport(referenceLocation, symbol, importOrExport.exportInfo, state); + } + } + function getReferenceForShorthandProperty(_a, search, state) { + var flags = _a.flags, valueDeclaration = _a.valueDeclaration; + var shorthandValueSymbol = state.checker.getShorthandAssignmentValueSymbol(valueDeclaration); + /* + * Because in short-hand property assignment, an identifier which stored as name of the short-hand property assignment + * has two meanings: property name and property value. Therefore when we do findAllReference at the position where + * an identifier is declared, the language service should return the position of the variable declaration as well as + * the position in short-hand property assignment excluding property accessing. However, if we do findAllReference at the + * position of property accessing, the referenceEntry of such position will be handled in the first case. */ - function getParentSymbolsOfPropertyAccess() { - if (implementations) { - var propertyAccessExpression = getPropertyAccessExpressionFromRightHandSide(searchLocation); - if (propertyAccessExpression) { - var localParentType = typeChecker.getTypeAtLocation(propertyAccessExpression.expression); - if (localParentType) { - if (localParentType.symbol && localParentType.symbol.flags & (32 /* Class */ | 64 /* Interface */) && localParentType.symbol !== searchSymbol.parent) { - return [localParentType.symbol]; - } - else if (localParentType.flags & 196608 /* UnionOrIntersection */) { - return getSymbolsForClassAndInterfaceComponents(localParentType); - } - } - } + if (!(flags & 134217728 /* Transient */) && search.includes(shorthandValueSymbol)) { + addReference(ts.getNameOfDeclaration(valueDeclaration), shorthandValueSymbol, search.location, state); + } + } + function addReference(referenceLocation, relatedSymbol, searchLocation, state) { + var addRef = state.referenceAdder(relatedSymbol, searchLocation); + if (state.implementations) { + addImplementationReferences(referenceLocation, addRef, state); + } + else { + addRef(referenceLocation); + } + } + /** Adds references when a constructor is used with `new this()` in its own class and `super()` calls in subclasses. */ + function findConstructorReferences(referenceLocation, sourceFile, search, state) { + if (ts.isNewExpressionTarget(referenceLocation)) { + addReference(referenceLocation, search.symbol, search.location, state); + } + var pusher = state.referenceAdder(search.symbol, search.location); + if (ts.isClassLike(referenceLocation.parent)) { + ts.Debug.assert(referenceLocation.parent.name === referenceLocation); + // This is the class declaration containing the constructor. + findOwnConstructorReferences(search.symbol, sourceFile, pusher); + } + else { + // If this class appears in `extends C`, then the extending class' "super" calls are references. + var classExtending = tryGetClassByExtendingIdentifier(referenceLocation); + if (classExtending && ts.isClassLike(classExtending)) { + findSuperConstructorAccesses(classExtending, pusher); } } - function getPropertyAccessExpressionFromRightHandSide(node) { - return ts.isRightSideOfPropertyAccess(node) && node.parent; + } + function getPropertyAccessExpressionFromRightHandSide(node) { + return ts.isRightSideOfPropertyAccess(node) && node.parent; + } + /** + * `classSymbol` is the class where the constructor was defined. + * Reference the constructor and all calls to `new this()`. + */ + function findOwnConstructorReferences(classSymbol, sourceFile, addNode) { + for (var _i = 0, _a = classSymbol.members.get("__constructor").declarations; _i < _a.length; _i++) { + var decl = _a[_i]; + var ctrKeyword = ts.findChildOfKind(decl, 123 /* ConstructorKeyword */, sourceFile); + ts.Debug.assert(decl.kind === 152 /* Constructor */ && !!ctrKeyword); + addNode(ctrKeyword); } - /** Adds references when a constructor is used with `new this()` in its own class and `super()` calls in subclasses. */ - function findAdditionalConstructorReferences(referenceSymbol, referenceLocation) { - ts.Debug.assert(ts.isClassLike(searchSymbol.valueDeclaration)); - var referenceClass = referenceLocation.parent; - if (referenceSymbol === searchSymbol && ts.isClassLike(referenceClass)) { - ts.Debug.assert(referenceClass.name === referenceLocation); - // This is the class declaration containing the constructor. - addReferences(findOwnConstructorCalls(searchSymbol)); - } - else { - // If this class appears in `extends C`, then the extending class' "super" calls are references. - var classExtending = tryGetClassByExtendingIdentifier(referenceLocation); - if (classExtending && ts.isClassLike(classExtending) && followAliasIfNecessary(referenceSymbol, referenceLocation) === searchSymbol) { - addReferences(superConstructorAccesses(classExtending)); - } - } - } - function addReferences(references) { - if (references.length) { - var referencedSymbol = getReferencedSymbol(searchSymbol); - ts.addRange(referencedSymbol.references, ts.map(references, getReferenceEntryFromNode)); - } - } - /** `classSymbol` is the class where the constructor was defined. - * Reference the constructor and all calls to `new this()`. - */ - function findOwnConstructorCalls(classSymbol) { - var result = []; - for (var _i = 0, _a = classSymbol.members["__constructor"].declarations; _i < _a.length; _i++) { - var decl = _a[_i]; - ts.Debug.assert(decl.kind === 150 /* Constructor */); - var ctrKeyword = decl.getChildAt(0); - ts.Debug.assert(ctrKeyword.kind === 122 /* ConstructorKeyword */); - result.push(ctrKeyword); - } - ts.forEachProperty(classSymbol.exports, function (member) { - var decl = member.valueDeclaration; - if (decl && decl.kind === 149 /* MethodDeclaration */) { - var body = decl.body; - if (body) { - forEachDescendantOfKind(body, 98 /* ThisKeyword */, function (thisKeyword) { - if (ts.isNewExpressionTarget(thisKeyword)) { - result.push(thisKeyword); - } - }); - } - } - }); - return result; - } - /** Find references to `super` in the constructor of an extending class. */ - function superConstructorAccesses(cls) { - var symbol = cls.symbol; - var ctr = symbol.members["__constructor"]; - if (!ctr) { - return []; - } - var result = []; - for (var _i = 0, _a = ctr.declarations; _i < _a.length; _i++) { - var decl = _a[_i]; - ts.Debug.assert(decl.kind === 150 /* Constructor */); + classSymbol.exports.forEach(function (member) { + var decl = member.valueDeclaration; + if (decl && decl.kind === 151 /* MethodDeclaration */) { var body = decl.body; if (body) { - forEachDescendantOfKind(body, 96 /* SuperKeyword */, function (node) { - if (ts.isCallExpressionTarget(node)) { - result.push(node); + forEachDescendantOfKind(body, 99 /* ThisKeyword */, function (thisKeyword) { + if (ts.isNewExpressionTarget(thisKeyword)) { + addNode(thisKeyword); } }); } } - ; - return result; + }); + } + /** Find references to `super` in the constructor of an extending class. */ + function findSuperConstructorAccesses(cls, addNode) { + var symbol = cls.symbol; + var ctr = symbol.members.get("__constructor"); + if (!ctr) { + return; } - function getReferencedSymbol(symbol) { - var symbolId = ts.getSymbolId(symbol); - var index = symbolToIndex[symbolId]; - if (index === undefined) { - index = result.length; - symbolToIndex[symbolId] = index; - result.push({ - definition: getDefinition(symbol), - references: [] + for (var _i = 0, _a = ctr.declarations; _i < _a.length; _i++) { + var decl = _a[_i]; + ts.Debug.assert(decl.kind === 152 /* Constructor */); + var body = decl.body; + if (body) { + forEachDescendantOfKind(body, 97 /* SuperKeyword */, function (node) { + if (ts.isCallExpressionTarget(node)) { + addNode(node); + } }); } - return result[index]; - } - function addReferenceToRelatedSymbol(node, relatedSymbol) { - var references = getReferencedSymbol(relatedSymbol).references; - if (implementations) { - getImplementationReferenceEntryForNode(node, references); - } - else { - references.push(getReferenceEntryFromNode(node)); - } } } - function getImplementationReferenceEntryForNode(refNode, result) { + function addImplementationReferences(refNode, addReference, state) { // Check if we found a function/propertyAssignment/method with an implementation or initializer if (ts.isDeclarationName(refNode) && isImplementation(refNode.parent)) { - result.push(getReferenceEntryFromNode(refNode.parent)); + addReference(refNode.parent); + return; } - else if (refNode.kind === 70 /* Identifier */) { - if (refNode.parent.kind === 258 /* ShorthandPropertyAssignment */) { - // Go ahead and dereference the shorthand assignment by going to its definition - getReferenceEntriesForShorthandPropertyAssignment(refNode, typeChecker, result); - } - // Check if the node is within an extends or implements clause - var containingClass = getContainingClassIfInHeritageClause(refNode); - if (containingClass) { - result.push(getReferenceEntryFromNode(containingClass)); - return; - } - // If we got a type reference, try and see if the reference applies to any expressions that can implement an interface - var containingTypeReference = getContainingTypeReference(refNode); - if (containingTypeReference) { - var parent_19 = containingTypeReference.parent; - if (ts.isVariableLike(parent_19) && parent_19.type === containingTypeReference && parent_19.initializer && isImplementationExpression(parent_19.initializer)) { - maybeAdd(getReferenceEntryFromNode(parent_19.initializer)); - } - else if (ts.isFunctionLike(parent_19) && parent_19.type === containingTypeReference && parent_19.body) { - if (parent_19.body.kind === 204 /* Block */) { - ts.forEachReturnStatement(parent_19.body, function (returnStatement) { - if (returnStatement.expression && isImplementationExpression(returnStatement.expression)) { - maybeAdd(getReferenceEntryFromNode(returnStatement.expression)); - } - }); - } - else if (isImplementationExpression(parent_19.body)) { - maybeAdd(getReferenceEntryFromNode(parent_19.body)); - } - } - else if (ts.isAssertionExpression(parent_19) && isImplementationExpression(parent_19.expression)) { - maybeAdd(getReferenceEntryFromNode(parent_19.expression)); - } - } + if (refNode.kind !== 71 /* Identifier */) { + return; } - // Type nodes can contain multiple references to the same type. For example: - // let x: Foo & (Foo & Bar) = ... - // Because we are returning the implementation locations and not the identifier locations, - // duplicate entries would be returned here as each of the type references is part of - // the same implementation. For that reason, check before we add a new entry - function maybeAdd(a) { - if (!ts.forEach(result, function (b) { return a.fileName === b.fileName && a.textSpan.start === b.textSpan.start && a.textSpan.length === b.textSpan.length; })) { - result.push(a); + if (refNode.parent.kind === 262 /* ShorthandPropertyAssignment */) { + // Go ahead and dereference the shorthand assignment by going to its definition + getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference); + } + // Check if the node is within an extends or implements clause + var containingClass = getContainingClassIfInHeritageClause(refNode); + if (containingClass) { + addReference(containingClass); + return; + } + // If we got a type reference, try and see if the reference applies to any expressions that can implement an interface + var containingTypeReference = getContainingTypeReference(refNode); + if (containingTypeReference && state.markSeenContainingTypeReference(containingTypeReference)) { + var parent = containingTypeReference.parent; + if (ts.isVariableLike(parent) && parent.type === containingTypeReference && parent.initializer && isImplementationExpression(parent.initializer)) { + addReference(parent.initializer); + } + else if (ts.isFunctionLike(parent) && parent.type === containingTypeReference && parent.body) { + if (parent.body.kind === 207 /* Block */) { + ts.forEachReturnStatement(parent.body, function (returnStatement) { + if (returnStatement.expression && isImplementationExpression(returnStatement.expression)) { + addReference(returnStatement.expression); + } + }); + } + else if (isImplementationExpression(parent.body)) { + addReference(parent.body); + } + } + else if (ts.isAssertionExpression(parent) && isImplementationExpression(parent.expression)) { + addReference(parent.expression); } } } @@ -70358,12 +76028,12 @@ var ts; } function getContainingClassIfInHeritageClause(node) { if (node && node.parent) { - if (node.kind === 199 /* ExpressionWithTypeArguments */ - && node.parent.kind === 255 /* HeritageClause */ + if (node.kind === 201 /* ExpressionWithTypeArguments */ + && node.parent.kind === 259 /* HeritageClause */ && ts.isClassLike(node.parent.parent)) { return node.parent.parent; } - else if (node.kind === 70 /* Identifier */ || node.kind === 177 /* PropertyAccessExpression */) { + else if (node.kind === 71 /* Identifier */ || node.kind === 179 /* PropertyAccessExpression */) { return getContainingClassIfInHeritageClause(node.parent); } } @@ -70373,15 +76043,18 @@ var ts; * Returns true if this is an expression that can be considered an implementation */ function isImplementationExpression(node) { - // Unwrap parentheses - if (node.kind === 183 /* ParenthesizedExpression */) { - return isImplementationExpression(node.expression); + switch (node.kind) { + case 185 /* ParenthesizedExpression */: + return isImplementationExpression(node.expression); + case 187 /* ArrowFunction */: + case 186 /* FunctionExpression */: + case 178 /* ObjectLiteralExpression */: + case 199 /* ClassExpression */: + case 177 /* ArrayLiteralExpression */: + return true; + default: + return false; } - return node.kind === 185 /* ArrowFunction */ || - node.kind === 184 /* FunctionExpression */ || - node.kind === 176 /* ObjectLiteralExpression */ || - node.kind === 197 /* ClassExpression */ || - node.kind === 175 /* ArrayLiteralExpression */; } /** * Determines if the parent symbol occurs somewhere in the child's ancestry. If the parent symbol @@ -70402,7 +76075,7 @@ var ts; * @param parent Another class or interface Symbol * @param cachedResults A map of symbol id pairs (i.e. "child,parent") to booleans indicating previous results */ - function explicitlyInheritsFrom(child, parent, cachedResults) { + function explicitlyInheritsFrom(child, parent, cachedResults, checker) { var parentIsInterface = parent.getFlags() & 64 /* Interface */; return searchHierarchy(child); function searchHierarchy(symbol) { @@ -70410,11 +76083,12 @@ var ts; return true; } var key = ts.getSymbolId(symbol) + "," + ts.getSymbolId(parent); - if (key in cachedResults) { - return cachedResults[key]; + var cached = cachedResults.get(key); + if (cached !== undefined) { + return cached; } // Set the key so that we don't infinitely recurse - cachedResults[key] = false; + cachedResults.set(key, false); var inherits = ts.forEach(symbol.getDeclarations(), function (declaration) { if (ts.isClassLike(declaration)) { if (parentIsInterface) { @@ -70430,19 +76104,19 @@ var ts; } return searchTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); } - else if (declaration.kind === 227 /* InterfaceDeclaration */) { + else if (declaration.kind === 230 /* InterfaceDeclaration */) { if (parentIsInterface) { return ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), searchTypeReference); } } return false; }); - cachedResults[key] = inherits; + cachedResults.set(key, inherits); return inherits; } function searchTypeReference(typeReference) { if (typeReference) { - var type = typeChecker.getTypeAtLocation(typeReference); + var type = checker.getTypeAtLocation(typeReference); if (type && type.symbol) { return searchHierarchy(type.symbol); } @@ -70458,13 +76132,13 @@ var ts; // Whether 'super' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 149 /* PropertyDeclaration */: + case 148 /* PropertySignature */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: + case 152 /* Constructor */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; @@ -70474,49 +76148,48 @@ var ts; var references = []; var sourceFile = searchSpaceNode.getSourceFile(); var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "super", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); - ts.forEach(possiblePositions, function (position) { - cancellationToken.throwIfCancellationRequested(); + for (var _i = 0, possiblePositions_4 = possiblePositions; _i < possiblePositions_4.length; _i++) { + var position = possiblePositions_4[_i]; var node = ts.getTouchingWord(sourceFile, position); - if (!node || node.kind !== 96 /* SuperKeyword */) { - return; + if (!node || node.kind !== 97 /* SuperKeyword */) { + continue; } 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(getReferenceEntryFromNode(node)); + references.push(FindAllReferences.nodeEntry(node)); } - }); - var definition = getDefinition(searchSpaceNode.symbol); - return [{ definition: definition, references: references }]; + } + return [{ definition: { type: "symbol", symbol: searchSpaceNode.symbol, node: superKeyword }, references: references }]; } - function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles) { + 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 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: if (ts.isObjectLiteralMethod(searchSpaceNode)) { break; } - // fall through - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 150 /* Constructor */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + // falls through + case 149 /* PropertyDeclaration */: + case 148 /* PropertySignature */: + case 152 /* Constructor */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; - case 261 /* SourceFile */: + case 265 /* SourceFile */: if (ts.isExternalModule(searchSpaceNode)) { return undefined; } - // Fall through - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: + // falls through + case 228 /* FunctionDeclaration */: + case 186 /* 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. @@ -70525,8 +76198,9 @@ var ts; } var references = []; var possiblePositions; - if (searchSpaceNode.kind === 261 /* SourceFile */) { + if (searchSpaceNode.kind === 265 /* SourceFile */) { ts.forEach(sourceFiles, function (sourceFile) { + cancellationToken.throwIfCancellationRequested(); possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, references); }); @@ -70536,144 +76210,103 @@ var ts; possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, references); } - var thisOrSuperSymbol = typeChecker.getSymbolAtLocation(thisOrSuperKeyword); - var displayParts = thisOrSuperSymbol && ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, thisOrSuperSymbol, thisOrSuperKeyword.getSourceFile(), ts.getContainerNode(thisOrSuperKeyword), thisOrSuperKeyword).displayParts; return [{ - definition: { - containerKind: "", - containerName: "", - fileName: node.getSourceFile().fileName, - kind: ts.ScriptElementKind.variableElement, - name: "this", - textSpan: ts.createTextSpanFromBounds(node.getStart(), node.getEnd()), - displayParts: displayParts - }, + definition: { type: "this", node: thisOrSuperKeyword }, references: references }]; function getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, result) { ts.forEach(possiblePositions, function (position) { - cancellationToken.throwIfCancellationRequested(); var node = ts.getTouchingWord(sourceFile, position); if (!node || !ts.isThis(node)) { return; } var container = ts.getThisContainer(node, /* includeArrowFunctions */ false); switch (searchSpaceNode.kind) { - case 184 /* FunctionExpression */: - case 225 /* FunctionDeclaration */: + case 186 /* FunctionExpression */: + case 228 /* FunctionDeclaration */: if (searchSpaceNode.symbol === container.symbol) { - result.push(getReferenceEntryFromNode(node)); + result.push(FindAllReferences.nodeEntry(node)); } break; - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: if (ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) { - result.push(getReferenceEntryFromNode(node)); + result.push(FindAllReferences.nodeEntry(node)); } break; - case 197 /* ClassExpression */: - case 226 /* ClassDeclaration */: + case 199 /* ClassExpression */: + case 229 /* 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(getReferenceEntryFromNode(node)); + result.push(FindAllReferences.nodeEntry(node)); } break; - case 261 /* SourceFile */: - if (container.kind === 261 /* SourceFile */ && !ts.isExternalModule(container)) { - result.push(getReferenceEntryFromNode(node)); + case 265 /* SourceFile */: + if (container.kind === 265 /* SourceFile */ && !ts.isExternalModule(container)) { + result.push(FindAllReferences.nodeEntry(node)); } break; } }); } } - function getReferencesForStringLiteral(node, sourceFiles) { - var type = ts.getStringLiteralTypeForNode(node, typeChecker); - if (!type) { - // nothing to do here. moving on - return undefined; - } + function getReferencesForStringLiteral(node, sourceFiles, cancellationToken) { var references = []; - for (var _i = 0, sourceFiles_9 = sourceFiles; _i < sourceFiles_9.length; _i++) { - var sourceFile = sourceFiles_9[_i]; - var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, type.text, sourceFile.getStart(), sourceFile.getEnd()); - getReferencesForStringLiteralInFile(sourceFile, type, possiblePositions, references); + for (var _i = 0, sourceFiles_6 = sourceFiles; _i < sourceFiles_6.length; _i++) { + var sourceFile = sourceFiles_6[_i]; + cancellationToken.throwIfCancellationRequested(); + var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, node.text, sourceFile.getStart(), sourceFile.getEnd()); + getReferencesForStringLiteralInFile(sourceFile, node.text, possiblePositions, references); } return [{ - definition: { - containerKind: "", - containerName: "", - fileName: node.getSourceFile().fileName, - kind: ts.ScriptElementKind.variableElement, - name: type.text, - textSpan: ts.createTextSpanFromBounds(node.getStart(), node.getEnd()), - displayParts: [ts.displayPart(ts.getTextOfNode(node), ts.SymbolDisplayPartKind.stringLiteral)] - }, + definition: { type: "string", node: node }, references: references }]; - function getReferencesForStringLiteralInFile(sourceFile, searchType, possiblePositions, references) { - for (var _i = 0, possiblePositions_1 = possiblePositions; _i < possiblePositions_1.length; _i++) { - var position = possiblePositions_1[_i]; - cancellationToken.throwIfCancellationRequested(); - var node_2 = ts.getTouchingWord(sourceFile, position); - if (!node_2 || node_2.kind !== 9 /* StringLiteral */) { - return; - } - var type_1 = ts.getStringLiteralTypeForNode(node_2, typeChecker); - if (type_1 === searchType) { - references.push(getReferenceEntryFromNode(node_2)); + function getReferencesForStringLiteralInFile(sourceFile, searchText, possiblePositions, references) { + for (var _i = 0, possiblePositions_5 = possiblePositions; _i < possiblePositions_5.length; _i++) { + var position = possiblePositions_5[_i]; + var node_7 = ts.getTouchingWord(sourceFile, position); + if (node_7 && node_7.kind === 9 /* StringLiteral */ && node_7.text === searchText) { + references.push(FindAllReferences.nodeEntry(node_7, /*isInString*/ true)); } } } } - function populateSearchSymbolSet(symbol, location) { + // For certain symbol kinds, we need to include other symbols in the search set. + // This is not needed when searching for re-exports. + function populateSearchSymbolSet(symbol, location, checker, implementations) { // The search set contains at least the current symbol var result = [symbol]; - // If the location is name of property symbol from object literal destructuring pattern - // Search the property symbol - // for ( { property: p2 } of elems) { } - var containingObjectLiteralElement = getContainingObjectLiteralElement(location); - if (containingObjectLiteralElement && containingObjectLiteralElement.kind !== 258 /* ShorthandPropertyAssignment */) { - var propertySymbol = getPropertySymbolOfDestructuringAssignment(location); - if (propertySymbol) { - result.push(propertySymbol); - } - } - // If the symbol is an alias, add what it aliases to the list - // import {a} from "mod"; - // export {a} - // If the symbol is an alias to default declaration, add what it aliases to the list - // declare "mod" { export default class B { } } - // import B from "mod"; - //// For export specifiers, the exported name can be referring to a local symbol, e.g.: - //// import {a} from "mod"; - //// export {a as somethingElse} - //// We want the *local* declaration of 'a' as declared in the import, - //// *not* as declared within "mod" (or farther) - var aliasSymbol = getAliasSymbolForPropertyNameSymbol(symbol, location); - if (aliasSymbol) { - result = result.concat(populateSearchSymbolSet(aliasSymbol, location)); - } - // If the location is in a context sensitive location (i.e. in an object literal) try - // to get a contextual type for it, and add the property symbol from the contextual - // type to the search set + var containingObjectLiteralElement = ts.getContainingObjectLiteralElement(location); if (containingObjectLiteralElement) { - ts.forEach(getPropertySymbolsFromContextualType(containingObjectLiteralElement), function (contextualSymbol) { - ts.addRange(result, typeChecker.getRootSymbols(contextualSymbol)); + // 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 !== 262 /* ShorthandPropertyAssignment */) { + var propertySymbol = getPropertySymbolOfDestructuringAssignment(location, checker); + if (propertySymbol) { + result.push(propertySymbol); + } + } + // If the location is in a context sensitive location (i.e. in an object literal) try + // to get a contextual type for it, and add the property symbol from the contextual + // type to the search set + ts.forEach(getPropertySymbolsFromContextualType(containingObjectLiteralElement, checker), function (contextualSymbol) { + ts.addRange(result, checker.getRootSymbols(contextualSymbol)); }); /* Because in short-hand property assignment, location has two meaning : property name and as value of the property - * When we do findAllReference at the position of the short-hand property assignment, we would want to have references to position of - * property name and variable declaration of the identifier. - * Like in below example, when querying for all references for an identifier 'name', of the property assignment, the language service - * should show both 'name' in 'obj' and 'name' in variable declaration - * const name = "Foo"; - * const obj = { name }; - * In order to do that, we will populate the search set with the value symbol of the identifier as a value of the property assignment - * so that when matching with potential reference symbol, both symbols from property declaration and variable declaration - * will be included correctly. - */ - var shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(location.parent); + * When we do findAllReference at the position of the short-hand property assignment, we would want to have references to position of + * property name and variable declaration of the identifier. + * Like in below example, when querying for all references for an identifier 'name', of the property assignment, the language service + * should show both 'name' in 'obj' and 'name' in variable declaration + * const name = "Foo"; + * const obj = { name }; + * In order to do that, we will populate the search set with the value symbol of the identifier as a value of the property assignment + * so that when matching with potential reference symbol, both symbols from property declaration and variable declaration + * will be included correctly. + */ + var shorthandValueSymbol = checker.getShorthandAssignmentValueSymbol(location.parent); if (shorthandValueSymbol) { result.push(shorthandValueSymbol); } @@ -70682,27 +76315,28 @@ var ts; // we should include both parameter declaration symbol and property declaration symbol // Parameter Declaration symbol is only visible within function scope, so the symbol is stored in constructor.locals. // Property Declaration symbol is a member of the class, so the symbol is stored in its class Declaration.symbol.members - if (symbol.valueDeclaration && symbol.valueDeclaration.kind === 144 /* Parameter */ && + if (symbol.valueDeclaration && symbol.valueDeclaration.kind === 146 /* Parameter */ && ts.isParameterPropertyDeclaration(symbol.valueDeclaration)) { - result = result.concat(typeChecker.getSymbolsOfParameterPropertyDeclaration(symbol.valueDeclaration, symbol.name)); + ts.addRange(result, checker.getSymbolsOfParameterPropertyDeclaration(symbol.valueDeclaration, symbol.name)); } // If this is symbol of binding element without propertyName declaration in Object binding pattern // Include the property in the search - var bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol); + var bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker); if (bindingElementPropertySymbol) { result.push(bindingElementPropertySymbol); } // If this is a union property, add all the symbols from all its source symbols in all unioned types. // If the symbol is an instantiation from a another symbol (e.g. widened symbol) , add the root the list - ts.forEach(typeChecker.getRootSymbols(symbol), function (rootSymbol) { + for (var _i = 0, _a = checker.getRootSymbols(symbol); _i < _a.length; _i++) { + var rootSymbol = _a[_i]; if (rootSymbol !== symbol) { result.push(rootSymbol); } // Add symbol of properties/methods of the same name in base classes and implemented interfaces definitions if (!implementations && rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */)) { - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result, /*previousIterationSymbolsCache*/ ts.createMap()); + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result, /*previousIterationSymbolsCache*/ ts.createMap(), checker); } - }); + } return result; } /** @@ -70713,7 +76347,7 @@ var ts; * @param previousIterationSymbolsCache a cache of symbol from previous iterations of calling this function to prevent infinite revisiting of the same symbol. * The value of previousIterationSymbol is undefined when the function is first called. */ - function getPropertySymbolsFromBaseTypes(symbol, propertyName, result, previousIterationSymbolsCache) { + function getPropertySymbolsFromBaseTypes(symbol, propertyName, result, previousIterationSymbolsCache, checker) { if (!symbol) { return; } @@ -70728,7 +76362,7 @@ var ts; // the function will add any found symbol of the property-name, then its sub-routine will call // getPropertySymbolsFromBaseTypes again to walk up any base types to prevent revisiting already // visited symbol, interface "C", the sub-routine will pass the current symbol as previousIterationSymbol. - if (symbol.name in previousIterationSymbolsCache) { + if (previousIterationSymbolsCache.has(symbol.name)) { return; } if (symbol.flags & (32 /* Class */ | 64 /* Interface */)) { @@ -70737,7 +76371,7 @@ var ts; getPropertySymbolFromTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); ts.forEach(ts.getClassImplementsHeritageClauseElements(declaration), getPropertySymbolFromTypeReference); } - else if (declaration.kind === 227 /* InterfaceDeclaration */) { + else if (declaration.kind === 230 /* InterfaceDeclaration */) { ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), getPropertySymbolFromTypeReference); } }); @@ -70745,37 +76379,30 @@ var ts; return; function getPropertySymbolFromTypeReference(typeReference) { if (typeReference) { - var type = typeChecker.getTypeAtLocation(typeReference); + var type = checker.getTypeAtLocation(typeReference); if (type) { - var propertySymbol = typeChecker.getPropertyOfType(type, propertyName); + var propertySymbol = checker.getPropertyOfType(type, propertyName); if (propertySymbol) { - result.push.apply(result, typeChecker.getRootSymbols(propertySymbol)); + result.push.apply(result, checker.getRootSymbols(propertySymbol)); } // Visit the typeReference as well to see if it directly or indirectly use that property - previousIterationSymbolsCache[symbol.name] = symbol; - getPropertySymbolsFromBaseTypes(type.symbol, propertyName, result, previousIterationSymbolsCache); + previousIterationSymbolsCache.set(symbol.name, symbol); + getPropertySymbolsFromBaseTypes(type.symbol, propertyName, result, previousIterationSymbolsCache, checker); } } } } - function getRelatedSymbol(searchSymbols, referenceSymbol, referenceLocation, searchLocationIsConstructor, parents, cache) { - if (ts.contains(searchSymbols, referenceSymbol)) { - // If we are searching for constructor uses, they must be 'new' expressions. - return (!searchLocationIsConstructor || ts.isNewExpressionTarget(referenceLocation)) && referenceSymbol; - } - // If the reference symbol is an alias, check if what it is aliasing is one of the search - // symbols but by looking up for related symbol of this alias so it can handle multiple level of indirectness. - var aliasSymbol = getAliasSymbolForPropertyNameSymbol(referenceSymbol, referenceLocation); - if (aliasSymbol) { - return getRelatedSymbol(searchSymbols, aliasSymbol, referenceLocation, searchLocationIsConstructor, parents, cache); + function getRelatedSymbol(search, referenceSymbol, referenceLocation, state) { + if (search.includes(referenceSymbol)) { + return referenceSymbol; } // If the reference location is in an object literal, try to get the contextual type for the // object literal, lookup the property symbol in the contextual type, and use this symbol to // compare to our searchSymbol - var containingObjectLiteralElement = getContainingObjectLiteralElement(referenceLocation); + var containingObjectLiteralElement = ts.getContainingObjectLiteralElement(referenceLocation); if (containingObjectLiteralElement) { - var contextualSymbol = ts.forEach(getPropertySymbolsFromContextualType(containingObjectLiteralElement), function (contextualSymbol) { - return ts.forEach(typeChecker.getRootSymbols(contextualSymbol), function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; }); + var contextualSymbol = ts.forEach(getPropertySymbolsFromContextualType(containingObjectLiteralElement, state.checker), function (contextualSymbol) { + return ts.find(state.checker.getRootSymbols(contextualSymbol), search.includes); }); if (contextualSymbol) { return contextualSymbol; @@ -70784,23 +76411,23 @@ var ts; // Get the property symbol from the object literal's type and look if thats the search symbol // In below eg. get 'property' from type of elems iterating type // for ( { property: p2 } of elems) { } - var propertySymbol = getPropertySymbolOfDestructuringAssignment(referenceLocation); - if (propertySymbol && searchSymbols.indexOf(propertySymbol) >= 0) { + var propertySymbol = getPropertySymbolOfDestructuringAssignment(referenceLocation, state.checker); + if (propertySymbol && search.includes(propertySymbol)) { return propertySymbol; } } // If the reference location is the binding element and doesn't have property name // then include the binding element in the related symbols // let { a } : { a }; - var bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(referenceSymbol); - if (bindingElementPropertySymbol && searchSymbols.indexOf(bindingElementPropertySymbol) >= 0) { + var bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(referenceSymbol, state.checker); + if (bindingElementPropertySymbol && search.includes(bindingElementPropertySymbol)) { return bindingElementPropertySymbol; } // Unwrap symbols to get to the root (e.g. transient symbols as a result of widening) // Or a union property, use its underlying unioned symbols - return ts.forEach(typeChecker.getRootSymbols(referenceSymbol), function (rootSymbol) { + return ts.forEach(state.checker.getRootSymbols(referenceSymbol), function (rootSymbol) { // if it is in the list, then we are done - if (searchSymbols.indexOf(rootSymbol) >= 0) { + if (search.includes(rootSymbol)) { return rootSymbol; } // Finally, try all properties with the same name in any type the containing type extended or implemented, and @@ -70808,20 +76435,18 @@ var ts; // parent symbol if (rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */)) { // Parents will only be defined if implementations is true - if (parents) { - if (!ts.forEach(parents, function (parent) { return explicitlyInheritsFrom(rootSymbol.parent, parent, cache); })) { - return undefined; - } + if (search.parents && !ts.some(search.parents, function (parent) { return explicitlyInheritsFrom(rootSymbol.parent, parent, state.inheritsFromCache, state.checker); })) { + return undefined; } - var result_4 = []; - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result_4, /*previousIterationSymbolsCache*/ ts.createMap()); - return ts.forEach(result_4, function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; }); + var result = []; + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result, /*previousIterationSymbolsCache*/ ts.createMap(), state.checker); + return ts.find(result, search.includes); } return undefined; }); } function getNameFromObjectLiteralElement(node) { - if (node.name.kind === 142 /* ComputedPropertyName */) { + if (node.name.kind === 144 /* 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)) { @@ -70831,15 +76456,16 @@ var ts; } return node.name.text; } - function getPropertySymbolsFromContextualType(node) { + /** Gets all symbols for one property. Does not get symbols for every property. */ + function getPropertySymbolsFromContextualType(node, checker) { var objectLiteral = node.parent; - var contextualType = typeChecker.getContextualType(objectLiteral); + var contextualType = checker.getContextualType(objectLiteral); var name = getNameFromObjectLiteralElement(node); if (name && contextualType) { var result_5 = []; - var symbol_2 = contextualType.getProperty(name); - if (symbol_2) { - result_5.push(symbol_2); + var symbol = contextualType.getProperty(name); + if (symbol) { + result_5.push(symbol); } if (contextualType.flags & 65536 /* Union */) { ts.forEach(contextualType.types, function (t) { @@ -70853,13 +76479,14 @@ var ts; } return undefined; } - /** Given an initial searchMeaning, extracted from a location, widen the search scope based on the declarations - * of the corresponding symbol. e.g. if we are searching for "Foo" in value position, but "Foo" references a class - * then we need to widen the search to include type positions as well. - * On the contrary, if we are searching for "Bar" in type position and we trace bar to an interface, and an uninstantiated - * 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. - */ + /** + * Given an initial searchMeaning, extracted from a location, widen the search scope based on the declarations + * of the corresponding symbol. e.g. if we are searching for "Foo" in value position, but "Foo" references a class + * then we need to widen the search to include type positions as well. + * On the contrary, if we are searching for "Bar" in type position and we trace bar to an interface, and an uninstantiated + * 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) { if (declarations) { var lastIterationMeaning = void 0; @@ -70870,8 +76497,8 @@ var ts; // To achieve that we will keep iterating until the result stabilizes. // Remember the last meaning lastIterationMeaning = meaning; - for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { - var declaration = declarations_8[_i]; + for (var _i = 0, declarations_11 = declarations; _i < declarations_11.length; _i++) { + var declaration = declarations_11[_i]; var declarationMeaning = ts.getMeaningFromDeclaration(declaration); if (declarationMeaning & meaning) { meaning |= declarationMeaning; @@ -70881,143 +76508,93 @@ var ts; } return meaning; } - } - FindAllReferences.getReferencedSymbolsForNode = getReferencedSymbolsForNode; - function convertReferences(referenceSymbols) { - if (!referenceSymbols) { - return undefined; - } - var referenceEntries = []; - for (var _i = 0, referenceSymbols_1 = referenceSymbols; _i < referenceSymbols_1.length; _i++) { - var referenceSymbol = referenceSymbols_1[_i]; - ts.addRange(referenceEntries, referenceSymbol.references); - } - return referenceEntries; - } - FindAllReferences.convertReferences = convertReferences; - function isImplementation(node) { - if (!node) { + function isImplementation(node) { + if (!node) { + return false; + } + else if (ts.isVariableLike(node)) { + if (node.initializer) { + return true; + } + else if (node.kind === 226 /* VariableDeclaration */) { + var parentStatement = getParentStatementOfVariableDeclaration(node); + return parentStatement && ts.hasModifier(parentStatement, 2 /* Ambient */); + } + } + else if (ts.isFunctionLike(node)) { + return !!node.body || ts.hasModifier(node, 2 /* Ambient */); + } + else { + switch (node.kind) { + case 229 /* ClassDeclaration */: + case 199 /* ClassExpression */: + case 232 /* EnumDeclaration */: + case 233 /* ModuleDeclaration */: + return true; + } + } return false; } - else if (ts.isVariableLike(node)) { - if (node.initializer) { - return true; - } - else if (node.kind === 223 /* VariableDeclaration */) { - var parentStatement = getParentStatementOfVariableDeclaration(node); - return parentStatement && ts.hasModifier(parentStatement, 2 /* Ambient */); + function getParentStatementOfVariableDeclaration(node) { + if (node.parent && node.parent.parent && node.parent.parent.kind === 208 /* VariableStatement */) { + ts.Debug.assert(node.parent.kind === 227 /* VariableDeclarationList */); + return node.parent.parent; } } - else if (ts.isFunctionLike(node)) { - return !!node.body || ts.hasModifier(node, 2 /* Ambient */); - } - else { - switch (node.kind) { - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: - case 229 /* EnumDeclaration */: - case 230 /* ModuleDeclaration */: - return true; - } - } - return false; - } - function getParentStatementOfVariableDeclaration(node) { - if (node.parent && node.parent.parent && node.parent.parent.kind === 205 /* VariableStatement */) { - ts.Debug.assert(node.parent.kind === 224 /* VariableDeclarationList */); - return node.parent.parent; - } - } - function getReferenceEntriesForShorthandPropertyAssignment(node, typeChecker, result) { - var refSymbol = typeChecker.getSymbolAtLocation(node); - var shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(refSymbol.valueDeclaration); - if (shorthandSymbol) { - for (var _i = 0, _a = shorthandSymbol.getDeclarations(); _i < _a.length; _i++) { - var declaration = _a[_i]; - if (ts.getMeaningFromDeclaration(declaration) & 1 /* Value */) { - result.push(getReferenceEntryFromNode(declaration)); + function getReferenceEntriesForShorthandPropertyAssignment(node, checker, addReference) { + var refSymbol = checker.getSymbolAtLocation(node); + var shorthandSymbol = checker.getShorthandAssignmentValueSymbol(refSymbol.valueDeclaration); + if (shorthandSymbol) { + for (var _i = 0, _a = shorthandSymbol.getDeclarations(); _i < _a.length; _i++) { + var declaration = _a[_i]; + if (ts.getMeaningFromDeclaration(declaration) & 1 /* Value */) { + addReference(declaration); + } } } } - } - FindAllReferences.getReferenceEntriesForShorthandPropertyAssignment = getReferenceEntriesForShorthandPropertyAssignment; - function getReferenceEntryFromNode(node) { - var start = node.getStart(); - var end = node.getEnd(); - if (node.kind === 9 /* StringLiteral */) { - start += 1; - end -= 1; - } - return { - fileName: node.getSourceFile().fileName, - textSpan: ts.createTextSpanFromBounds(start, end), - isWriteAccess: isWriteAccess(node), - isDefinition: ts.isDeclarationName(node) || ts.isLiteralComputedPropertyDeclarationName(node) - }; - } - FindAllReferences.getReferenceEntryFromNode = getReferenceEntryFromNode; - /** A node is considered a writeAccess iff it is a name of a declaration or a target of an assignment */ - function isWriteAccess(node) { - if (node.kind === 70 /* Identifier */ && ts.isDeclarationName(node)) { - return true; - } - var parent = node.parent; - if (parent) { - if (parent.kind === 191 /* PostfixUnaryExpression */ || parent.kind === 190 /* PrefixUnaryExpression */) { - return true; - } - else if (parent.kind === 192 /* BinaryExpression */ && parent.left === node) { - var operator = parent.operatorToken.kind; - return 57 /* FirstAssignment */ <= operator && operator <= 69 /* LastAssignment */; - } - } - return false; - } - function forEachDescendantOfKind(node, kind, action) { - ts.forEachChild(node, function (child) { - if (child.kind === kind) { - action(child); - } - forEachDescendantOfKind(child, kind, action); - }); - } - /** - * Returns the containing object literal property declaration given a possible name node, e.g. "a" in x = { "a": 1 } - */ - function getContainingObjectLiteralElement(node) { - switch (node.kind) { - case 9 /* StringLiteral */: - case 8 /* NumericLiteral */: - if (node.parent.kind === 142 /* ComputedPropertyName */) { - return isObjectLiteralPropertyDeclaration(node.parent.parent) ? node.parent.parent : undefined; + Core.getReferenceEntriesForShorthandPropertyAssignment = getReferenceEntriesForShorthandPropertyAssignment; + function forEachDescendantOfKind(node, kind, action) { + ts.forEachChild(node, function (child) { + if (child.kind === kind) { + action(child); } - // intential fall through - case 70 /* Identifier */: - return isObjectLiteralPropertyDeclaration(node.parent) && node.parent.name === node ? node.parent : undefined; + forEachDescendantOfKind(child, kind, action); + }); } - return undefined; - } - function isObjectLiteralPropertyDeclaration(node) { - switch (node.kind) { - case 257 /* PropertyAssignment */: - case 258 /* ShorthandPropertyAssignment */: - case 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - return true; + /** Get `C` given `N` if `N` is in the position `class C extends N` or `class C extends foo.N` where `N` is an identifier. */ + function tryGetClassByExtendingIdentifier(node) { + return ts.tryGetClassExtendingExpressionWithTypeArguments(ts.climbPastPropertyAccess(node).parent); } - return false; - } - /** Get `C` given `N` if `N` is in the position `class C extends N` or `class C extends foo.N` where `N` is an identifier. */ - function tryGetClassByExtendingIdentifier(node) { - return ts.tryGetClassExtendingExpressionWithTypeArguments(ts.climbPastPropertyAccess(node).parent); - } - function isNameOfExternalModuleImportOrDeclaration(node) { - if (node.kind === 9 /* StringLiteral */) { - return ts.isNameOfModuleDeclaration(node) || ts.isExpressionOfExternalModuleImportEqualsDeclaration(node); + function isNameOfExternalModuleImportOrDeclaration(node) { + if (node.kind === 9 /* StringLiteral */) { + return ts.isNameOfModuleDeclaration(node) || ts.isExpressionOfExternalModuleImportEqualsDeclaration(node); + } + return false; } - return false; - } + /** + * If we are just looking for implementations and this is a property access expression, we need to get the + * symbol of the local type of the symbol the property is being accessed on. This is because our search + * symbol may have a different parent symbol if the local type's symbol does not declare the property + * being accessed (i.e. it is declared in some parent class or interface) + */ + function getParentSymbolsOfPropertyAccess(location, symbol, checker) { + var propertyAccessExpression = getPropertyAccessExpressionFromRightHandSide(location); + if (!propertyAccessExpression) { + return undefined; + } + var localParentType = checker.getTypeAtLocation(propertyAccessExpression.expression); + if (!localParentType) { + return undefined; + } + if (localParentType.symbol && localParentType.symbol.flags & (32 /* Class */ | 64 /* Interface */) && localParentType.symbol !== symbol.parent) { + return [localParentType.symbol]; + } + else if (localParentType.flags & 196608 /* UnionOrIntersection */) { + return getSymbolsForClassAndInterfaceComponents(localParentType); + } + } + })(Core = FindAllReferences.Core || (FindAllReferences.Core = {})); })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {})); })(ts || (ts = {})); /* @internal */ @@ -71038,11 +76615,9 @@ var ts; // Type reference directives var typeReferenceDirective = findReferenceInPosition(sourceFile.typeReferenceDirectives, position); if (typeReferenceDirective) { - var referenceFile = program.getResolvedTypeReferenceDirectives()[typeReferenceDirective.fileName]; - if (referenceFile && referenceFile.resolvedFileName) { - return [getDefinitionInfoForFileReference(typeReferenceDirective.fileName, referenceFile.resolvedFileName)]; - } - return undefined; + var referenceFile = program.getResolvedTypeReferenceDirectives().get(typeReferenceDirective.fileName); + return referenceFile && referenceFile.resolvedFileName && + [getDefinitionInfoForFileReference(typeReferenceDirective.fileName, referenceFile.resolvedFileName)]; } var node = ts.getTouchingPropertyName(sourceFile, position); if (node === sourceFile) { @@ -71052,7 +76627,7 @@ var ts; if (ts.isJumpStatementTarget(node)) { var labelName = node.text; var label = ts.getTargetLabel(node.parent, node.text); - return label ? [createDefinitionInfo(label, ts.ScriptElementKind.label, labelName, /*containerName*/ undefined)] : undefined; + return label ? [createDefinitionInfoFromName(label, ts.ScriptElementKind.label, labelName, /*containerName*/ undefined)] : undefined; } var typeChecker = program.getTypeChecker(); var calledDeclaration = tryGetSignatureDeclaration(typeChecker, node); @@ -71076,9 +76651,9 @@ var ts; // (1) when the aliased symbol was declared in the location(parent). // (2) when the aliased symbol is originating from a named import. // - if (node.kind === 70 /* Identifier */ && + if (node.kind === 71 /* Identifier */ && (node.parent === declaration || - (declaration.kind === 239 /* ImportSpecifier */ && declaration.parent && declaration.parent.kind === 238 /* NamedImports */))) { + (declaration.kind === 242 /* ImportSpecifier */ && declaration.parent && declaration.parent.kind === 241 /* NamedImports */))) { symbol = typeChecker.getAliasedSymbol(symbol); } } @@ -71087,7 +76662,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 === 258 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 262 /* ShorthandPropertyAssignment */) { var shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); if (!shorthandSymbol) { return []; @@ -71098,6 +76673,37 @@ var ts; var shorthandContainerName_1 = typeChecker.symbolToString(symbol.parent, node); return ts.map(shorthandDeclarations, function (declaration) { return createDefinitionInfo(declaration, shorthandSymbolKind_1, shorthandSymbolName_1, shorthandContainerName_1); }); } + if (ts.isJsxOpeningLikeElement(node.parent)) { + // If there are errors when trying to figure out stateless component function, just return the first declaration + // For example: + // declare function /*firstSource*/MainButton(buttonProps: ButtonProps): JSX.Element; + // declare function /*secondSource*/MainButton(linkProps: LinkProps): JSX.Element; + // declare function /*thirdSource*/MainButton(props: ButtonProps | LinkProps): JSX.Element; + // let opt =
; // Error - We get undefined for resolved signature indicating an error, then just return the first declaration + var _a = getSymbolInfo(typeChecker, symbol, node), symbolName = _a.symbolName, symbolKind = _a.symbolKind, containerName = _a.containerName; + return [createDefinitionInfo(symbol.valueDeclaration, symbolKind, symbolName, containerName)]; + } + // If the current location we want to find its definition is in an object literal, try to get the contextual type for the + // object literal, lookup the property symbol in the contextual type, and use this for goto-definition. + // For example + // interface Props{ + // /*first*/prop1: number + // prop2: boolean + // } + // function Foo(arg: Props) {} + // Foo( { pr/*1*/op1: 10, prop2: true }) + var element = ts.getContainingObjectLiteralElement(node); + if (element) { + if (typeChecker.getContextualType(element.parent)) { + var result = []; + var propertySymbols = ts.getPropertySymbolsFromContextualType(typeChecker, element); + for (var _i = 0, propertySymbols_1 = propertySymbols; _i < propertySymbols_1.length; _i++) { + var propertySymbol = propertySymbols_1[_i]; + result.push.apply(result, getDefinitionFromSymbol(typeChecker, propertySymbol, node)); + } + return result; + } + } return getDefinitionFromSymbol(typeChecker, symbol, node); } GoToDefinition.getDefinitionAtPosition = getDefinitionAtPosition; @@ -71145,7 +76751,7 @@ var ts; function tryAddConstructSignature(symbol, location, symbolKind, symbolName, containerName, result) { // 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(location) || location.kind === 122 /* ConstructorKeyword */) { + if (ts.isNewExpressionTarget(location) || location.kind === 123 /* ConstructorKeyword */) { if (symbol.flags & 32 /* Class */) { // Find the first class-like declaration and try to get the construct signature. for (var _i = 0, _a = symbol.getDeclarations(); _i < _a.length; _i++) { @@ -71167,31 +76773,47 @@ var ts; return false; } function tryAddSignature(signatureDeclarations, selectConstructors, symbolKind, symbolName, containerName, result) { + if (!signatureDeclarations) { + return false; + } var declarations = []; var definition; - ts.forEach(signatureDeclarations, function (d) { - if ((selectConstructors && d.kind === 150 /* Constructor */) || - (!selectConstructors && (d.kind === 225 /* FunctionDeclaration */ || d.kind === 149 /* MethodDeclaration */ || d.kind === 148 /* MethodSignature */))) { + for (var _i = 0, signatureDeclarations_1 = signatureDeclarations; _i < signatureDeclarations_1.length; _i++) { + var d = signatureDeclarations_1[_i]; + if (selectConstructors ? d.kind === 152 /* Constructor */ : isSignatureDeclaration(d)) { declarations.push(d); if (d.body) definition = d; } - }); - if (definition) { - result.push(createDefinitionInfo(definition, symbolKind, symbolName, containerName)); - return true; } - else if (declarations.length) { - result.push(createDefinitionInfo(ts.lastOrUndefined(declarations), symbolKind, symbolName, containerName)); + if (declarations.length) { + result.push(createDefinitionInfo(definition || ts.lastOrUndefined(declarations), symbolKind, symbolName, containerName)); return true; } return false; } } + function isSignatureDeclaration(node) { + switch (node.kind) { + case 152 /* Constructor */: + case 228 /* FunctionDeclaration */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: + return true; + default: + return false; + } + } + /** Creates a DefinitionInfo from a Declaration, using the declaration's name if possible. */ function createDefinitionInfo(node, symbolKind, symbolName, containerName) { + return createDefinitionInfoFromName(ts.getNameOfDeclaration(node) || node, symbolKind, symbolName, containerName); + } + /** Creates a DefinitionInfo directly from the name of a declaration. */ + function createDefinitionInfoFromName(name, symbolKind, symbolName, containerName) { + var sourceFile = name.getSourceFile(); return { - fileName: node.getSourceFile().fileName, - textSpan: ts.createTextSpanFromBounds(node.getStart(), node.getEnd()), + fileName: sourceFile.fileName, + textSpan: ts.createTextSpanFromNode(name, sourceFile), kind: symbolKind, name: symbolName, containerKind: undefined, @@ -71239,46 +76861,20 @@ var ts; } function tryGetSignatureDeclaration(typeChecker, node) { var callLike = getAncestorCallLikeExpression(node); - return callLike && typeChecker.getResolvedSignature(callLike).declaration; + var signature = callLike && typeChecker.getResolvedSignature(callLike); + if (signature) { + var decl = signature.declaration; + if (decl && isSignatureDeclaration(decl)) { + return decl; + } + } + // Don't go to a function type, go to the value having that type. + return undefined; } })(GoToDefinition = ts.GoToDefinition || (ts.GoToDefinition = {})); })(ts || (ts = {})); /* @internal */ var ts; -(function (ts) { - var GoToImplementation; - (function (GoToImplementation) { - function getImplementationAtPosition(typeChecker, cancellationToken, sourceFiles, node) { - // 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 === 258 /* ShorthandPropertyAssignment */) { - var result = []; - ts.FindAllReferences.getReferenceEntriesForShorthandPropertyAssignment(node, typeChecker, result); - return result.length > 0 ? result : undefined; - } - else if (node.kind === 96 /* SuperKeyword */ || ts.isSuperProperty(node.parent)) { - // References to and accesses on the super keyword only have one possible implementation, so no - // need to "Find all References" - var symbol = typeChecker.getSymbolAtLocation(node); - return symbol.valueDeclaration && [ts.FindAllReferences.getReferenceEntryFromNode(symbol.valueDeclaration)]; - } - else { - // Perform "Find all References" and retrieve only those that are implementations - var referencedSymbols = ts.FindAllReferences.getReferencedSymbolsForNode(typeChecker, cancellationToken, node, sourceFiles, /*findInStrings*/ false, /*findInComments*/ false, /*implementations*/ true); - var result = ts.flatMap(referencedSymbols, function (symbol) { - return ts.map(symbol.references, function (_a) { - var textSpan = _a.textSpan, fileName = _a.fileName; - return ({ textSpan: textSpan, fileName: fileName }); - }); - }); - return result && result.length > 0 ? result : undefined; - } - } - GoToImplementation.getImplementationAtPosition = getImplementationAtPosition; - })(GoToImplementation = ts.GoToImplementation || (ts.GoToImplementation = {})); -})(ts || (ts = {})); -/* @internal */ -var ts; (function (ts) { var JsDoc; (function (JsDoc) { @@ -71324,7 +76920,8 @@ var ts; "prop", "version" ]; - var jsDocCompletionEntries; + var jsDocTagNameCompletionEntries; + var jsDocTagCompletionEntries; function getJsDocCommentsFromDeclarations(declarations) { // Only collect doc comments from duplicate declarations once: // In case of a union property there might be same declaration multiple times @@ -71363,7 +76960,7 @@ var ts; var doc = jsDocs_1[_i]; var tagsForDoc = doc.tags; if (tagsForDoc) { - tags.push.apply(tags, tagsForDoc.filter(function (tag) { return tag.kind === 279 /* JSDocTag */; }).map(function (jsDocTag) { + tags.push.apply(tags, tagsForDoc.filter(function (tag) { return tag.kind === 284 /* JSDocTag */; }).map(function (jsDocTag) { return { name: jsDocTag.tagName.text, text: jsDocTag.comment @@ -71382,7 +76979,7 @@ var ts; */ function forEachUnique(array, callback) { if (array) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { if (ts.indexOf(array, array[i]) === i) { var result = callback(array[i], i); if (result) { @@ -71393,8 +76990,8 @@ var ts; } return undefined; } - function getAllJsDocCompletionEntries() { - return jsDocCompletionEntries || (jsDocCompletionEntries = ts.map(jsDocTagNames, function (tagName) { + function getJSDocTagNameCompletions() { + return jsDocTagNameCompletionEntries || (jsDocTagNameCompletionEntries = ts.map(jsDocTagNames, function (tagName) { return { name: tagName, kind: ts.ScriptElementKind.keyword, @@ -71403,7 +77000,18 @@ var ts; }; })); } - JsDoc.getAllJsDocCompletionEntries = getAllJsDocCompletionEntries; + JsDoc.getJSDocTagNameCompletions = getJSDocTagNameCompletions; + function getJSDocTagCompletions() { + return jsDocTagCompletionEntries || (jsDocTagCompletionEntries = ts.map(jsDocTagNames, function (tagName) { + return { + name: "@" + tagName, + kind: ts.ScriptElementKind.keyword, + kindModifiers: "", + sortText: "0" + }; + })); + } + JsDoc.getJSDocTagCompletions = getJSDocTagCompletions; /** * Checks if position points to a valid position to add JSDoc comments, and if so, * returns the appropriate template. Otherwise returns an empty string. @@ -71442,19 +77050,19 @@ var ts; var commentOwner; findOwner: for (commentOwner = tokenAtPos; commentOwner; commentOwner = commentOwner.parent) { switch (commentOwner.kind) { - case 225 /* FunctionDeclaration */: - case 149 /* MethodDeclaration */: - case 150 /* Constructor */: - case 226 /* ClassDeclaration */: - case 205 /* VariableStatement */: + case 228 /* FunctionDeclaration */: + case 151 /* MethodDeclaration */: + case 152 /* Constructor */: + case 229 /* ClassDeclaration */: + case 208 /* VariableStatement */: break findOwner; - case 261 /* SourceFile */: + case 265 /* SourceFile */: return undefined; - case 230 /* ModuleDeclaration */: + case 233 /* 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 { }'. - if (commentOwner.parent.kind === 230 /* ModuleDeclaration */) { + if (commentOwner.parent.kind === 233 /* ModuleDeclaration */) { return undefined; } break findOwner; @@ -71466,12 +77074,13 @@ var ts; var parameters = getParametersForJsDocOwningNode(commentOwner); var posLineAndChar = sourceFile.getLineAndCharacterOfPosition(position); var lineStart = sourceFile.getLineStarts()[posLineAndChar.line]; - var indentationStr = sourceFile.text.substr(lineStart, posLineAndChar.character); + // replace non-whitespace characters in prefix with spaces. + var indentationStr = sourceFile.text.substr(lineStart, posLineAndChar.character).replace(/\S/i, function () { return " "; }); var isJavaScriptFile = ts.hasJavaScriptFileExtension(sourceFile.fileName); var docParams = ""; - for (var i = 0, numParams = parameters.length; i < numParams; i++) { + for (var i = 0; i < parameters.length; i++) { var currentName = parameters[i].name; - var paramName = currentName.kind === 70 /* Identifier */ ? + var paramName = currentName.kind === 71 /* Identifier */ ? currentName.text : "param" + i; if (isJavaScriptFile) { @@ -71501,7 +77110,7 @@ var ts; if (ts.isFunctionLike(commentOwner)) { return commentOwner.parameters; } - if (commentOwner.kind === 205 /* VariableStatement */) { + if (commentOwner.kind === 208 /* VariableStatement */) { var varStatement = commentOwner; var varDeclarations = varStatement.declarationList.declarations; if (varDeclarations.length === 1 && varDeclarations[0].initializer) { @@ -71519,17 +77128,17 @@ var ts; * @returns the parameters of a signature found on the RHS if one exists; otherwise 'emptyArray'. */ function getParametersFromRightHandSideOfAssignment(rightHandSide) { - while (rightHandSide.kind === 183 /* ParenthesizedExpression */) { + while (rightHandSide.kind === 185 /* ParenthesizedExpression */) { rightHandSide = rightHandSide.expression; } switch (rightHandSide.kind) { - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: + case 186 /* FunctionExpression */: + case 187 /* ArrowFunction */: return rightHandSide.parameters; - case 197 /* ClassExpression */: + case 199 /* ClassExpression */: for (var _i = 0, _a = rightHandSide.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 150 /* Constructor */) { + if (member.kind === 152 /* Constructor */) { return member.parameters; } } @@ -71549,8 +77158,6 @@ var ts; (function (ts) { var JsTyping; (function (JsTyping) { - ; - ; // A map of loose file names to library names // that we are confident require typings var safeList; @@ -71587,7 +77194,7 @@ var ts; }); if (!safeList) { var result = ts.readConfigFile(safeListPath, function (path) { return host.readFile(path); }); - safeList = result.config ? ts.createMap(result.config) : EmptySafeList; + safeList = result.config ? ts.createMapFromTemplate(result.config) : EmptySafeList; } var filesToWatch = []; // Directories to search for package.json, bower.json and other typing information @@ -71606,41 +77213,43 @@ var ts; getTypingNamesFromJson(packageJsonPath, filesToWatch); var bowerJsonPath = ts.combinePaths(searchDir, "bower.json"); getTypingNamesFromJson(bowerJsonPath, filesToWatch); + var bowerComponentsPath = ts.combinePaths(searchDir, "bower_components"); + getTypingNamesFromPackagesFolder(bowerComponentsPath); var nodeModulesPath = ts.combinePaths(searchDir, "node_modules"); - getTypingNamesFromNodeModuleFolder(nodeModulesPath); + getTypingNamesFromPackagesFolder(nodeModulesPath); } getTypingNamesFromSourceFileNames(fileNames); // add typings for unresolved imports if (unresolvedImports) { for (var _a = 0, unresolvedImports_1 = unresolvedImports; _a < unresolvedImports_1.length; _a++) { var moduleId = unresolvedImports_1[_a]; - var typingName = moduleId in nodeCoreModules ? "node" : moduleId; - if (!(typingName in inferredTypings)) { - inferredTypings[typingName] = undefined; + var typingName = nodeCoreModules.has(moduleId) ? "node" : moduleId; + if (!inferredTypings.has(typingName)) { + inferredTypings.set(typingName, undefined); } } } // Add the cached typing locations for inferred typings that are already installed - for (var name_47 in packageNameToTypingLocation) { - if (name_47 in inferredTypings && !inferredTypings[name_47]) { - inferredTypings[name_47] = packageNameToTypingLocation[name_47]; + packageNameToTypingLocation.forEach(function (typingLocation, name) { + if (inferredTypings.has(name) && inferredTypings.get(name) === undefined) { + inferredTypings.set(name, typingLocation); } - } + }); // Remove typings that the user has added to the exclude list for (var _b = 0, exclude_1 = exclude; _b < exclude_1.length; _b++) { var excludeTypingName = exclude_1[_b]; - delete inferredTypings[excludeTypingName]; + inferredTypings.delete(excludeTypingName); } var newTypingNames = []; var cachedTypingPaths = []; - for (var typing in inferredTypings) { - if (inferredTypings[typing] !== undefined) { - cachedTypingPaths.push(inferredTypings[typing]); + inferredTypings.forEach(function (inferred, typing) { + if (inferred !== undefined) { + cachedTypingPaths.push(inferred); } else { newTypingNames.push(typing); } - } + }); return { cachedTypingPaths: cachedTypingPaths, newTypingNames: newTypingNames, filesToWatch: filesToWatch }; /** * Merge a given list of typingNames to the inferredTypings map @@ -71651,8 +77260,8 @@ var ts; } for (var _i = 0, typingNames_1 = typingNames; _i < typingNames_1.length; _i++) { var typing = typingNames_1[_i]; - if (!(typing in inferredTypings)) { - inferredTypings[typing] = undefined; + if (!inferredTypings.has(typing)) { + inferredTypings.set(typing, undefined); } } } @@ -71691,7 +77300,7 @@ var ts; var inferredTypingNames = ts.map(jsFileNames, function (f) { return ts.removeFileExtension(ts.getBaseFileName(f.toLowerCase())); }); var cleanedTypingNames = ts.map(inferredTypingNames, function (f) { return f.replace(/((?:\.|-)min(?=\.|$))|((?:-|\.)\d+)/g, ""); }); if (safeList !== EmptySafeList) { - mergeTypings(ts.filter(cleanedTypingNames, function (f) { return f in safeList; })); + mergeTypings(ts.filter(cleanedTypingNames, function (f) { return safeList.has(f); })); } var hasJsxFile = ts.forEach(fileNames, function (f) { return ts.ensureScriptKind(f, ts.getScriptKindFromFileName(f)) === 2 /* JSX */; }); if (hasJsxFile) { @@ -71699,20 +77308,22 @@ var ts; } } /** - * Infer typing names from node_module folder - * @param nodeModulesPath is the path to the "node_modules" folder + * Infer typing names from packages folder (ex: node_module, bower_components) + * @param packagesFolderPath is the path to the packages folder */ - function getTypingNamesFromNodeModuleFolder(nodeModulesPath) { + function getTypingNamesFromPackagesFolder(packagesFolderPath) { + filesToWatch.push(packagesFolderPath); // Todo: add support for ModuleResolutionHost too - if (!host.directoryExists(nodeModulesPath)) { + if (!host.directoryExists(packagesFolderPath)) { return; } var typingNames = []; - var fileNames = host.readDirectory(nodeModulesPath, [".json"], /*excludes*/ undefined, /*includes*/ undefined, /*depth*/ 2); + var fileNames = host.readDirectory(packagesFolderPath, [".json"], /*excludes*/ undefined, /*includes*/ undefined, /*depth*/ 2); for (var _i = 0, fileNames_2 = fileNames; _i < fileNames_2.length; _i++) { var fileName = fileNames_2[_i]; var normalizedFileName = ts.normalizePath(fileName); - if (ts.getBaseFileName(normalizedFileName) !== "package.json") { + var baseFileName = ts.getBaseFileName(normalizedFileName); + if (baseFileName !== "package.json" && baseFileName !== "bower.json") { continue; } var result = ts.readConfigFile(normalizedFileName, function (path) { return host.readFile(path); }); @@ -71723,7 +77334,7 @@ var ts; // npm 3's package.json contains a "_requiredBy" field // we should include all the top level module names for npm 2, and only module names whose // "_requiredBy" field starts with "#" or equals "/" for npm 3. - if (packageJson._requiredBy && + if (baseFileName === "package.json" && packageJson._requiredBy && ts.filter(packageJson._requiredBy, function (r) { return r[0] === "#" || r === "/"; }).length === 0) { continue; } @@ -71734,7 +77345,7 @@ var ts; } if (packageJson.typings) { var absolutePath = ts.getNormalizedAbsolutePath(packageJson.typings, ts.getDirectoryPath(normalizedFileName)); - inferredTypings[packageJson.name] = absolutePath; + inferredTypings.set(packageJson.name, absolutePath); } else { typingNames.push(packageJson.name); @@ -71754,47 +77365,49 @@ var ts; function getNavigateToItems(sourceFiles, checker, cancellationToken, searchValue, maxResultCount, excludeDtsFiles) { var patternMatcher = ts.createPatternMatcher(searchValue); var rawItems = []; - // Search the declarations in all files and output matched NavigateToItem into array of NavigateToItem[] - ts.forEach(sourceFiles, function (sourceFile) { + var _loop_4 = function (sourceFile) { cancellationToken.throwIfCancellationRequested(); if (excludeDtsFiles && ts.fileExtensionIs(sourceFile.fileName, ".d.ts")) { - return; + return "continue"; } - var nameToDeclarations = sourceFile.getNamedDeclarations(); - for (var name_48 in nameToDeclarations) { - var declarations = nameToDeclarations[name_48]; + ts.forEachEntry(sourceFile.getNamedDeclarations(), function (declarations, name) { if (declarations) { // First do a quick check to see if the name of the declaration matches the // last portion of the (possibly) dotted name they're searching for. - var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name_48); + var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name); if (!matches) { - continue; + return; // continue to next named declarations } - for (var _i = 0, declarations_9 = declarations; _i < declarations_9.length; _i++) { - var declaration = declarations_9[_i]; + for (var _i = 0, declarations_12 = declarations; _i < declarations_12.length; _i++) { + var declaration = declarations_12[_i]; // It was a match! If the pattern has dots in it, then also see if the // declaration container matches as well. if (patternMatcher.patternContainsDots) { var containers = getContainers(declaration); if (!containers) { - return undefined; + return true; // Break out of named declarations and go to the next source file. } - matches = patternMatcher.getMatches(containers, name_48); + matches = patternMatcher.getMatches(containers, name); if (!matches) { - continue; + return; // continue to next named declarations } } var fileName = sourceFile.fileName; var matchKind = bestMatchKind(matches); - rawItems.push({ name: name_48, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); + rawItems.push({ name: name, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); } } - } - }); + }); + }; + // Search the declarations in all files and output matched NavigateToItem into array of NavigateToItem[] + for (var _i = 0, sourceFiles_7 = sourceFiles; _i < sourceFiles_7.length; _i++) { + var sourceFile = sourceFiles_7[_i]; + _loop_4(sourceFile); + } // Remove imports when the imported declaration is already in the list and has the same name. rawItems = ts.filter(rawItems, function (item) { var decl = item.declaration; - if (decl.kind === 236 /* ImportClause */ || decl.kind === 239 /* ImportSpecifier */ || decl.kind === 234 /* ImportEqualsDeclaration */) { + if (decl.kind === 239 /* ImportClause */ || decl.kind === 242 /* ImportSpecifier */ || decl.kind === 237 /* ImportEqualsDeclaration */) { var importer = checker.getSymbolAtLocation(decl.name); var imported = checker.getAliasedSymbol(importer); return importer.name !== imported.name; @@ -71822,7 +77435,7 @@ var ts; } function getTextOfIdentifierOrLiteral(node) { if (node) { - if (node.kind === 70 /* Identifier */ || + if (node.kind === 71 /* Identifier */ || node.kind === 9 /* StringLiteral */ || node.kind === 8 /* NumericLiteral */) { return node.text; @@ -71831,17 +77444,20 @@ var ts; return undefined; } function tryAddSingleDeclarationName(declaration, containers) { - if (declaration && declaration.name) { - var text = getTextOfIdentifierOrLiteral(declaration.name); - if (text !== undefined) { - containers.unshift(text); - } - else if (declaration.name.kind === 142 /* ComputedPropertyName */) { - return tryAddComputedPropertyName(declaration.name.expression, containers, /*includeLastPortion*/ true); - } - else { - // Don't know how to add this. - return false; + if (declaration) { + var name = ts.getNameOfDeclaration(declaration); + if (name) { + var text = getTextOfIdentifierOrLiteral(name); + if (text !== undefined) { + containers.unshift(text); + } + else if (name.kind === 144 /* ComputedPropertyName */) { + return tryAddComputedPropertyName(name.expression, containers, /*includeLastPortion*/ true); + } + else { + // Don't know how to add this. + return false; + } } } return true; @@ -71857,7 +77473,7 @@ var ts; } return true; } - if (expression.kind === 177 /* PropertyAccessExpression */) { + if (expression.kind === 179 /* PropertyAccessExpression */) { var propertyAccess = expression; if (includeLastPortion) { containers.unshift(propertyAccess.name.text); @@ -71870,8 +77486,9 @@ var ts; var containers = []; // First, if we started with a computed property name, then add all but the last // portion into the container array. - if (declaration.name.kind === 142 /* ComputedPropertyName */) { - if (!tryAddComputedPropertyName(declaration.name.expression, containers, /*includeLastPortion*/ false)) { + var name = ts.getNameOfDeclaration(declaration); + if (name.kind === 144 /* ComputedPropertyName */) { + if (!tryAddComputedPropertyName(name.expression, containers, /*includeLastPortion*/ false)) { return undefined; } } @@ -71909,6 +77526,7 @@ var ts; function createNavigateToItem(rawItem) { var declaration = rawItem.declaration; var container = ts.getContainerNode(declaration); + var containerName = container && ts.getNameOfDeclaration(container); return { name: rawItem.name, kind: ts.getNodeKind(declaration), @@ -71916,10 +77534,10 @@ var ts; matchKind: ts.PatternMatchKind[rawItem.matchKind], isCaseSensitive: rawItem.isCaseSensitive, fileName: rawItem.fileName, - textSpan: ts.createTextSpanFromBounds(declaration.getStart(), declaration.getEnd()), + textSpan: ts.createTextSpanFromNode(declaration), // TODO(jfreeman): What should be the containerName when the container has a computed name? - containerName: container && container.name ? container.name.text : "", - containerKind: container && container.name ? ts.getNodeKind(container) : "" + containerName: containerName ? containerName.text : "", + containerKind: containerName ? ts.getNodeKind(container) : "" }; } } @@ -71932,22 +77550,61 @@ var ts; (function (ts) { var NavigationBar; (function (NavigationBar) { - function getNavigationBarItems(sourceFile) { + /** + * Matches all whitespace characters in a string. Eg: + * + * "app. + * + * onactivated" + * + * matches because of the newline, whereas + * + * "app.onactivated" + * + * does not match. + */ + var whiteSpaceRegex = /\s+/g; + // Keep sourceFile handy so we don't have to search for it every time we need to call `getText`. + var curCancellationToken; + var curSourceFile; + /** + * For performance, we keep navigation bar parents on a stack rather than passing them through each recursion. + * `parent` is the current parent and is *not* stored in parentsStack. + * `startNode` sets a new parent and `endNode` returns to the previous parent. + */ + var parentsStack = []; + var parent; + // NavigationBarItem requires an array, but will not mutate it, so just give it this for performance. + var emptyChildItemArray = []; + function getNavigationBarItems(sourceFile, cancellationToken) { + curCancellationToken = cancellationToken; curSourceFile = sourceFile; - var result = ts.map(topLevelItems(rootNavigationBarNode(sourceFile)), convertToTopLevelItem); - curSourceFile = undefined; - return result; + try { + return ts.map(topLevelItems(rootNavigationBarNode(sourceFile)), convertToTopLevelItem); + } + finally { + reset(); + } } NavigationBar.getNavigationBarItems = getNavigationBarItems; - function getNavigationTree(sourceFile) { + function getNavigationTree(sourceFile, cancellationToken) { + curCancellationToken = cancellationToken; curSourceFile = sourceFile; - var result = convertToTree(rootNavigationBarNode(sourceFile)); - curSourceFile = undefined; - return result; + try { + return convertToTree(rootNavigationBarNode(sourceFile)); + } + finally { + reset(); + } } NavigationBar.getNavigationTree = getNavigationTree; - // Keep sourceFile handy so we don't have to search for it every time we need to call `getText`. - var curSourceFile; + function reset() { + curSourceFile = undefined; + curCancellationToken = undefined; + parentsStack = []; + parent = undefined; + emptyChildItemArray = []; + } function nodeText(node) { return node.getText(curSourceFile); } @@ -71962,13 +77619,6 @@ var ts; parent.children = [child]; } } - /* - For performance, we keep navigation bar parents on a stack rather than passing them through each recursion. - `parent` is the current parent and is *not* stored in parentsStack. - `startNode` sets a new parent and `endNode` returns to the previous parent. - */ - var parentsStack = []; - var parent; function rootNavigationBarNode(sourceFile) { ts.Debug.assert(!parentsStack.length); var root = { node: sourceFile, additionalNodes: undefined, parent: undefined, children: undefined, indent: 0 }; @@ -72019,11 +77669,12 @@ var ts; } /** Look for navigation bar items in node's subtree, adding them to the current `parent`. */ function addChildrenRecursively(node) { + curCancellationToken.throwIfCancellationRequested(); if (!node || ts.isToken(node)) { return; } switch (node.kind) { - case 150 /* Constructor */: + case 152 /* 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); @@ -72035,21 +77686,21 @@ var ts; } } break; - case 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 148 /* MethodSignature */: + case 151 /* MethodDeclaration */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + case 150 /* MethodSignature */: if (!ts.hasDynamicName(node)) { addNodeWithRecursiveChild(node, node.body); } break; - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: + case 149 /* PropertyDeclaration */: + case 148 /* PropertySignature */: if (!ts.hasDynamicName(node)) { addLeafNode(node); } break; - case 236 /* ImportClause */: + case 239 /* ImportClause */: var importClause = node; // Handle default import case e.g.: // import d from "mod"; @@ -72061,7 +77712,7 @@ var ts; // import {a, b as B} from "mod"; var namedBindings = importClause.namedBindings; if (namedBindings) { - if (namedBindings.kind === 237 /* NamespaceImport */) { + if (namedBindings.kind === 240 /* NamespaceImport */) { addLeafNode(namedBindings); } else { @@ -72072,12 +77723,12 @@ var ts; } } break; - case 174 /* BindingElement */: - case 223 /* VariableDeclaration */: + case 176 /* BindingElement */: + case 226 /* VariableDeclaration */: var decl = node; - var name_49 = decl.name; - if (ts.isBindingPattern(name_49)) { - addChildrenRecursively(name_49); + var name = decl.name; + if (ts.isBindingPattern(name)) { + addChildrenRecursively(name); } else if (decl.initializer && isFunctionOrClassExpression(decl.initializer)) { // For `const x = function() {}`, just use the function node, not the const. @@ -72087,12 +77738,12 @@ var ts; addNodeWithRecursiveChild(decl, decl.initializer); } break; - case 185 /* ArrowFunction */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: + case 187 /* ArrowFunction */: + case 228 /* FunctionDeclaration */: + case 186 /* FunctionExpression */: addNodeWithRecursiveChild(node, node.body); break; - case 229 /* EnumDeclaration */: + case 232 /* EnumDeclaration */: startNode(node); for (var _d = 0, _e = node.members; _d < _e.length; _d++) { var member = _e[_d]; @@ -72102,9 +77753,9 @@ var ts; } endNode(); break; - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: - case 227 /* InterfaceDeclaration */: + case 229 /* ClassDeclaration */: + case 199 /* ClassExpression */: + case 230 /* InterfaceDeclaration */: startNode(node); for (var _f = 0, _g = node.members; _f < _g.length; _f++) { var member = _g[_f]; @@ -72112,21 +77763,21 @@ var ts; } endNode(); break; - case 230 /* ModuleDeclaration */: + case 233 /* ModuleDeclaration */: addNodeWithRecursiveChild(node, getInteriorModule(node).body); break; - case 243 /* ExportSpecifier */: - case 234 /* ImportEqualsDeclaration */: - case 155 /* IndexSignature */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 228 /* TypeAliasDeclaration */: + case 246 /* ExportSpecifier */: + case 237 /* ImportEqualsDeclaration */: + case 157 /* IndexSignature */: + case 155 /* CallSignature */: + case 156 /* ConstructSignature */: + case 231 /* TypeAliasDeclaration */: addLeafNode(node); break; default: ts.forEach(node.jsDoc, function (jsDoc) { ts.forEach(jsDoc.tags, function (tag) { - if (tag.kind === 285 /* JSDocTypedefTag */) { + if (tag.kind === 290 /* JSDocTypedefTag */) { addLeafNode(tag); } }); @@ -72138,15 +77789,15 @@ var ts; function mergeChildren(children) { var nameToItems = ts.createMap(); ts.filterMutate(children, function (child) { - var decl = child.node; - var name = decl.name && nodeText(decl.name); + var declName = ts.getNameOfDeclaration(child.node); + var name = declName && nodeText(declName); if (!name) { // Anonymous items are never merged. return true; } - var itemsWithSameName = nameToItems[name]; + var itemsWithSameName = nameToItems.get(name); if (!itemsWithSameName) { - nameToItems[name] = child; + nameToItems.set(name, child); return true; } if (itemsWithSameName instanceof Array) { @@ -72164,7 +77815,7 @@ var ts; if (tryMerge(itemWithSameName, child)) { return false; } - nameToItems[name] = [itemWithSameName, child]; + nameToItems.set(name, [itemWithSameName, child]); return true; } function tryMerge(a, b) { @@ -72177,14 +77828,14 @@ var ts; }); /** a and b have the same name, but they may not be mergeable. */ function shouldReallyMerge(a, b) { - return a.kind === b.kind && (a.kind !== 230 /* ModuleDeclaration */ || areSameModule(a, b)); + return a.kind === b.kind && (a.kind !== 233 /* ModuleDeclaration */ || areSameModule(a, b)); // 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) { if (a.body.kind !== b.body.kind) { return false; } - if (a.body.kind !== 230 /* ModuleDeclaration */) { + if (a.body.kind !== 233 /* ModuleDeclaration */) { return true; } return areSameModule(a.body, b.body); @@ -72212,61 +77863,42 @@ var ts; function compareChildren(child1, child2) { var name1 = tryGetName(child1.node), name2 = tryGetName(child2.node); if (name1 && name2) { - var cmp = localeCompareFix(name1, name2); + var cmp = ts.compareStringsCaseInsensitive(name1, name2); return cmp !== 0 ? cmp : navigationBarNodeKind(child1) - navigationBarNodeKind(child2); } else { return name1 ? 1 : name2 ? -1 : navigationBarNodeKind(child1) - navigationBarNodeKind(child2); } } - // Intl is missing in Safari, and node 0.10 treats "a" as greater than "B". - var localeCompareIsCorrect = ts.collator && ts.collator.compare("a", "B") < 0; - var localeCompareFix = localeCompareIsCorrect ? ts.collator.compare : function (a, b) { - // This isn't perfect, but it passes all of our tests. - for (var i = 0; i < Math.min(a.length, b.length); i++) { - var chA = a.charAt(i), chB = b.charAt(i); - if (chA === "\"" && chB === "'") { - return 1; - } - if (chA === "'" && chB === "\"") { - return -1; - } - var cmp = ts.compareStrings(chA.toLocaleLowerCase(), chB.toLocaleLowerCase()); - if (cmp !== 0) { - return cmp; - } - } - return a.length - b.length; - }; /** * This differs from getItemName because this is just used for sorting. * We only sort nodes by name that have a more-or-less "direct" name, as opposed to `new()` and the like. * So `new()` can still come before an `aardvark` method. */ function tryGetName(node) { - if (node.kind === 230 /* ModuleDeclaration */) { + if (node.kind === 233 /* ModuleDeclaration */) { return getModuleName(node); } - var decl = node; - if (decl.name) { - return ts.getPropertyNameForPropertyNameNode(decl.name); + var declName = ts.getNameOfDeclaration(node); + if (declName) { + return ts.getPropertyNameForPropertyNameNode(declName); } switch (node.kind) { - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - case 197 /* ClassExpression */: + case 186 /* FunctionExpression */: + case 187 /* ArrowFunction */: + case 199 /* ClassExpression */: return getFunctionOrClassName(node); - case 285 /* JSDocTypedefTag */: + case 290 /* JSDocTypedefTag */: return getJSDocTypedefTagName(node); default: return undefined; } } function getItemName(node) { - if (node.kind === 230 /* ModuleDeclaration */) { + if (node.kind === 233 /* ModuleDeclaration */) { return getModuleName(node); } - var name = node.name; + var name = ts.getNameOfDeclaration(node); if (name) { var text = nodeText(name); if (text.length > 0) { @@ -72274,16 +77906,16 @@ var ts; } } switch (node.kind) { - case 261 /* SourceFile */: + case 265 /* SourceFile */: var sourceFile = node; return ts.isExternalModule(sourceFile) ? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))) + "\"" : ""; - case 185 /* ArrowFunction */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: + case 187 /* ArrowFunction */: + case 228 /* FunctionDeclaration */: + case 186 /* FunctionExpression */: + case 229 /* ClassDeclaration */: + case 199 /* ClassExpression */: if (ts.getModifierFlags(node) & 512 /* Default */) { return "default"; } @@ -72291,15 +77923,15 @@ var ts; // (eg: "app\n.onactivated"), so we should remove the whitespace for readabiltiy in the // navigation bar. return getFunctionOrClassName(node); - case 150 /* Constructor */: + case 152 /* Constructor */: return "constructor"; - case 154 /* ConstructSignature */: + case 156 /* ConstructSignature */: return "new()"; - case 153 /* CallSignature */: + case 155 /* CallSignature */: return "()"; - case 155 /* IndexSignature */: + case 157 /* IndexSignature */: return "[]"; - case 285 /* JSDocTypedefTag */: + case 290 /* JSDocTypedefTag */: return getJSDocTypedefTagName(node); default: return ""; @@ -72311,10 +77943,10 @@ var ts; } else { var parentNode = node.parent && node.parent.parent; - if (parentNode && parentNode.kind === 205 /* VariableStatement */) { + if (parentNode && parentNode.kind === 208 /* VariableStatement */) { if (parentNode.declarationList.declarations.length > 0) { var nameIdentifier = parentNode.declarationList.declarations[0].name; - if (nameIdentifier.kind === 70 /* Identifier */) { + if (nameIdentifier.kind === 71 /* Identifier */) { return nameIdentifier.text; } } @@ -72340,24 +77972,24 @@ var ts; return topLevel; function isTopLevel(item) { switch (navigationBarNodeKind(item)) { - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: - case 229 /* EnumDeclaration */: - case 227 /* InterfaceDeclaration */: - case 230 /* ModuleDeclaration */: - case 261 /* SourceFile */: - case 228 /* TypeAliasDeclaration */: - case 285 /* JSDocTypedefTag */: + case 229 /* ClassDeclaration */: + case 199 /* ClassExpression */: + case 232 /* EnumDeclaration */: + case 230 /* InterfaceDeclaration */: + case 233 /* ModuleDeclaration */: + case 265 /* SourceFile */: + case 231 /* TypeAliasDeclaration */: + case 290 /* JSDocTypedefTag */: return true; - case 150 /* Constructor */: - case 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 223 /* VariableDeclaration */: + case 152 /* Constructor */: + case 151 /* MethodDeclaration */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + case 226 /* VariableDeclaration */: return hasSomeImportantChild(item); - case 185 /* ArrowFunction */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: + case 187 /* ArrowFunction */: + case 228 /* FunctionDeclaration */: + case 186 /* FunctionExpression */: return isTopLevelFunctionDeclaration(item); default: return false; @@ -72367,10 +77999,10 @@ var ts; return false; } switch (navigationBarNodeKind(item.parent)) { - case 231 /* ModuleBlock */: - case 261 /* SourceFile */: - case 149 /* MethodDeclaration */: - case 150 /* Constructor */: + case 234 /* ModuleBlock */: + case 265 /* SourceFile */: + case 151 /* MethodDeclaration */: + case 152 /* Constructor */: return true; default: return hasSomeImportantChild(item); @@ -72379,18 +78011,16 @@ var ts; function hasSomeImportantChild(item) { return ts.forEach(item.children, function (child) { var childKind = navigationBarNodeKind(child); - return childKind !== 223 /* VariableDeclaration */ && childKind !== 174 /* BindingElement */; + return childKind !== 226 /* VariableDeclaration */ && childKind !== 176 /* BindingElement */; }); } } } - // NavigationBarItem requires an array, but will not mutate it, so just give it this for performance. - var emptyChildItemArray = []; function convertToTree(n) { return { text: getItemName(n.node), kind: ts.getNodeKind(n.node), - kindModifiers: ts.getNodeModifiers(n.node), + kindModifiers: getModifiers(n.node), spans: getSpans(n), childItems: ts.map(n.children, convertToTree) }; @@ -72399,7 +78029,7 @@ var ts; return { text: getItemName(n.node), kind: ts.getNodeKind(n.node), - kindModifiers: ts.getNodeModifiers(n.node), + kindModifiers: getModifiers(n.node), spans: getSpans(n), childItems: ts.map(n.children, convertToChildItem) || emptyChildItemArray, indent: n.indent, @@ -72437,7 +78067,7 @@ var ts; // Otherwise, we need to aggregate each identifier to build up the qualified name. var result = []; result.push(moduleDeclaration.name.text); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 230 /* ModuleDeclaration */) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 233 /* ModuleDeclaration */) { moduleDeclaration = moduleDeclaration.body; result.push(moduleDeclaration.name.text); } @@ -72448,28 +78078,34 @@ var ts; * We store 'A' as associated with a NavNode, and use getModuleName to traverse down again. */ function getInteriorModule(decl) { - return decl.body.kind === 230 /* ModuleDeclaration */ ? getInteriorModule(decl.body) : decl; + return decl.body.kind === 233 /* ModuleDeclaration */ ? getInteriorModule(decl.body) : decl; } function isComputedProperty(member) { - return !member.name || member.name.kind === 142 /* ComputedPropertyName */; + return !member.name || member.name.kind === 144 /* ComputedPropertyName */; } function getNodeSpan(node) { - return node.kind === 261 /* SourceFile */ + return node.kind === 265 /* SourceFile */ ? ts.createTextSpanFromBounds(node.getFullStart(), node.getEnd()) - : ts.createTextSpanFromBounds(node.getStart(curSourceFile), node.getEnd()); + : ts.createTextSpanFromNode(node, curSourceFile); + } + function getModifiers(node) { + if (node.parent && node.parent.kind === 226 /* VariableDeclaration */) { + node = node.parent; + } + return ts.getNodeModifiers(node); } function getFunctionOrClassName(node) { if (node.name && ts.getFullWidth(node.name) > 0) { return ts.declarationNameToString(node.name); } - else if (node.parent.kind === 223 /* VariableDeclaration */) { + else if (node.parent.kind === 226 /* VariableDeclaration */) { return ts.declarationNameToString(node.parent.name); } - else if (node.parent.kind === 192 /* BinaryExpression */ && - node.parent.operatorToken.kind === 57 /* EqualsToken */) { + else if (node.parent.kind === 194 /* BinaryExpression */ && + node.parent.operatorToken.kind === 58 /* EqualsToken */) { return nodeText(node.parent.left).replace(whiteSpaceRegex, ""); } - else if (node.parent.kind === 257 /* PropertyAssignment */ && node.parent.name) { + else if (node.parent.kind === 261 /* PropertyAssignment */ && node.parent.name) { return nodeText(node.parent.name); } else if (ts.getModifierFlags(node) & 512 /* Default */) { @@ -72480,22 +78116,8 @@ var ts; } } function isFunctionOrClassExpression(node) { - return node.kind === 184 /* FunctionExpression */ || node.kind === 185 /* ArrowFunction */ || node.kind === 197 /* ClassExpression */; + return node.kind === 186 /* FunctionExpression */ || node.kind === 187 /* ArrowFunction */ || node.kind === 199 /* ClassExpression */; } - /** - * Matches all whitespace characters in a string. Eg: - * - * "app. - * - * onactivated" - * - * matches because of the newline, whereas - * - * "app.onactivated" - * - * does not match. - */ - var whiteSpaceRegex = /\s+/g; })(NavigationBar = ts.NavigationBar || (ts.NavigationBar = {})); })(ts || (ts = {})); /* @internal */ @@ -72503,29 +78125,29 @@ var ts; (function (ts) { var OutliningElementsCollector; (function (OutliningElementsCollector) { - function collectElements(sourceFile) { + function collectElements(sourceFile, cancellationToken) { var elements = []; var collapseText = "..."; function addOutliningSpan(hintSpanNode, startElement, endElement, autoCollapse) { if (hintSpanNode && startElement && endElement) { - var span_12 = { + var span_13 = { textSpan: ts.createTextSpanFromBounds(startElement.pos, endElement.end), - hintSpan: ts.createTextSpanFromBounds(hintSpanNode.getStart(), hintSpanNode.end), + hintSpan: ts.createTextSpanFromNode(hintSpanNode, sourceFile), bannerText: collapseText, autoCollapse: autoCollapse }; - elements.push(span_12); + elements.push(span_13); } } function addOutliningSpanComments(commentSpan, autoCollapse) { if (commentSpan) { - var span_13 = { + var span_14 = { textSpan: ts.createTextSpanFromBounds(commentSpan.pos, commentSpan.end), hintSpan: ts.createTextSpanFromBounds(commentSpan.pos, commentSpan.end), bannerText: collapseText, autoCollapse: autoCollapse }; - elements.push(span_13); + elements.push(span_14); } } function addOutliningForLeadingCommentsForNode(n) { @@ -72537,6 +78159,7 @@ var ts; var singleLineCommentCount = 0; for (var _i = 0, comments_4 = comments; _i < comments_4.length; _i++) { var currentComment = comments_4[_i]; + cancellationToken.throwIfCancellationRequested(); // For single line comments, combine consecutive ones (2 or more) into // a single span from the start of the first till the end of the last if (currentComment.kind === 2 /* SingleLineCommentTrivia */) { @@ -72562,19 +78185,20 @@ var ts; // Only outline spans of two or more consecutive single line comments if (count > 1) { var multipleSingleLineComments = { + kind: 2 /* SingleLineCommentTrivia */, pos: start, end: end, - kind: 2 /* SingleLineCommentTrivia */ }; addOutliningSpanComments(multipleSingleLineComments, /*autoCollapse*/ false); } } function autoCollapse(node) { - return ts.isFunctionBlock(node) && node.parent.kind !== 185 /* ArrowFunction */; + return ts.isFunctionBlock(node) && node.parent.kind !== 187 /* ArrowFunction */; } var depth = 0; var maxDepth = 20; function walk(n) { + cancellationToken.throwIfCancellationRequested(); if (depth > maxDepth) { return; } @@ -72582,71 +78206,72 @@ var ts; addOutliningForLeadingCommentsForNode(n); } switch (n.kind) { - case 204 /* Block */: + case 207 /* Block */: if (!ts.isFunctionBlock(n)) { - var parent_20 = n.parent; - var openBrace = ts.findChildOfKind(n, 16 /* OpenBraceToken */, sourceFile); - var closeBrace = ts.findChildOfKind(n, 17 /* CloseBraceToken */, sourceFile); + var parent = n.parent; + var openBrace = ts.findChildOfKind(n, 17 /* OpenBraceToken */, sourceFile); + var closeBrace = ts.findChildOfKind(n, 18 /* CloseBraceToken */, sourceFile); // 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. - if (parent_20.kind === 209 /* DoStatement */ || - parent_20.kind === 212 /* ForInStatement */ || - parent_20.kind === 213 /* ForOfStatement */ || - parent_20.kind === 211 /* ForStatement */ || - parent_20.kind === 208 /* IfStatement */ || - parent_20.kind === 210 /* WhileStatement */ || - parent_20.kind === 217 /* WithStatement */ || - parent_20.kind === 256 /* CatchClause */) { - addOutliningSpan(parent_20, openBrace, closeBrace, autoCollapse(n)); + if (parent.kind === 212 /* DoStatement */ || + parent.kind === 215 /* ForInStatement */ || + parent.kind === 216 /* ForOfStatement */ || + parent.kind === 214 /* ForStatement */ || + parent.kind === 211 /* IfStatement */ || + parent.kind === 213 /* WhileStatement */ || + parent.kind === 220 /* WithStatement */ || + parent.kind === 260 /* CatchClause */) { + addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); break; } - if (parent_20.kind === 221 /* TryStatement */) { + if (parent.kind === 224 /* TryStatement */) { // Could be the try-block, or the finally-block. - var tryStatement = parent_20; + var tryStatement = parent; if (tryStatement.tryBlock === n) { - addOutliningSpan(parent_20, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); break; } else if (tryStatement.finallyBlock === n) { - var finallyKeyword = ts.findChildOfKind(tryStatement, 86 /* FinallyKeyword */, sourceFile); + var finallyKeyword = ts.findChildOfKind(tryStatement, 87 /* FinallyKeyword */, sourceFile); if (finallyKeyword) { addOutliningSpan(finallyKeyword, openBrace, closeBrace, autoCollapse(n)); break; } } + // fall through. } // Block was a standalone block. In this case we want to only collapse // the span of the block, independent of any parent span. - var span_14 = ts.createTextSpanFromBounds(n.getStart(), n.end); + var span_15 = ts.createTextSpanFromNode(n); elements.push({ - textSpan: span_14, - hintSpan: span_14, + textSpan: span_15, + hintSpan: span_15, bannerText: collapseText, autoCollapse: autoCollapse(n) }); break; } - // Fallthrough. - case 231 /* ModuleBlock */: { - var openBrace = ts.findChildOfKind(n, 16 /* OpenBraceToken */, sourceFile); - var closeBrace = ts.findChildOfKind(n, 17 /* CloseBraceToken */, sourceFile); + // falls through + case 234 /* ModuleBlock */: { + var openBrace = ts.findChildOfKind(n, 17 /* OpenBraceToken */, sourceFile); + var closeBrace = ts.findChildOfKind(n, 18 /* CloseBraceToken */, sourceFile); addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n)); break; } - case 226 /* ClassDeclaration */: - case 227 /* InterfaceDeclaration */: - case 229 /* EnumDeclaration */: - case 176 /* ObjectLiteralExpression */: - case 232 /* CaseBlock */: { - var openBrace = ts.findChildOfKind(n, 16 /* OpenBraceToken */, sourceFile); - var closeBrace = ts.findChildOfKind(n, 17 /* CloseBraceToken */, sourceFile); + case 229 /* ClassDeclaration */: + case 230 /* InterfaceDeclaration */: + case 232 /* EnumDeclaration */: + case 178 /* ObjectLiteralExpression */: + case 235 /* CaseBlock */: { + var openBrace = ts.findChildOfKind(n, 17 /* OpenBraceToken */, sourceFile); + var closeBrace = ts.findChildOfKind(n, 18 /* CloseBraceToken */, sourceFile); addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); break; } - case 175 /* ArrayLiteralExpression */: - var openBracket = ts.findChildOfKind(n, 20 /* OpenBracketToken */, sourceFile); - var closeBracket = ts.findChildOfKind(n, 21 /* CloseBracketToken */, sourceFile); + case 177 /* ArrayLiteralExpression */: + var openBracket = ts.findChildOfKind(n, 21 /* OpenBracketToken */, sourceFile); + var closeBracket = ts.findChildOfKind(n, 22 /* CloseBracketToken */, sourceFile); addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n)); break; } @@ -72740,10 +78365,11 @@ var ts; return totalMatch; } function getWordSpans(word) { - if (!(word in stringToWordSpans)) { - stringToWordSpans[word] = breakIntoWordSpans(word); + var spans = stringToWordSpans.get(word); + if (!spans) { + stringToWordSpans.set(word, spans = breakIntoWordSpans(word)); } - return stringToWordSpans[word]; + return spans; } function matchTextChunk(candidate, chunk, punctuationStripped) { var index = indexOfIgnoringCase(candidate, chunk.textLowerCase); @@ -72771,10 +78397,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_15 = wordSpans_1[_i]; - if (partStartsWith(candidate, span_15, chunk.text, /*ignoreCase:*/ true)) { + var span_16 = wordSpans_1[_i]; + if (partStartsWith(candidate, span_16, chunk.text, /*ignoreCase:*/ true)) { return createPatternMatch(PatternMatchKind.substring, punctuationStripped, - /*isCaseSensitive:*/ partStartsWith(candidate, span_15, chunk.text, /*ignoreCase:*/ false)); + /*isCaseSensitive:*/ partStartsWith(candidate, span_16, chunk.text, /*ignoreCase:*/ false)); } } } @@ -73024,7 +78650,8 @@ var ts; } // Assumes 'value' is already lowercase. function indexOfIgnoringCase(string, value) { - for (var i = 0, n = string.length - value.length; i <= n; i++) { + var n = string.length - value.length; + for (var i = 0; i <= n; i++) { if (startsWithIgnoringCase(string, value, i)) { return i; } @@ -73033,7 +78660,7 @@ var ts; } // Assumes 'value' is already lowercase. function startsWithIgnoringCase(string, value, start) { - for (var i = 0, n = value.length; i < n; i++) { + for (var i = 0; i < value.length; i++) { var ch1 = toLowerCase(string.charCodeAt(i + start)); var ch2 = value.charCodeAt(i); if (ch1 !== ch2) { @@ -73105,7 +78732,7 @@ var ts; function breakIntoSpans(identifier, word) { var result = []; var wordStart = 0; - for (var i = 1, n = identifier.length; i < n; i++) { + for (var i = 1; i < identifier.length; i++) { var lastIsDigit = isDigit(identifier.charCodeAt(i - 1)); var currentIsDigit = isDigit(identifier.charCodeAt(i)); var hasTransitionFromLowerToUpper = transitionFromLowerToUpper(identifier, word, i); @@ -73235,10 +78862,10 @@ var ts; var externalModule = false; function nextToken() { var token = ts.scanner.scan(); - if (token === 16 /* OpenBraceToken */) { + if (token === 17 /* OpenBraceToken */) { braceNesting++; } - else if (token === 17 /* CloseBraceToken */) { + else if (token === 18 /* CloseBraceToken */) { braceNesting--; } return token; @@ -73289,10 +78916,10 @@ var ts; */ function tryConsumeDeclare() { var token = ts.scanner.getToken(); - if (token === 123 /* DeclareKeyword */) { + if (token === 124 /* DeclareKeyword */) { // declare module "mod" token = nextToken(); - if (token === 127 /* ModuleKeyword */) { + if (token === 128 /* ModuleKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { recordAmbientExternalModule(); @@ -73307,7 +78934,7 @@ var ts; */ function tryConsumeImport() { var token = ts.scanner.getToken(); - if (token === 90 /* ImportKeyword */) { + if (token === 91 /* ImportKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // import "mod"; @@ -73315,9 +78942,9 @@ var ts; return true; } else { - if (token === 70 /* Identifier */ || ts.isKeyword(token)) { + if (token === 71 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 138 /* FromKeyword */) { + if (token === 140 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // import d from "mod"; @@ -73325,12 +78952,12 @@ var ts; return true; } } - else if (token === 57 /* EqualsToken */) { + else if (token === 58 /* EqualsToken */) { if (tryConsumeRequireCall(/*skipCurrentToken*/ true)) { return true; } } - else if (token === 25 /* CommaToken */) { + else if (token === 26 /* CommaToken */) { // consume comma and keep going token = nextToken(); } @@ -73339,16 +78966,16 @@ var ts; return true; } } - if (token === 16 /* OpenBraceToken */) { + if (token === 17 /* OpenBraceToken */) { token = nextToken(); // consume "{ a as B, c, d as D}" clauses // make sure that it stops on EOF - while (token !== 17 /* CloseBraceToken */ && token !== 1 /* EndOfFileToken */) { + while (token !== 18 /* CloseBraceToken */ && token !== 1 /* EndOfFileToken */) { token = nextToken(); } - if (token === 17 /* CloseBraceToken */) { + if (token === 18 /* CloseBraceToken */) { token = nextToken(); - if (token === 138 /* FromKeyword */) { + if (token === 140 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // import {a as A} from "mod"; @@ -73358,13 +78985,13 @@ var ts; } } } - else if (token === 38 /* AsteriskToken */) { + else if (token === 39 /* AsteriskToken */) { token = nextToken(); - if (token === 117 /* AsKeyword */) { + if (token === 118 /* AsKeyword */) { token = nextToken(); - if (token === 70 /* Identifier */ || ts.isKeyword(token)) { + if (token === 71 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 138 /* FromKeyword */) { + if (token === 140 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // import * as NS from "mod" @@ -73382,19 +79009,19 @@ var ts; } function tryConsumeExport() { var token = ts.scanner.getToken(); - if (token === 83 /* ExportKeyword */) { + if (token === 84 /* ExportKeyword */) { markAsExternalModuleIfTopLevel(); token = nextToken(); - if (token === 16 /* OpenBraceToken */) { + if (token === 17 /* OpenBraceToken */) { token = nextToken(); // consume "{ a as B, c, d as D}" clauses // make sure it stops on EOF - while (token !== 17 /* CloseBraceToken */ && token !== 1 /* EndOfFileToken */) { + while (token !== 18 /* CloseBraceToken */ && token !== 1 /* EndOfFileToken */) { token = nextToken(); } - if (token === 17 /* CloseBraceToken */) { + if (token === 18 /* CloseBraceToken */) { token = nextToken(); - if (token === 138 /* FromKeyword */) { + if (token === 140 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // export {a as A} from "mod"; @@ -73404,9 +79031,9 @@ var ts; } } } - else if (token === 38 /* AsteriskToken */) { + else if (token === 39 /* AsteriskToken */) { token = nextToken(); - if (token === 138 /* FromKeyword */) { + if (token === 140 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // export * from "mod" @@ -73414,11 +79041,11 @@ var ts; } } } - else if (token === 90 /* ImportKeyword */) { + else if (token === 91 /* ImportKeyword */) { token = nextToken(); - if (token === 70 /* Identifier */ || ts.isKeyword(token)) { + if (token === 71 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 57 /* EqualsToken */) { + if (token === 58 /* EqualsToken */) { if (tryConsumeRequireCall(/*skipCurrentToken*/ true)) { return true; } @@ -73431,9 +79058,9 @@ var ts; } function tryConsumeRequireCall(skipCurrentToken) { var token = skipCurrentToken ? nextToken() : ts.scanner.getToken(); - if (token === 131 /* RequireKeyword */) { + if (token === 132 /* RequireKeyword */) { token = nextToken(); - if (token === 18 /* OpenParenToken */) { + if (token === 19 /* OpenParenToken */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // require("mod"); @@ -73446,16 +79073,16 @@ var ts; } function tryConsumeDefine() { var token = ts.scanner.getToken(); - if (token === 70 /* Identifier */ && ts.scanner.getTokenValue() === "define") { + if (token === 71 /* Identifier */ && ts.scanner.getTokenValue() === "define") { token = nextToken(); - if (token !== 18 /* OpenParenToken */) { + if (token !== 19 /* OpenParenToken */) { return true; } token = nextToken(); if (token === 9 /* StringLiteral */) { // looks like define ("modname", ... - skip string literal and comma token = nextToken(); - if (token === 25 /* CommaToken */) { + if (token === 26 /* CommaToken */) { token = nextToken(); } else { @@ -73464,14 +79091,14 @@ var ts; } } // should be start of dependency list - if (token !== 20 /* OpenBracketToken */) { + if (token !== 21 /* OpenBracketToken */) { return true; } // skip open bracket token = nextToken(); var i = 0; // scan until ']' or EOF - while (token !== 21 /* CloseBracketToken */ && token !== 1 /* EndOfFileToken */) { + while (token !== 22 /* CloseBracketToken */ && token !== 1 /* EndOfFileToken */) { // record string literals as module names if (token === 9 /* StringLiteral */) { recordModuleName(); @@ -73558,93 +79185,89 @@ var ts; var Rename; (function (Rename) { function getRenameInfo(typeChecker, defaultLibFileName, getCanonicalFileName, sourceFile, position) { - var canonicalDefaultLibName = getCanonicalFileName(ts.normalizePath(defaultLibFileName)); + var getCanonicalDefaultLibName = ts.memoize(function () { return getCanonicalFileName(ts.normalizePath(defaultLibFileName)); }); var node = ts.getTouchingWord(sourceFile, position, /*includeJsDocComment*/ true); - if (node) { - if (node.kind === 70 /* Identifier */ || - node.kind === 9 /* StringLiteral */ || - ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || - ts.isThis(node)) { - 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(); - if (declarations && declarations.length > 0) { - // Disallow rename for elements that are defined in the standard TypeScript library. - if (ts.forEach(declarations, isDefinedInLibraryFile)) { - return getRenameInfoError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library)); - } - var displayName = ts.stripQuotes(ts.getDeclaredName(typeChecker, symbol, node)); - var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, node); - if (kind) { - return { - canRename: true, - kind: kind, - displayName: displayName, - localizedErrorMessage: undefined, - fullDisplayName: typeChecker.getFullyQualifiedName(symbol), - kindModifiers: ts.SymbolDisplay.getSymbolModifiers(symbol), - triggerSpan: createTriggerSpanForNode(node, sourceFile) - }; - } - } - } - else if (node.kind === 9 /* StringLiteral */) { - var type = ts.getStringLiteralTypeForNode(node, typeChecker); - if (type) { - if (isDefinedInLibraryFile(node)) { - return getRenameInfoError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library)); - } - else { - var displayName = ts.stripQuotes(type.text); - return { - canRename: true, - kind: ts.ScriptElementKind.variableElement, - displayName: displayName, - localizedErrorMessage: undefined, - fullDisplayName: displayName, - kindModifiers: ts.ScriptElementKindModifier.none, - triggerSpan: createTriggerSpanForNode(node, sourceFile) - }; - } - } - } - } - } - return getRenameInfoError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_this_element)); - function getRenameInfoError(localizedErrorMessage) { - return { - canRename: false, - localizedErrorMessage: localizedErrorMessage, - displayName: undefined, - fullDisplayName: undefined, - kind: undefined, - kindModifiers: undefined, - triggerSpan: undefined - }; - } + var renameInfo = node && nodeIsEligibleForRename(node) + ? getRenameInfoForNode(node, typeChecker, sourceFile, isDefinedInLibraryFile) + : undefined; + return renameInfo || getRenameInfoError(ts.Diagnostics.You_cannot_rename_this_element); function isDefinedInLibraryFile(declaration) { - if (defaultLibFileName) { - var sourceFile_1 = declaration.getSourceFile(); - var canonicalName = getCanonicalFileName(ts.normalizePath(sourceFile_1.fileName)); - if (canonicalName === canonicalDefaultLibName) { - return true; - } + if (!defaultLibFileName) { + return false; } - return false; - } - function createTriggerSpanForNode(node, sourceFile) { - var start = node.getStart(sourceFile); - var width = node.getWidth(sourceFile); - if (node.kind === 9 /* StringLiteral */) { - // Exclude the quotes - start += 1; - width -= 2; - } - return ts.createTextSpan(start, width); + var sourceFile = declaration.getSourceFile(); + var canonicalName = getCanonicalFileName(ts.normalizePath(sourceFile.fileName)); + return canonicalName === getCanonicalDefaultLibName(); } } Rename.getRenameInfo = getRenameInfo; + function getRenameInfoForNode(node, typeChecker, sourceFile, isDefinedInLibraryFile) { + 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(); + if (declarations && declarations.length > 0) { + // Disallow rename for elements that are defined in the standard TypeScript library. + if (ts.some(declarations, 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 */) { + return undefined; + } + var displayName = ts.stripQuotes(ts.getDeclaredName(typeChecker, symbol, node)); + var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, node); + return kind ? getRenameInfoSuccess(displayName, typeChecker.getFullyQualifiedName(symbol), kind, ts.SymbolDisplay.getSymbolModifiers(symbol), node, sourceFile) : undefined; + } + } + else if (node.kind === 9 /* StringLiteral */) { + 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, ts.ScriptElementKind.variableElement, ts.ScriptElementKindModifier.none, node, sourceFile); + } + } + function getRenameInfoSuccess(displayName, fullDisplayName, kind, kindModifiers, node, sourceFile) { + return { + canRename: true, + kind: kind, + displayName: displayName, + localizedErrorMessage: undefined, + fullDisplayName: fullDisplayName, + kindModifiers: kindModifiers, + triggerSpan: createTriggerSpanForNode(node, sourceFile) + }; + } + function getRenameInfoError(diagnostic) { + return { + canRename: false, + localizedErrorMessage: ts.getLocaleSpecificMessage(diagnostic), + displayName: undefined, + fullDisplayName: undefined, + kind: undefined, + kindModifiers: undefined, + triggerSpan: undefined + }; + } + function createTriggerSpanForNode(node, sourceFile) { + var start = node.getStart(sourceFile); + var width = node.getWidth(sourceFile); + if (node.kind === 9 /* StringLiteral */) { + // Exclude the quotes + start += 1; + width -= 2; + } + return ts.createTextSpan(start, width); + } + function nodeIsEligibleForRename(node) { + return node.kind === 71 /* Identifier */ || + node.kind === 9 /* StringLiteral */ || + ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || + ts.isThis(node); + } })(Rename = ts.Rename || (ts.Rename = {})); })(ts || (ts = {})); /// @@ -73699,7 +79322,7 @@ var ts; // stack++; // break; // case TypeScript.SyntaxKind.CommaToken: - // if (stack == 0) { + // if (stack === 0) { // argumentIndex++; // } // break; @@ -73791,6 +79414,7 @@ var ts; ArgumentListKind[ArgumentListKind["TypeArguments"] = 0] = "TypeArguments"; ArgumentListKind[ArgumentListKind["CallArguments"] = 1] = "CallArguments"; ArgumentListKind[ArgumentListKind["TaggedTemplateArguments"] = 2] = "TaggedTemplateArguments"; + ArgumentListKind[ArgumentListKind["JSXAttributesArguments"] = 3] = "JSXAttributesArguments"; })(ArgumentListKind = SignatureHelp.ArgumentListKind || (SignatureHelp.ArgumentListKind = {})); function getSignatureHelpItems(program, sourceFile, position, cancellationToken) { var typeChecker = program.getTypeChecker(); @@ -73822,15 +79446,15 @@ var ts; } SignatureHelp.getSignatureHelpItems = getSignatureHelpItems; function createJavaScriptSignatureHelpItems(argumentInfo, program) { - if (argumentInfo.invocation.kind !== 179 /* CallExpression */) { + if (argumentInfo.invocation.kind !== 181 /* 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 === 70 /* Identifier */ + var name = expression.kind === 71 /* Identifier */ ? expression - : expression.kind === 177 /* PropertyAccessExpression */ + : expression.kind === 179 /* PropertyAccessExpression */ ? expression.name : undefined; if (!name || !name.text) { @@ -73840,10 +79464,10 @@ var ts; for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { var sourceFile = _a[_i]; var nameToDeclarations = sourceFile.getNamedDeclarations(); - var declarations = nameToDeclarations[name.text]; + var declarations = nameToDeclarations.get(name.text); if (declarations) { - for (var _b = 0, declarations_10 = declarations; _b < declarations_10.length; _b++) { - var declaration = declarations_10[_b]; + for (var _b = 0, declarations_13 = declarations; _b < declarations_13.length; _b++) { + var declaration = declarations_13[_b]; var symbol = declaration.symbol; if (symbol) { var type = typeChecker.getTypeOfSymbolAtLocation(symbol, declaration); @@ -73863,24 +79487,24 @@ var ts; * in the argument of an invocation; returns undefined otherwise. */ function getImmediatelyContainingArgumentInfo(node, position, sourceFile) { - if (node.parent.kind === 179 /* CallExpression */ || node.parent.kind === 180 /* NewExpression */) { + if (node.parent.kind === 181 /* CallExpression */ || node.parent.kind === 182 /* NewExpression */) { var callExpression = node.parent; // There are 3 cases to handle: - // 1. The token introduces a list, and should begin a sig help session + // 1. The token introduces a list, and should begin a signature help session // 2. The token is either not associated with a list, or ends a list, so the session should end - // 3. The token is buried inside a list, and should give sig help + // 3. The token is buried inside a list, and should give signature help // // The following are examples of each: // // Case 1: - // foo<#T, U>(#a, b) -> The token introduces a list, and should begin a sig help session + // foo<#T, U>(#a, b) -> The token introduces a list, and should begin a signature help session // Case 2: // fo#o#(a, b)# -> The token is either not associated with a list, or ends a list, so the session should end // Case 3: - // foo(a#, #b#) -> The token is buried inside a list, and should give sig help + // foo(a#, #b#) -> The token is buried inside a list, and should give signature help // Find out if 'node' is an argument, a type argument, or neither - if (node.kind === 26 /* LessThanToken */ || - node.kind === 18 /* OpenParenToken */) { + if (node.kind === 27 /* LessThanToken */ || + node.kind === 19 /* OpenParenToken */) { // Find the list that starts right *after* the < or ( token. // If the user has just opened a list, consider this item 0. var list = getChildListThatStartsWithOpenerToken(callExpression, node, sourceFile); @@ -73896,7 +79520,7 @@ var ts; } // findListItemInfo can return undefined if we are not in parent's argument list // or type argument list. This includes cases where the cursor is: - // - To the right of the closing paren, non-substitution template, or template tail. + // - To the right of the closing parenthesis, non-substitution template, or template tail. // - Between the type arguments and the arguments (greater than token) // - On the target of the call (parent.func) // - On the 'new' keyword in a 'new' expression @@ -73917,35 +79541,52 @@ var ts; } return undefined; } - else if (node.kind === 12 /* NoSubstitutionTemplateLiteral */ && node.parent.kind === 181 /* TaggedTemplateExpression */) { + else if (node.kind === 13 /* NoSubstitutionTemplateLiteral */ && node.parent.kind === 183 /* 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 === 13 /* TemplateHead */ && node.parent.parent.kind === 181 /* TaggedTemplateExpression */) { + else if (node.kind === 14 /* TemplateHead */ && node.parent.parent.kind === 183 /* TaggedTemplateExpression */) { var templateExpression = node.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 194 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 196 /* TemplateExpression */); var argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); } - else if (node.parent.kind === 202 /* TemplateSpan */ && node.parent.parent.parent.kind === 181 /* TaggedTemplateExpression */) { + else if (node.parent.kind === 205 /* TemplateSpan */ && node.parent.parent.parent.kind === 183 /* TaggedTemplateExpression */) { var templateSpan = node.parent; var templateExpression = templateSpan.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 194 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 196 /* TemplateExpression */); // If we're just after a template tail, don't show signature help. - if (node.kind === 15 /* TemplateTail */ && !ts.isInsideTemplateLiteral(node, position)) { + if (node.kind === 16 /* TemplateTail */ && !ts.isInsideTemplateLiteral(node, position)) { return undefined; } var spanIndex = templateExpression.templateSpans.indexOf(templateSpan); var argumentIndex = getArgumentIndexForTemplatePiece(spanIndex, node, position); return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); } + else if (node.parent && ts.isJsxOpeningLikeElement(node.parent)) { + // Provide a signature help for JSX opening element or JSX self-closing element. + // This is not guarantee that JSX tag-name is resolved into stateless function component. (that is done in "getSignatureHelpItems") + // i.e + // export function MainButton(props: ButtonProps, context: any): JSX.Element { ... } + // ' '' - // That will give us 2 non-commas. We then add one for the last comma, givin us an + // That will give us 2 non-commas. We then add one for the last comma, giving us an // arg count of 3. var listChildren = argumentsList.getChildren(); - var argumentCount = ts.countWhere(listChildren, function (arg) { return arg.kind !== 25 /* CommaToken */; }); - if (listChildren.length > 0 && ts.lastOrUndefined(listChildren).kind === 25 /* CommaToken */) { + var argumentCount = ts.countWhere(listChildren, function (arg) { return arg.kind !== 26 /* CommaToken */; }); + if (listChildren.length > 0 && ts.lastOrUndefined(listChildren).kind === 26 /* CommaToken */) { argumentCount++; } return argumentCount; @@ -74015,7 +79656,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 === 12 /* NoSubstitutionTemplateLiteral */ + var argumentCount = tagExpression.template.kind === 13 /* NoSubstitutionTemplateLiteral */ ? 1 : tagExpression.template.templateSpans.length + 1; ts.Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, "argumentCount < argumentIndex, " + argumentCount + " < " + argumentIndex); @@ -74053,7 +79694,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 === 194 /* TemplateExpression */) { + if (template.kind === 196 /* TemplateExpression */) { var lastSpan = ts.lastOrUndefined(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, /*stopAfterLineBreak*/ false); @@ -74062,7 +79703,7 @@ var ts; return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); } function getContainingArgumentInfo(node, position, sourceFile) { - for (var n = node; n.kind !== 261 /* SourceFile */; n = n.parent) { + for (var n = node; n.kind !== 265 /* SourceFile */; n = n.parent) { if (ts.isFunctionBlock(n)) { return undefined; } @@ -74075,6 +79716,7 @@ var ts; if (argumentInfo) { return argumentInfo; } + // TODO: Handle generic call with incomplete syntax } return undefined; } @@ -74125,10 +79767,10 @@ var ts; var isVariadic; if (isTypeParameterList) { isVariadic = false; // type parameter lists are not variadic - prefixDisplayParts.push(ts.punctuationPart(26 /* LessThanToken */)); + prefixDisplayParts.push(ts.punctuationPart(27 /* LessThanToken */)); var typeParameters = candidateSignature.typeParameters; signatureHelpParameters = typeParameters && typeParameters.length > 0 ? ts.map(typeParameters, createSignatureHelpParameterForTypeParameter) : emptyArray; - suffixDisplayParts.push(ts.punctuationPart(28 /* GreaterThanToken */)); + suffixDisplayParts.push(ts.punctuationPart(29 /* GreaterThanToken */)); var parameterParts = ts.mapToDisplayParts(function (writer) { return typeChecker.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.thisParameter, candidateSignature.parameters, writer, invocation); }); @@ -74140,10 +79782,10 @@ var ts; return typeChecker.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(candidateSignature.typeParameters, writer, invocation); }); ts.addRange(prefixDisplayParts, typeParameterParts); - prefixDisplayParts.push(ts.punctuationPart(18 /* OpenParenToken */)); + prefixDisplayParts.push(ts.punctuationPart(19 /* OpenParenToken */)); var parameters = candidateSignature.parameters; signatureHelpParameters = parameters.length > 0 ? ts.map(parameters, createSignatureHelpParameterForParameter) : emptyArray; - suffixDisplayParts.push(ts.punctuationPart(19 /* CloseParenToken */)); + suffixDisplayParts.push(ts.punctuationPart(20 /* CloseParenToken */)); } var returnTypeParts = ts.mapToDisplayParts(function (writer) { return typeChecker.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, invocation); @@ -74153,7 +79795,7 @@ var ts; isVariadic: isVariadic, prefixDisplayParts: prefixDisplayParts, suffixDisplayParts: suffixDisplayParts, - separatorDisplayParts: [ts.punctuationPart(25 /* CommaToken */), ts.spacePart()], + separatorDisplayParts: [ts.punctuationPart(26 /* CommaToken */), ts.spacePart()], parameters: signatureHelpParameters, documentation: candidateSignature.getDocumentationComment(), tags: candidateSignature.getJsDocTags() @@ -74206,9 +79848,9 @@ var ts; (function (SymbolDisplay) { // TODO(drosen): use contextual SemanticMeaning. function getSymbolKind(typeChecker, symbol, location) { - var flags = symbol.getFlags(); + var flags = symbol.flags; if (flags & 32 /* Class */) - return ts.getDeclarationOfKind(symbol, 197 /* ClassExpression */) ? + return ts.getDeclarationOfKind(symbol, 199 /* ClassExpression */) ? ts.ScriptElementKind.localClassElement : ts.ScriptElementKind.classElement; if (flags & 384 /* Enum */) return ts.ScriptElementKind.enumElement; @@ -74218,12 +79860,12 @@ var ts; return ts.ScriptElementKind.interfaceElement; if (flags & 262144 /* TypeParameter */) return ts.ScriptElementKind.typeParameterElement; - var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, flags, location); + var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location); if (result === ts.ScriptElementKind.unknown) { if (flags & 262144 /* TypeParameter */) return ts.ScriptElementKind.typeParameterElement; if (flags & 8 /* EnumMember */) - return ts.ScriptElementKind.variableElement; + return ts.ScriptElementKind.enumMemberElement; if (flags & 8388608 /* Alias */) return ts.ScriptElementKind.alias; if (flags & 1536 /* Module */) @@ -74232,16 +79874,17 @@ var ts; return result; } SymbolDisplay.getSymbolKind = getSymbolKind; - function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, flags, location) { + function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location) { if (typeChecker.isUndefinedSymbol(symbol)) { return ts.ScriptElementKind.variableElement; } if (typeChecker.isArgumentsSymbol(symbol)) { return ts.ScriptElementKind.localVariableElement; } - if (location.kind === 98 /* ThisKeyword */ && ts.isExpression(location)) { + if (location.kind === 99 /* ThisKeyword */ && ts.isExpression(location)) { return ts.ScriptElementKind.parameterElement; } + var flags = symbol.flags; if (flags & 3 /* Variable */) { if (ts.isFirstDeclarationOfSymbolParameter(symbol)) { return ts.ScriptElementKind.parameterElement; @@ -74265,7 +79908,7 @@ var ts; if (flags & 16384 /* Constructor */) return ts.ScriptElementKind.constructorImplementationElement; if (flags & 4 /* Property */) { - if (flags & 268435456 /* SyntheticProperty */) { + if (flags & 134217728 /* Transient */ && symbol.checkFlags & 6 /* Synthetic */) { // If union property is result of union of non method (property/accessors/variables), it is labeled as property var unionPropertyKind = ts.forEach(typeChecker.getRootSymbols(symbol), function (rootSymbol) { var rootSymbolFlags = rootSymbol.getFlags(); @@ -74285,6 +79928,9 @@ var ts; } return unionPropertyKind; } + if (location.parent && ts.isJsxAttribute(location.parent)) { + return ts.ScriptElementKind.jsxAttribute; + } return ts.ScriptElementKind.memberVariableElement; } return ts.ScriptElementKind.unknown; @@ -74302,9 +79948,9 @@ var ts; var documentation; var tags; var symbolFlags = symbol.flags; - var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, symbolFlags, location); + var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location); var hasAddedSymbolInfo; - var isThisExpression = location.kind === 98 /* ThisKeyword */ && ts.isExpression(location); + var isThisExpression = location.kind === 99 /* ThisKeyword */ && ts.isExpression(location); var type; // Class at constructor site need to be shown as constructor apart from property,method, vars if (symbolKind !== ts.ScriptElementKind.unknown || symbolFlags & 32 /* Class */ || symbolFlags & 8388608 /* Alias */) { @@ -74315,7 +79961,7 @@ var ts; var signature = void 0; type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol, location); if (type) { - if (location.parent && location.parent.kind === 177 /* PropertyAccessExpression */) { + if (location.parent && location.parent.kind === 179 /* 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)) { @@ -74323,21 +79969,24 @@ var ts; } } // try get the call/construct signature from the type if it matches - var callExpression = void 0; - if (location.kind === 179 /* CallExpression */ || location.kind === 180 /* NewExpression */) { - callExpression = location; + var callExpressionLike = void 0; + if (location.kind === 181 /* CallExpression */ || location.kind === 182 /* NewExpression */) { + callExpressionLike = location; } else if (ts.isCallExpressionTarget(location) || ts.isNewExpressionTarget(location)) { - callExpression = location.parent; + callExpressionLike = location.parent; } - if (callExpression) { + else if (location.parent && ts.isJsxOpeningLikeElement(location.parent) && ts.isFunctionLike(symbol.valueDeclaration)) { + callExpressionLike = location.parent; + } + if (callExpressionLike) { var candidateSignatures = []; - signature = typeChecker.getResolvedSignature(callExpression, candidateSignatures); + signature = typeChecker.getResolvedSignature(callExpressionLike, candidateSignatures); if (!signature && candidateSignatures.length) { // Use the first candidate: signature = candidateSignatures[0]; } - var useConstructSignatures = callExpression.kind === 180 /* NewExpression */ || callExpression.expression.kind === 96 /* SuperKeyword */; + var useConstructSignatures = callExpressionLike.kind === 182 /* 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 @@ -74355,7 +80004,7 @@ var ts; pushTypePart(symbolKind); displayParts.push(ts.spacePart()); if (useConstructSignatures) { - displayParts.push(ts.keywordPart(93 /* NewKeyword */)); + displayParts.push(ts.keywordPart(94 /* NewKeyword */)); displayParts.push(ts.spacePart()); } addFullSymbolName(symbol); @@ -74364,6 +80013,7 @@ var ts; addPrefixForAnyFunctionOrVar(symbol, symbolKind); } switch (symbolKind) { + case ts.ScriptElementKind.jsxAttribute: case ts.ScriptElementKind.memberVariableElement: case ts.ScriptElementKind.variableElement: case ts.ScriptElementKind.constElement: @@ -74371,10 +80021,10 @@ var ts; case ts.ScriptElementKind.parameterElement: case ts.ScriptElementKind.localVariableElement: // If it is call or construct signature of lambda's write type name - displayParts.push(ts.punctuationPart(55 /* ColonToken */)); + displayParts.push(ts.punctuationPart(56 /* ColonToken */)); displayParts.push(ts.spacePart()); if (useConstructSignatures) { - displayParts.push(ts.keywordPart(93 /* NewKeyword */)); + displayParts.push(ts.keywordPart(94 /* NewKeyword */)); displayParts.push(ts.spacePart()); } if (!(type.flags & 32768 /* Object */ && type.objectFlags & 16 /* Anonymous */) && type.symbol) { @@ -74390,24 +80040,24 @@ var ts; } } else if ((ts.isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304 /* Accessor */)) || - (location.kind === 122 /* ConstructorKeyword */ && location.parent.kind === 150 /* Constructor */)) { + (location.kind === 123 /* ConstructorKeyword */ && location.parent.kind === 152 /* Constructor */)) { // get the signature from the declaration and write it var functionDeclaration = location.parent; - var allSignatures = functionDeclaration.kind === 150 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); + var allSignatures = functionDeclaration.kind === 152 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); if (!typeChecker.isImplementationOfOverload(functionDeclaration)) { signature = typeChecker.getSignatureFromDeclaration(functionDeclaration); } else { signature = allSignatures[0]; } - if (functionDeclaration.kind === 150 /* Constructor */) { + if (functionDeclaration.kind === 152 /* Constructor */) { // show (constructor) Type(...) signature symbolKind = ts.ScriptElementKind.constructorImplementationElement; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { // (function/method) symbol(..signature) - addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 153 /* CallSignature */ && + addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 155 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); @@ -74416,7 +80066,7 @@ var ts; } } if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo && !isThisExpression) { - if (ts.getDeclarationOfKind(symbol, 197 /* ClassExpression */)) { + if (ts.getDeclarationOfKind(symbol, 199 /* 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 @@ -74424,7 +80074,7 @@ var ts; } else { // Class declaration has name which is not local. - displayParts.push(ts.keywordPart(74 /* ClassKeyword */)); + displayParts.push(ts.keywordPart(75 /* ClassKeyword */)); } displayParts.push(ts.spacePart()); addFullSymbolName(symbol); @@ -74432,45 +80082,45 @@ var ts; } if ((symbolFlags & 64 /* Interface */) && (semanticMeaning & 2 /* Type */)) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(108 /* InterfaceKeyword */)); + displayParts.push(ts.keywordPart(109 /* InterfaceKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); } if (symbolFlags & 524288 /* TypeAlias */) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(136 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(138 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); displayParts.push(ts.spacePart()); - displayParts.push(ts.operatorPart(57 /* EqualsToken */)); + displayParts.push(ts.operatorPart(58 /* EqualsToken */)); displayParts.push(ts.spacePart()); ts.addRange(displayParts, ts.typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, 512 /* InTypeAlias */)); } if (symbolFlags & 384 /* Enum */) { addNewLineIfDisplayPartsExist(); if (ts.forEach(symbol.declarations, ts.isConstEnumDeclaration)) { - displayParts.push(ts.keywordPart(75 /* ConstKeyword */)); + displayParts.push(ts.keywordPart(76 /* ConstKeyword */)); displayParts.push(ts.spacePart()); } - displayParts.push(ts.keywordPart(82 /* EnumKeyword */)); + displayParts.push(ts.keywordPart(83 /* EnumKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } if (symbolFlags & 1536 /* Module */) { addNewLineIfDisplayPartsExist(); - var declaration = ts.getDeclarationOfKind(symbol, 230 /* ModuleDeclaration */); - var isNamespace = declaration && declaration.name && declaration.name.kind === 70 /* Identifier */; - displayParts.push(ts.keywordPart(isNamespace ? 128 /* NamespaceKeyword */ : 127 /* ModuleKeyword */)); + var declaration = ts.getDeclarationOfKind(symbol, 233 /* ModuleDeclaration */); + var isNamespace = declaration && declaration.name && declaration.name.kind === 71 /* Identifier */; + displayParts.push(ts.keywordPart(isNamespace ? 129 /* NamespaceKeyword */ : 128 /* ModuleKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } if ((symbolFlags & 262144 /* TypeParameter */) && (semanticMeaning & 2 /* Type */)) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.punctuationPart(18 /* OpenParenToken */)); + displayParts.push(ts.punctuationPart(19 /* OpenParenToken */)); displayParts.push(ts.textPart("type parameter")); - displayParts.push(ts.punctuationPart(19 /* CloseParenToken */)); + displayParts.push(ts.punctuationPart(20 /* CloseParenToken */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); if (symbol.parent) { @@ -74481,28 +80131,28 @@ var ts; } else { // Method/function type parameter - var declaration = ts.getDeclarationOfKind(symbol, 143 /* TypeParameter */); + var declaration = ts.getDeclarationOfKind(symbol, 145 /* TypeParameter */); ts.Debug.assert(declaration !== undefined); declaration = declaration.parent; if (declaration) { if (ts.isFunctionLikeKind(declaration.kind)) { addInPrefix(); var signature = typeChecker.getSignatureFromDeclaration(declaration); - if (declaration.kind === 154 /* ConstructSignature */) { - displayParts.push(ts.keywordPart(93 /* NewKeyword */)); + if (declaration.kind === 156 /* ConstructSignature */) { + displayParts.push(ts.keywordPart(94 /* NewKeyword */)); displayParts.push(ts.spacePart()); } - else if (declaration.kind !== 153 /* CallSignature */ && declaration.name) { + else if (declaration.kind !== 155 /* CallSignature */ && declaration.name) { addFullSymbolName(declaration.symbol); } ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); } - else if (declaration.kind === 228 /* TypeAliasDeclaration */) { + else if (declaration.kind === 231 /* TypeAliasDeclaration */) { // Type alias type parameter // For example // type list = T[]; // Both T will go through same code path addInPrefix(); - displayParts.push(ts.keywordPart(136 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(138 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(declaration.symbol); writeTypeParametersOfSymbol(declaration.symbol, sourceFile); @@ -74511,13 +80161,14 @@ var ts; } } if (symbolFlags & 8 /* EnumMember */) { + symbolKind = ts.ScriptElementKind.enumMemberElement; addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 260 /* EnumMember */) { + if (declaration.kind === 264 /* EnumMember */) { var constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); - displayParts.push(ts.operatorPart(57 /* EqualsToken */)); + displayParts.push(ts.operatorPart(58 /* EqualsToken */)); displayParts.push(ts.spacePart()); displayParts.push(ts.displayPart(constantValue.toString(), ts.SymbolDisplayPartKind.numericLiteral)); } @@ -74525,33 +80176,33 @@ var ts; } if (symbolFlags & 8388608 /* Alias */) { addNewLineIfDisplayPartsExist(); - if (symbol.declarations[0].kind === 233 /* NamespaceExportDeclaration */) { - displayParts.push(ts.keywordPart(83 /* ExportKeyword */)); + if (symbol.declarations[0].kind === 236 /* NamespaceExportDeclaration */) { + displayParts.push(ts.keywordPart(84 /* ExportKeyword */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(128 /* NamespaceKeyword */)); + displayParts.push(ts.keywordPart(129 /* NamespaceKeyword */)); } else { - displayParts.push(ts.keywordPart(90 /* ImportKeyword */)); + displayParts.push(ts.keywordPart(91 /* ImportKeyword */)); } displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 234 /* ImportEqualsDeclaration */) { + if (declaration.kind === 237 /* ImportEqualsDeclaration */) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); - displayParts.push(ts.operatorPart(57 /* EqualsToken */)); + displayParts.push(ts.operatorPart(58 /* EqualsToken */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(131 /* RequireKeyword */)); - displayParts.push(ts.punctuationPart(18 /* OpenParenToken */)); + displayParts.push(ts.keywordPart(132 /* RequireKeyword */)); + displayParts.push(ts.punctuationPart(19 /* OpenParenToken */)); displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), ts.SymbolDisplayPartKind.stringLiteral)); - displayParts.push(ts.punctuationPart(19 /* CloseParenToken */)); + displayParts.push(ts.punctuationPart(20 /* CloseParenToken */)); } else { var internalAliasSymbol = typeChecker.getSymbolAtLocation(importEqualsDeclaration.moduleReference); if (internalAliasSymbol) { displayParts.push(ts.spacePart()); - displayParts.push(ts.operatorPart(57 /* EqualsToken */)); + displayParts.push(ts.operatorPart(58 /* EqualsToken */)); displayParts.push(ts.spacePart()); addFullSymbolName(internalAliasSymbol, enclosingDeclaration); } @@ -74565,17 +80216,18 @@ var ts; if (type) { if (isThisExpression) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(98 /* ThisKeyword */)); + displayParts.push(ts.keywordPart(99 /* ThisKeyword */)); } else { addPrefixForAnyFunctionOrVar(symbol, symbolKind); } // For properties, variables and local vars: show the type if (symbolKind === ts.ScriptElementKind.memberVariableElement || + symbolKind === ts.ScriptElementKind.jsxAttribute || symbolFlags & 3 /* Variable */ || symbolKind === ts.ScriptElementKind.localVariableElement || isThisExpression) { - displayParts.push(ts.punctuationPart(55 /* ColonToken */)); + displayParts.push(ts.punctuationPart(56 /* ColonToken */)); displayParts.push(ts.spacePart()); // If the type is type parameter, format it specially if (type.symbol && type.symbol.flags & 262144 /* TypeParameter */) { @@ -74607,13 +80259,13 @@ var ts; documentation = symbol.getDocumentationComment(); tags = symbol.getJsDocTags(); if (documentation.length === 0 && symbol.flags & 4 /* Property */) { - // For some special property access expressions like `experts.foo = foo` or `module.exports.foo = foo` + // 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 === 261 /* SourceFile */; })) { + if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 265 /* SourceFile */; })) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (!declaration.parent || declaration.parent.kind !== 192 /* BinaryExpression */) { + if (!declaration.parent || declaration.parent.kind !== 194 /* BinaryExpression */) { continue; } var rhsSymbol = typeChecker.getSymbolAtLocation(declaration.parent.right); @@ -74637,7 +80289,7 @@ var ts; } function addInPrefix() { displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(91 /* InKeyword */)); + displayParts.push(ts.keywordPart(92 /* InKeyword */)); displayParts.push(ts.spacePart()); } function addFullSymbolName(symbol, enclosingDeclaration) { @@ -74662,9 +80314,9 @@ var ts; displayParts.push(ts.textOrKeywordPart(symbolKind)); return; default: - displayParts.push(ts.punctuationPart(18 /* OpenParenToken */)); + displayParts.push(ts.punctuationPart(19 /* OpenParenToken */)); displayParts.push(ts.textOrKeywordPart(symbolKind)); - displayParts.push(ts.punctuationPart(19 /* CloseParenToken */)); + displayParts.push(ts.punctuationPart(20 /* CloseParenToken */)); return; } } @@ -74672,12 +80324,12 @@ var ts; ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, enclosingDeclaration, flags | 32 /* WriteTypeArgumentsOfSignature */)); if (allSignatures.length > 1) { displayParts.push(ts.spacePart()); - displayParts.push(ts.punctuationPart(18 /* OpenParenToken */)); - displayParts.push(ts.operatorPart(36 /* PlusToken */)); + displayParts.push(ts.punctuationPart(19 /* OpenParenToken */)); + displayParts.push(ts.operatorPart(37 /* PlusToken */)); displayParts.push(ts.displayPart((allSignatures.length - 1).toString(), ts.SymbolDisplayPartKind.numericLiteral)); displayParts.push(ts.spacePart()); displayParts.push(ts.textPart(allSignatures.length === 2 ? "overload" : "overloads")); - displayParts.push(ts.punctuationPart(19 /* CloseParenToken */)); + displayParts.push(ts.punctuationPart(20 /* CloseParenToken */)); } documentation = signature.getDocumentationComment(); tags = signature.getJsDocTags(); @@ -74696,16 +80348,16 @@ var ts; } return ts.forEach(symbol.declarations, function (declaration) { // Function expressions are local - if (declaration.kind === 184 /* FunctionExpression */) { + if (declaration.kind === 186 /* FunctionExpression */) { return true; } - if (declaration.kind !== 223 /* VariableDeclaration */ && declaration.kind !== 225 /* FunctionDeclaration */) { + if (declaration.kind !== 226 /* VariableDeclaration */ && declaration.kind !== 228 /* FunctionDeclaration */) { return false; } // If the parent is not sourceFile or module block it is local variable - for (var parent_21 = declaration.parent; !ts.isFunctionBlock(parent_21); parent_21 = parent_21.parent) { + for (var parent = declaration.parent; !ts.isFunctionBlock(parent); parent = parent.parent) { // Reached source file or module block - if (parent_21.kind === 261 /* SourceFile */ || parent_21.kind === 231 /* ModuleBlock */) { + if (parent.kind === 265 /* SourceFile */ || parent.kind === 234 /* ModuleBlock */) { return false; } } @@ -74758,7 +80410,7 @@ var ts; sourceFile.moduleName = transpileOptions.moduleName; } if (transpileOptions.renamedDependencies) { - sourceFile.renamedDependencies = ts.createMap(transpileOptions.renamedDependencies); + sourceFile.renamedDependencies = ts.createMapFromTemplate(transpileOptions.renamedDependencies); } var newLine = ts.getNewLineCharacter(options); // Output @@ -74810,13 +80462,14 @@ var ts; ts.transpile = transpile; var commandLineOptionsStringToEnum; /** JS users may pass in string values for enum compiler options (such as ModuleKind), so convert. */ + /*@internal*/ function fixupCompilerOptions(options, diagnostics) { // Lazily create this value to fix module loading errors. commandLineOptionsStringToEnum = commandLineOptionsStringToEnum || ts.filter(ts.optionDeclarations, function (o) { - return typeof o.type === "object" && !ts.forEachProperty(o.type, function (v) { return typeof v !== "number"; }); + return typeof o.type === "object" && !ts.forEachEntry(o.type, function (v) { return typeof v !== "number"; }); }); options = ts.clone(options); - var _loop_3 = function (opt) { + var _loop_5 = function (opt) { if (!ts.hasProperty(options, opt.name)) { return "continue"; } @@ -74827,7 +80480,7 @@ var ts; options[opt.name] = ts.parseCustomTypeOption(opt, value, diagnostics); } else { - if (!ts.forEachProperty(opt.type, function (v) { return v === value; })) { + if (!ts.forEachEntry(opt.type, function (v) { return v === value; })) { // Supplied value isn't a valid enum value. diagnostics.push(ts.createCompilerDiagnosticForInvalidCustomType(opt)); } @@ -74835,10 +80488,11 @@ var ts; }; for (var _i = 0, commandLineOptionsStringToEnum_1 = commandLineOptionsStringToEnum; _i < commandLineOptionsStringToEnum_1.length; _i++) { var opt = commandLineOptionsStringToEnum_1[_i]; - _loop_3(opt); + _loop_5(opt); } return options; } + ts.fixupCompilerOptions = fixupCompilerOptions; })(ts || (ts = {})); /// /// @@ -74862,10 +80516,10 @@ var ts; ScanAction[ScanAction["RescanJsxIdentifier"] = 4] = "RescanJsxIdentifier"; ScanAction[ScanAction["RescanJsxText"] = 5] = "RescanJsxText"; })(ScanAction || (ScanAction = {})); - function getFormattingScanner(sourceFile, startPos, endPos) { + function getFormattingScanner(text, languageVariant, startPos, endPos) { ts.Debug.assert(scanner === undefined, "Scanner should be undefined"); - scanner = sourceFile.languageVariant === 1 /* JSX */ ? jsxScanner : standardScanner; - scanner.setText(sourceFile.text); + scanner = languageVariant === 1 /* JSX */ ? jsxScanner : standardScanner; + scanner.setText(text); scanner.setTextPos(startPos); var wasNewLine = true; var leadingTrivia; @@ -74930,11 +80584,11 @@ var ts; function shouldRescanGreaterThanToken(node) { if (node) { switch (node.kind) { - case 30 /* GreaterThanEqualsToken */: - case 65 /* GreaterThanGreaterThanEqualsToken */: - case 66 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - case 46 /* GreaterThanGreaterThanGreaterThanToken */: - case 45 /* GreaterThanGreaterThanToken */: + case 31 /* GreaterThanEqualsToken */: + case 66 /* GreaterThanGreaterThanEqualsToken */: + case 67 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 47 /* GreaterThanGreaterThanGreaterThanToken */: + case 46 /* GreaterThanGreaterThanToken */: return true; } } @@ -74943,11 +80597,11 @@ var ts; function shouldRescanJsxIdentifier(node) { if (node.parent) { switch (node.parent.kind) { - case 250 /* JsxAttribute */: - case 248 /* JsxOpeningElement */: - case 249 /* JsxClosingElement */: - case 247 /* JsxSelfClosingElement */: - return node.kind === 70 /* Identifier */; + case 253 /* JsxAttribute */: + case 251 /* JsxOpeningElement */: + case 252 /* JsxClosingElement */: + case 250 /* JsxSelfClosingElement */: + return node.kind === 71 /* Identifier */; } } return false; @@ -74956,14 +80610,14 @@ var ts; return node && node.kind === 10 /* JsxText */; } function shouldRescanSlashToken(container) { - return container.kind === 11 /* RegularExpressionLiteral */; + return container.kind === 12 /* RegularExpressionLiteral */; } function shouldRescanTemplateToken(container) { - return container.kind === 14 /* TemplateMiddle */ || - container.kind === 15 /* TemplateTail */; + return container.kind === 15 /* TemplateMiddle */ || + container.kind === 16 /* TemplateTail */; } function startsWithSlashToken(t) { - return t === 40 /* SlashToken */ || t === 62 /* SlashEqualsToken */; + return t === 41 /* SlashToken */ || t === 63 /* SlashEqualsToken */; } function readTokenInfo(n) { ts.Debug.assert(scanner !== undefined); @@ -75004,7 +80658,7 @@ var ts; scanner.scan(); } var currentToken = scanner.getToken(); - if (expectedScanAction === 1 /* RescanGreaterThanToken */ && currentToken === 28 /* GreaterThanToken */) { + if (expectedScanAction === 1 /* RescanGreaterThanToken */ && currentToken === 29 /* GreaterThanToken */) { currentToken = scanner.reScanGreaterToken(); ts.Debug.assert(n.kind === currentToken); lastScanAction = 1 /* RescanGreaterThanToken */; @@ -75014,11 +80668,11 @@ var ts; ts.Debug.assert(n.kind === currentToken); lastScanAction = 2 /* RescanSlashToken */; } - else if (expectedScanAction === 3 /* RescanTemplateToken */ && currentToken === 17 /* CloseBraceToken */) { + else if (expectedScanAction === 3 /* RescanTemplateToken */ && currentToken === 18 /* CloseBraceToken */) { currentToken = scanner.reScanTemplateToken(); lastScanAction = 3 /* RescanTemplateToken */; } - else if (expectedScanAction === 4 /* RescanJsxIdentifier */ && currentToken === 70 /* Identifier */) { + else if (expectedScanAction === 4 /* RescanJsxIdentifier */ && currentToken === 71 /* Identifier */) { currentToken = scanner.scanJsxIdentifier(); lastScanAction = 4 /* RescanJsxIdentifier */; } @@ -75067,8 +80721,8 @@ var ts; } function isOnToken() { ts.Debug.assert(scanner !== undefined); - var current = (lastTokenInfo && lastTokenInfo.token.kind) || scanner.getToken(); - var startPos = (lastTokenInfo && lastTokenInfo.token.pos) || scanner.getStartPos(); + var current = lastTokenInfo ? lastTokenInfo.token.kind : scanner.getToken(); + var startPos = lastTokenInfo ? lastTokenInfo.token.pos : scanner.getStartPos(); return startPos < endPos && current !== 1 /* EndOfFileToken */ && !ts.isTrivia(current); } // when containing node in the tree is token @@ -75101,9 +80755,10 @@ var ts; var formatting; (function (formatting) { var FormattingContext = (function () { - function FormattingContext(sourceFile, formattingRequestKind) { + function FormattingContext(sourceFile, formattingRequestKind, options) { this.sourceFile = sourceFile; this.formattingRequestKind = formattingRequestKind; + this.options = options; } FormattingContext.prototype.updateContext = function (currentRange, currentTokenParent, nextRange, nextTokenParent, commonParent) { ts.Debug.assert(currentRange !== undefined, "currentTokenSpan is null"); @@ -75161,8 +80816,8 @@ var ts; return startLine === endLine; }; FormattingContext.prototype.BlockIsOnOneLine = function (node) { - var openBrace = ts.findChildOfKind(node, 16 /* OpenBraceToken */, this.sourceFile); - var closeBrace = ts.findChildOfKind(node, 17 /* CloseBraceToken */, this.sourceFile); + var openBrace = ts.findChildOfKind(node, 17 /* OpenBraceToken */, this.sourceFile); + var closeBrace = ts.findChildOfKind(node, 18 /* CloseBraceToken */, this.sourceFile); if (openBrace && closeBrace) { var startLine = this.sourceFile.getLineAndCharacterOfPosition(openBrace.getEnd()).line; var endLine = this.sourceFile.getLineAndCharacterOfPosition(closeBrace.getStart(this.sourceFile)).line; @@ -75350,127 +81005,180 @@ var ts; this.IgnoreBeforeComment = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.Comments), formatting.RuleOperation.create1(1 /* Ignore */)); this.IgnoreAfterLineComment = new formatting.Rule(formatting.RuleDescriptor.create3(2 /* SingleLineCommentTrivia */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create1(1 /* Ignore */)); // Space after keyword but not before ; or : or ? - this.NoSpaceBeforeSemicolon = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 24 /* SemicolonToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); - this.NoSpaceBeforeColon = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 55 /* ColonToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNotBinaryOpContext), 8 /* Delete */)); - this.NoSpaceBeforeQuestionMark = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 54 /* QuestionToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNotBinaryOpContext), 8 /* Delete */)); - this.SpaceAfterColon = new formatting.Rule(formatting.RuleDescriptor.create3(55 /* ColonToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNotBinaryOpContext), 2 /* Space */)); - this.SpaceAfterQuestionMarkInConditionalOperator = new formatting.Rule(formatting.RuleDescriptor.create3(54 /* QuestionToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsConditionalOperatorContext), 2 /* Space */)); - this.NoSpaceAfterQuestionMark = new formatting.Rule(formatting.RuleDescriptor.create3(54 /* QuestionToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); - this.SpaceAfterSemicolon = new formatting.Rule(formatting.RuleDescriptor.create3(24 /* SemicolonToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); + this.NoSpaceBeforeSemicolon = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 25 /* SemicolonToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBeforeColon = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 56 /* ColonToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNotBinaryOpContext), 8 /* Delete */)); + this.NoSpaceBeforeQuestionMark = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 55 /* QuestionToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNotBinaryOpContext), 8 /* Delete */)); + this.SpaceAfterColon = new formatting.Rule(formatting.RuleDescriptor.create3(56 /* ColonToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNotBinaryOpContext), 2 /* Space */)); + this.SpaceAfterQuestionMarkInConditionalOperator = new formatting.Rule(formatting.RuleDescriptor.create3(55 /* QuestionToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsConditionalOperatorContext), 2 /* Space */)); + this.NoSpaceAfterQuestionMark = new formatting.Rule(formatting.RuleDescriptor.create3(55 /* QuestionToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + this.SpaceAfterSemicolon = new formatting.Rule(formatting.RuleDescriptor.create3(25 /* SemicolonToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); // Space after }. - this.SpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(17 /* CloseBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsAfterCodeBlockContext), 2 /* Space */)); + this.SpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(18 /* CloseBraceToken */, formatting.Shared.TokenRange.FromRange(0 /* FirstToken */, 142 /* LastToken */, [20 /* CloseParenToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsAfterCodeBlockContext), 2 /* Space */)); // Special case for (}, else) and (}, while) since else & while tokens are not part of the tree which makes SpaceAfterCloseBrace rule not applied - this.SpaceBetweenCloseBraceAndElse = new formatting.Rule(formatting.RuleDescriptor.create1(17 /* CloseBraceToken */, 81 /* ElseKeyword */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); - this.SpaceBetweenCloseBraceAndWhile = new formatting.Rule(formatting.RuleDescriptor.create1(17 /* CloseBraceToken */, 105 /* WhileKeyword */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); - this.NoSpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(17 /* CloseBraceToken */, formatting.Shared.TokenRange.FromTokens([19 /* CloseParenToken */, 21 /* CloseBracketToken */, 25 /* CommaToken */, 24 /* SemicolonToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + this.SpaceBetweenCloseBraceAndElse = new formatting.Rule(formatting.RuleDescriptor.create1(18 /* CloseBraceToken */, 82 /* ElseKeyword */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); + this.SpaceBetweenCloseBraceAndWhile = new formatting.Rule(formatting.RuleDescriptor.create1(18 /* CloseBraceToken */, 106 /* WhileKeyword */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); + this.NoSpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(18 /* CloseBraceToken */, formatting.Shared.TokenRange.FromTokens([22 /* CloseBracketToken */, 26 /* CommaToken */, 25 /* SemicolonToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); // No space for dot - this.NoSpaceBeforeDot = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 22 /* DotToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); - this.NoSpaceAfterDot = new formatting.Rule(formatting.RuleDescriptor.create3(22 /* DotToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBeforeDot = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 23 /* DotToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterDot = new formatting.Rule(formatting.RuleDescriptor.create3(23 /* DotToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); // No space before and after indexer - this.NoSpaceBeforeOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 20 /* OpenBracketToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); - this.NoSpaceAfterCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create3(21 /* CloseBracketToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNotBeforeBlockInFunctionDeclarationContext), 8 /* Delete */)); + this.NoSpaceBeforeOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 21 /* OpenBracketToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create3(22 /* CloseBracketToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNotBeforeBlockInFunctionDeclarationContext), 8 /* Delete */)); // Place a space before open brace in a function declaration this.FunctionOpenBraceLeftTokenRange = formatting.Shared.TokenRange.AnyIncludingMultilineComments; - this.SpaceBeforeOpenBraceInFunction = new formatting.Rule(formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 16 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsBeforeBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2 /* Space */), 1 /* CanDeleteNewLines */); + this.SpaceBeforeOpenBraceInFunction = new formatting.Rule(formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 17 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsBeforeBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2 /* Space */), 1 /* CanDeleteNewLines */); // Place a space before open brace in a TypeScript declaration that has braces as children (class, module, enum, etc) - this.TypeScriptOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([70 /* Identifier */, 3 /* MultiLineCommentTrivia */, 74 /* ClassKeyword */, 83 /* ExportKeyword */, 90 /* ImportKeyword */]); - this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock = new formatting.Rule(formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 16 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2 /* Space */), 1 /* CanDeleteNewLines */); + this.TypeScriptOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([71 /* Identifier */, 3 /* MultiLineCommentTrivia */, 75 /* ClassKeyword */, 84 /* ExportKeyword */, 91 /* ImportKeyword */]); + this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock = new formatting.Rule(formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 17 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2 /* Space */), 1 /* CanDeleteNewLines */); // Place a space before open brace in a control flow construct - this.ControlOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([19 /* CloseParenToken */, 3 /* MultiLineCommentTrivia */, 80 /* DoKeyword */, 101 /* TryKeyword */, 86 /* FinallyKeyword */, 81 /* ElseKeyword */]); - this.SpaceBeforeOpenBraceInControl = new formatting.Rule(formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 16 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2 /* Space */), 1 /* CanDeleteNewLines */); + this.ControlOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([20 /* CloseParenToken */, 3 /* MultiLineCommentTrivia */, 81 /* DoKeyword */, 102 /* TryKeyword */, 87 /* FinallyKeyword */, 82 /* ElseKeyword */]); + this.SpaceBeforeOpenBraceInControl = new formatting.Rule(formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 17 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2 /* Space */), 1 /* CanDeleteNewLines */); // Insert a space after { and before } in single-line contexts, but remove space from empty object literals {}. - this.SpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(16 /* OpenBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2 /* Space */)); - this.SpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2 /* Space */)); - this.NoSpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(16 /* OpenBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 8 /* Delete */)); - this.NoSpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 8 /* Delete */)); - this.NoSpaceBetweenEmptyBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(16 /* OpenBraceToken */, 17 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsObjectContext), 8 /* Delete */)); + this.SpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(17 /* OpenBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionEnabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"), Rules.IsBraceWrappedContext), 2 /* Space */)); + this.SpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionEnabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"), Rules.IsBraceWrappedContext), 2 /* Space */)); + this.NoSpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(17 /* OpenBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionDisabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"), Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionDisabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"), Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBetweenEmptyBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(17 /* OpenBraceToken */, 18 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsObjectContext), 8 /* Delete */)); // Insert new line after { and before } in multi-line contexts. - this.NewLineAfterOpenBraceInBlockContext = new formatting.Rule(formatting.RuleDescriptor.create3(16 /* OpenBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 4 /* NewLine */)); + this.NewLineAfterOpenBraceInBlockContext = new formatting.Rule(formatting.RuleDescriptor.create3(17 /* OpenBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 4 /* NewLine */)); // For functions and control block place } on a new line [multi-line rule] - this.NewLineBeforeCloseBraceInBlockContext = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.AnyIncludingMultilineComments, 17 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 4 /* NewLine */)); + this.NewLineBeforeCloseBraceInBlockContext = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.AnyIncludingMultilineComments, 18 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 4 /* NewLine */)); // Special handling of unary operators. // Prefix operators generally shouldn't have a space between // them and their target unary expression. this.NoSpaceAfterUnaryPrefixOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.UnaryPrefixOperators, formatting.Shared.TokenRange.UnaryPrefixExpressions), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNotBinaryOpContext), 8 /* Delete */)); - this.NoSpaceAfterUnaryPreincrementOperator = new formatting.Rule(formatting.RuleDescriptor.create3(42 /* PlusPlusToken */, formatting.Shared.TokenRange.UnaryPreincrementExpressions), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); - this.NoSpaceAfterUnaryPredecrementOperator = new formatting.Rule(formatting.RuleDescriptor.create3(43 /* MinusMinusToken */, formatting.Shared.TokenRange.UnaryPredecrementExpressions), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); - this.NoSpaceBeforeUnaryPostincrementOperator = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.UnaryPostincrementExpressions, 42 /* PlusPlusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); - this.NoSpaceBeforeUnaryPostdecrementOperator = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.UnaryPostdecrementExpressions, 43 /* MinusMinusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterUnaryPreincrementOperator = new formatting.Rule(formatting.RuleDescriptor.create3(43 /* PlusPlusToken */, formatting.Shared.TokenRange.UnaryPreincrementExpressions), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterUnaryPredecrementOperator = new formatting.Rule(formatting.RuleDescriptor.create3(44 /* MinusMinusToken */, formatting.Shared.TokenRange.UnaryPredecrementExpressions), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBeforeUnaryPostincrementOperator = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.UnaryPostincrementExpressions, 43 /* PlusPlusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBeforeUnaryPostdecrementOperator = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.UnaryPostdecrementExpressions, 44 /* MinusMinusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); // More unary operator special-casing. // DevDiv 181814: Be careful when removing leading whitespace // around unary operators. Examples: // 1 - -2 --X--> 1--2 // a + ++b --X--> a+++b - this.SpaceAfterPostincrementWhenFollowedByAdd = new formatting.Rule(formatting.RuleDescriptor.create1(42 /* PlusPlusToken */, 36 /* PlusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); - this.SpaceAfterAddWhenFollowedByUnaryPlus = new formatting.Rule(formatting.RuleDescriptor.create1(36 /* PlusToken */, 36 /* PlusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); - this.SpaceAfterAddWhenFollowedByPreincrement = new formatting.Rule(formatting.RuleDescriptor.create1(36 /* PlusToken */, 42 /* PlusPlusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); - this.SpaceAfterPostdecrementWhenFollowedBySubtract = new formatting.Rule(formatting.RuleDescriptor.create1(43 /* MinusMinusToken */, 37 /* MinusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); - this.SpaceAfterSubtractWhenFollowedByUnaryMinus = new formatting.Rule(formatting.RuleDescriptor.create1(37 /* MinusToken */, 37 /* MinusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); - this.SpaceAfterSubtractWhenFollowedByPredecrement = new formatting.Rule(formatting.RuleDescriptor.create1(37 /* MinusToken */, 43 /* MinusMinusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); - this.NoSpaceBeforeComma = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 25 /* CommaToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); - this.SpaceAfterCertainKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([103 /* VarKeyword */, 99 /* ThrowKeyword */, 93 /* NewKeyword */, 79 /* DeleteKeyword */, 95 /* ReturnKeyword */, 102 /* TypeOfKeyword */, 120 /* AwaitKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); - this.SpaceAfterLetConstInVariableDeclaration = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([109 /* LetKeyword */, 75 /* ConstKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsStartOfVariableDeclarationList), 2 /* Space */)); - this.NoSpaceBeforeOpenParenInFuncCall = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsFunctionCallOrNewContext, Rules.IsPreviousTokenNotComma), 8 /* Delete */)); - this.SpaceAfterFunctionInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create3(88 /* FunctionKeyword */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2 /* Space */)); - this.SpaceBeforeOpenParenInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsFunctionDeclContext), 2 /* Space */)); - this.NoSpaceBeforeOpenParenInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsFunctionDeclContext), 8 /* Delete */)); - this.SpaceAfterVoidOperator = new formatting.Rule(formatting.RuleDescriptor.create3(104 /* VoidKeyword */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsVoidOpContext), 2 /* Space */)); - this.NoSpaceBetweenReturnAndSemicolon = new formatting.Rule(formatting.RuleDescriptor.create1(95 /* ReturnKeyword */, 24 /* SemicolonToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + this.SpaceAfterPostincrementWhenFollowedByAdd = new formatting.Rule(formatting.RuleDescriptor.create1(43 /* PlusPlusToken */, 37 /* PlusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.SpaceAfterAddWhenFollowedByUnaryPlus = new formatting.Rule(formatting.RuleDescriptor.create1(37 /* PlusToken */, 37 /* PlusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.SpaceAfterAddWhenFollowedByPreincrement = new formatting.Rule(formatting.RuleDescriptor.create1(37 /* PlusToken */, 43 /* PlusPlusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.SpaceAfterPostdecrementWhenFollowedBySubtract = new formatting.Rule(formatting.RuleDescriptor.create1(44 /* MinusMinusToken */, 38 /* MinusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.SpaceAfterSubtractWhenFollowedByUnaryMinus = new formatting.Rule(formatting.RuleDescriptor.create1(38 /* MinusToken */, 38 /* MinusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.SpaceAfterSubtractWhenFollowedByPredecrement = new formatting.Rule(formatting.RuleDescriptor.create1(38 /* MinusToken */, 44 /* MinusMinusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.NoSpaceBeforeComma = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 26 /* CommaToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + this.SpaceAfterCertainKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([104 /* VarKeyword */, 100 /* ThrowKeyword */, 94 /* NewKeyword */, 80 /* DeleteKeyword */, 96 /* ReturnKeyword */, 103 /* TypeOfKeyword */, 121 /* AwaitKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); + this.SpaceAfterLetConstInVariableDeclaration = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([110 /* LetKeyword */, 76 /* ConstKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsStartOfVariableDeclarationList), 2 /* Space */)); + this.NoSpaceBeforeOpenParenInFuncCall = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 19 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsFunctionCallOrNewContext, Rules.IsPreviousTokenNotComma), 8 /* Delete */)); + this.SpaceAfterFunctionInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create3(89 /* FunctionKeyword */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2 /* Space */)); + this.SpaceBeforeOpenParenInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 19 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionEnabled("insertSpaceBeforeFunctionParenthesis"), Rules.IsNonJsxSameLineTokenContext, Rules.IsFunctionDeclContext), 2 /* Space */)); + this.NoSpaceBeforeOpenParenInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 19 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionDisabledOrUndefined("insertSpaceBeforeFunctionParenthesis"), Rules.IsNonJsxSameLineTokenContext, Rules.IsFunctionDeclContext), 8 /* Delete */)); + this.SpaceAfterVoidOperator = new formatting.Rule(formatting.RuleDescriptor.create3(105 /* VoidKeyword */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsVoidOpContext), 2 /* Space */)); + this.NoSpaceBetweenReturnAndSemicolon = new formatting.Rule(formatting.RuleDescriptor.create1(96 /* ReturnKeyword */, 25 /* SemicolonToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); // 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] - this.SpaceBetweenStatements = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([19 /* CloseParenToken */, 80 /* DoKeyword */, 81 /* ElseKeyword */, 72 /* CaseKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNonJsxElementContext, Rules.IsNotForContext), 2 /* Space */)); + this.SpaceBetweenStatements = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([20 /* CloseParenToken */, 81 /* DoKeyword */, 82 /* ElseKeyword */, 73 /* CaseKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNonJsxElementContext, Rules.IsNotForContext), 2 /* Space */)); // This low-pri rule takes care of "try {" and "finally {" in case the rule SpaceBeforeOpenBraceInControl didn't execute on FormatOnEnter. - this.SpaceAfterTryFinally = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([101 /* TryKeyword */, 86 /* FinallyKeyword */]), 16 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); + this.SpaceAfterTryFinally = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([102 /* TryKeyword */, 87 /* FinallyKeyword */]), 17 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); // get x() {} // set x(val) {} - this.SpaceAfterGetSetInMember = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([124 /* GetKeyword */, 133 /* SetKeyword */]), 70 /* Identifier */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2 /* Space */)); + this.SpaceAfterGetSetInMember = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([125 /* GetKeyword */, 135 /* SetKeyword */]), 71 /* Identifier */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2 /* Space */)); // Special case for binary operators (that are keywords). For these we have to add a space and shouldn't follow any user options. this.SpaceBeforeBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryKeywordOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); this.SpaceAfterBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryKeywordOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); // TypeScript-specific higher priority rules - // Treat constructor as an identifier in a function declaration, and remove spaces between constructor and following left parentheses - this.SpaceAfterConstructor = new formatting.Rule(formatting.RuleDescriptor.create1(122 /* ConstructorKeyword */, 18 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); - this.NoSpaceAfterConstructor = new formatting.Rule(formatting.RuleDescriptor.create1(122 /* ConstructorKeyword */, 18 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + this.SpaceAfterConstructor = new formatting.Rule(formatting.RuleDescriptor.create1(123 /* ConstructorKeyword */, 19 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionEnabled("insertSpaceAfterConstructor"), Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); + this.NoSpaceAfterConstructor = new formatting.Rule(formatting.RuleDescriptor.create1(123 /* ConstructorKeyword */, 19 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionDisabledOrUndefined("insertSpaceAfterConstructor"), Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); // Use of module as a function call. e.g.: import m2 = module("m2"); - this.NoSpaceAfterModuleImport = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([127 /* ModuleKeyword */, 131 /* RequireKeyword */]), 18 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterModuleImport = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([128 /* ModuleKeyword */, 132 /* RequireKeyword */]), 19 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); // Add a space around certain TypeScript keywords - this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([116 /* AbstractKeyword */, 74 /* ClassKeyword */, 123 /* DeclareKeyword */, 78 /* DefaultKeyword */, 82 /* EnumKeyword */, 83 /* ExportKeyword */, 84 /* ExtendsKeyword */, 124 /* GetKeyword */, 107 /* ImplementsKeyword */, 90 /* ImportKeyword */, 108 /* InterfaceKeyword */, 127 /* ModuleKeyword */, 128 /* NamespaceKeyword */, 111 /* PrivateKeyword */, 113 /* PublicKeyword */, 112 /* ProtectedKeyword */, 130 /* ReadonlyKeyword */, 133 /* SetKeyword */, 114 /* StaticKeyword */, 136 /* TypeKeyword */, 138 /* FromKeyword */, 126 /* KeyOfKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); - this.SpaceBeforeCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([84 /* ExtendsKeyword */, 107 /* ImplementsKeyword */, 138 /* FromKeyword */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); + this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([117 /* AbstractKeyword */, 75 /* ClassKeyword */, 124 /* DeclareKeyword */, 79 /* DefaultKeyword */, 83 /* EnumKeyword */, 84 /* ExportKeyword */, 85 /* ExtendsKeyword */, 125 /* GetKeyword */, 108 /* ImplementsKeyword */, 91 /* ImportKeyword */, 109 /* InterfaceKeyword */, 128 /* ModuleKeyword */, 129 /* NamespaceKeyword */, 112 /* PrivateKeyword */, 114 /* PublicKeyword */, 113 /* ProtectedKeyword */, 131 /* ReadonlyKeyword */, 135 /* SetKeyword */, 115 /* StaticKeyword */, 138 /* TypeKeyword */, 140 /* FromKeyword */, 127 /* KeyOfKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); + this.SpaceBeforeCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([85 /* ExtendsKeyword */, 108 /* ImplementsKeyword */, 140 /* FromKeyword */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.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" { - this.SpaceAfterModuleName = new formatting.Rule(formatting.RuleDescriptor.create1(9 /* StringLiteral */, 16 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsModuleDeclContext), 2 /* Space */)); + this.SpaceAfterModuleName = new formatting.Rule(formatting.RuleDescriptor.create1(9 /* StringLiteral */, 17 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsModuleDeclContext), 2 /* Space */)); // Lambda expressions - this.SpaceBeforeArrow = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 35 /* EqualsGreaterThanToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); - this.SpaceAfterArrow = new formatting.Rule(formatting.RuleDescriptor.create3(35 /* EqualsGreaterThanToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); + this.SpaceBeforeArrow = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 36 /* EqualsGreaterThanToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); + this.SpaceAfterArrow = new formatting.Rule(formatting.RuleDescriptor.create3(36 /* EqualsGreaterThanToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); // Optional parameters and let args - this.NoSpaceAfterEllipsis = new formatting.Rule(formatting.RuleDescriptor.create1(23 /* DotDotDotToken */, 70 /* Identifier */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); - this.NoSpaceAfterOptionalParameters = new formatting.Rule(formatting.RuleDescriptor.create3(54 /* QuestionToken */, formatting.Shared.TokenRange.FromTokens([19 /* CloseParenToken */, 25 /* CommaToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNotBinaryOpContext), 8 /* Delete */)); + this.NoSpaceAfterEllipsis = new formatting.Rule(formatting.RuleDescriptor.create1(24 /* DotDotDotToken */, 71 /* Identifier */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterOptionalParameters = new formatting.Rule(formatting.RuleDescriptor.create3(55 /* QuestionToken */, formatting.Shared.TokenRange.FromTokens([20 /* CloseParenToken */, 26 /* CommaToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNotBinaryOpContext), 8 /* Delete */)); // generics and type assertions - this.NoSpaceBeforeOpenAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.TypeNames, 26 /* LessThanToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeArgumentOrParameterOrAssertionContext), 8 /* Delete */)); - this.NoSpaceBetweenCloseParenAndAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create1(19 /* CloseParenToken */, 26 /* LessThanToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeArgumentOrParameterOrAssertionContext), 8 /* Delete */)); - this.NoSpaceAfterOpenAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create3(26 /* LessThanToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeArgumentOrParameterOrAssertionContext), 8 /* Delete */)); - this.NoSpaceBeforeCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 28 /* GreaterThanToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeArgumentOrParameterOrAssertionContext), 8 /* Delete */)); - this.NoSpaceAfterCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create3(28 /* GreaterThanToken */, formatting.Shared.TokenRange.FromTokens([18 /* OpenParenToken */, 20 /* OpenBracketToken */, 28 /* GreaterThanToken */, 25 /* CommaToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeArgumentOrParameterOrAssertionContext), 8 /* Delete */)); + this.NoSpaceBeforeOpenAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.TypeNames, 27 /* LessThanToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeArgumentOrParameterOrAssertionContext), 8 /* Delete */)); + this.NoSpaceBetweenCloseParenAndAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create1(20 /* CloseParenToken */, 27 /* LessThanToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeArgumentOrParameterOrAssertionContext), 8 /* Delete */)); + this.NoSpaceAfterOpenAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create3(27 /* LessThanToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeArgumentOrParameterOrAssertionContext), 8 /* Delete */)); + this.NoSpaceBeforeCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 29 /* GreaterThanToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeArgumentOrParameterOrAssertionContext), 8 /* Delete */)); + this.NoSpaceAfterCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create3(29 /* GreaterThanToken */, formatting.Shared.TokenRange.FromTokens([19 /* OpenParenToken */, 21 /* OpenBracketToken */, 29 /* GreaterThanToken */, 26 /* CommaToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeArgumentOrParameterOrAssertionContext), 8 /* Delete */)); // Remove spaces in empty interface literals. e.g.: x: {} - this.NoSpaceBetweenEmptyInterfaceBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(16 /* OpenBraceToken */, 17 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsObjectTypeContext), 8 /* Delete */)); + this.NoSpaceBetweenEmptyInterfaceBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(17 /* OpenBraceToken */, 18 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsObjectTypeContext), 8 /* Delete */)); // decorators - this.SpaceBeforeAt = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 56 /* AtToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); - this.NoSpaceAfterAt = new formatting.Rule(formatting.RuleDescriptor.create3(56 /* AtToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); - this.SpaceAfterDecorator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([116 /* AbstractKeyword */, 70 /* Identifier */, 83 /* ExportKeyword */, 78 /* DefaultKeyword */, 74 /* ClassKeyword */, 114 /* StaticKeyword */, 113 /* PublicKeyword */, 111 /* PrivateKeyword */, 112 /* ProtectedKeyword */, 124 /* GetKeyword */, 133 /* SetKeyword */, 20 /* OpenBracketToken */, 38 /* AsteriskToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsEndOfDecoratorContextOnSameLine), 2 /* Space */)); - this.NoSpaceBetweenFunctionKeywordAndStar = new formatting.Rule(formatting.RuleDescriptor.create1(88 /* FunctionKeyword */, 38 /* AsteriskToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclarationOrFunctionExpressionContext), 8 /* Delete */)); - this.SpaceAfterStarInGeneratorDeclaration = new formatting.Rule(formatting.RuleDescriptor.create3(38 /* AsteriskToken */, formatting.Shared.TokenRange.FromTokens([70 /* Identifier */, 18 /* OpenParenToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclarationOrFunctionExpressionContext), 2 /* Space */)); - this.NoSpaceBetweenYieldKeywordAndStar = new formatting.Rule(formatting.RuleDescriptor.create1(115 /* YieldKeyword */, 38 /* AsteriskToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsYieldOrYieldStarWithOperand), 8 /* Delete */)); - this.SpaceBetweenYieldOrYieldStarAndOperand = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([115 /* YieldKeyword */, 38 /* AsteriskToken */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsYieldOrYieldStarWithOperand), 2 /* Space */)); + this.SpaceBeforeAt = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 57 /* AtToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); + this.NoSpaceAfterAt = new formatting.Rule(formatting.RuleDescriptor.create3(57 /* AtToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + this.SpaceAfterDecorator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([117 /* AbstractKeyword */, 71 /* Identifier */, 84 /* ExportKeyword */, 79 /* DefaultKeyword */, 75 /* ClassKeyword */, 115 /* StaticKeyword */, 114 /* PublicKeyword */, 112 /* PrivateKeyword */, 113 /* ProtectedKeyword */, 125 /* GetKeyword */, 135 /* SetKeyword */, 21 /* OpenBracketToken */, 39 /* AsteriskToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsEndOfDecoratorContextOnSameLine), 2 /* Space */)); + this.NoSpaceBetweenFunctionKeywordAndStar = new formatting.Rule(formatting.RuleDescriptor.create1(89 /* FunctionKeyword */, 39 /* AsteriskToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclarationOrFunctionExpressionContext), 8 /* Delete */)); + this.SpaceAfterStarInGeneratorDeclaration = new formatting.Rule(formatting.RuleDescriptor.create3(39 /* AsteriskToken */, formatting.Shared.TokenRange.FromTokens([71 /* Identifier */, 19 /* OpenParenToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclarationOrFunctionExpressionContext), 2 /* Space */)); + this.NoSpaceBetweenYieldKeywordAndStar = new formatting.Rule(formatting.RuleDescriptor.create1(116 /* YieldKeyword */, 39 /* AsteriskToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsYieldOrYieldStarWithOperand), 8 /* Delete */)); + this.SpaceBetweenYieldOrYieldStarAndOperand = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([116 /* YieldKeyword */, 39 /* AsteriskToken */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsYieldOrYieldStarWithOperand), 2 /* Space */)); // Async-await - this.SpaceBetweenAsyncAndOpenParen = new formatting.Rule(formatting.RuleDescriptor.create1(119 /* AsyncKeyword */, 18 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsArrowFunctionContext, Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); - this.SpaceBetweenAsyncAndFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(119 /* AsyncKeyword */, 88 /* FunctionKeyword */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); + this.SpaceBetweenAsyncAndOpenParen = new formatting.Rule(formatting.RuleDescriptor.create1(120 /* AsyncKeyword */, 19 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsArrowFunctionContext, Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); + this.SpaceBetweenAsyncAndFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(120 /* AsyncKeyword */, 89 /* FunctionKeyword */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); // template string - this.NoSpaceBetweenTagAndTemplateString = new formatting.Rule(formatting.RuleDescriptor.create3(70 /* Identifier */, formatting.Shared.TokenRange.FromTokens([12 /* NoSubstitutionTemplateLiteral */, 13 /* TemplateHead */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBetweenTagAndTemplateString = new formatting.Rule(formatting.RuleDescriptor.create3(71 /* Identifier */, formatting.Shared.TokenRange.FromTokens([13 /* NoSubstitutionTemplateLiteral */, 14 /* TemplateHead */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); // jsx opening element - this.SpaceBeforeJsxAttribute = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 70 /* Identifier */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNextTokenParentJsxAttribute, Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); - this.SpaceBeforeSlashInJsxOpeningElement = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 40 /* SlashToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsJsxSelfClosingElementContext, Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); - this.NoSpaceBeforeGreaterThanTokenInJsxOpeningElement = new formatting.Rule(formatting.RuleDescriptor.create1(40 /* SlashToken */, 28 /* GreaterThanToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsJsxSelfClosingElementContext, Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); - this.NoSpaceBeforeEqualInJsxAttribute = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 57 /* EqualsToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsJsxAttributeContext, Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); - this.NoSpaceAfterEqualInJsxAttribute = new formatting.Rule(formatting.RuleDescriptor.create3(57 /* EqualsToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsJsxAttributeContext, Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + this.SpaceBeforeJsxAttribute = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 71 /* Identifier */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNextTokenParentJsxAttribute, Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); + this.SpaceBeforeSlashInJsxOpeningElement = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 41 /* SlashToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsJsxSelfClosingElementContext, Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); + this.NoSpaceBeforeGreaterThanTokenInJsxOpeningElement = new formatting.Rule(formatting.RuleDescriptor.create1(41 /* SlashToken */, 29 /* GreaterThanToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsJsxSelfClosingElementContext, Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBeforeEqualInJsxAttribute = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 58 /* EqualsToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsJsxAttributeContext, Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterEqualInJsxAttribute = new formatting.Rule(formatting.RuleDescriptor.create3(58 /* EqualsToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsJsxAttributeContext, Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + // No space before non-null assertion operator + this.NoSpaceBeforeNonNullAssertionOperator = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 51 /* ExclamationToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNonNullAssertionContext), 8 /* Delete */)); + /// + /// Rules controlled by user options + /// + // Insert space after comma delimiter + this.SpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(26 /* CommaToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionEnabled("insertSpaceAfterCommaDelimiter"), Rules.IsNonJsxSameLineTokenContext, Rules.IsNonJsxElementContext, Rules.IsNextTokenNotCloseBracket), 2 /* Space */)); + this.NoSpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(26 /* CommaToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionDisabledOrUndefined("insertSpaceAfterCommaDelimiter"), Rules.IsNonJsxSameLineTokenContext, Rules.IsNonJsxElementContext), 8 /* Delete */)); + // Insert space before and after binary operators + this.SpaceBeforeBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionEnabled("insertSpaceBeforeAndAfterBinaryOperators"), Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.SpaceAfterBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionEnabled("insertSpaceBeforeAndAfterBinaryOperators"), Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.NoSpaceBeforeBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionDisabledOrUndefined("insertSpaceBeforeAndAfterBinaryOperators"), Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 8 /* Delete */)); + this.NoSpaceAfterBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionDisabledOrUndefined("insertSpaceBeforeAndAfterBinaryOperators"), Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 8 /* Delete */)); + // Insert space after keywords in control flow statements + this.SpaceAfterKeywordInControl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Keywords, 19 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionEnabled("insertSpaceAfterKeywordsInControlFlowStatements"), Rules.IsControlDeclContext), 2 /* Space */)); + this.NoSpaceAfterKeywordInControl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Keywords, 19 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionDisabledOrUndefined("insertSpaceAfterKeywordsInControlFlowStatements"), Rules.IsControlDeclContext), 8 /* Delete */)); + // Open Brace braces after function + // TypeScript: Function can have return types, which can be made of tons of different token kinds + this.NewLineBeforeOpenBraceInFunction = new formatting.Rule(formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 17 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionEnabled("placeOpenBraceOnNewLineForFunctions"), Rules.IsFunctionDeclContext, Rules.IsBeforeMultilineBlockContext), 4 /* NewLine */), 1 /* CanDeleteNewLines */); + // Open Brace braces after TypeScript module/class/interface + this.NewLineBeforeOpenBraceInTypeScriptDeclWithBlock = new formatting.Rule(formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 17 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionEnabled("placeOpenBraceOnNewLineForFunctions"), Rules.IsTypeScriptDeclWithBlockContext, Rules.IsBeforeMultilineBlockContext), 4 /* NewLine */), 1 /* CanDeleteNewLines */); + // Open Brace braces after control block + this.NewLineBeforeOpenBraceInControl = new formatting.Rule(formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 17 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionEnabled("placeOpenBraceOnNewLineForControlBlocks"), Rules.IsControlDeclContext, Rules.IsBeforeMultilineBlockContext), 4 /* NewLine */), 1 /* CanDeleteNewLines */); + // Insert space after semicolon in for statement + this.SpaceAfterSemicolonInFor = new formatting.Rule(formatting.RuleDescriptor.create3(25 /* SemicolonToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionEnabled("insertSpaceAfterSemicolonInForStatements"), Rules.IsNonJsxSameLineTokenContext, Rules.IsForContext), 2 /* Space */)); + this.NoSpaceAfterSemicolonInFor = new formatting.Rule(formatting.RuleDescriptor.create3(25 /* SemicolonToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionDisabledOrUndefined("insertSpaceAfterSemicolonInForStatements"), Rules.IsNonJsxSameLineTokenContext, Rules.IsForContext), 8 /* Delete */)); + // Insert space after opening and before closing nonempty parenthesis + this.SpaceAfterOpenParen = new formatting.Rule(formatting.RuleDescriptor.create3(19 /* OpenParenToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); + this.SpaceBeforeCloseParen = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 20 /* CloseParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); + this.NoSpaceBetweenParens = new formatting.Rule(formatting.RuleDescriptor.create1(19 /* OpenParenToken */, 20 /* CloseParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterOpenParen = new formatting.Rule(formatting.RuleDescriptor.create3(19 /* OpenParenToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBeforeCloseParen = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 20 /* CloseParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + // Insert space after opening and before closing nonempty brackets + this.SpaceAfterOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create3(21 /* OpenBracketToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"), Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); + this.SpaceBeforeCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 22 /* CloseBracketToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"), Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); + this.NoSpaceBetweenBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(21 /* OpenBracketToken */, 22 /* CloseBracketToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create3(21 /* OpenBracketToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"), Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBeforeCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 22 /* CloseBracketToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"), Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + // Insert space after opening and before closing template string braces + this.NoSpaceAfterTemplateHeadAndMiddle = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([14 /* TemplateHead */, 15 /* TemplateMiddle */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"), Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + this.SpaceAfterTemplateHeadAndMiddle = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([14 /* TemplateHead */, 15 /* TemplateMiddle */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"), Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); + this.NoSpaceBeforeTemplateMiddleAndTail = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([15 /* TemplateMiddle */, 16 /* TemplateTail */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"), Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + this.SpaceBeforeTemplateMiddleAndTail = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([15 /* TemplateMiddle */, 16 /* TemplateTail */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"), Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); + // No space after { and before } in JSX expression + this.NoSpaceAfterOpenBraceInJsxExpression = new formatting.Rule(formatting.RuleDescriptor.create3(17 /* OpenBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"), Rules.IsNonJsxSameLineTokenContext, Rules.IsJsxExpressionContext), 8 /* Delete */)); + this.SpaceAfterOpenBraceInJsxExpression = new formatting.Rule(formatting.RuleDescriptor.create3(17 /* OpenBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"), Rules.IsNonJsxSameLineTokenContext, Rules.IsJsxExpressionContext), 2 /* Space */)); + this.NoSpaceBeforeCloseBraceInJsxExpression = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"), Rules.IsNonJsxSameLineTokenContext, Rules.IsJsxExpressionContext), 8 /* Delete */)); + this.SpaceBeforeCloseBraceInJsxExpression = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"), Rules.IsNonJsxSameLineTokenContext, Rules.IsJsxExpressionContext), 2 /* Space */)); + // Insert space after function keyword for anonymous functions + this.SpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(89 /* FunctionKeyword */, 19 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionEnabled("insertSpaceAfterFunctionKeywordForAnonymousFunctions"), Rules.IsFunctionDeclContext), 2 /* Space */)); + this.NoSpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(89 /* FunctionKeyword */, 19 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionDisabledOrUndefined("insertSpaceAfterFunctionKeywordForAnonymousFunctions"), Rules.IsFunctionDeclContext), 8 /* Delete */)); + // No space after type assertion + this.NoSpaceAfterTypeAssertion = new formatting.Rule(formatting.RuleDescriptor.create3(29 /* GreaterThanToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionDisabledOrUndefined("insertSpaceAfterTypeAssertion"), Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeAssertionContext), 8 /* Delete */)); + this.SpaceAfterTypeAssertion = new formatting.Rule(formatting.RuleDescriptor.create3(29 /* GreaterThanToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionEnabled("insertSpaceAfterTypeAssertion"), Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeAssertionContext), 2 /* Space */)); // These rules are higher in priority than user-configurable rules. this.HighPriorityCommonRules = [ this.IgnoreBeforeComment, this.IgnoreAfterLineComment, @@ -75516,6 +81224,25 @@ var ts; this.SpaceBeforeAt, this.NoSpaceAfterAt, this.SpaceAfterDecorator, + this.NoSpaceBeforeNonNullAssertionOperator + ]; + // These rules are applied after high priority rules. + this.UserConfigurableRules = [ + this.SpaceAfterConstructor, this.NoSpaceAfterConstructor, + this.SpaceAfterComma, this.NoSpaceAfterComma, + this.SpaceAfterAnonymousFunctionKeyword, this.NoSpaceAfterAnonymousFunctionKeyword, + this.SpaceAfterKeywordInControl, this.NoSpaceAfterKeywordInControl, + this.SpaceAfterOpenParen, this.SpaceBeforeCloseParen, this.NoSpaceBetweenParens, this.NoSpaceAfterOpenParen, this.NoSpaceBeforeCloseParen, + this.SpaceAfterOpenBracket, this.SpaceBeforeCloseBracket, this.NoSpaceBetweenBrackets, this.NoSpaceAfterOpenBracket, this.NoSpaceBeforeCloseBracket, + this.SpaceAfterOpenBrace, this.SpaceBeforeCloseBrace, this.NoSpaceBetweenEmptyBraceBrackets, this.NoSpaceAfterOpenBrace, this.NoSpaceBeforeCloseBrace, + this.SpaceAfterTemplateHeadAndMiddle, this.SpaceBeforeTemplateMiddleAndTail, this.NoSpaceAfterTemplateHeadAndMiddle, this.NoSpaceBeforeTemplateMiddleAndTail, + this.SpaceAfterOpenBraceInJsxExpression, this.SpaceBeforeCloseBraceInJsxExpression, this.NoSpaceAfterOpenBraceInJsxExpression, this.NoSpaceBeforeCloseBraceInJsxExpression, + this.SpaceAfterSemicolonInFor, this.NoSpaceAfterSemicolonInFor, + this.SpaceBeforeBinaryOperator, this.SpaceAfterBinaryOperator, this.NoSpaceBeforeBinaryOperator, this.NoSpaceAfterBinaryOperator, + this.SpaceBeforeOpenParenInFuncDecl, this.NoSpaceBeforeOpenParenInFuncDecl, + this.NewLineBeforeOpenBraceInControl, + this.NewLineBeforeOpenBraceInFunction, this.NewLineBeforeOpenBraceInTypeScriptDeclWithBlock, + this.SpaceAfterTypeAssertion, this.NoSpaceAfterTypeAssertion ]; // These rules are lower in priority than user-configurable rules. this.LowPriorityCommonRules = [ @@ -75527,64 +81254,12 @@ var ts; this.SpaceAfterSemicolon, this.SpaceBetweenStatements, this.SpaceAfterTryFinally ]; - /// - /// Rules controlled by user options - /// - // Insert space after comma delimiter - this.SpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(25 /* CommaToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNonJsxElementContext, Rules.IsNextTokenNotCloseBracket), 2 /* Space */)); - this.NoSpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(25 /* CommaToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNonJsxElementContext), 8 /* Delete */)); - // Insert space before and after binary operators - this.SpaceBeforeBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); - this.SpaceAfterBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); - this.NoSpaceBeforeBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 8 /* Delete */)); - this.NoSpaceAfterBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 8 /* Delete */)); - // Insert space after keywords in control flow statements - this.SpaceAfterKeywordInControl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Keywords, 18 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext), 2 /* Space */)); - this.NoSpaceAfterKeywordInControl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Keywords, 18 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext), 8 /* Delete */)); - // Open Brace braces after function - // TypeScript: Function can have return types, which can be made of tons of different token kinds - this.NewLineBeforeOpenBraceInFunction = new formatting.Rule(formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 16 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsBeforeMultilineBlockContext), 4 /* NewLine */), 1 /* CanDeleteNewLines */); - // Open Brace braces after TypeScript module/class/interface - this.NewLineBeforeOpenBraceInTypeScriptDeclWithBlock = new formatting.Rule(formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 16 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsBeforeMultilineBlockContext), 4 /* NewLine */), 1 /* CanDeleteNewLines */); - // Open Brace braces after control block - this.NewLineBeforeOpenBraceInControl = new formatting.Rule(formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 16 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsBeforeMultilineBlockContext), 4 /* NewLine */), 1 /* CanDeleteNewLines */); - // Insert space after semicolon in for statement - this.SpaceAfterSemicolonInFor = new formatting.Rule(formatting.RuleDescriptor.create3(24 /* SemicolonToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsForContext), 2 /* Space */)); - this.NoSpaceAfterSemicolonInFor = new formatting.Rule(formatting.RuleDescriptor.create3(24 /* SemicolonToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsForContext), 8 /* Delete */)); - // Insert space after opening and before closing nonempty parenthesis - this.SpaceAfterOpenParen = new formatting.Rule(formatting.RuleDescriptor.create3(18 /* OpenParenToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); - this.SpaceBeforeCloseParen = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 19 /* CloseParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); - this.NoSpaceBetweenParens = new formatting.Rule(formatting.RuleDescriptor.create1(18 /* OpenParenToken */, 19 /* CloseParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); - this.NoSpaceAfterOpenParen = new formatting.Rule(formatting.RuleDescriptor.create3(18 /* OpenParenToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); - this.NoSpaceBeforeCloseParen = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 19 /* CloseParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); - // Insert space after opening and before closing nonempty brackets - this.SpaceAfterOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create3(20 /* OpenBracketToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); - this.SpaceBeforeCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 21 /* CloseBracketToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); - this.NoSpaceBetweenBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(20 /* OpenBracketToken */, 21 /* CloseBracketToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); - this.NoSpaceAfterOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create3(20 /* OpenBracketToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); - this.NoSpaceBeforeCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 21 /* CloseBracketToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); - // Insert space after opening and before closing template string braces - this.NoSpaceAfterTemplateHeadAndMiddle = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([13 /* TemplateHead */, 14 /* TemplateMiddle */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); - this.SpaceAfterTemplateHeadAndMiddle = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([13 /* TemplateHead */, 14 /* TemplateMiddle */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); - this.NoSpaceBeforeTemplateMiddleAndTail = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([14 /* TemplateMiddle */, 15 /* TemplateTail */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); - this.SpaceBeforeTemplateMiddleAndTail = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([14 /* TemplateMiddle */, 15 /* TemplateTail */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); - // No space after { and before } in JSX expression - this.NoSpaceAfterOpenBraceInJsxExpression = new formatting.Rule(formatting.RuleDescriptor.create3(16 /* OpenBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsJsxExpressionContext), 8 /* Delete */)); - this.SpaceAfterOpenBraceInJsxExpression = new formatting.Rule(formatting.RuleDescriptor.create3(16 /* OpenBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsJsxExpressionContext), 2 /* Space */)); - this.NoSpaceBeforeCloseBraceInJsxExpression = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsJsxExpressionContext), 8 /* Delete */)); - this.SpaceBeforeCloseBraceInJsxExpression = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsJsxExpressionContext), 2 /* Space */)); - // Insert space after function keyword for anonymous functions - this.SpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(88 /* FunctionKeyword */, 18 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2 /* Space */)); - this.NoSpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(88 /* FunctionKeyword */, 18 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 8 /* Delete */)); - // No space after type assertion - this.NoSpaceAfterTypeAssertion = new formatting.Rule(formatting.RuleDescriptor.create3(28 /* GreaterThanToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeAssertionContext), 8 /* Delete */)); - this.SpaceAfterTypeAssertion = new formatting.Rule(formatting.RuleDescriptor.create3(28 /* GreaterThanToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeAssertionContext), 2 /* Space */)); } Rules.prototype.getRuleName = function (rule) { var o = this; - for (var name_50 in o) { - if (o[name_50] === rule) { - return name_50; + for (var name in o) { + if (o[name] === rule) { + return name; } } throw new Error("Unknown rule"); @@ -75592,45 +81267,57 @@ var ts; /// /// Contexts /// + Rules.IsOptionEnabled = function (optionName) { + return function (context) { return context.options && context.options.hasOwnProperty(optionName) && !!context.options[optionName]; }; + }; + Rules.IsOptionDisabled = function (optionName) { + return function (context) { return context.options && context.options.hasOwnProperty(optionName) && !context.options[optionName]; }; + }; + Rules.IsOptionDisabledOrUndefined = function (optionName) { + return function (context) { return !context.options || !context.options.hasOwnProperty(optionName) || !context.options[optionName]; }; + }; + Rules.IsOptionEnabledOrUndefined = function (optionName) { + return function (context) { return !context.options || !context.options.hasOwnProperty(optionName) || !!context.options[optionName]; }; + }; Rules.IsForContext = function (context) { - return context.contextNode.kind === 211 /* ForStatement */; + return context.contextNode.kind === 214 /* ForStatement */; }; Rules.IsNotForContext = function (context) { return !Rules.IsForContext(context); }; Rules.IsBinaryOpContext = function (context) { switch (context.contextNode.kind) { - case 192 /* BinaryExpression */: - case 193 /* ConditionalExpression */: - case 200 /* AsExpression */: - case 243 /* ExportSpecifier */: - case 239 /* ImportSpecifier */: - case 156 /* TypePredicate */: - case 164 /* UnionType */: - case 165 /* IntersectionType */: + case 194 /* BinaryExpression */: + case 195 /* ConditionalExpression */: + case 202 /* AsExpression */: + case 246 /* ExportSpecifier */: + case 242 /* ImportSpecifier */: + case 158 /* TypePredicate */: + case 166 /* UnionType */: + case 167 /* IntersectionType */: return true; // equals in binding elements: function foo([[x, y] = [1, 2]]) - case 174 /* BindingElement */: + case 176 /* BindingElement */: // equals in type X = ... - case 228 /* TypeAliasDeclaration */: + case 231 /* TypeAliasDeclaration */: // equal in import a = module('a'); - case 234 /* ImportEqualsDeclaration */: + case 237 /* ImportEqualsDeclaration */: // equal in let a = 0; - case 223 /* VariableDeclaration */: + case 226 /* VariableDeclaration */: // equal in p = 0; - case 144 /* Parameter */: - case 260 /* EnumMember */: - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - return context.currentTokenSpan.kind === 57 /* EqualsToken */ || context.nextTokenSpan.kind === 57 /* EqualsToken */; + case 146 /* Parameter */: + case 264 /* EnumMember */: + case 149 /* PropertyDeclaration */: + case 148 /* PropertySignature */: + return context.currentTokenSpan.kind === 58 /* EqualsToken */ || context.nextTokenSpan.kind === 58 /* EqualsToken */; // "in" keyword in for (let x in []) { } - case 212 /* ForInStatement */: + case 215 /* ForInStatement */: // "in" keyword in [P in keyof T]: T[P] - case 143 /* TypeParameter */: - return context.currentTokenSpan.kind === 91 /* InKeyword */ || context.nextTokenSpan.kind === 91 /* InKeyword */; + case 145 /* 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 213 /* ForOfStatement */: - return context.currentTokenSpan.kind === 140 /* OfKeyword */ || context.nextTokenSpan.kind === 140 /* OfKeyword */; + case 216 /* ForOfStatement */: + return context.currentTokenSpan.kind === 142 /* OfKeyword */ || context.nextTokenSpan.kind === 142 /* OfKeyword */; } return false; }; @@ -75638,7 +81325,7 @@ var ts; return !Rules.IsBinaryOpContext(context); }; Rules.IsConditionalOperatorContext = function (context) { - return context.contextNode.kind === 193 /* ConditionalExpression */; + return context.contextNode.kind === 195 /* ConditionalExpression */; }; Rules.IsSameLineTokenOrBeforeMultilineBlockContext = function (context) { //// This check is mainly used inside SpaceBeforeOpenBraceInControl and SpaceBeforeOpenBraceInFunction. @@ -75659,6 +81346,9 @@ var ts; //// * ) and { are on different lines. We only need to format if the block is multiline context. So in this case we format. return context.TokensAreOnSameLine() || Rules.IsBeforeMultilineBlockContext(context); }; + Rules.IsBraceWrappedContext = function (context) { + return context.contextNode.kind === 174 /* ObjectBindingPattern */ || Rules.IsSingleLineBlockContext(context); + }; // This check is done before an open brace in a control construct, a function, or a typescript block declaration Rules.IsBeforeMultilineBlockContext = function (context) { return Rules.IsBeforeBlockContext(context) && !(context.NextNodeAllOnSameLine() || context.NextNodeBlockIsOnOneLine()); @@ -75682,70 +81372,70 @@ var ts; return true; } switch (node.kind) { - case 204 /* Block */: - case 232 /* CaseBlock */: - case 176 /* ObjectLiteralExpression */: - case 231 /* ModuleBlock */: + case 207 /* Block */: + case 235 /* CaseBlock */: + case 178 /* ObjectLiteralExpression */: + case 234 /* ModuleBlock */: return true; } return false; }; Rules.IsFunctionDeclContext = function (context) { switch (context.contextNode.kind) { - case 225 /* FunctionDeclaration */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 228 /* FunctionDeclaration */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: // case SyntaxKind.MemberFunctionDeclaration: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: // case SyntaxKind.MethodSignature: - case 153 /* CallSignature */: - case 184 /* FunctionExpression */: - case 150 /* Constructor */: - case 185 /* ArrowFunction */: + case 155 /* CallSignature */: + case 186 /* FunctionExpression */: + case 152 /* Constructor */: + case 187 /* ArrowFunction */: // case SyntaxKind.ConstructorDeclaration: // case SyntaxKind.SimpleArrowFunctionExpression: // case SyntaxKind.ParenthesizedArrowFunctionExpression: - case 227 /* InterfaceDeclaration */: + case 230 /* InterfaceDeclaration */: return true; } return false; }; Rules.IsFunctionDeclarationOrFunctionExpressionContext = function (context) { - return context.contextNode.kind === 225 /* FunctionDeclaration */ || context.contextNode.kind === 184 /* FunctionExpression */; + return context.contextNode.kind === 228 /* FunctionDeclaration */ || context.contextNode.kind === 186 /* FunctionExpression */; }; Rules.IsTypeScriptDeclWithBlockContext = function (context) { return Rules.NodeIsTypeScriptDeclWithBlockContext(context.contextNode); }; Rules.NodeIsTypeScriptDeclWithBlockContext = function (node) { switch (node.kind) { - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: - case 227 /* InterfaceDeclaration */: - case 229 /* EnumDeclaration */: - case 161 /* TypeLiteral */: - case 230 /* ModuleDeclaration */: - case 241 /* ExportDeclaration */: - case 242 /* NamedExports */: - case 235 /* ImportDeclaration */: - case 238 /* NamedImports */: + case 229 /* ClassDeclaration */: + case 199 /* ClassExpression */: + case 230 /* InterfaceDeclaration */: + case 232 /* EnumDeclaration */: + case 163 /* TypeLiteral */: + case 233 /* ModuleDeclaration */: + case 244 /* ExportDeclaration */: + case 245 /* NamedExports */: + case 238 /* ImportDeclaration */: + case 241 /* NamedImports */: return true; } return false; }; Rules.IsAfterCodeBlockContext = function (context) { switch (context.currentTokenParent.kind) { - case 226 /* ClassDeclaration */: - case 230 /* ModuleDeclaration */: - case 229 /* EnumDeclaration */: - case 256 /* CatchClause */: - case 231 /* ModuleBlock */: - case 218 /* SwitchStatement */: + case 229 /* ClassDeclaration */: + case 233 /* ModuleDeclaration */: + case 232 /* EnumDeclaration */: + case 260 /* CatchClause */: + case 234 /* ModuleBlock */: + case 221 /* SwitchStatement */: return true; - case 204 /* Block */: { + case 207 /* Block */: { var blockParent = context.currentTokenParent.parent; - if (blockParent.kind !== 185 /* ArrowFunction */ && - blockParent.kind !== 184 /* FunctionExpression */) { + if (blockParent.kind !== 187 /* ArrowFunction */ && + blockParent.kind !== 186 /* FunctionExpression */) { return true; } } @@ -75754,61 +81444,61 @@ var ts; }; Rules.IsControlDeclContext = function (context) { switch (context.contextNode.kind) { - case 208 /* IfStatement */: - case 218 /* SwitchStatement */: - case 211 /* ForStatement */: - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: - case 210 /* WhileStatement */: - case 221 /* TryStatement */: - case 209 /* DoStatement */: - case 217 /* WithStatement */: + case 211 /* IfStatement */: + case 221 /* SwitchStatement */: + case 214 /* ForStatement */: + case 215 /* ForInStatement */: + case 216 /* ForOfStatement */: + case 213 /* WhileStatement */: + case 224 /* TryStatement */: + case 212 /* DoStatement */: + case 220 /* WithStatement */: // TODO // case SyntaxKind.ElseClause: - case 256 /* CatchClause */: + case 260 /* CatchClause */: return true; default: return false; } }; Rules.IsObjectContext = function (context) { - return context.contextNode.kind === 176 /* ObjectLiteralExpression */; + return context.contextNode.kind === 178 /* ObjectLiteralExpression */; }; Rules.IsFunctionCallContext = function (context) { - return context.contextNode.kind === 179 /* CallExpression */; + return context.contextNode.kind === 181 /* CallExpression */; }; Rules.IsNewContext = function (context) { - return context.contextNode.kind === 180 /* NewExpression */; + return context.contextNode.kind === 182 /* NewExpression */; }; Rules.IsFunctionCallOrNewContext = function (context) { return Rules.IsFunctionCallContext(context) || Rules.IsNewContext(context); }; Rules.IsPreviousTokenNotComma = function (context) { - return context.currentTokenSpan.kind !== 25 /* CommaToken */; + return context.currentTokenSpan.kind !== 26 /* CommaToken */; }; Rules.IsNextTokenNotCloseBracket = function (context) { - return context.nextTokenSpan.kind !== 21 /* CloseBracketToken */; + return context.nextTokenSpan.kind !== 22 /* CloseBracketToken */; }; Rules.IsArrowFunctionContext = function (context) { - return context.contextNode.kind === 185 /* ArrowFunction */; + return context.contextNode.kind === 187 /* ArrowFunction */; }; Rules.IsNonJsxSameLineTokenContext = function (context) { return context.TokensAreOnSameLine() && context.contextNode.kind !== 10 /* JsxText */; }; Rules.IsNonJsxElementContext = function (context) { - return context.contextNode.kind !== 246 /* JsxElement */; + return context.contextNode.kind !== 249 /* JsxElement */; }; Rules.IsJsxExpressionContext = function (context) { - return context.contextNode.kind === 252 /* JsxExpression */; + return context.contextNode.kind === 256 /* JsxExpression */; }; Rules.IsNextTokenParentJsxAttribute = function (context) { - return context.nextTokenParent.kind === 250 /* JsxAttribute */; + return context.nextTokenParent.kind === 253 /* JsxAttribute */; }; Rules.IsJsxAttributeContext = function (context) { - return context.contextNode.kind === 250 /* JsxAttribute */; + return context.contextNode.kind === 253 /* JsxAttribute */; }; Rules.IsJsxSelfClosingElementContext = function (context) { - return context.contextNode.kind === 247 /* JsxSelfClosingElement */; + return context.contextNode.kind === 250 /* JsxSelfClosingElement */; }; Rules.IsNotBeforeBlockInFunctionDeclarationContext = function (context) { return !Rules.IsFunctionDeclContext(context) && !Rules.IsBeforeBlockContext(context); @@ -75823,42 +81513,42 @@ var ts; while (ts.isPartOfExpression(node)) { node = node.parent; } - return node.kind === 145 /* Decorator */; + return node.kind === 147 /* Decorator */; }; Rules.IsStartOfVariableDeclarationList = function (context) { - return context.currentTokenParent.kind === 224 /* VariableDeclarationList */ && + return context.currentTokenParent.kind === 227 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; }; Rules.IsNotFormatOnEnter = function (context) { return context.formattingRequestKind !== 2 /* FormatOnEnter */; }; Rules.IsModuleDeclContext = function (context) { - return context.contextNode.kind === 230 /* ModuleDeclaration */; + return context.contextNode.kind === 233 /* ModuleDeclaration */; }; Rules.IsObjectTypeContext = function (context) { - return context.contextNode.kind === 161 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; + return context.contextNode.kind === 163 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; }; Rules.IsTypeArgumentOrParameterOrAssertion = function (token, parent) { - if (token.kind !== 26 /* LessThanToken */ && token.kind !== 28 /* GreaterThanToken */) { + if (token.kind !== 27 /* LessThanToken */ && token.kind !== 29 /* GreaterThanToken */) { return false; } switch (parent.kind) { - case 157 /* TypeReference */: - case 182 /* TypeAssertionExpression */: - case 228 /* TypeAliasDeclaration */: - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: - case 227 /* InterfaceDeclaration */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 179 /* CallExpression */: - case 180 /* NewExpression */: - case 199 /* ExpressionWithTypeArguments */: + case 159 /* TypeReference */: + case 184 /* TypeAssertionExpression */: + case 231 /* TypeAliasDeclaration */: + case 229 /* ClassDeclaration */: + case 199 /* ClassExpression */: + case 230 /* InterfaceDeclaration */: + case 228 /* FunctionDeclaration */: + case 186 /* FunctionExpression */: + case 187 /* ArrowFunction */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: + case 155 /* CallSignature */: + case 156 /* ConstructSignature */: + case 181 /* CallExpression */: + case 182 /* NewExpression */: + case 201 /* ExpressionWithTypeArguments */: return true; default: return false; @@ -75869,13 +81559,16 @@ var ts; Rules.IsTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent); }; Rules.IsTypeAssertionContext = function (context) { - return context.contextNode.kind === 182 /* TypeAssertionExpression */; + return context.contextNode.kind === 184 /* TypeAssertionExpression */; }; Rules.IsVoidOpContext = function (context) { - return context.currentTokenSpan.kind === 104 /* VoidKeyword */ && context.currentTokenParent.kind === 188 /* VoidExpression */; + return context.currentTokenSpan.kind === 105 /* VoidKeyword */ && context.currentTokenParent.kind === 190 /* VoidExpression */; }; Rules.IsYieldOrYieldStarWithOperand = function (context) { - return context.contextNode.kind === 195 /* YieldExpression */ && context.contextNode.expression !== undefined; + return context.contextNode.kind === 197 /* YieldExpression */ && context.contextNode.expression !== undefined; + }; + Rules.IsNonNullAssertionContext = function (context) { + return context.contextNode.kind === 203 /* NonNullExpression */; }; return Rules; }()); @@ -75899,7 +81592,7 @@ var ts; return result; }; RulesMap.prototype.Initialize = function (rules) { - this.mapRowLength = 140 /* LastToken */ + 1; + this.mapRowLength = 142 /* LastToken */ + 1; this.map = new Array(this.mapRowLength * this.mapRowLength); // new Array(this.mapRowLength * this.mapRowLength); // This array is used only during construction of the rulesbucket in the map var rulesBucketConstructionStateList = new Array(this.map.length); // new Array(this.map.length); @@ -75913,7 +81606,7 @@ var ts; }); }; RulesMap.prototype.GetRuleBucketIndex = function (row, column) { - ts.Debug.assert(row <= 140 /* LastKeyword */ && column <= 140 /* LastKeyword */, "Must compute formatting context from tokens"); + ts.Debug.assert(row <= 142 /* LastKeyword */ && column <= 142 /* LastKeyword */, "Must compute formatting context from tokens"); var rulesBucketIndex = (row * this.mapRowLength) + column; return rulesBucketIndex; }; @@ -76094,7 +81787,7 @@ var ts; } TokenAllAccess.prototype.GetTokens = function () { var result = []; - for (var token = 0 /* FirstToken */; token <= 140 /* LastToken */; token++) { + for (var token = 0 /* FirstToken */; token <= 142 /* LastToken */; token++) { result.push(token); } return result; @@ -76138,17 +81831,17 @@ var ts; }()); TokenRange.Any = TokenRange.AllTokens(); TokenRange.AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([3 /* MultiLineCommentTrivia */])); - TokenRange.Keywords = TokenRange.FromRange(71 /* FirstKeyword */, 140 /* LastKeyword */); - TokenRange.BinaryOperators = TokenRange.FromRange(26 /* FirstBinaryOperator */, 69 /* LastBinaryOperator */); - TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([91 /* InKeyword */, 92 /* InstanceOfKeyword */, 140 /* OfKeyword */, 117 /* AsKeyword */, 125 /* IsKeyword */]); - TokenRange.UnaryPrefixOperators = TokenRange.FromTokens([42 /* PlusPlusToken */, 43 /* MinusMinusToken */, 51 /* TildeToken */, 50 /* ExclamationToken */]); - TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([8 /* NumericLiteral */, 70 /* Identifier */, 18 /* OpenParenToken */, 20 /* OpenBracketToken */, 16 /* OpenBraceToken */, 98 /* ThisKeyword */, 93 /* NewKeyword */]); - TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([70 /* Identifier */, 18 /* OpenParenToken */, 98 /* ThisKeyword */, 93 /* NewKeyword */]); - TokenRange.UnaryPostincrementExpressions = TokenRange.FromTokens([70 /* Identifier */, 19 /* CloseParenToken */, 21 /* CloseBracketToken */, 93 /* NewKeyword */]); - TokenRange.UnaryPredecrementExpressions = TokenRange.FromTokens([70 /* Identifier */, 18 /* OpenParenToken */, 98 /* ThisKeyword */, 93 /* NewKeyword */]); - TokenRange.UnaryPostdecrementExpressions = TokenRange.FromTokens([70 /* Identifier */, 19 /* CloseParenToken */, 21 /* CloseBracketToken */, 93 /* NewKeyword */]); + TokenRange.Keywords = TokenRange.FromRange(72 /* FirstKeyword */, 142 /* LastKeyword */); + TokenRange.BinaryOperators = TokenRange.FromRange(27 /* FirstBinaryOperator */, 70 /* LastBinaryOperator */); + TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([92 /* InKeyword */, 93 /* InstanceOfKeyword */, 142 /* OfKeyword */, 118 /* AsKeyword */, 126 /* IsKeyword */]); + TokenRange.UnaryPrefixOperators = TokenRange.FromTokens([43 /* PlusPlusToken */, 44 /* MinusMinusToken */, 52 /* TildeToken */, 51 /* ExclamationToken */]); + TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([8 /* NumericLiteral */, 71 /* Identifier */, 19 /* OpenParenToken */, 21 /* OpenBracketToken */, 17 /* OpenBraceToken */, 99 /* ThisKeyword */, 94 /* NewKeyword */]); + TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([71 /* Identifier */, 19 /* OpenParenToken */, 99 /* ThisKeyword */, 94 /* NewKeyword */]); + TokenRange.UnaryPostincrementExpressions = TokenRange.FromTokens([71 /* Identifier */, 20 /* CloseParenToken */, 22 /* CloseBracketToken */, 94 /* NewKeyword */]); + TokenRange.UnaryPredecrementExpressions = TokenRange.FromTokens([71 /* Identifier */, 19 /* OpenParenToken */, 99 /* ThisKeyword */, 94 /* NewKeyword */]); + TokenRange.UnaryPostdecrementExpressions = TokenRange.FromTokens([71 /* Identifier */, 20 /* CloseParenToken */, 22 /* CloseBracketToken */, 94 /* NewKeyword */]); TokenRange.Comments = TokenRange.FromTokens([2 /* SingleLineCommentTrivia */, 3 /* MultiLineCommentTrivia */]); - TokenRange.TypeNames = TokenRange.FromTokens([70 /* Identifier */, 132 /* NumberKeyword */, 134 /* StringKeyword */, 121 /* BooleanKeyword */, 135 /* SymbolKeyword */, 104 /* VoidKeyword */, 118 /* AnyKeyword */]); + TokenRange.TypeNames = TokenRange.FromTokens([71 /* Identifier */, 133 /* NumberKeyword */, 136 /* StringKeyword */, 122 /* BooleanKeyword */, 137 /* SymbolKeyword */, 105 /* VoidKeyword */, 119 /* AnyKeyword */]); Shared.TokenRange = TokenRange; })(Shared = formatting.Shared || (formatting.Shared = {})); })(formatting = ts.formatting || (ts.formatting = {})); @@ -76174,6 +81867,8 @@ var ts; var RulesProvider = (function () { function RulesProvider() { this.globalRules = new formatting.Rules(); + var activeRules = this.globalRules.HighPriorityCommonRules.slice(0).concat(this.globalRules.UserConfigurableRules).concat(this.globalRules.LowPriorityCommonRules); + this.rulesMap = formatting.RulesMap.create(activeRules); } RulesProvider.prototype.getRuleName = function (rule) { return this.globalRules.getRuleName(rule); @@ -76184,125 +81879,14 @@ var ts; RulesProvider.prototype.getRulesMap = function () { return this.rulesMap; }; + RulesProvider.prototype.getFormatOptions = function () { + return this.options; + }; RulesProvider.prototype.ensureUpToDate = function (options) { if (!this.options || !ts.compareDataObjects(this.options, options)) { - var activeRules = this.createActiveRules(options); - var rulesMap = formatting.RulesMap.create(activeRules); - this.activeRules = activeRules; - this.rulesMap = rulesMap; this.options = ts.clone(options); } }; - RulesProvider.prototype.createActiveRules = function (options) { - var rules = this.globalRules.HighPriorityCommonRules.slice(0); - if (options.insertSpaceAfterConstructor) { - rules.push(this.globalRules.SpaceAfterConstructor); - } - else { - rules.push(this.globalRules.NoSpaceAfterConstructor); - } - if (options.insertSpaceAfterCommaDelimiter) { - rules.push(this.globalRules.SpaceAfterComma); - } - else { - rules.push(this.globalRules.NoSpaceAfterComma); - } - if (options.insertSpaceAfterFunctionKeywordForAnonymousFunctions) { - rules.push(this.globalRules.SpaceAfterAnonymousFunctionKeyword); - } - else { - rules.push(this.globalRules.NoSpaceAfterAnonymousFunctionKeyword); - } - if (options.insertSpaceAfterKeywordsInControlFlowStatements) { - rules.push(this.globalRules.SpaceAfterKeywordInControl); - } - else { - rules.push(this.globalRules.NoSpaceAfterKeywordInControl); - } - if (options.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis) { - rules.push(this.globalRules.SpaceAfterOpenParen); - rules.push(this.globalRules.SpaceBeforeCloseParen); - rules.push(this.globalRules.NoSpaceBetweenParens); - } - else { - rules.push(this.globalRules.NoSpaceAfterOpenParen); - rules.push(this.globalRules.NoSpaceBeforeCloseParen); - rules.push(this.globalRules.NoSpaceBetweenParens); - } - if (options.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets) { - rules.push(this.globalRules.SpaceAfterOpenBracket); - rules.push(this.globalRules.SpaceBeforeCloseBracket); - rules.push(this.globalRules.NoSpaceBetweenBrackets); - } - else { - rules.push(this.globalRules.NoSpaceAfterOpenBracket); - rules.push(this.globalRules.NoSpaceBeforeCloseBracket); - rules.push(this.globalRules.NoSpaceBetweenBrackets); - } - // The default value of InsertSpaceAfterOpeningAndBeforeClosingNonemptyBraces is true - // so if the option is undefined, we should treat it as true as well - if (options.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces !== false) { - rules.push(this.globalRules.SpaceAfterOpenBrace); - rules.push(this.globalRules.SpaceBeforeCloseBrace); - rules.push(this.globalRules.NoSpaceBetweenEmptyBraceBrackets); - } - else { - rules.push(this.globalRules.NoSpaceAfterOpenBrace); - rules.push(this.globalRules.NoSpaceBeforeCloseBrace); - rules.push(this.globalRules.NoSpaceBetweenEmptyBraceBrackets); - } - if (options.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces) { - rules.push(this.globalRules.SpaceAfterTemplateHeadAndMiddle); - rules.push(this.globalRules.SpaceBeforeTemplateMiddleAndTail); - } - else { - rules.push(this.globalRules.NoSpaceAfterTemplateHeadAndMiddle); - rules.push(this.globalRules.NoSpaceBeforeTemplateMiddleAndTail); - } - if (options.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces) { - rules.push(this.globalRules.SpaceAfterOpenBraceInJsxExpression); - rules.push(this.globalRules.SpaceBeforeCloseBraceInJsxExpression); - } - else { - rules.push(this.globalRules.NoSpaceAfterOpenBraceInJsxExpression); - rules.push(this.globalRules.NoSpaceBeforeCloseBraceInJsxExpression); - } - if (options.insertSpaceAfterSemicolonInForStatements) { - rules.push(this.globalRules.SpaceAfterSemicolonInFor); - } - else { - rules.push(this.globalRules.NoSpaceAfterSemicolonInFor); - } - if (options.insertSpaceBeforeAndAfterBinaryOperators) { - rules.push(this.globalRules.SpaceBeforeBinaryOperator); - rules.push(this.globalRules.SpaceAfterBinaryOperator); - } - else { - rules.push(this.globalRules.NoSpaceBeforeBinaryOperator); - rules.push(this.globalRules.NoSpaceAfterBinaryOperator); - } - if (options.insertSpaceBeforeFunctionParenthesis) { - rules.push(this.globalRules.SpaceBeforeOpenParenInFuncDecl); - } - else { - rules.push(this.globalRules.NoSpaceBeforeOpenParenInFuncDecl); - } - if (options.placeOpenBraceOnNewLineForControlBlocks) { - rules.push(this.globalRules.NewLineBeforeOpenBraceInControl); - } - if (options.placeOpenBraceOnNewLineForFunctions) { - rules.push(this.globalRules.NewLineBeforeOpenBraceInFunction); - rules.push(this.globalRules.NewLineBeforeOpenBraceInTypeScriptDeclWithBlock); - } - if (options.insertSpaceAfterTypeAssertion) { - rules.push(this.globalRules.SpaceAfterTypeAssertion); - } - else { - rules.push(this.globalRules.NoSpaceAfterTypeAssertion); - } - rules = rules.concat(this.globalRules.LowPriorityCommonRules); - return rules; - }; return RulesProvider; }()); formatting.RulesProvider = RulesProvider; @@ -76351,11 +81935,11 @@ var ts; } formatting.formatOnEnter = formatOnEnter; function formatOnSemicolon(position, sourceFile, rulesProvider, options) { - return formatOutermostParent(position, 24 /* SemicolonToken */, sourceFile, options, rulesProvider, 3 /* FormatOnSemicolon */); + return formatOutermostParent(position, 25 /* SemicolonToken */, sourceFile, options, rulesProvider, 3 /* FormatOnSemicolon */); } formatting.formatOnSemicolon = formatOnSemicolon; function formatOnClosingCurly(position, sourceFile, rulesProvider, options) { - return formatOutermostParent(position, 17 /* CloseBraceToken */, sourceFile, options, rulesProvider, 4 /* FormatOnClosingCurlyBrace */); + return formatOutermostParent(position, 18 /* CloseBraceToken */, sourceFile, options, rulesProvider, 4 /* FormatOnClosingCurlyBrace */); } formatting.formatOnClosingCurly = formatOnClosingCurly; function formatDocument(sourceFile, rulesProvider, options) { @@ -76419,17 +82003,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 226 /* ClassDeclaration */: - case 227 /* InterfaceDeclaration */: + case 229 /* ClassDeclaration */: + case 230 /* InterfaceDeclaration */: return ts.rangeContainsRange(parent.members, node); - case 230 /* ModuleDeclaration */: + case 233 /* ModuleDeclaration */: var body = parent.body; - return body && body.kind === 231 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); - case 261 /* SourceFile */: - case 204 /* Block */: - case 231 /* ModuleBlock */: + return body && body.kind === 234 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); + case 265 /* SourceFile */: + case 207 /* Block */: + case 234 /* ModuleBlock */: return ts.rangeContainsRange(parent.statements, node); - case 256 /* CatchClause */: + case 260 /* CatchClause */: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -76449,9 +82033,9 @@ var ts; } } /** formatting is not applied to ranges that contain parse errors. - * This function will return a predicate that for a given text range will tell - * if there are any parse errors that overlap with the range. - */ + * This function will return a predicate that for a given text range will tell + * if there are any parse errors that overlap with the range. + */ function prepareRangeContainsErrorFunction(errors, originalRange) { if (!errors.length) { return rangeHasNoErrors; @@ -76489,10 +82073,10 @@ var ts; } } /** - * Start of the original range might fall inside the comment - scanner will not yield appropriate results - * This function will look for token that is located before the start of target range - * and return its end as start position for the scanner. - */ + * Start of the original range might fall inside the comment - scanner will not yield appropriate results + * This function will look for token that is located before the start of target range + * and return its end as start position for the scanner. + */ function getScanStartPosition(enclosingNode, originalRange, sourceFile) { var start = enclosingNode.getStart(sourceFile); if (start === originalRange.pos && enclosingNode.end === originalRange.end) { @@ -76542,14 +82126,21 @@ var ts; } return 0; } + /* @internal */ + function formatNode(node, sourceFileLike, languageVariant, initialIndentation, delta, rulesProvider) { + var range = { pos: 0, end: sourceFileLike.text.length }; + return formatSpanWorker(range, node, initialIndentation, delta, formatting.getFormattingScanner(sourceFileLike.text, languageVariant, range.pos, range.end), rulesProvider.getFormatOptions(), rulesProvider, 1 /* FormatSelection */, function (_) { return false; }, // assume that node does not have any errors + sourceFileLike); + } + formatting.formatNode = formatNode; function formatSpan(originalRange, sourceFile, options, rulesProvider, requestKind) { - var rangeContainsError = prepareRangeContainsErrorFunction(sourceFile.parseDiagnostics, originalRange); - // formatting context is used by rules provider - var formattingContext = new formatting.FormattingContext(sourceFile, requestKind); // find the smallest node that fully wraps the range and compute the initial indentation for the node var enclosingNode = findEnclosingNode(originalRange, sourceFile); - var formattingScanner = formatting.getFormattingScanner(sourceFile, getScanStartPosition(enclosingNode, originalRange, sourceFile), originalRange.end); - var initialIndentation = formatting.SmartIndenter.getIndentationForNode(enclosingNode, originalRange, sourceFile, options); + return formatSpanWorker(originalRange, enclosingNode, formatting.SmartIndenter.getIndentationForNode(enclosingNode, originalRange, sourceFile, options), getOwnOrInheritedDelta(enclosingNode, options, sourceFile), formatting.getFormattingScanner(sourceFile.text, sourceFile.languageVariant, getScanStartPosition(enclosingNode, originalRange, sourceFile), originalRange.end), options, rulesProvider, requestKind, prepareRangeContainsErrorFunction(sourceFile.parseDiagnostics, originalRange), sourceFile); + } + function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delta, formattingScanner, options, rulesProvider, requestKind, rangeContainsError, sourceFile) { + // formatting context is used by rules provider + var formattingContext = new formatting.FormattingContext(sourceFile, requestKind, options); var previousRangeHasError; var previousRange; var previousParent; @@ -76564,13 +82155,12 @@ var ts; if (enclosingNode.decorators) { undecoratedStartLine = sourceFile.getLineAndCharacterOfPosition(ts.getNonDecoratorTokenPosOfNode(enclosingNode, sourceFile)).line; } - var delta = getOwnOrInheritedDelta(enclosingNode, options, sourceFile); processNode(enclosingNode, enclosingNode, startLine, undecoratedStartLine, initialIndentation, delta); } if (!formattingScanner.isOnToken()) { var leadingTrivia = formattingScanner.getCurrentLeadingTrivia(); if (leadingTrivia) { - processTrivia(leadingTrivia, enclosingNode, enclosingNode, undefined); + processTrivia(leadingTrivia, enclosingNode, enclosingNode, /*dynamicIndentation*/ undefined); trimTrailingWhitespacesForRemainingRange(); } } @@ -76578,12 +82168,12 @@ var ts; return edits; // local functions /** Tries to compute the indentation for a list element. - * If list element is not in range then - * function will pick its actual indentation - * so it can be pushed downstream as inherited indentation. - * If list element is in the range - its indentation will be equal - * to inherited indentation from its predecessors. - */ + * If list element is not in range then + * function will pick its actual indentation + * so it can be pushed downstream as inherited indentation. + * If list element is in the range - its indentation will be equal + * to inherited indentation from its predecessors. + */ function tryComputeIndentationForListItem(startPos, endPos, parentStartLine, range, inheritedIndentation) { if (ts.rangeOverlapsWithStartEnd(range, startPos, endPos) || ts.rangeContainsStartEnd(range, startPos, endPos) /* Not to miss zero-range nodes e.g. JsxText */) { @@ -76634,21 +82224,20 @@ var ts; return node.modifiers[0].kind; } switch (node.kind) { - case 226 /* ClassDeclaration */: return 74 /* ClassKeyword */; - case 227 /* InterfaceDeclaration */: return 108 /* InterfaceKeyword */; - case 225 /* FunctionDeclaration */: return 88 /* FunctionKeyword */; - case 229 /* EnumDeclaration */: return 229 /* EnumDeclaration */; - case 151 /* GetAccessor */: return 124 /* GetKeyword */; - case 152 /* SetAccessor */: return 133 /* SetKeyword */; - case 149 /* MethodDeclaration */: + case 229 /* ClassDeclaration */: return 75 /* ClassKeyword */; + case 230 /* InterfaceDeclaration */: return 109 /* InterfaceKeyword */; + case 228 /* FunctionDeclaration */: return 89 /* FunctionKeyword */; + case 232 /* EnumDeclaration */: return 232 /* EnumDeclaration */; + case 153 /* GetAccessor */: return 125 /* GetKeyword */; + case 154 /* SetAccessor */: return 135 /* SetKeyword */; + case 151 /* MethodDeclaration */: if (node.asteriskToken) { - return 38 /* AsteriskToken */; - } /* - fall-through - */ - case 147 /* PropertyDeclaration */: - case 144 /* Parameter */: - return node.name.kind; + return 39 /* AsteriskToken */; + } + // falls through + case 149 /* PropertyDeclaration */: + case 146 /* Parameter */: + return ts.getNameOfDeclaration(node).kind; } } function getDynamicIndentation(node, nodeStartLine, indentation, delta) { @@ -76659,9 +82248,9 @@ var ts; // .. { // // comment // } - case 17 /* CloseBraceToken */: - case 21 /* CloseBracketToken */: - case 19 /* CloseParenToken */: + case 18 /* CloseBraceToken */: + case 22 /* CloseBracketToken */: + case 20 /* CloseParenToken */: return indentation + getEffectiveDelta(delta, container); } return tokenIndentation !== -1 /* Unknown */ ? tokenIndentation : indentation; @@ -76675,26 +82264,26 @@ var ts; } switch (kind) { // open and close brace, 'else' and 'while' (in do statement) tokens has indentation of the parent - case 16 /* OpenBraceToken */: - case 17 /* CloseBraceToken */: - case 18 /* OpenParenToken */: - case 19 /* CloseParenToken */: - case 81 /* ElseKeyword */: - case 105 /* WhileKeyword */: - case 56 /* AtToken */: + case 17 /* OpenBraceToken */: + case 18 /* CloseBraceToken */: + case 19 /* OpenParenToken */: + case 20 /* CloseParenToken */: + case 82 /* ElseKeyword */: + case 106 /* WhileKeyword */: + case 57 /* AtToken */: return indentation; - case 40 /* SlashToken */: - case 28 /* GreaterThanToken */: { - if (container.kind === 248 /* JsxOpeningElement */ || - container.kind === 249 /* JsxClosingElement */ || - container.kind === 247 /* JsxSelfClosingElement */) { + case 41 /* SlashToken */: + case 29 /* GreaterThanToken */: { + if (container.kind === 251 /* JsxOpeningElement */ || + container.kind === 252 /* JsxClosingElement */ || + container.kind === 250 /* JsxSelfClosingElement */) { return indentation; } break; } - case 20 /* OpenBracketToken */: - case 21 /* CloseBracketToken */: { - if (container.kind !== 170 /* MappedType */) { + case 21 /* OpenBracketToken */: + case 22 /* CloseBracketToken */: { + if (container.kind !== 172 /* MappedType */) { return indentation; } break; @@ -76724,7 +82313,7 @@ var ts; }; function getEffectiveDelta(delta, child) { // Delta value should be zero when the node explicitly prevents indentation of the child node - return formatting.SmartIndenter.nodeWillIndentChild(node, child, true) ? delta : 0; + return formatting.SmartIndenter.nodeWillIndentChild(node, child, /*indentByDefault*/ true) ? delta : 0; } } function processNode(node, contextNode, nodeStartLine, undecoratedNodeStartLine, indentation, delta) { @@ -76804,11 +82393,11 @@ var ts; consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child); return inheritedIndentation; } - var effectiveParentStartLine = child.kind === 145 /* Decorator */ ? childStartLine : undecoratedParentStartLine; + var effectiveParentStartLine = child.kind === 147 /* Decorator */ ? childStartLine : undecoratedParentStartLine; var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); childContextNode = node; - if (isFirstListItem && parent.kind === 175 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { + if (isFirstListItem && parent.kind === 177 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { inheritedIndentation = childIndentation.indentation; } return inheritedIndentation; @@ -77060,7 +82649,7 @@ var ts; } // shift all parts on the delta size var delta = indentation - nonWhitespaceColumnInFirstPart.column; - for (var i = startIndex, len = parts.length; i < len; i++, startLine++) { + for (var i = startIndex; i < parts.length; i++, startLine++) { var startLinePos_1 = ts.getStartPositionOfLine(startLine, sourceFile); var nonWhitespaceCharacterAndColumn = i === 0 ? nonWhitespaceColumnInFirstPart @@ -77165,41 +82754,41 @@ var ts; } function getOpenTokenForList(node, list) { switch (node.kind) { - case 150 /* Constructor */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 185 /* ArrowFunction */: + case 152 /* Constructor */: + case 228 /* FunctionDeclaration */: + case 186 /* FunctionExpression */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: + case 187 /* ArrowFunction */: if (node.typeParameters === list) { - return 26 /* LessThanToken */; + return 27 /* LessThanToken */; } else if (node.parameters === list) { - return 18 /* OpenParenToken */; + return 19 /* OpenParenToken */; } break; - case 179 /* CallExpression */: - case 180 /* NewExpression */: + case 181 /* CallExpression */: + case 182 /* NewExpression */: if (node.typeArguments === list) { - return 26 /* LessThanToken */; + return 27 /* LessThanToken */; } else if (node.arguments === list) { - return 18 /* OpenParenToken */; + return 19 /* OpenParenToken */; } break; - case 157 /* TypeReference */: + case 159 /* TypeReference */: if (node.typeArguments === list) { - return 26 /* LessThanToken */; + return 27 /* LessThanToken */; } } return 0 /* Unknown */; } function getCloseTokenForOpenToken(kind) { switch (kind) { - case 18 /* OpenParenToken */: - return 19 /* CloseParenToken */; - case 26 /* LessThanToken */: - return 28 /* GreaterThanToken */; + case 19 /* OpenParenToken */: + return 20 /* CloseParenToken */; + case 27 /* LessThanToken */: + return 29 /* GreaterThanToken */; } return 0 /* Unknown */; } @@ -77267,7 +82856,20 @@ var ts; (function (Value) { Value[Value["Unknown"] = -1] = "Unknown"; })(Value || (Value = {})); - function getIndentation(position, sourceFile, options) { + /** + * Computed indentation for a given position in source file + * @param position - position in file + * @param sourceFile - target source file + * @param options - set of editor options that control indentation + * @param assumeNewLineBeforeCloseBrace - false when getIndentation is called on the text from the real source file. + * true - when we need to assume that position is on the newline. This is usefult for codefixes, i.e. + * function f() { + * |} + * when inserting some text after open brace we would like to get the value of indentation as if newline was already there. + * However by default indentation at position | will be 0 so 'assumeNewLineBeforeCloseBrace' allows to override this behavior, + */ + function getIndentation(position, sourceFile, options, assumeNewLineBeforeCloseBrace) { + if (assumeNewLineBeforeCloseBrace === void 0) { assumeNewLineBeforeCloseBrace = false; } if (position > sourceFile.text.length) { return getBaseIndentation(options); // past EOF } @@ -77295,7 +82897,7 @@ var ts; var current_1 = position; while (current_1 > 0) { var char = sourceFile.text.charCodeAt(current_1); - if (!ts.isWhiteSpace(char)) { + if (!ts.isWhiteSpaceLike(char)) { break; } current_1--; @@ -77303,7 +82905,7 @@ var ts; var lineStart = ts.getLineStartPositionForPosition(current_1, sourceFile); return SmartIndenter.findFirstNonWhitespaceColumn(lineStart, current_1, sourceFile, options); } - if (precedingToken.kind === 25 /* CommaToken */ && precedingToken.parent.kind !== 192 /* BinaryExpression */) { + if (precedingToken.kind === 26 /* CommaToken */ && precedingToken.parent.kind !== 194 /* 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 */) { @@ -77319,8 +82921,10 @@ var ts; while (current) { if (ts.positionBelongsToNode(current, position, sourceFile) && shouldIndentChildNode(current, previous)) { currentStart = getStartLineAndCharacterForNode(current, sourceFile); - if (nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile)) { - indentationDelta = 0; + var nextTokenKind = nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile); + if (nextTokenKind !== 0 /* Unknown */) { + // handle cases when codefix is about to be inserted before the close brace + indentationDelta = assumeNewLineBeforeCloseBrace && nextTokenKind === 2 /* CloseBrace */ ? options.indentSize : 0; } else { indentationDelta = lineAtPosition !== currentStart.line ? options.indentSize : 0; @@ -77426,22 +83030,28 @@ 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 === 261 /* SourceFile */ || !parentAndChildShareLine); + (parent.kind === 265 /* SourceFile */ || !parentAndChildShareLine); if (!useActualIndentation) { return -1 /* Unknown */; } return findColumnForFirstNonWhitespaceCharacterInLine(currentLineAndChar, sourceFile, options); } + var NextTokenKind; + (function (NextTokenKind) { + NextTokenKind[NextTokenKind["Unknown"] = 0] = "Unknown"; + NextTokenKind[NextTokenKind["OpenBrace"] = 1] = "OpenBrace"; + NextTokenKind[NextTokenKind["CloseBrace"] = 2] = "CloseBrace"; + })(NextTokenKind || (NextTokenKind = {})); function nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile) { var nextToken = ts.findNextToken(precedingToken, current); if (!nextToken) { - return false; + return 0 /* Unknown */; } - if (nextToken.kind === 16 /* OpenBraceToken */) { + if (nextToken.kind === 17 /* OpenBraceToken */) { // open braces are always indented at the parent level - return true; + return 1 /* OpenBrace */; } - else if (nextToken.kind === 17 /* CloseBraceToken */) { + else if (nextToken.kind === 18 /* CloseBraceToken */) { // close braces are indented at the parent level if they are located on the same line with cursor // this means that if new line will be added at $ position, this case will be indented // class A { @@ -77451,16 +83061,16 @@ var ts; // class A { // $} var nextTokenStartLine = getStartLineAndCharacterForNode(nextToken, sourceFile).line; - return lineAtPosition === nextTokenStartLine; + return lineAtPosition === nextTokenStartLine ? 2 /* CloseBrace */ : 0 /* Unknown */; } - return false; + return 0 /* Unknown */; } function getStartLineAndCharacterForNode(n, sourceFile) { return sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile)); } function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 208 /* IfStatement */ && parent.elseStatement === child) { - var elseKeyword = ts.findChildOfKind(parent, 81 /* ElseKeyword */, sourceFile); + if (parent.kind === 211 /* IfStatement */ && parent.elseStatement === child) { + var elseKeyword = ts.findChildOfKind(parent, 82 /* ElseKeyword */, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; return elseKeywordStartLine === childStartLine; @@ -77468,53 +83078,49 @@ var ts; return false; } SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement = childStartsOnTheSameLineWithElseInIfStatement; + function getListIfStartEndIsInListRange(list, start, end) { + return list && ts.rangeContainsStartEnd(list, start, end) ? list : undefined; + } function getContainingList(node, sourceFile) { if (node.parent) { switch (node.parent.kind) { - case 157 /* TypeReference */: - if (node.parent.typeArguments && - ts.rangeContainsStartEnd(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd())) { - return node.parent.typeArguments; - } - break; - case 176 /* ObjectLiteralExpression */: + case 159 /* TypeReference */: + return getListIfStartEndIsInListRange(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd()); + case 178 /* ObjectLiteralExpression */: return node.parent.properties; - case 175 /* ArrayLiteralExpression */: + case 177 /* ArrayLiteralExpression */: return node.parent.elements; - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: { + case 228 /* FunctionDeclaration */: + case 186 /* FunctionExpression */: + case 187 /* ArrowFunction */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: + case 155 /* CallSignature */: + case 152 /* Constructor */: + case 161 /* ConstructorType */: + case 156 /* ConstructSignature */: { var start = node.getStart(sourceFile); - if (node.parent.typeParameters && - ts.rangeContainsStartEnd(node.parent.typeParameters, start, node.getEnd())) { - return node.parent.typeParameters; - } - if (ts.rangeContainsStartEnd(node.parent.parameters, start, node.getEnd())) { - return node.parent.parameters; - } - break; + return getListIfStartEndIsInListRange(node.parent.typeParameters, start, node.getEnd()) || + getListIfStartEndIsInListRange(node.parent.parameters, start, node.getEnd()); } - case 180 /* NewExpression */: - case 179 /* CallExpression */: { + case 229 /* ClassDeclaration */: + return getListIfStartEndIsInListRange(node.parent.typeParameters, node.getStart(sourceFile), node.getEnd()); + case 182 /* NewExpression */: + case 181 /* CallExpression */: { var start = node.getStart(sourceFile); - if (node.parent.typeArguments && - ts.rangeContainsStartEnd(node.parent.typeArguments, start, node.getEnd())) { - return node.parent.typeArguments; - } - if (node.parent.arguments && - ts.rangeContainsStartEnd(node.parent.arguments, start, node.getEnd())) { - return node.parent.arguments; - } - break; + return getListIfStartEndIsInListRange(node.parent.typeArguments, start, node.getEnd()) || + getListIfStartEndIsInListRange(node.parent.arguments, start, node.getEnd()); } + case 227 /* VariableDeclarationList */: + return getListIfStartEndIsInListRange(node.parent.declarations, node.getStart(sourceFile), node.getEnd()); + case 241 /* NamedImports */: + case 245 /* NamedExports */: + return getListIfStartEndIsInListRange(node.parent.elements, node.getStart(sourceFile), node.getEnd()); } } return undefined; } + SmartIndenter.getContainingList = getContainingList; function getActualIndentationForListItem(node, sourceFile, options) { var containingList = getContainingList(node, sourceFile); return containingList ? getActualIndentationFromList(containingList) : -1 /* Unknown */; @@ -77526,11 +83132,11 @@ var ts; function getLineIndentationWhenExpressionIsInMultiLine(node, sourceFile, options) { // actual indentation should not be used when: // - node is close parenthesis - this is the end of the expression - if (node.kind === 19 /* CloseParenToken */) { + if (node.kind === 20 /* CloseParenToken */) { return -1 /* Unknown */; } - if (node.parent && (node.parent.kind === 179 /* CallExpression */ || - node.parent.kind === 180 /* NewExpression */) && + if (node.parent && (node.parent.kind === 181 /* CallExpression */ || + node.parent.kind === 182 /* NewExpression */) && node.parent.expression !== node) { var fullCallOrNewExpression = node.parent.expression; var startingExpression = getStartingExpression(fullCallOrNewExpression); @@ -77548,10 +83154,10 @@ var ts; function getStartingExpression(node) { while (true) { switch (node.kind) { - case 179 /* CallExpression */: - case 180 /* NewExpression */: - case 177 /* PropertyAccessExpression */: - case 178 /* ElementAccessExpression */: + case 181 /* CallExpression */: + case 182 /* NewExpression */: + case 179 /* PropertyAccessExpression */: + case 180 /* ElementAccessExpression */: node = node.expression; break; default: @@ -77567,7 +83173,7 @@ var ts; // if end line for item [i - 1] differs from the start line for item [i] - find column of the first non-whitespace character on the line of item [i] var lineAndCharacter = getStartLineAndCharacterForNode(node, sourceFile); for (var i = index - 1; i >= 0; i--) { - if (list[i].kind === 25 /* CommaToken */) { + if (list[i].kind === 26 /* CommaToken */) { continue; } // skip list items that ends on the same line with the current list element @@ -77615,49 +83221,49 @@ var ts; SmartIndenter.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn; function nodeContentIsAlwaysIndented(kind) { switch (kind) { - case 207 /* ExpressionStatement */: - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: - case 227 /* InterfaceDeclaration */: - case 229 /* EnumDeclaration */: - case 228 /* TypeAliasDeclaration */: - case 175 /* ArrayLiteralExpression */: - case 204 /* Block */: - case 231 /* ModuleBlock */: - case 176 /* ObjectLiteralExpression */: - case 161 /* TypeLiteral */: - case 170 /* MappedType */: - case 163 /* TupleType */: - case 232 /* CaseBlock */: - case 254 /* DefaultClause */: - case 253 /* CaseClause */: - case 183 /* ParenthesizedExpression */: - case 177 /* PropertyAccessExpression */: - case 179 /* CallExpression */: - case 180 /* NewExpression */: - case 205 /* VariableStatement */: - case 223 /* VariableDeclaration */: - case 240 /* ExportAssignment */: - case 216 /* ReturnStatement */: - case 193 /* ConditionalExpression */: - case 173 /* ArrayBindingPattern */: - case 172 /* ObjectBindingPattern */: - case 248 /* JsxOpeningElement */: - case 247 /* JsxSelfClosingElement */: - case 252 /* JsxExpression */: - case 148 /* MethodSignature */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 144 /* Parameter */: - case 158 /* FunctionType */: - case 159 /* ConstructorType */: - case 166 /* ParenthesizedType */: - case 181 /* TaggedTemplateExpression */: - case 189 /* AwaitExpression */: - case 242 /* NamedExports */: - case 238 /* NamedImports */: - case 243 /* ExportSpecifier */: - case 239 /* ImportSpecifier */: + case 210 /* ExpressionStatement */: + case 229 /* ClassDeclaration */: + case 199 /* ClassExpression */: + case 230 /* InterfaceDeclaration */: + case 232 /* EnumDeclaration */: + case 231 /* TypeAliasDeclaration */: + case 177 /* ArrayLiteralExpression */: + case 207 /* Block */: + case 234 /* ModuleBlock */: + case 178 /* ObjectLiteralExpression */: + case 163 /* TypeLiteral */: + case 172 /* MappedType */: + case 165 /* TupleType */: + case 235 /* CaseBlock */: + case 258 /* DefaultClause */: + case 257 /* CaseClause */: + case 185 /* ParenthesizedExpression */: + case 179 /* PropertyAccessExpression */: + case 181 /* CallExpression */: + case 182 /* NewExpression */: + case 208 /* VariableStatement */: + case 226 /* VariableDeclaration */: + case 243 /* ExportAssignment */: + case 219 /* ReturnStatement */: + case 195 /* ConditionalExpression */: + case 175 /* ArrayBindingPattern */: + case 174 /* ObjectBindingPattern */: + case 251 /* JsxOpeningElement */: + case 250 /* JsxSelfClosingElement */: + case 256 /* JsxExpression */: + case 150 /* MethodSignature */: + case 155 /* CallSignature */: + case 156 /* ConstructSignature */: + case 146 /* Parameter */: + case 160 /* FunctionType */: + case 161 /* ConstructorType */: + case 168 /* ParenthesizedType */: + case 183 /* TaggedTemplateExpression */: + case 191 /* AwaitExpression */: + case 245 /* NamedExports */: + case 241 /* NamedImports */: + case 246 /* ExportSpecifier */: + case 242 /* ImportSpecifier */: return true; } return false; @@ -77666,27 +83272,27 @@ var ts; function nodeWillIndentChild(parent, child, indentByDefault) { var childKind = child ? child.kind : 0 /* Unknown */; switch (parent.kind) { - case 209 /* DoStatement */: - case 210 /* WhileStatement */: - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: - case 211 /* ForStatement */: - case 208 /* IfStatement */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 149 /* MethodDeclaration */: - case 185 /* ArrowFunction */: - case 150 /* Constructor */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - return childKind !== 204 /* Block */; - case 241 /* ExportDeclaration */: - return childKind !== 242 /* NamedExports */; - case 235 /* ImportDeclaration */: - return childKind !== 236 /* ImportClause */ || - (child.namedBindings && child.namedBindings.kind !== 238 /* NamedImports */); - case 246 /* JsxElement */: - return childKind !== 249 /* JsxClosingElement */; + case 212 /* DoStatement */: + case 213 /* WhileStatement */: + case 215 /* ForInStatement */: + case 216 /* ForOfStatement */: + case 214 /* ForStatement */: + case 211 /* IfStatement */: + case 228 /* FunctionDeclaration */: + case 186 /* FunctionExpression */: + case 151 /* MethodDeclaration */: + case 187 /* ArrowFunction */: + case 152 /* Constructor */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + return childKind !== 207 /* Block */; + case 244 /* ExportDeclaration */: + return childKind !== 245 /* NamedExports */; + case 238 /* ImportDeclaration */: + return childKind !== 239 /* ImportClause */ || + (child.namedBindings && child.namedBindings.kind !== 241 /* NamedImports */); + case 249 /* JsxElement */: + return childKind !== 252 /* JsxClosingElement */; } // No explicit rule for given nodes so the result will follow the default value argument return indentByDefault; @@ -77704,10 +83310,589 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; +(function (ts) { + var textChanges; + (function (textChanges) { + /** + * 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. + */ + function getPos(n) { + return n["__pos"]; + } + function setPos(n, pos) { + n["__pos"] = pos; + } + function getEnd(n) { + return n["__end"]; + } + function setEnd(n, end) { + n["__end"] = end; + } + var Position; + (function (Position) { + Position[Position["FullStart"] = 0] = "FullStart"; + Position[Position["Start"] = 1] = "Start"; + })(Position = textChanges.Position || (textChanges.Position = {})); + function skipWhitespacesAndLineBreaks(text, start) { + return ts.skipTrivia(text, start, /*stopAfterLineBreak*/ false, /*stopAtComments*/ true); + } + function hasCommentsBeforeLineBreak(text, start) { + var i = start; + while (i < text.length) { + var ch = text.charCodeAt(i); + if (ts.isWhiteSpaceSingleLine(ch)) { + i++; + continue; + } + return ch === 47 /* slash */; + } + return false; + } + function getSeparatorCharacter(separator) { + return ts.tokenToString(separator.kind); + } + textChanges.getSeparatorCharacter = getSeparatorCharacter; + function getAdjustedStartPosition(sourceFile, node, options, position) { + if (options.useNonAdjustedStartPosition) { + return node.getFullStart(); + } + var fullStart = node.getFullStart(); + var start = node.getStart(sourceFile); + if (fullStart === start) { + return start; + } + var fullStartLine = ts.getLineStartPositionForPosition(fullStart, sourceFile); + var startLine = ts.getLineStartPositionForPosition(start, sourceFile); + if (startLine === fullStartLine) { + // full start and start of the node are on the same line + // a, b; + // ^ ^ + // | start + // fullstart + // when b is replaced - we usually want to keep the leading trvia + // when b is deleted - we delete it + return position === Position.Start ? start : fullStart; + } + // get start position of the line following the line that contains fullstart position + var adjustedStartPosition = ts.getStartPositionOfLine(ts.getLineOfLocalPosition(sourceFile, fullStartLine) + 1, sourceFile); + // skip whitespaces/newlines + adjustedStartPosition = skipWhitespacesAndLineBreaks(sourceFile.text, adjustedStartPosition); + return ts.getStartPositionOfLine(ts.getLineOfLocalPosition(sourceFile, adjustedStartPosition), sourceFile); + } + textChanges.getAdjustedStartPosition = getAdjustedStartPosition; + function getAdjustedEndPosition(sourceFile, node, options) { + if (options.useNonAdjustedEndPosition) { + return node.getEnd(); + } + var end = node.getEnd(); + var newEnd = ts.skipTrivia(sourceFile.text, end, /*stopAfterLineBreak*/ true); + // check if last character before newPos is linebreak + // if yes - considered all skipped trivia to be trailing trivia of the node + return newEnd !== end && ts.isLineBreak(sourceFile.text.charCodeAt(newEnd - 1)) + ? newEnd + : end; + } + textChanges.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 === 178 /* ObjectLiteralExpression */)); + } + function spaces(count) { + var s = ""; + for (var i = 0; i < count; i++) { + s += " "; + } + return s; + } + var ChangeTracker = (function () { + function ChangeTracker(newLine, rulesProvider, validator) { + this.newLine = newLine; + this.rulesProvider = rulesProvider; + this.validator = validator; + this.changes = []; + this.newLineCharacter = ts.getNewLineCharacter({ newLine: newLine }); + } + ChangeTracker.fromCodeFixContext = function (context) { + return new ChangeTracker(context.newLineCharacter === "\n" ? 1 /* LineFeed */ : 0 /* CarriageReturnLineFeed */, context.rulesProvider); + }; + ChangeTracker.prototype.deleteNode = function (sourceFile, node, options) { + if (options === void 0) { options = {}; } + var startPosition = getAdjustedStartPosition(sourceFile, node, options, Position.FullStart); + var endPosition = getAdjustedEndPosition(sourceFile, node, options); + this.changes.push({ sourceFile: sourceFile, options: options, range: { pos: startPosition, end: endPosition } }); + return this; + }; + ChangeTracker.prototype.deleteRange = function (sourceFile, range) { + this.changes.push({ sourceFile: sourceFile, range: range }); + return this; + }; + ChangeTracker.prototype.deleteNodeRange = function (sourceFile, startNode, endNode, options) { + if (options === void 0) { options = {}; } + var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.FullStart); + var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); + this.changes.push({ sourceFile: sourceFile, options: options, range: { pos: startPosition, end: endPosition } }); + return this; + }; + ChangeTracker.prototype.deleteNodeInList = function (sourceFile, node) { + var containingList = ts.formatting.SmartIndenter.getContainingList(node, sourceFile); + if (!containingList) { + ts.Debug.fail("node is not a list element"); + return this; + } + var index = containingList.indexOf(node); + if (index < 0) { + return this; + } + if (containingList.length === 1) { + this.deleteNode(sourceFile, node); + return this; + } + if (index !== containingList.length - 1) { + var nextToken = ts.getTokenAtPosition(sourceFile, node.end); + if (nextToken && isSeparator(node, nextToken)) { + // find first non-whitespace position in the leading trivia of the node + var startPosition = ts.skipTrivia(sourceFile.text, getAdjustedStartPosition(sourceFile, node, {}, Position.FullStart), /*stopAfterLineBreak*/ false, /*stopAtComments*/ true); + var nextElement = containingList[index + 1]; + /// find first non-whitespace position in the leading trivia of the next node + var endPosition = ts.skipTrivia(sourceFile.text, getAdjustedStartPosition(sourceFile, nextElement, {}, Position.FullStart), /*stopAfterLineBreak*/ false, /*stopAtComments*/ true); + // shift next node so its first non-whitespace position will be moved to the first non-whitespace position of the deleted node + this.deleteRange(sourceFile, { pos: startPosition, end: endPosition }); + } + } + else { + var previousToken = ts.getTokenAtPosition(sourceFile, containingList[index - 1].end); + if (previousToken && isSeparator(node, previousToken)) { + this.deleteNodeRange(sourceFile, previousToken, node); + } + } + return this; + }; + ChangeTracker.prototype.replaceRange = function (sourceFile, range, newNode, options) { + if (options === void 0) { options = {}; } + this.changes.push({ sourceFile: sourceFile, range: range, options: options, node: newNode }); + return this; + }; + 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); + this.changes.push({ sourceFile: sourceFile, options: options, useIndentationFromFile: true, node: newNode, range: { pos: startPosition, end: endPosition } }); + return this; + }; + 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); + this.changes.push({ sourceFile: sourceFile, options: options, useIndentationFromFile: true, node: newNode, range: { pos: startPosition, end: endPosition } }); + return this; + }; + ChangeTracker.prototype.insertNodeAt = function (sourceFile, pos, newNode, options) { + if (options === void 0) { options = {}; } + this.changes.push({ sourceFile: sourceFile, options: options, node: newNode, range: { pos: pos, end: pos } }); + return this; + }; + ChangeTracker.prototype.insertNodeBefore = function (sourceFile, before, newNode, options) { + if (options === void 0) { options = {}; } + var startPosition = getAdjustedStartPosition(sourceFile, before, options, Position.Start); + this.changes.push({ sourceFile: sourceFile, options: options, useIndentationFromFile: true, node: newNode, range: { pos: startPosition, end: startPosition } }); + return this; + }; + ChangeTracker.prototype.insertNodeAfter = function (sourceFile, after, newNode, options) { + if (options === void 0) { options = {}; } + if ((ts.isStatementButNotDeclaration(after)) || + after.kind === 149 /* PropertyDeclaration */ || + after.kind === 148 /* PropertySignature */ || + after.kind === 150 /* 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 */) { + this.changes.push({ + sourceFile: sourceFile, + options: {}, + range: { pos: after.end, end: after.end }, + node: ts.createToken(25 /* SemicolonToken */) + }); + } + } + var endPosition = getAdjustedEndPosition(sourceFile, after, options); + this.changes.push({ sourceFile: sourceFile, options: options, useIndentationFromFile: true, node: newNode, range: { pos: endPosition, end: endPosition } }); + return this; + }; + /** + * This function should be used to insert nodes in lists when nodes don't carry separators as the part of the node range, + * i.e. arguments in arguments lists, parameters in parameter lists etc. + * Note that separators are part of the node in statements and class elements. + */ + ChangeTracker.prototype.insertNodeInListAfter = function (sourceFile, after, newNode) { + var containingList = ts.formatting.SmartIndenter.getContainingList(after, sourceFile); + if (!containingList) { + ts.Debug.fail("node is not a list element"); + return this; + } + var index = containingList.indexOf(after); + if (index < 0) { + return this; + } + var end = after.getEnd(); + if (index !== containingList.length - 1) { + // any element except the last one + // use next sibling as an anchor + var nextToken = ts.getTokenAtPosition(sourceFile, after.end); + if (nextToken && isSeparator(after, nextToken)) { + // for list + // a, b, c + // create change for adding 'e' after 'a' as + // - find start of next element after a (it is b) + // - use this start as start and end position in final change + // - build text of change by formatting the text of node + separator + whitespace trivia of b + // in multiline case it will work as + // a, + // b, + // c, + // result - '*' denotes leading trivia that will be inserted after new text (displayed as '#') + // a,* + // ***insertedtext# + // ###b, + // c, + // find line and character of the next element + var lineAndCharOfNextElement = ts.getLineAndCharacterOfPosition(sourceFile, skipWhitespacesAndLineBreaks(sourceFile.text, containingList[index + 1].getFullStart())); + // find line and character of the token that precedes next element (usually it is separator) + var lineAndCharOfNextToken = ts.getLineAndCharacterOfPosition(sourceFile, nextToken.end); + var prefix = void 0; + var startPos = void 0; + if (lineAndCharOfNextToken.line === lineAndCharOfNextElement.line) { + // next element is located on the same line with separator: + // a,$$$$b + // ^ ^ + // | |-next element + // |-separator + // where $$$ is some leading trivia + // for a newly inserted node we'll maintain the same relative position comparing to separator and replace leading trivia with spaces + // a, x,$$$$b + // ^ ^ ^ + // | | |-next element + // | |-new inserted node padded with spaces + // |-separator + startPos = nextToken.end; + prefix = spaces(lineAndCharOfNextElement.character - lineAndCharOfNextToken.character); + } + else { + // next element is located on different line that separator + // let insert position be the beginning of the line that contains next element + startPos = ts.getStartPositionOfLine(lineAndCharOfNextElement.line, sourceFile); + } + this.changes.push({ + sourceFile: sourceFile, + range: { pos: startPos, end: containingList[index + 1].getStart(sourceFile) }, + node: newNode, + useIndentationFromFile: true, + options: { + prefix: prefix, + // write separator and leading trivia of the next element as suffix + suffix: "" + ts.tokenToString(nextToken.kind) + sourceFile.text.substring(nextToken.end, containingList[index + 1].getStart(sourceFile)) + } + }); + } + } + else { + var afterStart = after.getStart(sourceFile); + var afterStartLinePosition = ts.getLineStartPositionForPosition(afterStart, sourceFile); + var separator = void 0; + var multilineList = false; + // insert element after the last element in the list that has more than one item + // pick the element preceding the after element to: + // - pick the separator + // - determine if list is a multiline + if (containingList.length === 1) { + // if list has only one element then we'll format is as multiline if node has comment in trailing trivia, or as singleline otherwise + // i.e. var x = 1 // this is x + // | new element will be inserted at this position + separator = 26 /* CommaToken */; + } + else { + // element has more than one element, pick separator from the list + var tokenBeforeInsertPosition = ts.findPrecedingToken(after.pos, sourceFile); + separator = isSeparator(after, tokenBeforeInsertPosition) ? tokenBeforeInsertPosition.kind : 26 /* CommaToken */; + // determine if list is multiline by checking lines of after element and element that precedes it. + var afterMinusOneStartLinePosition = ts.getLineStartPositionForPosition(containingList[index - 1].getStart(sourceFile), sourceFile); + multilineList = afterMinusOneStartLinePosition !== afterStartLinePosition; + } + if (hasCommentsBeforeLineBreak(sourceFile.text, after.end)) { + // in this case we'll always treat containing list as multiline + multilineList = true; + } + if (multilineList) { + // insert separator immediately following the 'after' node to preserve comments in trailing trivia + this.changes.push({ + sourceFile: sourceFile, + range: { pos: end, end: end }, + node: ts.createToken(separator), + options: {} + }); + // use the same indentation as 'after' item + var indentation = ts.formatting.SmartIndenter.findFirstNonWhitespaceColumn(afterStartLinePosition, afterStart, sourceFile, this.rulesProvider.getFormatOptions()); + // insert element before the line break on the line that contains 'after' element + var insertPos = ts.skipTrivia(sourceFile.text, end, /*stopAfterLineBreak*/ true, /*stopAtComments*/ false); + if (insertPos !== end && ts.isLineBreak(sourceFile.text.charCodeAt(insertPos - 1))) { + insertPos--; + } + this.changes.push({ + sourceFile: sourceFile, + range: { pos: insertPos, end: insertPos }, + node: newNode, + options: { indentation: indentation, prefix: this.newLineCharacter } + }); + } + else { + this.changes.push({ + sourceFile: sourceFile, + range: { pos: end, end: end }, + node: newNode, + options: { prefix: ts.tokenToString(separator) + " " } + }); + } + } + return this; + }; + ChangeTracker.prototype.getChanges = function () { + var _this = this; + var changesPerFile = ts.createFileMap(); + // 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.forEachValue(function (path) { + var changesInFile = changesPerFile.get(path); + 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) { + if (!change.node) { + // deletion case + return ""; + } + var options = change.options || {}; + var nonFormattedText = getNonformattedText(change.node, sourceFile, this.newLine); + if (this.validator) { + this.validator(nonFormattedText); + } + var formatOptions = this.rulesProvider.getFormatOptions(); + var pos = change.range.pos; + var posStartsLine = ts.getLineStartPositionForPosition(pos, sourceFile) === pos; + var initialIndentation = change.options.indentation !== undefined + ? change.options.indentation + : change.useIndentationFromFile + ? ts.formatting.SmartIndenter.getIndentation(change.range.pos, sourceFile, formatOptions, posStartsLine || (change.options.prefix === this.newLineCharacter)) + : 0; + var delta = change.options.delta !== undefined + ? change.options.delta + : ts.formatting.SmartIndenter.shouldIndentChildNode(change.node) + ? formatOptions.indentSize + : 0; + var text = applyFormatting(nonFormattedText, sourceFile, initialIndentation, delta, this.rulesProvider); + // strip initial indentation (spaces or tabs) if text will be inserted in the middle of the line + // however keep indentation if it is was forced + text = posStartsLine || change.options.indentation !== undefined ? text : text.replace(/^\s+/, ""); + return (options.prefix || "") + text + (options.suffix || ""); + }; + 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 ChangeTracker; + }()); + textChanges.ChangeTracker = ChangeTracker; + function getNonformattedText(node, sourceFile, newLine) { + var options = { newLine: newLine, target: sourceFile.languageVersion }; + var writer = new Writer(ts.getNewLineCharacter(options)); + var printer = ts.createPrinter(options, writer); + printer.writeNode(3 /* Unspecified */, node, sourceFile, writer); + return { text: writer.getText(), node: assignPositionsToNode(node) }; + } + textChanges.getNonformattedText = getNonformattedText; + function applyFormatting(nonFormattedText, sourceFile, initialIndentation, delta, rulesProvider) { + 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.formatNode(nonFormattedText.node, file, sourceFile.languageVariant, initialIndentation, delta, rulesProvider); + return applyChanges(nonFormattedText.text, changes); + } + textChanges.applyFormatting = applyFormatting; + function applyChanges(text, changes) { + for (var i = changes.length - 1; i >= 0; i--) { + var change = changes[i]; + text = "" + text.substring(0, change.span.start) + change.newText + text.substring(ts.textSpanEnd(change.span)); + } + return text; + } + textChanges.applyChanges = applyChanges; + function isTrivia(s) { + return ts.skipTrivia(s, 0) === s.length; + } + var nullTransformationContext = { + enableEmitNotification: ts.noop, + enableSubstitution: ts.noop, + endLexicalEnvironment: function () { return undefined; }, + getCompilerOptions: ts.notImplemented, + getEmitHost: ts.notImplemented, + getEmitResolver: ts.notImplemented, + hoistFunctionDeclaration: ts.noop, + hoistVariableDeclaration: ts.noop, + isEmitNotificationEnabled: ts.notImplemented, + isSubstitutionEnabled: ts.notImplemented, + onEmitNode: ts.noop, + onSubstituteNode: ts.notImplemented, + readEmitHelpers: ts.notImplemented, + requestEmitHelper: ts.noop, + resumeLexicalEnvironment: ts.noop, + startLexicalEnvironment: ts.noop, + suspendLexicalEnvironment: ts.noop + }; + function assignPositionsToNode(node) { + var visited = ts.visitEachChild(node, assignPositionsToNode, nullTransformationContext, assignPositionsToNodeArray, assignPositionsToNode); + // create proxy node for non synthesized nodes + var newNode = ts.nodeIsSynthesized(visited) + ? visited + : (Proxy.prototype = visited, new Proxy()); + newNode.pos = getPos(node); + newNode.end = getEnd(node); + return newNode; + function Proxy() { } + } + function assignPositionsToNodeArray(nodes, visitor, test, start, count) { + var visited = ts.visitNodes(nodes, visitor, test, start, count); + if (!visited) { + return visited; + } + // clone nodearray if necessary + var nodeArray = visited === nodes ? ts.createNodeArray(visited.slice(0)) : visited; + nodeArray.pos = getPos(nodes); + nodeArray.end = getEnd(nodes); + return nodeArray; + } + var Writer = (function () { + function Writer(newLine) { + var _this = this; + this.lastNonTriviaPosition = 0; + this.writer = ts.createTextWriter(newLine); + this.onEmitNode = function (hint, node, printCallback) { + if (node) { + setPos(node, _this.lastNonTriviaPosition); + } + printCallback(hint, node); + if (node) { + setEnd(node, _this.lastNonTriviaPosition); + } + }; + this.onBeforeEmitNodeArray = function (nodes) { + if (nodes) { + setPos(nodes, _this.lastNonTriviaPosition); + } + }; + this.onAfterEmitNodeArray = function (nodes) { + if (nodes) { + setEnd(nodes, _this.lastNonTriviaPosition); + } + }; + } + Writer.prototype.setLastNonTriviaPosition = function (s, force) { + if (force || !isTrivia(s)) { + this.lastNonTriviaPosition = this.writer.getTextPos(); + var i = 0; + while (ts.isWhiteSpaceLike(s.charCodeAt(s.length - i - 1))) { + i++; + } + // trim trailing whitespaces + this.lastNonTriviaPosition -= i; + } + }; + Writer.prototype.write = function (s) { + this.writer.write(s); + this.setLastNonTriviaPosition(s, /*force*/ false); + }; + Writer.prototype.writeTextOfNode = function (text, node) { + this.writer.writeTextOfNode(text, node); + }; + Writer.prototype.writeLine = function () { + this.writer.writeLine(); + }; + Writer.prototype.increaseIndent = function () { + this.writer.increaseIndent(); + }; + Writer.prototype.decreaseIndent = function () { + this.writer.decreaseIndent(); + }; + Writer.prototype.getText = function () { + return this.writer.getText(); + }; + Writer.prototype.rawWrite = function (s) { + this.writer.rawWrite(s); + this.setLastNonTriviaPosition(s, /*force*/ false); + }; + Writer.prototype.writeLiteral = function (s) { + this.writer.writeLiteral(s); + this.setLastNonTriviaPosition(s, /*force*/ true); + }; + Writer.prototype.getTextPos = function () { + return this.writer.getTextPos(); + }; + Writer.prototype.getLine = function () { + return this.writer.getLine(); + }; + Writer.prototype.getColumn = function () { + return this.writer.getColumn(); + }; + Writer.prototype.getIndent = function () { + return this.writer.getIndent(); + }; + Writer.prototype.isAtStartOfLine = function () { + return this.writer.isAtStartOfLine(); + }; + Writer.prototype.reset = function () { + this.writer.reset(); + this.lastNonTriviaPosition = 0; + }; + return Writer; + }()); + })(textChanges = ts.textChanges || (ts.textChanges = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; (function (ts) { var codefix; (function (codefix) { - var codeFixes = ts.createMap(); + var codeFixes = []; function registerCodeFix(action) { ts.forEach(action.errorCodes, function (error) { var fixes = codeFixes[error]; @@ -77742,31 +83927,232 @@ var ts; (function (ts) { var codefix; (function (codefix) { - function getOpenBraceEnd(constructor, sourceFile) { - // First token is the open curly, this is where we want to put the 'super' call. - return constructor.body.getFirstToken(sourceFile).getEnd(); - } codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call.code], - getCodeActions: function (context) { - var sourceFile = context.sourceFile; - var token = ts.getTokenAtPosition(sourceFile, context.span.start); - if (token.kind !== 122 /* ConstructorKeyword */) { - return undefined; - } - var newPosition = getOpenBraceEnd(token.parent, sourceFile); - return [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_missing_super_call), - changes: [{ fileName: sourceFile.fileName, textChanges: [{ newText: "super();", span: { start: newPosition, length: 0 } }] }] - }]; - } + errorCodes: [ts.Diagnostics.Class_0_incorrectly_implements_interface_1.code], + getCodeActions: getActionForClassLikeIncorrectImplementsInterface }); + function getActionForClassLikeIncorrectImplementsInterface(context) { + var sourceFile = context.sourceFile; + var start = context.span.start; + var token = ts.getTokenAtPosition(sourceFile, start); + var checker = context.program.getTypeChecker(); + var classDeclaration = ts.getContainingClass(token); + if (!classDeclaration) { + return undefined; + } + var openBrace = ts.getOpenBraceOfClassLike(classDeclaration, sourceFile); + var classType = checker.getTypeAtLocation(classDeclaration); + var implementedTypeNodes = ts.getClassImplementsHeritageClauseElements(classDeclaration); + var hasNumericIndexSignature = !!checker.getIndexTypeOfType(classType, 1 /* Number */); + var hasStringIndexSignature = !!checker.getIndexTypeOfType(classType, 0 /* String */); + var result = []; + for (var _i = 0, implementedTypeNodes_2 = implementedTypeNodes; _i < implementedTypeNodes_2.length; _i++) { + var implementedTypeNode = implementedTypeNodes_2[_i]; + // Note that this is ultimately derived from a map indexed by symbol names, + // so duplicates cannot occur. + var implementedType = checker.getTypeAtLocation(implementedTypeNode); + var implementedTypeSymbols = checker.getPropertiesOfType(implementedType); + var nonPrivateMembers = implementedTypeSymbols.filter(function (symbol) { return !(ts.getModifierFlags(symbol.valueDeclaration) & 8 /* Private */); }); + var newNodes = []; + createAndAddMissingIndexSignatureDeclaration(implementedType, 1 /* Number */, hasNumericIndexSignature, newNodes); + createAndAddMissingIndexSignatureDeclaration(implementedType, 0 /* String */, hasStringIndexSignature, newNodes); + newNodes = newNodes.concat(codefix.createMissingMemberNodes(classDeclaration, nonPrivateMembers, checker)); + var message = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Implement_interface_0), [implementedTypeNode.getText()]); + if (newNodes.length > 0) { + pushAction(result, newNodes, message); + } + } + return result; + function createAndAddMissingIndexSignatureDeclaration(type, kind, hasIndexSigOfKind, newNodes) { + if (hasIndexSigOfKind) { + return; + } + var indexInfoOfKind = checker.getIndexInfoOfType(type, kind); + if (!indexInfoOfKind) { + return; + } + var newIndexSignatureDeclaration = checker.indexInfoToIndexSignatureDeclaration(indexInfoOfKind, kind, classDeclaration); + newNodes.push(newIndexSignatureDeclaration); + } + function pushAction(result, newNodes, description) { + var newAction = { + description: description, + changes: codefix.newNodesToChanges(newNodes, openBrace, context) + }; + result.push(newAction); + } + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: [ts.Diagnostics.Property_0_does_not_exist_on_type_1.code], + getCodeActions: getActionsForAddMissingMember + }); + function getActionsForAddMissingMember(context) { + var sourceFile = context.sourceFile; + var start = context.span.start; + // This is the identifier of the missing property. eg: + // this.missing = 1; + // ^^^^^^^ + var token = ts.getTokenAtPosition(sourceFile, start); + if (token.kind !== 71 /* Identifier */) { + return undefined; + } + if (!ts.isPropertyAccessExpression(token.parent) || token.parent.expression.kind !== 99 /* ThisKeyword */) { + return undefined; + } + var classMemberDeclaration = ts.getThisContainer(token, /*includeArrowFunctions*/ false); + if (!ts.isClassElement(classMemberDeclaration)) { + return undefined; + } + var classDeclaration = classMemberDeclaration.parent; + if (!classDeclaration || !ts.isClassLike(classDeclaration)) { + return undefined; + } + var isStatic = ts.hasModifier(classMemberDeclaration, 32 /* Static */); + return ts.isInJavaScriptFile(sourceFile) ? getActionsForAddMissingMemberInJavaScriptFile() : getActionsForAddMissingMemberInTypeScriptFile(); + function getActionsForAddMissingMemberInJavaScriptFile() { + var memberName = token.getText(); + if (isStatic) { + if (classDeclaration.kind === 199 /* ClassExpression */) { + return undefined; + } + var className = classDeclaration.name.getText(); + return [{ + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Initialize_static_property_0), [memberName]), + changes: [{ + fileName: sourceFile.fileName, + textChanges: [{ + span: { start: classDeclaration.getEnd(), length: 0 }, + newText: "" + context.newLineCharacter + className + "." + memberName + " = undefined;" + context.newLineCharacter + }] + }] + }]; + } + else { + var classConstructor = ts.getFirstConstructorWithBody(classDeclaration); + if (!classConstructor) { + return undefined; + } + return [{ + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Initialize_property_0_in_the_constructor), [memberName]), + changes: [{ + fileName: sourceFile.fileName, + textChanges: [{ + span: { start: classConstructor.body.getEnd() - 1, length: 0 }, + newText: "this." + memberName + " = undefined;" + context.newLineCharacter + }] + }] + }]; + } + } + function getActionsForAddMissingMemberInTypeScriptFile() { + var typeNode; + if (token.parent.parent.kind === 194 /* BinaryExpression */) { + var binaryExpression = token.parent.parent; + var checker = context.program.getTypeChecker(); + var widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(binaryExpression.right))); + typeNode = checker.typeToTypeNode(widenedType, classDeclaration); + } + typeNode = typeNode || ts.createKeywordTypeNode(119 /* AnyKeyword */); + var openBrace = ts.getOpenBraceOfClassLike(classDeclaration, sourceFile); + var property = ts.createProperty( + /*decorators*/ undefined, + /*modifiers*/ isStatic ? [ts.createToken(115 /* StaticKeyword */)] : undefined, token.getText(sourceFile), + /*questionToken*/ undefined, typeNode, + /*initializer*/ undefined); + var propertyChangeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + propertyChangeTracker.insertNodeAfter(sourceFile, openBrace, property, { suffix: context.newLineCharacter }); + var actions = [{ + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Add_declaration_for_missing_property_0), [token.getText()]), + changes: propertyChangeTracker.getChanges() + }]; + if (!isStatic) { + var stringTypeNode = ts.createKeywordTypeNode(136 /* StringKeyword */); + var indexingParameter = ts.createParameter( + /*decorators*/ undefined, + /*modifiers*/ undefined, + /*dotDotDotToken*/ undefined, "x", + /*questionToken*/ undefined, stringTypeNode, + /*initializer*/ undefined); + var indexSignature = ts.createIndexSignatureDeclaration( + /*decorators*/ undefined, + /*modifiers*/ undefined, [indexingParameter], typeNode); + var indexSignatureChangeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + indexSignatureChangeTracker.insertNodeAfter(sourceFile, openBrace, indexSignature, { suffix: context.newLineCharacter }); + actions.push({ + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Add_index_signature_for_missing_property_0), [token.getText()]), + changes: indexSignatureChangeTracker.getChanges() + }); + } + return actions; + } + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: [ts.Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2.code], + getCodeActions: getActionForClassLikeMissingAbstractMember + }); + codefix.registerCodeFix({ + errorCodes: [ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1.code], + getCodeActions: getActionForClassLikeMissingAbstractMember + }); + function getActionForClassLikeMissingAbstractMember(context) { + var sourceFile = context.sourceFile; + var start = context.span.start; + // This 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, start); + var checker = context.program.getTypeChecker(); + if (ts.isClassLike(token.parent)) { + var classDeclaration = token.parent; + var extendsNode = ts.getClassExtendsHeritageClauseElement(classDeclaration); + var instantiatedExtendsType = checker.getTypeAtLocation(extendsNode); + // Note that this is ultimately derived from a map indexed by symbol names, + // so duplicates cannot occur. + var extendsSymbols = checker.getPropertiesOfType(instantiatedExtendsType); + var abstractAndNonPrivateExtendsSymbols = extendsSymbols.filter(symbolPointsToNonPrivateAndAbstractMember); + var newNodes = codefix.createMissingMemberNodes(classDeclaration, abstractAndNonPrivateExtendsSymbols, checker); + var changes = codefix.newNodesToChanges(newNodes, ts.getOpenBraceOfClassLike(classDeclaration, sourceFile), context); + if (changes && changes.length > 0) { + return [{ + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Implement_inherited_abstract_class), + changes: changes + }]; + } + } + return undefined; + } + function symbolPointsToNonPrivateAndAbstractMember(symbol) { + var decls = symbol.getDeclarations(); + ts.Debug.assert(!!(decls && decls.length > 0)); + var flags = ts.getModifierFlags(decls[0]); + return !(flags & 8 /* Private */) && !!(flags & 128 /* Abstract */); + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { codefix.registerCodeFix({ errorCodes: [ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class.code], getCodeActions: function (context) { var sourceFile = context.sourceFile; var token = ts.getTokenAtPosition(sourceFile, context.span.start); - if (token.kind !== 98 /* ThisKeyword */) { + if (token.kind !== 99 /* ThisKeyword */) { return undefined; } var constructor = ts.getContainingFunction(token); @@ -77774,9 +84160,9 @@ var ts; if (!superCall) { return undefined; } - // figure out if the this access is actuall inside the supercall + // figure out if the `this` access is actually inside the supercall // i.e. super(this.a), since in that case we won't suggest a fix - if (superCall.expression && superCall.expression.kind == 179 /* CallExpression */) { + if (superCall.expression && superCall.expression.kind === 181 /* CallExpression */) { var arguments_1 = superCall.expression.arguments; for (var i = 0; i < arguments_1.length; i++) { if (arguments_1[i].expression === token) { @@ -77784,23 +84170,15 @@ var ts; } } } - var newPosition = getOpenBraceEnd(constructor, sourceFile); - var changes = [{ - fileName: sourceFile.fileName, textChanges: [{ - newText: superCall.getText(sourceFile), - span: { start: newPosition, length: 0 } - }, - { - newText: "", - span: { start: superCall.getStart(sourceFile), length: superCall.getWidth(sourceFile) } - }] - }]; + var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + changeTracker.insertNodeAfter(sourceFile, ts.getOpenBrace(constructor, sourceFile), superCall, { suffix: context.newLineCharacter }); + changeTracker.deleteNode(sourceFile, superCall); return [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Make_super_call_the_first_statement_in_the_constructor), - changes: changes + changes: changeTracker.getChanges() }]; function findSuperCall(n) { - if (n.kind === 207 /* ExpressionStatement */ && ts.isSuperCall(n.expression)) { + if (n.kind === 210 /* ExpressionStatement */ && ts.isSuperCall(n.expression)) { return n; } if (ts.isFunctionLike(n)) { @@ -77812,679 +84190,1038 @@ var ts; }); })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); -// /* @internal */ -// namespace ts.codefix { -// type ImportCodeActionKind = "CodeChange" | "InsertingIntoExistingImport" | "NewImport"; -// interface ImportCodeAction extends CodeAction { -// kind: ImportCodeActionKind, -// moduleSpecifier?: string -// } -// enum ModuleSpecifierComparison { -// Better, -// Equal, -// Worse -// } -// class ImportCodeActionMap { -// private symbolIdToActionMap = createMap(); -// addAction(symbolId: number, newAction: ImportCodeAction) { -// if (!newAction) { -// return; -// } -// if (!this.symbolIdToActionMap[symbolId]) { -// this.symbolIdToActionMap[symbolId] = [newAction]; -// return; -// } -// if (newAction.kind === "CodeChange") { -// this.symbolIdToActionMap[symbolId].push(newAction); -// return; -// } -// const updatedNewImports: ImportCodeAction[] = []; -// for (const existingAction of this.symbolIdToActionMap[symbolId]) { -// if (existingAction.kind === "CodeChange") { -// // only import actions should compare -// updatedNewImports.push(existingAction); -// continue; -// } -// switch (this.compareModuleSpecifiers(existingAction.moduleSpecifier, newAction.moduleSpecifier)) { -// case ModuleSpecifierComparison.Better: -// // the new one is not worth considering if it is a new improt. -// // 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; -// } -// case ModuleSpecifierComparison.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 ModuleSpecifierComparison.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; -// } -// addActions(symbolId: number, newActions: ImportCodeAction[]) { -// for (const newAction of newActions) { -// this.addAction(symbolId, newAction); -// } -// } -// getAllActions() { -// let result: ImportCodeAction[] = []; -// for (const symbolId in this.symbolIdToActionMap) { -// result = concatenate(result, this.symbolIdToActionMap[symbolId]); -// } -// return result; -// } -// private compareModuleSpecifiers(moduleSpecifier1: string, moduleSpecifier2: string): ModuleSpecifierComparison { -// if (moduleSpecifier1 === moduleSpecifier2) { -// return ModuleSpecifierComparison.Equal; -// } -// // if moduleSpecifier1 (ms1) is a substring of ms2, then it is better -// if (moduleSpecifier2.indexOf(moduleSpecifier1) === 0) { -// return ModuleSpecifierComparison.Better; -// } -// if (moduleSpecifier1.indexOf(moduleSpecifier2) === 0) { -// return ModuleSpecifierComparison.Worse; -// } -// // if both are relative paths, and ms1 has fewer levels, then it is better -// if (isExternalModuleNameRelative(moduleSpecifier1) && isExternalModuleNameRelative(moduleSpecifier2)) { -// const regex = new RegExp(directorySeparator, "g"); -// const moduleSpecifier1LevelCount = (moduleSpecifier1.match(regex) || []).length; -// const moduleSpecifier2LevelCount = (moduleSpecifier2.match(regex) || []).length; -// return moduleSpecifier1LevelCount < moduleSpecifier2LevelCount -// ? ModuleSpecifierComparison.Better -// : moduleSpecifier1LevelCount === moduleSpecifier2LevelCount -// ? ModuleSpecifierComparison.Equal -// : ModuleSpecifierComparison.Worse; -// } -// // the equal cases include when the two specifiers are not comparable. -// return ModuleSpecifierComparison.Equal; -// } -// } -// registerCodeFix({ -// errorCodes: [Diagnostics.Cannot_find_name_0.code], -// getCodeActions: (context: CodeFixContext) => { -// const sourceFile = context.sourceFile; -// const checker = context.program.getTypeChecker(); -// const allSourceFiles = context.program.getSourceFiles(); -// const useCaseSensitiveFileNames = context.host.useCaseSensitiveFileNames ? context.host.useCaseSensitiveFileNames() : false; -// const token = getTokenAtPosition(sourceFile, context.span.start); -// const name = token.getText(); -// const symbolIdActionMap = new ImportCodeActionMap(); -// // this is a module id -> module import declaration map -// const cachedImportDeclarations = createMap<(ImportDeclaration | ImportEqualsDeclaration)[]>(); -// let cachedNewImportInsertPosition: number; -// const allPotentialModules = checker.getAmbientModules(); -// for (const otherSourceFile of allSourceFiles) { -// if (otherSourceFile !== sourceFile && isExternalOrCommonJsModule(otherSourceFile)) { -// allPotentialModules.push(otherSourceFile.symbol); -// } -// } -// const currentTokenMeaning = getMeaningFromLocation(token); -// for (const moduleSymbol of allPotentialModules) { -// context.cancellationToken.throwIfCancellationRequested(); -// // check the default export -// const defaultExport = checker.tryGetMemberInModuleExports("default", moduleSymbol); -// if (defaultExport) { -// const localSymbol = getLocalSymbolForExportDefault(defaultExport); -// if (localSymbol && localSymbol.name === name && checkSymbolHasMeaning(localSymbol, currentTokenMeaning)) { -// // check if this symbol is already used -// const symbolId = getUniqueSymbolId(localSymbol); -// symbolIdActionMap.addActions(symbolId, getCodeActionForImport(moduleSymbol, /*isDefault*/ true)); -// } -// } -// // check exports with the same name -// const exportSymbolWithIdenticalName = checker.tryGetMemberInModuleExports(name, moduleSymbol); -// if (exportSymbolWithIdenticalName && checkSymbolHasMeaning(exportSymbolWithIdenticalName, currentTokenMeaning)) { -// const symbolId = getUniqueSymbolId(exportSymbolWithIdenticalName); -// symbolIdActionMap.addActions(symbolId, getCodeActionForImport(moduleSymbol)); -// } -// } -// return symbolIdActionMap.getAllActions(); -// function getImportDeclarations(moduleSymbol: Symbol) { -// const moduleSymbolId = getUniqueSymbolId(moduleSymbol); -// if (cachedImportDeclarations[moduleSymbolId]) { -// return cachedImportDeclarations[moduleSymbolId]; -// } -// const existingDeclarations: (ImportDeclaration | ImportEqualsDeclaration)[] = []; -// for (const importModuleSpecifier of sourceFile.imports) { -// const importSymbol = checker.getSymbolAtLocation(importModuleSpecifier); -// if (importSymbol === moduleSymbol) { -// existingDeclarations.push(getImportDeclaration(importModuleSpecifier)); -// } -// } -// cachedImportDeclarations[moduleSymbolId] = existingDeclarations; -// return existingDeclarations; -// function getImportDeclaration(moduleSpecifier: LiteralExpression) { -// let node: Node = moduleSpecifier; -// while (node) { -// if (node.kind === SyntaxKind.ImportDeclaration) { -// return node; -// } -// if (node.kind === SyntaxKind.ImportEqualsDeclaration) { -// return node; -// } -// node = node.parent; -// } -// return undefined; -// } -// } -// function getUniqueSymbolId(symbol: Symbol) { -// if (symbol.flags & SymbolFlags.Alias) { -// return getSymbolId(checker.getAliasedSymbol(symbol)); -// } -// return getSymbolId(symbol); -// } -// function checkSymbolHasMeaning(symbol: Symbol, meaning: SemanticMeaning) { -// const declarations = symbol.getDeclarations(); -// return declarations ? some(symbol.declarations, decl => !!(getMeaningFromDeclaration(decl) & meaning)) : false; -// } -// function getCodeActionForImport(moduleSymbol: Symbol, isDefault?: boolean): ImportCodeAction[] { -// const existingDeclarations = getImportDeclarations(moduleSymbol); -// if (existingDeclarations.length > 0) { -// // With an existing import statement, there are more than one actions the user can do. -// return getCodeActionsForExistingImport(existingDeclarations); -// } -// else { -// return [getCodeActionForNewImport()]; -// } -// function getCodeActionsForExistingImport(declarations: (ImportDeclaration | ImportEqualsDeclaration)[]): ImportCodeAction[] { -// const actions: ImportCodeAction[] = []; -// // 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. -// let namespaceImportDeclaration: ImportDeclaration | ImportEqualsDeclaration; -// let namedImportDeclaration: ImportDeclaration; -// let existingModuleSpecifier: string; -// for (const declaration of declarations) { -// if (declaration.kind === SyntaxKind.ImportDeclaration) { -// const namedBindings = declaration.importClause && declaration.importClause.namedBindings; -// if (namedBindings && namedBindings.kind === SyntaxKind.NamespaceImport) { -// // case: -// // import * as ns from "foo" -// namespaceImportDeclaration = declaration; -// } -// else { -// // cases: -// // import default from "foo" -// // import { bar } from "foo" or combination with the first one -// // import "foo" -// namedImportDeclaration = declaration; -// } -// existingModuleSpecifier = declaration.moduleSpecifier.getText(); -// } -// else { -// // case: -// // import foo = require("foo") -// namespaceImportDeclaration = declaration; -// existingModuleSpecifier = getModuleSpecifierFromImportEqualsDeclaration(declaration); -// } -// } -// if (namespaceImportDeclaration) { -// actions.push(getCodeActionForNamespaceImport(namespaceImportDeclaration)); -// } -// if (namedImportDeclaration && namedImportDeclaration.importClause && -// (namedImportDeclaration.importClause.name || namedImportDeclaration.importClause.namedBindings)) { -// /** -// * If the existing import declaration already has a named import list, just -// * insert the identifier into that list. -// */ -// const textChange = getTextChangeForImportClause(namedImportDeclaration.importClause); -// const moduleSpecifierWithoutQuotes = stripQuotes(namedImportDeclaration.moduleSpecifier.getText()); -// actions.push(createCodeAction( -// Diagnostics.Add_0_to_existing_import_declaration_from_1, -// [name, moduleSpecifierWithoutQuotes], -// textChange.newText, -// textChange.span, -// sourceFile.fileName, -// "InsertingIntoExistingImport", -// moduleSpecifierWithoutQuotes -// )); -// } -// else { -// // we need to create a new import statement, but the existing module specifier can be reused. -// actions.push(getCodeActionForNewImport(existingModuleSpecifier)); -// } -// return actions; -// function getModuleSpecifierFromImportEqualsDeclaration(declaration: ImportEqualsDeclaration) { -// if (declaration.moduleReference && declaration.moduleReference.kind === SyntaxKind.ExternalModuleReference) { -// return declaration.moduleReference.expression.getText(); -// } -// return declaration.moduleReference.getText(); -// } -// function getTextChangeForImportClause(importClause: ImportClause): TextChange { -// const newImportText = isDefault ? `default as ${name}` : name; -// const importList = importClause.namedBindings; -// // case 1: -// // original text: import default from "module" -// // change to: import default, { name } from "module" -// if (!importList && importClause.name) { -// const start = importClause.name.getEnd(); -// return { -// newText: `, { ${newImportText} }`, -// span: { start, length: 0 } -// }; -// } -// // case 2: -// // original text: import {} from "module" -// // change to: import { name } from "module" -// if (importList.elements.length === 0) { -// const start = importList.getStart(); -// return { -// newText: `{ ${newImportText} }`, -// span: { start, length: importList.getEnd() - start } -// }; -// } -// // case 3: -// // original text: import { foo, bar } from "module" -// // change to: import { foo, bar, name } from "module" -// const insertPoint = importList.elements[importList.elements.length - 1].getEnd(); -// /** -// * If the import list has one import per line, preserve that. Otherwise, insert on same line as last element -// * import { -// * foo -// * } from "./module"; -// */ -// const startLine = getLineOfLocalPosition(sourceFile, importList.getStart()); -// const endLine = getLineOfLocalPosition(sourceFile, importList.getEnd()); -// const oneImportPerLine = endLine - startLine > importList.elements.length; -// return { -// newText: `,${oneImportPerLine ? context.newLineCharacter : " "}${newImportText}`, -// span: { start: insertPoint, length: 0 } -// }; -// } -// function getCodeActionForNamespaceImport(declaration: ImportDeclaration | ImportEqualsDeclaration): ImportCodeAction { -// let namespacePrefix: string; -// if (declaration.kind === SyntaxKind.ImportDeclaration) { -// namespacePrefix = (declaration.importClause.namedBindings).name.getText(); -// } -// else { -// namespacePrefix = declaration.name.getText(); -// } -// namespacePrefix = stripQuotes(namespacePrefix); -// /** -// * Cases: -// * import * as ns from "mod" -// * import default, * as ns from "mod" -// * import ns = require("mod") -// * -// * Because there is no import list, we alter the reference to include the -// * namespace instead of altering the import declaration. For example, "foo" would -// * become "ns.foo" -// */ -// return createCodeAction( -// Diagnostics.Change_0_to_1, -// [name, `${namespacePrefix}.${name}`], -// `${namespacePrefix}.`, -// { start: token.getStart(), length: 0 }, -// sourceFile.fileName, -// "CodeChange" -// ); -// } -// } -// function getCodeActionForNewImport(moduleSpecifier?: string): ImportCodeAction { -// if (!cachedNewImportInsertPosition) { -// // insert after any existing imports -// let lastModuleSpecifierEnd = -1; -// for (const moduleSpecifier of sourceFile.imports) { -// const end = moduleSpecifier.getEnd(); -// if (!lastModuleSpecifierEnd || end > lastModuleSpecifierEnd) { -// lastModuleSpecifierEnd = end; -// } -// } -// cachedNewImportInsertPosition = lastModuleSpecifierEnd > 0 ? sourceFile.getLineEndOfPosition(lastModuleSpecifierEnd) : sourceFile.getStart(); -// } -// const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames); -// const moduleSpecifierWithoutQuotes = stripQuotes(moduleSpecifier || getModuleSpecifierForNewImport()); -// const importStatementText = isDefault -// ? `import ${name} from "${moduleSpecifierWithoutQuotes}"` -// : `import { ${name} } from "${moduleSpecifierWithoutQuotes}"`; -// // 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. -// const newText = cachedNewImportInsertPosition === sourceFile.getStart() -// ? `${importStatementText};${context.newLineCharacter}${context.newLineCharacter}` -// : `${context.newLineCharacter}${importStatementText};`; -// return createCodeAction( -// Diagnostics.Import_0_from_1, -// [name, `"${moduleSpecifierWithoutQuotes}"`], -// newText, -// { start: cachedNewImportInsertPosition, length: 0 }, -// sourceFile.fileName, -// "NewImport", -// moduleSpecifierWithoutQuotes -// ); -// function getModuleSpecifierForNewImport() { -// const fileName = sourceFile.path; -// const moduleFileName = moduleSymbol.valueDeclaration.getSourceFile().path; -// const sourceDirectory = getDirectoryPath(fileName); -// const options = context.program.getCompilerOptions(); -// return tryGetModuleNameFromAmbientModule() || -// tryGetModuleNameFromBaseUrl() || -// tryGetModuleNameFromRootDirs() || -// tryGetModuleNameFromTypeRoots() || -// tryGetModuleNameAsNodeModule() || -// removeFileExtension(getRelativePath(moduleFileName, sourceDirectory)); -// function tryGetModuleNameFromAmbientModule(): string { -// if (moduleSymbol.valueDeclaration.kind !== SyntaxKind.SourceFile) { -// return moduleSymbol.name; -// } -// } -// function tryGetModuleNameFromBaseUrl() { -// if (!options.baseUrl) { -// return undefined; -// } -// const normalizedBaseUrl = toPath(options.baseUrl, getDirectoryPath(options.baseUrl), getCanonicalFileName); -// let relativeName = tryRemoveParentDirectoryName(moduleFileName, normalizedBaseUrl); -// if (!relativeName) { -// return undefined; -// } -// relativeName = removeExtensionAndIndexPostFix(relativeName); -// if (options.paths) { -// for (const key in options.paths) { -// for (const pattern of options.paths[key]) { -// const indexOfStar = pattern.indexOf("*"); -// if (indexOfStar === 0 && pattern.length === 1) { -// continue; -// } -// else if (indexOfStar !== -1) { -// const prefix = pattern.substr(0, indexOfStar); -// const suffix = pattern.substr(indexOfStar + 1); -// if (relativeName.length >= prefix.length + suffix.length && -// startsWith(relativeName, prefix) && -// endsWith(relativeName, suffix)) { -// const matchedStar = relativeName.substr(prefix.length, relativeName.length - suffix.length); -// return key.replace("\*", matchedStar); -// } -// } -// else if (pattern === relativeName) { -// return key; -// } -// } -// } -// } -// return relativeName; -// } -// function tryGetModuleNameFromRootDirs() { -// if (options.rootDirs) { -// const normalizedRootDirs = map(options.rootDirs, rootDir => toPath(rootDir, /*basePath*/ undefined, getCanonicalFileName)); -// const normalizedTargetPath = getPathRelativeToRootDirs(moduleFileName, normalizedRootDirs); -// const normalizedSourcePath = getPathRelativeToRootDirs(sourceDirectory, normalizedRootDirs); -// if (normalizedTargetPath !== undefined) { -// const relativePath = normalizedSourcePath !== undefined ? getRelativePath(normalizedTargetPath, normalizedSourcePath) : normalizedTargetPath; -// return removeFileExtension(relativePath); -// } -// } -// return undefined; -// } -// function tryGetModuleNameFromTypeRoots() { -// const typeRoots = getEffectiveTypeRoots(options, context.host); -// if (typeRoots) { -// const normalizedTypeRoots = map(typeRoots, typeRoot => toPath(typeRoot, /*basePath*/ undefined, getCanonicalFileName)); -// for (const typeRoot of normalizedTypeRoots) { -// if (startsWith(moduleFileName, typeRoot)) { -// const relativeFileName = moduleFileName.substring(typeRoot.length + 1); -// return removeExtensionAndIndexPostFix(relativeFileName); -// } -// } -// } -// } -// function tryGetModuleNameAsNodeModule() { -// if (getEmitModuleResolutionKind(options) !== ModuleResolutionKind.NodeJs) { -// // nothing to do here -// return undefined; -// } -// const indexOfNodeModules = moduleFileName.indexOf("node_modules"); -// if (indexOfNodeModules < 0) { -// return undefined; -// } -// let relativeFileName: string; -// if (sourceDirectory.indexOf(moduleFileName.substring(0, indexOfNodeModules - 1)) === 0) { -// // if node_modules folder is in this folder or any of its parent folder, no need to keep it. -// relativeFileName = moduleFileName.substring(indexOfNodeModules + 13 /* "node_modules\".length */); -// } -// else { -// relativeFileName = getRelativePath(moduleFileName, sourceDirectory); -// } -// relativeFileName = removeFileExtension(relativeFileName); -// if (endsWith(relativeFileName, "/index")) { -// relativeFileName = getDirectoryPath(relativeFileName); -// } -// else { -// try { -// const moduleDirectory = getDirectoryPath(moduleFileName); -// const packageJsonContent = JSON.parse(context.host.readFile(combinePaths(moduleDirectory, "package.json"))); -// if (packageJsonContent) { -// const mainFile = packageJsonContent.main || packageJsonContent.typings; -// if (mainFile) { -// const mainExportFile = toPath(mainFile, moduleDirectory, getCanonicalFileName); -// if (removeFileExtension(mainExportFile) === removeFileExtension(moduleFileName)) { -// relativeFileName = getDirectoryPath(relativeFileName); -// } -// } -// } -// } -// catch (e) { } -// } -// return relativeFileName; -// } -// } -// function getPathRelativeToRootDirs(path: Path, rootDirs: Path[]) { -// for (const rootDir of rootDirs) { -// const relativeName = tryRemoveParentDirectoryName(path, rootDir); -// if (relativeName !== undefined) { -// return relativeName; -// } -// } -// return undefined; -// } -// function removeExtensionAndIndexPostFix(fileName: string) { -// fileName = removeFileExtension(fileName); -// if (endsWith(fileName, "/index")) { -// fileName = fileName.substr(0, fileName.length - 6/* "/index".length */); -// } -// return fileName; -// } -// function getRelativePath(path: string, directoryPath: string) { -// const relativePath = getRelativePathToDirectoryOrUrl(directoryPath, path, directoryPath, getCanonicalFileName, false); -// return moduleHasNonRelativeName(relativePath) ? "./" + relativePath : relativePath; -// } -// function tryRemoveParentDirectoryName(path: Path, parentDirectory: Path) { -// const index = path.indexOf(parentDirectory); -// if (index === 0) { -// return endsWith(parentDirectory, directorySeparator) -// ? path.substring(parentDirectory.length) -// : path.substring(parentDirectory.length + 1); -// } -// return undefined; -// } -// } -// } -// function createCodeAction( -// description: DiagnosticMessage, -// diagnosticArgs: string[], -// newText: string, -// span: TextSpan, -// fileName: string, -// kind: ImportCodeActionKind, -// moduleSpecifier?: string): ImportCodeAction { -// return { -// description: formatMessage.apply(undefined, [undefined, description].concat(diagnosticArgs)), -// changes: [{ fileName, textChanges: [{ newText, span }] }], -// kind, -// moduleSpecifier -// }; -// } -// } -// }); -// } -// /* @internal */ -// namespace ts.codefix { -// registerCodeFix({ -// errorCodes: [ -// Diagnostics._0_is_declared_but_never_used.code, -// Diagnostics.Property_0_is_declared_but_never_used.code -// ], -// getCodeActions: (context: CodeFixContext) => { -// const sourceFile = context.sourceFile; -// const start = context.span.start; -// let token = getTokenAtPosition(sourceFile, start); -// // this handles var ["computed"] = 12; -// if (token.kind === SyntaxKind.OpenBracketToken) { -// token = getTokenAtPosition(sourceFile, start + 1); -// } -// switch (token.kind) { -// case ts.SyntaxKind.Identifier: -// switch (token.parent.kind) { -// case ts.SyntaxKind.VariableDeclaration: -// switch (token.parent.parent.parent.kind) { -// case SyntaxKind.ForStatement: -// const forStatement = token.parent.parent.parent; -// const forInitializer = forStatement.initializer; -// if (forInitializer.declarations.length === 1) { -// return createCodeFix("", forInitializer.pos, forInitializer.end - forInitializer.pos); -// } -// else { -// return removeSingleItem(forInitializer.declarations, token); -// } -// case SyntaxKind.ForOfStatement: -// const forOfStatement = token.parent.parent.parent; -// if (forOfStatement.initializer.kind === SyntaxKind.VariableDeclarationList) { -// const forOfInitializer = forOfStatement.initializer; -// return createCodeFix("{}", forOfInitializer.declarations[0].pos, forOfInitializer.declarations[0].end - forOfInitializer.declarations[0].pos); -// } -// break; -// case SyntaxKind.ForInStatement: -// // There is no valid fix in the case of: -// // for .. in -// return undefined; -// case SyntaxKind.CatchClause: -// const catchClause = token.parent.parent; -// const parameter = catchClause.variableDeclaration.getChildren()[0]; -// return createCodeFix("", parameter.pos, parameter.end - parameter.pos); -// default: -// const variableStatement = token.parent.parent.parent; -// if (variableStatement.declarationList.declarations.length === 1) { -// return createCodeFix("", variableStatement.pos, variableStatement.end - variableStatement.pos); -// } -// else { -// const declarations = variableStatement.declarationList.declarations; -// return removeSingleItem(declarations, token); -// } -// } -// case SyntaxKind.TypeParameter: -// const typeParameters = (token.parent.parent).typeParameters; -// if (typeParameters.length === 1) { -// return createCodeFix("", token.parent.pos - 1, token.parent.end - token.parent.pos + 2); -// } -// else { -// return removeSingleItem(typeParameters, token); -// } -// case ts.SyntaxKind.Parameter: -// const functionDeclaration = token.parent.parent; -// if (functionDeclaration.parameters.length === 1) { -// return createCodeFix("", token.parent.pos, token.parent.end - token.parent.pos); -// } -// else { -// return removeSingleItem(functionDeclaration.parameters, token); -// } -// // handle case where 'import a = A;' -// case SyntaxKind.ImportEqualsDeclaration: -// const importEquals = findImportDeclaration(token); -// return createCodeFix("", importEquals.pos, importEquals.end - importEquals.pos); -// case SyntaxKind.ImportSpecifier: -// const namedImports = token.parent.parent; -// if (namedImports.elements.length === 1) { -// // Only 1 import and it is unused. So the entire declaration should be removed. -// const importSpec = findImportDeclaration(token); -// return createCodeFix("", importSpec.pos, importSpec.end - importSpec.pos); -// } -// else { -// return removeSingleItem(namedImports.elements, token); -// } -// // handle case where "import d, * as ns from './file'" -// // or "'import {a, b as ns} from './file'" -// case SyntaxKind.ImportClause: // this covers both 'import |d|' and 'import |d,| *' -// const importClause = token.parent; -// if (!importClause.namedBindings) { // |import d from './file'| or |import * as ns from './file'| -// const importDecl = findImportDeclaration(importClause); -// return createCodeFix("", importDecl.pos, importDecl.end - importDecl.pos); -// } -// else { // import |d,| * as ns from './file' -// return createCodeFix("", importClause.name.pos, importClause.namedBindings.pos - importClause.name.pos); -// } -// case SyntaxKind.NamespaceImport: -// const namespaceImport = token.parent; -// if (namespaceImport.name == token && !(namespaceImport.parent).name) { -// const importDecl = findImportDeclaration(namespaceImport); -// return createCodeFix("", importDecl.pos, importDecl.end - importDecl.pos); -// } -// else { -// const start = (namespaceImport.parent).name.end; -// return createCodeFix("", start, (namespaceImport.parent).namedBindings.end - start); -// } -// } -// break; -// case SyntaxKind.PropertyDeclaration: -// return createCodeFix("", token.parent.pos, token.parent.end - token.parent.pos); -// case SyntaxKind.NamespaceImport: -// return createCodeFix("", token.parent.pos, token.parent.end - token.parent.pos); -// } -// if (isDeclarationName(token)) { -// return createCodeFix("", token.parent.pos, token.parent.end - token.parent.pos); -// } -// else if (isLiteralComputedPropertyDeclarationName(token)) { -// return createCodeFix("", token.parent.parent.pos, token.parent.parent.end - token.parent.parent.pos); -// } -// else { -// return undefined; -// } -// function findImportDeclaration(token: Node): Node { -// let importDecl = token; -// while (importDecl.kind != SyntaxKind.ImportDeclaration && importDecl.parent) { -// importDecl = importDecl.parent; -// } -// return importDecl; -// } -// function createCodeFix(newText: string, start: number, length: number): CodeAction[] { -// return [{ -// description: getLocaleSpecificMessage(Diagnostics.Remove_unused_identifiers), -// changes: [{ -// fileName: sourceFile.fileName, -// textChanges: [{ newText, span: { start, length } }] -// }] -// }]; -// } -// function removeSingleItem(elements: NodeArray, token: T): CodeAction[] { -// if (elements[0] === token.parent) { -// return createCodeFix("", token.parent.pos, token.parent.end - token.parent.pos + 1); -// } -// else { -// return createCodeFix("", token.parent.pos - 1, token.parent.end - token.parent.pos + 1); -// } -// } -// } -// }); -// } -/// -/// -/// +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: [ts.Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call.code], + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var token = ts.getTokenAtPosition(sourceFile, context.span.start); + if (token.kind !== 123 /* ConstructorKeyword */) { + return undefined; + } + var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + var superCall = ts.createStatement(ts.createCall(ts.createSuper(), /*typeArguments*/ undefined, /*argumentsArray*/ ts.emptyArray)); + changeTracker.insertNodeAfter(sourceFile, ts.getOpenBrace(token.parent, sourceFile), superCall, { suffix: context.newLineCharacter }); + return [{ + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_missing_super_call), + changes: changeTracker.getChanges() + }]; + } + }); + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: [ts.Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code], + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var start = context.span.start; + var token = ts.getTokenAtPosition(sourceFile, start); + var classDeclNode = ts.getContainingClass(token); + if (!(token.kind === 71 /* Identifier */ && ts.isClassLike(classDeclNode))) { + return undefined; + } + var heritageClauses = classDeclNode.heritageClauses; + if (!(heritageClauses && heritageClauses.length > 0)) { + return undefined; + } + var extendsToken = heritageClauses[0].getFirstToken(); + if (!(extendsToken && extendsToken.kind === 85 /* ExtendsKeyword */)) { + return undefined; + } + var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + changeTracker.replaceNode(sourceFile, extendsToken, ts.createToken(108 /* ImplementsKeyword */)); + // We replace existing keywords with commas. + for (var i = 1; i < heritageClauses.length; i++) { + var keywordToken = heritageClauses[i].getFirstToken(); + if (keywordToken) { + changeTracker.replaceNode(sourceFile, keywordToken, ts.createToken(26 /* CommaToken */)); + } + } + var result = [{ + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Change_extends_to_implements), + changes: changeTracker.getChanges() + }]; + return result; + } + }); + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: [ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code], + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var token = ts.getTokenAtPosition(sourceFile, context.span.start); + if (token.kind !== 71 /* Identifier */) { + return undefined; + } + var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + changeTracker.replaceNode(sourceFile, token, ts.createPropertyAccess(ts.createThis(), token)); + return [{ + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_this_to_unresolved_variable), + changes: changeTracker.getChanges() + }]; + } + }); + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: [ + ts.Diagnostics._0_is_declared_but_never_used.code, + ts.Diagnostics.Property_0_is_declared_but_never_used.code + ], + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var start = context.span.start; + var token = ts.getTokenAtPosition(sourceFile, start); + // this handles var ["computed"] = 12; + if (token.kind === 21 /* OpenBracketToken */) { + token = ts.getTokenAtPosition(sourceFile, start + 1); + } + switch (token.kind) { + case 71 /* Identifier */: + switch (token.parent.kind) { + case 226 /* VariableDeclaration */: + switch (token.parent.parent.parent.kind) { + case 214 /* ForStatement */: + var forStatement = token.parent.parent.parent; + var forInitializer = forStatement.initializer; + if (forInitializer.declarations.length === 1) { + return deleteNode(forInitializer); + } + else { + return deleteNodeInList(token.parent); + } + case 216 /* ForOfStatement */: + var forOfStatement = token.parent.parent.parent; + if (forOfStatement.initializer.kind === 227 /* VariableDeclarationList */) { + var forOfInitializer = forOfStatement.initializer; + return replaceNode(forOfInitializer.declarations[0], ts.createObjectLiteral()); + } + break; + case 215 /* ForInStatement */: + // There is no valid fix in the case of: + // for .. in + return undefined; + case 260 /* CatchClause */: + var catchClause = token.parent.parent; + var parameter = catchClause.variableDeclaration.getChildren()[0]; + return deleteNode(parameter); + default: + var variableStatement = token.parent.parent.parent; + if (variableStatement.declarationList.declarations.length === 1) { + return deleteNode(variableStatement); + } + else { + return deleteNodeInList(token.parent); + } + } + // TODO: #14885 + // falls through + case 145 /* TypeParameter */: + var typeParameters = token.parent.parent.typeParameters; + if (typeParameters.length === 1) { + var previousToken = ts.getTokenAtPosition(sourceFile, typeParameters.pos - 1); + if (!previousToken || previousToken.kind !== 27 /* LessThanToken */) { + return deleteRange(typeParameters); + } + var nextToken = ts.getTokenAtPosition(sourceFile, typeParameters.end); + if (!nextToken || nextToken.kind !== 29 /* GreaterThanToken */) { + return deleteRange(typeParameters); + } + return deleteNodeRange(previousToken, nextToken); + } + else { + return deleteNodeInList(token.parent); + } + case 146 /* Parameter */: + var functionDeclaration = token.parent.parent; + if (functionDeclaration.parameters.length === 1) { + return deleteNode(token.parent); + } + else { + return deleteNodeInList(token.parent); + } + // handle case where 'import a = A;' + case 237 /* ImportEqualsDeclaration */: + var importEquals = ts.getAncestor(token, 237 /* ImportEqualsDeclaration */); + return deleteNode(importEquals); + case 242 /* ImportSpecifier */: + var namedImports = token.parent.parent; + if (namedImports.elements.length === 1) { + // Only 1 import and it is unused. So the entire declaration should be removed. + var importSpec = ts.getAncestor(token, 238 /* ImportDeclaration */); + return deleteNode(importSpec); + } + else { + // delete import specifier + return deleteNodeInList(token.parent); + } + // handle case where "import d, * as ns from './file'" + // or "'import {a, b as ns} from './file'" + case 239 /* ImportClause */: + var importClause = token.parent; + if (!importClause.namedBindings) { + var importDecl = ts.getAncestor(importClause, 238 /* ImportDeclaration */); + return deleteNode(importDecl); + } + else { + // import |d,| * as ns from './file' + var start_4 = importClause.name.getStart(sourceFile); + var nextToken = ts.getTokenAtPosition(sourceFile, importClause.name.end); + if (nextToken && nextToken.kind === 26 /* CommaToken */) { + // shift first non-whitespace position after comma to the start position of the node + return deleteRange({ pos: start_4, end: ts.skipTrivia(sourceFile.text, nextToken.end, /*stopAfterLineBreaks*/ false, /*stopAtComments*/ true) }); + } + else { + return deleteNode(importClause.name); + } + } + case 240 /* NamespaceImport */: + var namespaceImport = token.parent; + if (namespaceImport.name === token && !namespaceImport.parent.name) { + var importDecl = ts.getAncestor(namespaceImport, 238 /* ImportDeclaration */); + return deleteNode(importDecl); + } + else { + var previousToken = ts.getTokenAtPosition(sourceFile, namespaceImport.pos - 1); + if (previousToken && previousToken.kind === 26 /* CommaToken */) { + var startPosition = ts.textChanges.getAdjustedStartPosition(sourceFile, previousToken, {}, ts.textChanges.Position.FullStart); + return deleteRange({ pos: startPosition, end: namespaceImport.end }); + } + return deleteRange(namespaceImport); + } + } + break; + case 149 /* PropertyDeclaration */: + case 240 /* NamespaceImport */: + return deleteNode(token.parent); + } + if (ts.isDeclarationName(token)) { + return deleteNode(token.parent); + } + else if (ts.isLiteralComputedPropertyDeclarationName(token)) { + return deleteNode(token.parent.parent); + } + else { + return undefined; + } + function deleteNode(n) { + return makeChange(ts.textChanges.ChangeTracker.fromCodeFixContext(context).deleteNode(sourceFile, n)); + } + function deleteRange(range) { + return makeChange(ts.textChanges.ChangeTracker.fromCodeFixContext(context).deleteRange(sourceFile, range)); + } + function deleteNodeInList(n) { + return makeChange(ts.textChanges.ChangeTracker.fromCodeFixContext(context).deleteNodeInList(sourceFile, n)); + } + function deleteNodeRange(start, end) { + return makeChange(ts.textChanges.ChangeTracker.fromCodeFixContext(context).deleteNodeRange(sourceFile, start, end)); + } + function replaceNode(n, newNode) { + return makeChange(ts.textChanges.ChangeTracker.fromCodeFixContext(context).replaceNode(sourceFile, n, newNode)); + } + function makeChange(changeTracker) { + return [{ + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Remove_declaration_for_Colon_0), { 0: token.getText() }), + changes: changeTracker.getChanges() + }]; + } + } + }); + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + var ModuleSpecifierComparison; + (function (ModuleSpecifierComparison) { + ModuleSpecifierComparison[ModuleSpecifierComparison["Better"] = 0] = "Better"; + ModuleSpecifierComparison[ModuleSpecifierComparison["Equal"] = 1] = "Equal"; + ModuleSpecifierComparison[ModuleSpecifierComparison["Worse"] = 2] = "Worse"; + })(ModuleSpecifierComparison || (ModuleSpecifierComparison = {})); + var ImportCodeActionMap = (function () { + function ImportCodeActionMap() { + this.symbolIdToActionMap = []; + } + ImportCodeActionMap.prototype.addAction = function (symbolId, newAction) { + if (!newAction) { + return; + } + 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 ModuleSpecifierComparison.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 ModuleSpecifierComparison.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 ModuleSpecifierComparison.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 ModuleSpecifierComparison.Equal; + } + // if moduleSpecifier1 (ms1) is a substring of ms2, then it is better + if (moduleSpecifier2.indexOf(moduleSpecifier1) === 0) { + return ModuleSpecifierComparison.Better; + } + if (moduleSpecifier1.indexOf(moduleSpecifier2) === 0) { + return ModuleSpecifierComparison.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 + ? ModuleSpecifierComparison.Better + : moduleSpecifier1LevelCount === moduleSpecifier2LevelCount + ? ModuleSpecifierComparison.Equal + : ModuleSpecifierComparison.Worse; + } + // the equal cases include when the two specifiers are not comparable. + return ModuleSpecifierComparison.Equal; + }; + return ImportCodeActionMap; + }()); + codefix.registerCodeFix({ + errorCodes: [ + ts.Diagnostics.Cannot_find_name_0.code, + ts.Diagnostics.Cannot_find_namespace_0.code, + ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code + ], + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var checker = context.program.getTypeChecker(); + var allSourceFiles = context.program.getSourceFiles(); + var useCaseSensitiveFileNames = context.host.useCaseSensitiveFileNames ? context.host.useCaseSensitiveFileNames() : false; + var token = ts.getTokenAtPosition(sourceFile, context.span.start); + var name = token.getText(); + var symbolIdActionMap = new ImportCodeActionMap(); + // this is a module id -> module import declaration map + var cachedImportDeclarations = []; + var lastImportDeclaration; + var currentTokenMeaning = ts.getMeaningFromLocation(token); + if (context.errorCode === ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code) { + var symbol = checker.getAliasedSymbol(checker.getSymbolAtLocation(token)); + return getCodeActionForImport(symbol, /*isDefault*/ false, /*isNamespaceImport*/ true); + } + var candidateModules = checker.getAmbientModules(); + for (var _i = 0, allSourceFiles_1 = allSourceFiles; _i < allSourceFiles_1.length; _i++) { + var otherSourceFile = allSourceFiles_1[_i]; + if (otherSourceFile !== sourceFile && ts.isExternalOrCommonJsModule(otherSourceFile)) { + candidateModules.push(otherSourceFile.symbol); + } + } + for (var _a = 0, candidateModules_1 = candidateModules; _a < candidateModules_1.length; _a++) { + var moduleSymbol = candidateModules_1[_a]; + context.cancellationToken.throwIfCancellationRequested(); + // check the default export + var defaultExport = checker.tryGetMemberInModuleExports("default", moduleSymbol); + if (defaultExport) { + var localSymbol = ts.getLocalSymbolForExportDefault(defaultExport); + if (localSymbol && localSymbol.name === name && checkSymbolHasMeaning(localSymbol, currentTokenMeaning)) { + // check if this symbol is already used + var symbolId = getUniqueSymbolId(localSymbol); + symbolIdActionMap.addActions(symbolId, getCodeActionForImport(moduleSymbol, /*isDefault*/ true)); + } + } + // check exports with the same name + var exportSymbolWithIdenticalName = checker.tryGetMemberInModuleExports(name, moduleSymbol); + if (exportSymbolWithIdenticalName && checkSymbolHasMeaning(exportSymbolWithIdenticalName, currentTokenMeaning)) { + var symbolId = getUniqueSymbolId(exportSymbolWithIdenticalName); + symbolIdActionMap.addActions(symbolId, getCodeActionForImport(moduleSymbol)); + } + } + return symbolIdActionMap.getAllActions(); + function getImportDeclarations(moduleSymbol) { + var moduleSymbolId = getUniqueSymbolId(moduleSymbol); + var cached = cachedImportDeclarations[moduleSymbolId]; + if (cached) { + return cached; + } + var existingDeclarations = []; + for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) { + var importModuleSpecifier = _a[_i]; + var importSymbol = checker.getSymbolAtLocation(importModuleSpecifier); + if (importSymbol === moduleSymbol) { + existingDeclarations.push(getImportDeclaration(importModuleSpecifier)); + } + } + cachedImportDeclarations[moduleSymbolId] = existingDeclarations; + return existingDeclarations; + function getImportDeclaration(moduleSpecifier) { + var node = moduleSpecifier; + while (node) { + if (node.kind === 238 /* ImportDeclaration */) { + return node; + } + if (node.kind === 237 /* ImportEqualsDeclaration */) { + return node; + } + node = node.parent; + } + return undefined; + } + } + function getUniqueSymbolId(symbol) { + if (symbol.flags & 8388608 /* Alias */) { + return ts.getSymbolId(checker.getAliasedSymbol(symbol)); + } + return ts.getSymbolId(symbol); + } + function checkSymbolHasMeaning(symbol, meaning) { + var declarations = symbol.getDeclarations(); + return declarations ? ts.some(symbol.declarations, function (decl) { return !!(ts.getMeaningFromDeclaration(decl) & meaning); }) : false; + } + function getCodeActionForImport(moduleSymbol, isDefault, isNamespaceImport) { + var existingDeclarations = getImportDeclarations(moduleSymbol); + if (existingDeclarations.length > 0) { + // With an existing import statement, there are more than one actions the user can do. + return getCodeActionsForExistingImport(existingDeclarations); + } + else { + return [getCodeActionForNewImport()]; + } + function getCodeActionsForExistingImport(declarations) { + var actions = []; + // 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 namespaceImportDeclaration; + var namedImportDeclaration; + var existingModuleSpecifier; + for (var _i = 0, declarations_14 = declarations; _i < declarations_14.length; _i++) { + var declaration = declarations_14[_i]; + if (declaration.kind === 238 /* ImportDeclaration */) { + var namedBindings = declaration.importClause && declaration.importClause.namedBindings; + if (namedBindings && namedBindings.kind === 240 /* NamespaceImport */) { + // case: + // import * as ns from "foo" + namespaceImportDeclaration = declaration; + } + else { + // cases: + // import default from "foo" + // import { bar } from "foo" or combination with the first one + // import "foo" + namedImportDeclaration = declaration; + } + existingModuleSpecifier = declaration.moduleSpecifier.getText(); + } + else { + // case: + // import foo = require("foo") + namespaceImportDeclaration = declaration; + existingModuleSpecifier = getModuleSpecifierFromImportEqualsDeclaration(declaration); + } + } + if (namespaceImportDeclaration) { + actions.push(getCodeActionForNamespaceImport(namespaceImportDeclaration)); + } + if (!isNamespaceImport && namedImportDeclaration && namedImportDeclaration.importClause && + (namedImportDeclaration.importClause.name || namedImportDeclaration.importClause.namedBindings)) { + /** + * If the existing import declaration already has a named import list, just + * insert the identifier into that list. + */ + var fileTextChanges = getTextChangeForImportClause(namedImportDeclaration.importClause); + var moduleSpecifierWithoutQuotes = ts.stripQuotes(namedImportDeclaration.moduleSpecifier.getText()); + actions.push(createCodeAction(ts.Diagnostics.Add_0_to_existing_import_declaration_from_1, [name, moduleSpecifierWithoutQuotes], fileTextChanges, "InsertingIntoExistingImport", moduleSpecifierWithoutQuotes)); + } + else { + // we need to create a new import statement, but the existing module specifier can be reused. + actions.push(getCodeActionForNewImport(existingModuleSpecifier)); + } + return actions; + function getModuleSpecifierFromImportEqualsDeclaration(declaration) { + if (declaration.moduleReference && declaration.moduleReference.kind === 248 /* ExternalModuleReference */) { + return declaration.moduleReference.expression.getText(); + } + return declaration.moduleReference.getText(); + } + function getTextChangeForImportClause(importClause) { + var importList = importClause.namedBindings; + var newImportSpecifier = ts.createImportSpecifier(/*propertyName*/ undefined, ts.createIdentifier(name)); + // case 1: + // original text: import default from "module" + // change to: import default, { name } from "module" + // case 2: + // original text: import {} from "module" + // change to: import { name } from "module" + if (!importList || importList.elements.length === 0) { + var newImportClause = ts.createImportClause(importClause.name, ts.createNamedImports([newImportSpecifier])); + return createChangeTracker().replaceNode(sourceFile, importClause, newImportClause).getChanges(); + } + /** + * If the import list has one import per line, preserve that. Otherwise, insert on same line as last element + * import { + * foo + * } from "./module"; + */ + return createChangeTracker().insertNodeInListAfter(sourceFile, importList.elements[importList.elements.length - 1], newImportSpecifier).getChanges(); + } + function getCodeActionForNamespaceImport(declaration) { + var namespacePrefix; + if (declaration.kind === 238 /* ImportDeclaration */) { + namespacePrefix = declaration.importClause.namedBindings.name.getText(); + } + else { + namespacePrefix = declaration.name.getText(); + } + namespacePrefix = ts.stripQuotes(namespacePrefix); + /** + * Cases: + * import * as ns from "mod" + * import default, * as ns from "mod" + * import ns = require("mod") + * + * Because there is no import list, we alter the reference to include the + * namespace instead of altering the import declaration. For example, "foo" would + * become "ns.foo" + */ + return createCodeAction(ts.Diagnostics.Change_0_to_1, [name, namespacePrefix + "." + name], createChangeTracker().replaceNode(sourceFile, token, ts.createPropertyAccess(ts.createIdentifier(namespacePrefix), name)).getChanges(), "CodeChange"); + } + } + function getCodeActionForNewImport(moduleSpecifier) { + if (!lastImportDeclaration) { + // insert after any existing imports + for (var i = sourceFile.statements.length - 1; i >= 0; i--) { + var statement = sourceFile.statements[i]; + if (statement.kind === 237 /* ImportEqualsDeclaration */ || statement.kind === 238 /* ImportDeclaration */) { + lastImportDeclaration = statement; + break; + } + } + } + var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames); + var moduleSpecifierWithoutQuotes = ts.stripQuotes(moduleSpecifier || getModuleSpecifierForNewImport()); + var changeTracker = createChangeTracker(); + var importClause = isDefault + ? ts.createImportClause(ts.createIdentifier(name), /*namedBindings*/ undefined) + : isNamespaceImport + ? ts.createImportClause(/*name*/ undefined, ts.createNamespaceImport(ts.createIdentifier(name))) + : ts.createImportClause(/*name*/ undefined, ts.createNamedImports([ts.createImportSpecifier(/*propertyName*/ undefined, ts.createIdentifier(name))])); + var importDecl = ts.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, importClause, ts.createLiteral(moduleSpecifierWithoutQuotes)); + if (!lastImportDeclaration) { + changeTracker.insertNodeAt(sourceFile, sourceFile.getStart(), importDecl, { suffix: "" + context.newLineCharacter + context.newLineCharacter }); + } + else { + changeTracker.insertNodeAfter(sourceFile, lastImportDeclaration, importDecl, { suffix: context.newLineCharacter }); + } + // 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_1, [name, "\"" + moduleSpecifierWithoutQuotes + "\""], changeTracker.getChanges(), "NewImport", moduleSpecifierWithoutQuotes); + function getModuleSpecifierForNewImport() { + var fileName = sourceFile.fileName; + var moduleFileName = moduleSymbol.valueDeclaration.getSourceFile().fileName; + var sourceDirectory = ts.getDirectoryPath(fileName); + var options = context.program.getCompilerOptions(); + return tryGetModuleNameFromAmbientModule() || + tryGetModuleNameFromTypeRoots() || + tryGetModuleNameAsNodeModule() || + tryGetModuleNameFromBaseUrl() || + tryGetModuleNameFromRootDirs() || + ts.removeFileExtension(getRelativePath(moduleFileName, sourceDirectory)); + function tryGetModuleNameFromAmbientModule() { + if (moduleSymbol.valueDeclaration.kind !== 265 /* SourceFile */) { + return moduleSymbol.name; + } + } + function tryGetModuleNameFromBaseUrl() { + if (!options.baseUrl) { + return undefined; + } + var relativeName = getRelativePathIfInDirectory(moduleFileName, options.baseUrl); + if (!relativeName) { + return undefined; + } + var relativeNameWithIndex = ts.removeFileExtension(relativeName); + relativeName = removeExtensionAndIndexPostFix(relativeName); + if (options.paths) { + for (var key in options.paths) { + for (var _i = 0, _a = options.paths[key]; _i < _a.length; _i++) { + var pattern = _a[_i]; + var indexOfStar = pattern.indexOf("*"); + if (indexOfStar === 0 && pattern.length === 1) { + continue; + } + else if (indexOfStar !== -1) { + var prefix = pattern.substr(0, indexOfStar); + var suffix = pattern.substr(indexOfStar + 1); + if (relativeName.length >= prefix.length + suffix.length && + ts.startsWith(relativeName, prefix) && + ts.endsWith(relativeName, suffix)) { + var matchedStar = relativeName.substr(prefix.length, relativeName.length - suffix.length); + return key.replace("\*", matchedStar); + } + } + else if (pattern === relativeName || pattern === relativeNameWithIndex) { + return key; + } + } + } + } + return relativeName; + } + function tryGetModuleNameFromRootDirs() { + if (options.rootDirs) { + var normalizedTargetPath = getPathRelativeToRootDirs(moduleFileName, options.rootDirs); + var normalizedSourcePath = getPathRelativeToRootDirs(sourceDirectory, options.rootDirs); + if (normalizedTargetPath !== undefined) { + var relativePath = normalizedSourcePath !== undefined ? getRelativePath(normalizedTargetPath, normalizedSourcePath) : normalizedTargetPath; + return ts.removeFileExtension(relativePath); + } + } + return undefined; + } + function tryGetModuleNameFromTypeRoots() { + var typeRoots = ts.getEffectiveTypeRoots(options, context.host); + if (typeRoots) { + var normalizedTypeRoots = ts.map(typeRoots, function (typeRoot) { return ts.toPath(typeRoot, /*basePath*/ undefined, getCanonicalFileName); }); + for (var _i = 0, normalizedTypeRoots_1 = normalizedTypeRoots; _i < normalizedTypeRoots_1.length; _i++) { + var typeRoot = normalizedTypeRoots_1[_i]; + if (ts.startsWith(moduleFileName, typeRoot)) { + var relativeFileName = moduleFileName.substring(typeRoot.length + 1); + return removeExtensionAndIndexPostFix(relativeFileName); + } + } + } + } + function tryGetModuleNameAsNodeModule() { + if (ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeJs) { + // nothing to do here + return undefined; + } + var indexOfNodeModules = moduleFileName.indexOf("node_modules"); + if (indexOfNodeModules < 0) { + return undefined; + } + var relativeFileName; + if (sourceDirectory.indexOf(moduleFileName.substring(0, indexOfNodeModules - 1)) === 0) { + // if node_modules folder is in this folder or any of its parent folder, no need to keep it. + relativeFileName = moduleFileName.substring(indexOfNodeModules + 13 /* "node_modules\".length */); + } + else { + relativeFileName = getRelativePath(moduleFileName, sourceDirectory); + } + relativeFileName = ts.removeFileExtension(relativeFileName); + if (ts.endsWith(relativeFileName, "/index")) { + relativeFileName = ts.getDirectoryPath(relativeFileName); + } + else { + try { + var moduleDirectory = ts.getDirectoryPath(moduleFileName); + var packageJsonContent = JSON.parse(context.host.readFile(ts.combinePaths(moduleDirectory, "package.json"))); + if (packageJsonContent) { + var mainFile = packageJsonContent.main || packageJsonContent.typings; + if (mainFile) { + var mainExportFile = ts.toPath(mainFile, moduleDirectory, getCanonicalFileName); + if (ts.removeFileExtension(mainExportFile) === ts.removeFileExtension(moduleFileName)) { + relativeFileName = ts.getDirectoryPath(relativeFileName); + } + } + } + } + catch (e) { } + } + return relativeFileName; + } + } + function getPathRelativeToRootDirs(path, rootDirs) { + for (var _i = 0, rootDirs_2 = rootDirs; _i < rootDirs_2.length; _i++) { + var rootDir = rootDirs_2[_i]; + var relativeName = getRelativePathIfInDirectory(path, rootDir); + if (relativeName !== undefined) { + return relativeName; + } + } + return undefined; + } + function removeExtensionAndIndexPostFix(fileName) { + fileName = ts.removeFileExtension(fileName); + if (ts.endsWith(fileName, "/index")) { + fileName = fileName.substr(0, fileName.length - 6 /* "/index".length */); + } + return fileName; + } + function getRelativePathIfInDirectory(path, directoryPath) { + var relativePath = ts.getRelativePathToDirectoryOrUrl(directoryPath, path, directoryPath, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false); + return ts.isRootedDiskPath(relativePath) || ts.startsWith(relativePath, "..") ? undefined : relativePath; + } + function getRelativePath(path, directoryPath) { + var relativePath = ts.getRelativePathToDirectoryOrUrl(directoryPath, path, directoryPath, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false); + return ts.moduleHasNonRelativeName(relativePath) ? "./" + relativePath : relativePath; + } + } + } + function createChangeTracker() { + return ts.textChanges.ChangeTracker.fromCodeFixContext(context); + } + function createCodeAction(description, diagnosticArgs, changes, kind, moduleSpecifier) { + return { + description: ts.formatMessage.apply(undefined, [undefined, description].concat(diagnosticArgs)), + changes: changes, + kind: kind, + moduleSpecifier: moduleSpecifier + }; + } + } + }); + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: getApplicableDiagnosticCodes(), + getCodeActions: getDisableJsDiagnosticsCodeActions + }); + function getApplicableDiagnosticCodes() { + var allDiagnostcs = ts.Diagnostics; + return Object.keys(allDiagnostcs) + .filter(function (d) { return allDiagnostcs[d] && allDiagnostcs[d].category === ts.DiagnosticCategory.Error; }) + .map(function (d) { return allDiagnostcs[d].code; }); + } + function getIgnoreCommentLocationForLocation(sourceFile, position, newLineCharacter) { + var line = ts.getLineAndCharacterOfPosition(sourceFile, position).line; + var lineStartPosition = ts.getStartPositionOfLine(line, 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); + 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 immediatlly before the error span. + return { + span: { start: position, length: 0 }, + newText: (position === startPosition ? "" : newLineCharacter) + "// @ts-ignore" + newLineCharacter + }; + } + function getDisableJsDiagnosticsCodeActions(context) { + var sourceFile = context.sourceFile, program = context.program, newLineCharacter = context.newLineCharacter, span = context.span; + if (!ts.isInJavaScriptFile(sourceFile) || !ts.isCheckJsEnabledForFile(sourceFile, program.getCompilerOptions())) { + return undefined; + } + return [{ + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Ignore_this_error_message), + changes: [{ + fileName: sourceFile.fileName, + textChanges: [getIgnoreCommentLocationForLocation(sourceFile, span.start, newLineCharacter)] + }] + }, + { + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Disable_checking_for_this_file), + changes: [{ + fileName: sourceFile.fileName, + textChanges: [{ + span: { + start: sourceFile.checkJsDirective ? sourceFile.checkJsDirective.pos : 0, + length: sourceFile.checkJsDirective ? sourceFile.checkJsDirective.end - sourceFile.checkJsDirective.pos : 0 + }, + newText: "// @ts-nocheck" + newLineCharacter + }] + }] + }]; + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + function newNodesToChanges(newNodes, insertAfter, context) { + var sourceFile = context.sourceFile; + var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + for (var _i = 0, newNodes_1 = newNodes; _i < newNodes_1.length; _i++) { + var newNode = newNodes_1[_i]; + changeTracker.insertNodeAfter(sourceFile, insertAfter, newNode, { suffix: context.newLineCharacter }); + } + var changes = changeTracker.getChanges(); + if (!ts.some(changes)) { + return changes; + } + ts.Debug.assert(changes.length === 1); + var consolidatedChanges = [{ + fileName: changes[0].fileName, + textChanges: [{ + span: changes[0].textChanges[0].span, + newText: changes[0].textChanges.reduce(function (prev, cur) { return prev + cur.newText; }, "") + }] + }]; + return consolidatedChanges; + } + codefix.newNodesToChanges = newNodesToChanges; + /** + * Finds members of the resolved type that are missing in the class pointed to by class decl + * and generates source code for the missing members. + * @param possiblyMissingSymbols The collection of symbols to filter and then get insertions for. + * @returns Empty string iff there are no member insertions. + */ + function createMissingMemberNodes(classDeclaration, possiblyMissingSymbols, checker) { + var classMembers = classDeclaration.symbol.members; + var missingMembers = possiblyMissingSymbols.filter(function (symbol) { return !classMembers.has(symbol.getName()); }); + var newNodes = []; + for (var _i = 0, missingMembers_1 = missingMembers; _i < missingMembers_1.length; _i++) { + var symbol = missingMembers_1[_i]; + var newNode = createNewNodeForMemberSymbol(symbol, classDeclaration, checker); + if (newNode) { + if (Array.isArray(newNode)) { + newNodes = newNodes.concat(newNode); + } + else { + newNodes.push(newNode); + } + } + } + return newNodes; + } + codefix.createMissingMemberNodes = createMissingMemberNodes; + /** + * @returns Empty string iff there we can't figure out a representation for `symbol` in `enclosingDeclaration`. + */ + function createNewNodeForMemberSymbol(symbol, enclosingDeclaration, checker) { + var declarations = symbol.getDeclarations(); + if (!(declarations && declarations.length)) { + return undefined; + } + var declaration = declarations[0]; + // Clone name to remove leading trivia. + var name = ts.getSynthesizedClone(ts.getNameOfDeclaration(declaration)); + var visibilityModifier = createVisibilityModifier(ts.getModifierFlags(declaration)); + var modifiers = visibilityModifier ? ts.createNodeArray([visibilityModifier]) : undefined; + var type = checker.getWidenedType(checker.getTypeOfSymbolAtLocation(symbol, enclosingDeclaration)); + var optional = !!(symbol.flags & 67108864 /* Optional */); + switch (declaration.kind) { + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + case 148 /* PropertySignature */: + case 149 /* PropertyDeclaration */: + var typeNode = checker.typeToTypeNode(type, enclosingDeclaration); + var property = ts.createProperty( + /*decorators*/ undefined, modifiers, name, optional ? ts.createToken(55 /* QuestionToken */) : undefined, typeNode, + /*initializer*/ undefined); + return property; + case 150 /* MethodSignature */: + case 151 /* 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 + // extra declaration that isn't a signature for `type`. + // If there is more than one overload but no implementation signature + // (eg: an abstract method or interface declaration), there is a 1-1 + // correspondence of declarations and signatures. + var signatures = checker.getSignaturesOfType(type, 0 /* Call */); + if (!ts.some(signatures)) { + return undefined; + } + if (declarations.length === 1) { + ts.Debug.assert(signatures.length === 1); + var signature = signatures[0]; + return signatureToMethodDeclaration(signature, enclosingDeclaration, createStubbedMethodBody()); + } + var signatureDeclarations = []; + for (var i = 0; i < signatures.length; i++) { + var signature = signatures[i]; + var methodDeclaration = signatureToMethodDeclaration(signature, enclosingDeclaration); + if (methodDeclaration) { + signatureDeclarations.push(methodDeclaration); + } + } + if (declarations.length > signatures.length) { + var signature = checker.getSignatureFromDeclaration(declarations[declarations.length - 1]); + var methodDeclaration = signatureToMethodDeclaration(signature, enclosingDeclaration, createStubbedMethodBody()); + if (methodDeclaration) { + signatureDeclarations.push(methodDeclaration); + } + } + else { + ts.Debug.assert(declarations.length === signatures.length); + var methodImplementingSignatures = createMethodImplementingSignatures(signatures, name, optional, modifiers); + signatureDeclarations.push(methodImplementingSignatures); + } + return signatureDeclarations; + default: + return undefined; + } + function signatureToMethodDeclaration(signature, enclosingDeclaration, body) { + var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 151 /* MethodDeclaration */, enclosingDeclaration); + if (signatureDeclaration) { + signatureDeclaration.decorators = undefined; + signatureDeclaration.modifiers = modifiers; + signatureDeclaration.name = name; + signatureDeclaration.questionToken = optional ? ts.createToken(55 /* QuestionToken */) : undefined; + signatureDeclaration.body = body; + } + return signatureDeclaration; + } + } + function createMethodImplementingSignatures(signatures, name, optional, modifiers) { + /** This is *a* signature with the maximal number of arguments, + * such that if there is a "maximal" signature without rest arguments, + * this is one of them. + */ + var maxArgsSignature = signatures[0]; + var minArgumentCount = signatures[0].minArgumentCount; + var someSigHasRestParameter = false; + for (var i = 0; i < signatures.length; i++) { + var sig = signatures[i]; + minArgumentCount = Math.min(sig.minArgumentCount, minArgumentCount); + if (sig.hasRestParameter) { + someSigHasRestParameter = true; + } + if (sig.parameters.length >= maxArgsSignature.parameters.length && (!sig.hasRestParameter || maxArgsSignature.hasRestParameter)) { + maxArgsSignature = sig; + } + } + var maxNonRestArgs = maxArgsSignature.parameters.length - (maxArgsSignature.hasRestParameter ? 1 : 0); + var maxArgsParameterSymbolNames = maxArgsSignature.parameters.map(function (symbol) { return symbol.getName(); }); + var parameters = []; + for (var i = 0; i < maxNonRestArgs; i++) { + var anyType = ts.createKeywordTypeNode(119 /* AnyKeyword */); + var newParameter = ts.createParameter( + /*decorators*/ undefined, + /*modifiers*/ undefined, + /*dotDotDotToken*/ undefined, maxArgsParameterSymbolNames[i], + /*questionToken*/ i >= minArgumentCount ? ts.createToken(55 /* QuestionToken */) : undefined, anyType, + /*initializer*/ undefined); + parameters.push(newParameter); + } + if (someSigHasRestParameter) { + var anyArrayType = ts.createArrayTypeNode(ts.createKeywordTypeNode(119 /* AnyKeyword */)); + var restParameter = ts.createParameter( + /*decorators*/ undefined, + /*modifiers*/ undefined, ts.createToken(24 /* DotDotDotToken */), maxArgsParameterSymbolNames[maxNonRestArgs] || "rest", + /*questionToken*/ maxNonRestArgs >= minArgumentCount ? ts.createToken(55 /* QuestionToken */) : undefined, anyArrayType, + /*initializer*/ undefined); + parameters.push(restParameter); + } + return createStubbedMethod(modifiers, name, optional, + /*typeParameters*/ undefined, parameters, + /*returnType*/ undefined); + } + function createStubbedMethod(modifiers, name, optional, typeParameters, parameters, returnType) { + return ts.createMethodDeclaration( + /*decorators*/ undefined, modifiers, + /*asteriskToken*/ undefined, name, optional ? ts.createToken(55 /* QuestionToken */) : undefined, typeParameters, parameters, returnType, createStubbedMethodBody()); + } + codefix.createStubbedMethod = createStubbedMethod; + function createStubbedMethodBody() { + return ts.createBlock([ts.createThrow(ts.createNew(ts.createIdentifier("Error"), + /*typeArguments*/ undefined, [ts.createLiteral("Method not implemented.")]))], + /*multiline*/ true); + } + function createVisibilityModifier(flags) { + if (flags & 4 /* Public */) { + return ts.createToken(114 /* PublicKeyword */); + } + else if (flags & 16 /* Protected */) { + return ts.createToken(113 /* ProtectedKeyword */); + } + return undefined; + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// /// /// /// @@ -78496,7 +85233,6 @@ var ts; /// /// /// -/// /// /// /// @@ -78510,15 +85246,18 @@ var ts; /// /// /// -/// +/// +/// /// var ts; (function (ts) { /** The version of the language service API */ ts.servicesVersion = "0.5"; + /* @internal */ + var ruleProvider; function createNode(kind, pos, end, parent) { - var node = kind >= 141 /* FirstNode */ ? new NodeObject(kind, pos, end) : - kind === 70 /* Identifier */ ? new IdentifierObject(70 /* Identifier */, pos, end) : + var node = kind >= 143 /* FirstNode */ ? new NodeObject(kind, pos, end) : + kind === 71 /* Identifier */ ? new IdentifierObject(71 /* Identifier */, pos, end) : new TokenObject(kind, pos, end); node.parent = parent; return node; @@ -78575,11 +85314,11 @@ var ts; return pos; }; NodeObject.prototype.createSyntaxList = function (nodes) { - var list = createNode(292 /* SyntaxList */, nodes.pos, nodes.end, this); + var list = createNode(294 /* SyntaxList */, nodes.pos, nodes.end, this); list._children = []; var pos = nodes.pos; - for (var _i = 0, nodes_7 = nodes; _i < nodes_7.length; _i++) { - var node = nodes_7[_i]; + for (var _i = 0, nodes_9 = nodes; _i < nodes_9.length; _i++) { + var node = nodes_9[_i]; if (pos < node.pos) { pos = this.addSyntheticNodes(list._children, pos, node.pos); } @@ -78594,11 +85333,11 @@ var ts; NodeObject.prototype.createChildren = function (sourceFile) { var _this = this; var children; - if (this.kind >= 141 /* FirstNode */) { + if (this.kind >= 143 /* FirstNode */) { ts.scanner.setText((sourceFile || this.getSourceFile()).text); children = []; var pos_3 = this.pos; - var useJSDocScanner_1 = this.kind >= 278 /* FirstJSDocTagNode */ && this.kind <= 291 /* LastJSDocTagNode */; + var useJSDocScanner_1 = this.kind >= 283 /* FirstJSDocTagNode */ && this.kind <= 293 /* LastJSDocTagNode */; var processNode = function (node) { var isJSDocTagNode = ts.isJSDocTag(node); if (!isJSDocTagNode && pos_3 < node.pos) { @@ -78655,8 +85394,10 @@ var ts; if (!children.length) { return undefined; } - var child = children[0]; - return child.kind < 141 /* FirstNode */ ? child : child.getFirstToken(sourceFile); + var child = ts.find(children, function (kid) { return kid.kind < 267 /* FirstJSDocNode */ || kid.kind > 293 /* LastJSDocNode */; }); + return child.kind < 143 /* FirstNode */ ? + child : + child.getFirstToken(sourceFile); }; NodeObject.prototype.getLastToken = function (sourceFile) { var children = this.getChildren(sourceFile); @@ -78664,7 +85405,10 @@ var ts; if (!child) { return undefined; } - return child.kind < 141 /* FirstNode */ ? child : child.getLastToken(sourceFile); + return child.kind < 143 /* FirstNode */ ? child : child.getLastToken(sourceFile); + }; + NodeObject.prototype.forEachChild = function (cbNode, cbNodeArray) { + return ts.forEachChild(this, cbNode, cbNodeArray); }; return NodeObject; }()); @@ -78718,6 +85462,9 @@ var ts; TokenOrIdentifierObject.prototype.getLastToken = function () { return undefined; }; + TokenOrIdentifierObject.prototype.forEachChild = function () { + return undefined; + }; return TokenOrIdentifierObject; }()); var SymbolObject = (function () { @@ -78764,7 +85511,7 @@ var ts; } return IdentifierObject; }(TokenOrIdentifierObject)); - IdentifierObject.prototype.kind = 70 /* Identifier */; + IdentifierObject.prototype.kind = 71 /* Identifier */; var TypeObject = (function () { function TypeObject(checker, flags) { this.checker = checker; @@ -78875,27 +85622,32 @@ var ts; return this.namedDeclarations; }; SourceFileObject.prototype.computeNamedDeclarations = function () { - var result = ts.createMap(); + var result = ts.createMultiMap(); ts.forEachChild(this, visit); return result; function addDeclaration(declaration) { var name = getDeclarationName(declaration); if (name) { - ts.multiMapAdd(result, name, declaration); + result.add(name, declaration); } } function getDeclarations(name) { - return result[name] || (result[name] = []); + var declarations = result.get(name); + if (!declarations) { + result.set(name, declarations = []); + } + return declarations; } function getDeclarationName(declaration) { - if (declaration.name) { - var result_7 = getTextOfIdentifierOrLiteral(declaration.name); + var name = ts.getNameOfDeclaration(declaration); + if (name) { + var result_7 = getTextOfIdentifierOrLiteral(name); if (result_7 !== undefined) { return result_7; } - if (declaration.name.kind === 142 /* ComputedPropertyName */) { - var expr = declaration.name.expression; - if (expr.kind === 177 /* PropertyAccessExpression */) { + if (name.kind === 144 /* ComputedPropertyName */) { + var expr = name.expression; + if (expr.kind === 179 /* PropertyAccessExpression */) { return expr.name.text; } return getTextOfIdentifierOrLiteral(expr); @@ -78905,7 +85657,7 @@ var ts; } function getTextOfIdentifierOrLiteral(node) { if (node) { - if (node.kind === 70 /* Identifier */ || + if (node.kind === 71 /* Identifier */ || node.kind === 9 /* StringLiteral */ || node.kind === 8 /* NumericLiteral */) { return node.text; @@ -78915,10 +85667,10 @@ var ts; } function visit(node) { switch (node.kind) { - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 228 /* FunctionDeclaration */: + case 186 /* FunctionExpression */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: var functionDeclaration = node; var declarationName = getDeclarationName(functionDeclaration); if (declarationName) { @@ -78938,32 +85690,32 @@ var ts; } ts.forEachChild(node, visit); break; - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: - case 227 /* InterfaceDeclaration */: - case 228 /* TypeAliasDeclaration */: - case 229 /* EnumDeclaration */: - case 230 /* ModuleDeclaration */: - case 234 /* ImportEqualsDeclaration */: - case 243 /* ExportSpecifier */: - case 239 /* ImportSpecifier */: - case 234 /* ImportEqualsDeclaration */: - case 236 /* ImportClause */: - case 237 /* NamespaceImport */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 161 /* TypeLiteral */: + case 229 /* ClassDeclaration */: + case 199 /* ClassExpression */: + case 230 /* InterfaceDeclaration */: + case 231 /* TypeAliasDeclaration */: + case 232 /* EnumDeclaration */: + case 233 /* ModuleDeclaration */: + case 237 /* ImportEqualsDeclaration */: + case 246 /* ExportSpecifier */: + case 242 /* ImportSpecifier */: + case 237 /* ImportEqualsDeclaration */: + case 239 /* ImportClause */: + case 240 /* NamespaceImport */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + case 163 /* TypeLiteral */: addDeclaration(node); ts.forEachChild(node, visit); break; - case 144 /* Parameter */: + case 146 /* Parameter */: // Only consider parameter properties if (!ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { break; } - // fall through - case 223 /* VariableDeclaration */: - case 174 /* BindingElement */: { + // falls through + case 226 /* VariableDeclaration */: + case 176 /* BindingElement */: { var decl = node; if (ts.isBindingPattern(decl.name)) { ts.forEachChild(decl.name, visit); @@ -78972,19 +85724,20 @@ var ts; if (decl.initializer) visit(decl.initializer); } - case 260 /* EnumMember */: - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: + // falls through + case 264 /* EnumMember */: + case 149 /* PropertyDeclaration */: + case 148 /* PropertySignature */: addDeclaration(node); break; - case 241 /* ExportDeclaration */: + case 244 /* 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 235 /* ImportDeclaration */: + case 238 /* ImportDeclaration */: var importClause = node.importClause; if (importClause) { // Handle default import case e.g.: @@ -78996,7 +85749,7 @@ var ts; // import * as NS from "mod"; // import {a, b as B} from "mod"; if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 237 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 240 /* NamespaceImport */) { addDeclaration(importClause.namedBindings); } else { @@ -79245,10 +85998,40 @@ var ts; }; return CancellationTokenObject; }()); + /* @internal */ + /** A cancellation that throttles calls to the host */ + var ThrottledCancellationToken = (function () { + function ThrottledCancellationToken(hostCancellationToken, throttleWaitMilliseconds) { + if (throttleWaitMilliseconds === void 0) { throttleWaitMilliseconds = 20; } + this.hostCancellationToken = hostCancellationToken; + this.throttleWaitMilliseconds = throttleWaitMilliseconds; + // Store when we last tried to cancel. Checking cancellation can be expensive (as we have + // to marshall over to the host layer). So we only bother actually checking once enough + // time has passed. + this.lastCancellationCheckTime = 0; + } + ThrottledCancellationToken.prototype.isCancellationRequested = function () { + var time = ts.timestamp(); + var duration = Math.abs(time - this.lastCancellationCheckTime); + if (duration >= this.throttleWaitMilliseconds) { + // Check no more than once every throttle wait milliseconds + this.lastCancellationCheckTime = time; + return this.hostCancellationToken.isCancellationRequested(); + } + return false; + }; + ThrottledCancellationToken.prototype.throwIfCancellationRequested = function () { + if (this.isCancellationRequested()) { + throw new ts.OperationCanceledException(); + } + }; + return ThrottledCancellationToken; + }()); + ts.ThrottledCancellationToken = ThrottledCancellationToken; function createLanguageService(host, documentRegistry) { if (documentRegistry === void 0) { documentRegistry = ts.createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames(), host.getCurrentDirectory()); } var syntaxTreeCache = new SyntaxTreeCache(host); - var ruleProvider; + ruleProvider = ruleProvider || new ts.formatting.RulesProvider(); var program; var lastProjectVersion; var lastTypesRootVersion = 0; @@ -79273,10 +86056,6 @@ var ts; return sourceFile; } function getRuleProvider(options) { - // Ensure rules are initialized and up to date wrt to formatting options - if (!ruleProvider) { - ruleProvider = new ts.formatting.RulesProvider(); - } ruleProvider.ensureUpToDate(options); return ruleProvider; } @@ -79426,6 +86205,7 @@ var ts; ts.Debug.assert(hostFileInformation.scriptKind === oldSourceFile.scriptKind, "Registered script kind (" + oldSourceFile.scriptKind + ") should match new script kind (" + hostFileInformation.scriptKind + ") for file: " + path); return documentRegistry.updateDocumentWithKey(fileName, path, newSettings, documentRegistryBucketKey, hostFileInformation.scriptSnapshot, hostFileInformation.version, hostFileInformation.scriptKind); } + // We didn't already have the file. Fall through and acquire it from the registry. } // Could not find this file in the old program, create a new SourceFile for it. return documentRegistry.acquireDocumentWithKey(fileName, path, newSettings, documentRegistryBucketKey, hostFileInformation.scriptSnapshot, hostFileInformation.version, hostFileInformation.scriptKind); @@ -79525,12 +86305,12 @@ var ts; if (!symbol || typeChecker.isUnknownSymbol(symbol)) { // Try getting just type at this position and show switch (node.kind) { - case 70 /* Identifier */: - case 177 /* PropertyAccessExpression */: - case 141 /* QualifiedName */: - case 98 /* ThisKeyword */: - case 167 /* ThisType */: - case 96 /* SuperKeyword */: + case 71 /* Identifier */: + case 179 /* PropertyAccessExpression */: + case 143 /* QualifiedName */: + case 99 /* ThisKeyword */: + case 169 /* ThisType */: + case 97 /* SuperKeyword */: // For the identifiers/this/super etc get the type at position var type = typeChecker.getTypeAtLocation(node); if (type) { @@ -79561,22 +86341,23 @@ var ts; synchronizeHostData(); return ts.GoToDefinition.getDefinitionAtPosition(program, getValidSourceFile(fileName), position); } - /// Goto implementation - function getImplementationAtPosition(fileName, position) { - synchronizeHostData(); - return ts.GoToImplementation.getImplementationAtPosition(program.getTypeChecker(), cancellationToken, program.getSourceFiles(), ts.getTouchingPropertyName(getValidSourceFile(fileName), position)); - } function getTypeDefinitionAtPosition(fileName, position) { synchronizeHostData(); return ts.GoToDefinition.getTypeDefinitionAtPosition(program.getTypeChecker(), getValidSourceFile(fileName), position); } + /// Goto implementation + function getImplementationAtPosition(fileName, position) { + synchronizeHostData(); + return ts.FindAllReferences.getImplementationsAtPosition(program.getTypeChecker(), cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position); + } + /// References and Occurrences function getOccurrencesAtPosition(fileName, position) { var results = getOccurrencesAtPositionCore(fileName, position); if (results) { - var sourceFile_2 = getCanonicalFileName(ts.normalizeSlashes(fileName)); + var sourceFile_1 = 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; }); + results = ts.filter(results, function (r) { return getCanonicalFileName(ts.normalizeSlashes(r.fileName)) === sourceFile_1; }); } return results; } @@ -79586,9 +86367,7 @@ var ts; var sourceFile = getValidSourceFile(fileName); return ts.DocumentHighlights.getDocumentHighlights(program.getTypeChecker(), cancellationToken, sourceFile, position, sourceFilesToSearch); } - /// References and Occurrences function getOccurrencesAtPositionCore(fileName, position) { - synchronizeHostData(); return convertDocumentHighlights(getDocumentHighlights(fileName, position, [fileName])); function convertDocumentHighlights(documentHighlights) { if (!documentHighlights) { @@ -79603,7 +86382,8 @@ var ts; fileName: entry.fileName, textSpan: highlightSpan.textSpan, isWriteAccess: highlightSpan.kind === ts.HighlightSpanKind.writtenReference, - isDefinition: false + isDefinition: false, + isInString: highlightSpan.isInString, }); } } @@ -79611,21 +86391,18 @@ var ts; } } function findRenameLocations(fileName, position, findInStrings, findInComments) { - var referencedSymbols = findReferencedSymbols(fileName, position, findInStrings, findInComments); - return ts.FindAllReferences.convertReferences(referencedSymbols); + return getReferences(fileName, position, { findInStrings: findInStrings, findInComments: findInComments, isForRename: true }); } function getReferencesAtPosition(fileName, position) { - var referencedSymbols = findReferencedSymbols(fileName, position, /*findInStrings*/ false, /*findInComments*/ false); - return ts.FindAllReferences.convertReferences(referencedSymbols); + return getReferences(fileName, position); + } + function getReferences(fileName, position, options) { + synchronizeHostData(); + return ts.FindAllReferences.findReferencedEntries(program.getTypeChecker(), cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position, options); } function findReferences(fileName, position) { - var referencedSymbols = findReferencedSymbols(fileName, position, /*findInStrings*/ false, /*findInComments*/ false); - // Only include referenced symbols that have a valid definition. - return ts.filter(referencedSymbols, function (rs) { return !!rs.definition; }); - } - function findReferencedSymbols(fileName, position, findInStrings, findInComments) { synchronizeHostData(); - return ts.FindAllReferences.findReferencedSymbols(program.getTypeChecker(), cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position, findInStrings, findInComments); + return ts.FindAllReferences.findReferencedSymbols(program.getTypeChecker(), cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position); } /// NavigateTo function getNavigateToItems(searchValue, maxResultCount, fileName, excludeDtsFiles) { @@ -79644,7 +86421,8 @@ var ts; text: data }); } - var emitOutput = program.emit(sourceFile, writeFile, cancellationToken, emitOnlyDtsFiles); + var customTransformers = host.getCustomTransformers && host.getCustomTransformers(); + var emitOutput = program.emit(sourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); return { outputFiles: outputFiles, emitSkipped: emitOutput.emitSkipped @@ -79674,16 +86452,16 @@ var ts; return; } switch (node.kind) { - case 177 /* PropertyAccessExpression */: - case 141 /* QualifiedName */: + case 179 /* PropertyAccessExpression */: + case 143 /* QualifiedName */: case 9 /* StringLiteral */: - case 85 /* FalseKeyword */: - case 100 /* TrueKeyword */: - case 94 /* NullKeyword */: - case 96 /* SuperKeyword */: - case 98 /* ThisKeyword */: - case 167 /* ThisType */: - case 70 /* Identifier */: + case 86 /* FalseKeyword */: + case 101 /* TrueKeyword */: + case 95 /* NullKeyword */: + case 97 /* SuperKeyword */: + case 99 /* ThisKeyword */: + case 169 /* ThisType */: + case 71 /* Identifier */: break; // Cant create the text span default: @@ -79699,7 +86477,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 === 230 /* ModuleDeclaration */ && + if (nodeForStartPos.parent.parent.kind === 233 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { // Use parent module declarations name for start pos nodeForStartPos = nodeForStartPos.parent.parent.name; @@ -79722,10 +86500,10 @@ var ts; return ts.BreakpointResolver.spanInSourceFileAtLocation(sourceFile, position); } function getNavigationBarItems(fileName) { - return ts.NavigationBar.getNavigationBarItems(syntaxTreeCache.getCurrentSourceFile(fileName)); + return ts.NavigationBar.getNavigationBarItems(syntaxTreeCache.getCurrentSourceFile(fileName), cancellationToken); } function getNavigationTree(fileName) { - return ts.NavigationBar.getNavigationTree(syntaxTreeCache.getCurrentSourceFile(fileName)); + return ts.NavigationBar.getNavigationTree(syntaxTreeCache.getCurrentSourceFile(fileName), cancellationToken); } function isTsOrTsxFile(fileName) { var kind = ts.getScriptKind(fileName, host); @@ -79758,7 +86536,7 @@ var ts; function getOutliningSpans(fileName) { // doesn't use compiler - no need to synchronize with host var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - return ts.OutliningElementsCollector.collectElements(sourceFile); + return ts.OutliningElementsCollector.collectElements(sourceFile, cancellationToken); } function getBraceMatchingAtPosition(fileName, position) { var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); @@ -79790,14 +86568,14 @@ var ts; return result; function getMatchingTokenKind(token) { switch (token.kind) { - case 16 /* OpenBraceToken */: return 17 /* CloseBraceToken */; - case 18 /* OpenParenToken */: return 19 /* CloseParenToken */; - case 20 /* OpenBracketToken */: return 21 /* CloseBracketToken */; - case 26 /* LessThanToken */: return 28 /* GreaterThanToken */; - case 17 /* CloseBraceToken */: return 16 /* OpenBraceToken */; - case 19 /* CloseParenToken */: return 18 /* OpenParenToken */; - case 21 /* CloseBracketToken */: return 20 /* OpenBracketToken */; - case 28 /* GreaterThanToken */: return 26 /* LessThanToken */; + 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; } @@ -79836,13 +86614,13 @@ var ts; } return []; } - function getCodeFixesAtPosition(fileName, start, end, errorCodes) { + function getCodeFixesAtPosition(fileName, start, end, errorCodes, formatOptions) { synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); var span = { start: start, length: end - start }; var newLineChar = ts.getNewLineOrDefaultFromHost(host); var allFixes = []; - ts.forEach(errorCodes, function (error) { + ts.forEach(ts.deduplicate(errorCodes), function (error) { cancellationToken.throwIfCancellationRequested(); var context = { errorCode: error, @@ -79851,7 +86629,8 @@ var ts; program: program, newLineCharacter: newLineChar, host: host, - cancellationToken: cancellationToken + cancellationToken: cancellationToken, + rulesProvider: getRuleProvider(formatOptions) }; var fixes = ts.codefix.getFixes(context); if (fixes) { @@ -79931,7 +86710,7 @@ var ts; continue; } var descriptor = undefined; - for (var i = 0, n = descriptors.length; i < n; i++) { + for (var i = 0; i < descriptors.length; i++) { if (matchArray[i + firstDescriptorCaptureIndex]) { descriptor = descriptors[i]; } @@ -80062,6 +86841,7 @@ var ts; } ts.createLanguageService = createLanguageService; /* @internal */ + /** Names in the name table are escaped, so an identifier `__foo` will have a name table entry `___foo`. */ function getNameTable(sourceFile) { if (!sourceFile.nameTable) { initializeNameTable(sourceFile); @@ -80075,8 +86855,8 @@ var ts; sourceFile.nameTable = nameTable; function walk(node) { switch (node.kind) { - case 70 /* Identifier */: - nameTable[node.text] = nameTable[node.text] === undefined ? node.pos : -1; + case 71 /* Identifier */: + setNameTable(node.text, node); break; case 9 /* StringLiteral */: case 8 /* NumericLiteral */: @@ -80085,10 +86865,10 @@ var ts; // then we want 'something' to be in the name table. Similarly, if we have // "a['propname']" then we want to store "propname" in the name table. if (ts.isDeclarationName(node) || - node.parent.kind === 245 /* ExternalModuleReference */ || + node.parent.kind === 248 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node) || ts.isLiteralComputedPropertyDeclarationName(node)) { - nameTable[node.text] = nameTable[node.text] === undefined ? node.pos : -1; + setNameTable(node.text, node); } break; default: @@ -80101,18 +86881,79 @@ var ts; } } } + function setNameTable(text, node) { + nameTable.set(text, nameTable.get(text) === undefined ? node.pos : -1); + } } + function isObjectLiteralElement(node) { + switch (node.kind) { + case 253 /* JsxAttribute */: + case 255 /* JsxSpreadAttribute */: + case 261 /* PropertyAssignment */: + case 262 /* ShorthandPropertyAssignment */: + case 151 /* MethodDeclaration */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + return true; + } + return false; + } + /** + * Returns the containing object literal property declaration given a possible name node, e.g. "a" in x = { "a": 1 } + */ + /* @internal */ + function getContainingObjectLiteralElement(node) { + switch (node.kind) { + case 9 /* StringLiteral */: + case 8 /* NumericLiteral */: + if (node.parent.kind === 144 /* ComputedPropertyName */) { + return isObjectLiteralElement(node.parent.parent) ? node.parent.parent : undefined; + } + // falls through + case 71 /* Identifier */: + return isObjectLiteralElement(node.parent) && + (node.parent.parent.kind === 178 /* ObjectLiteralExpression */ || node.parent.parent.kind === 254 /* JsxAttributes */) && + node.parent.name === node ? node.parent : undefined; + } + return undefined; + } + ts.getContainingObjectLiteralElement = getContainingObjectLiteralElement; + /* @internal */ + function getPropertySymbolsFromContextualType(typeChecker, node) { + var objectLiteral = node.parent; + var contextualType = typeChecker.getContextualType(objectLiteral); + var name = ts.getTextOfPropertyName(node.name); + if (name && contextualType) { + var result_8 = []; + var symbol = contextualType.getProperty(name); + if (contextualType.flags & 65536 /* Union */) { + ts.forEach(contextualType.types, function (t) { + var symbol = t.getProperty(name); + if (symbol) { + result_8.push(symbol); + } + }); + return result_8; + } + if (symbol) { + result_8.push(symbol); + return result_8; + } + } + return undefined; + } + ts.getPropertySymbolsFromContextualType = getPropertySymbolsFromContextualType; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 178 /* ElementAccessExpression */ && + node.parent.kind === 180 /* ElementAccessExpression */ && node.parent.argumentExpression === node; } /** - * Get the path of the default library files (lib.d.ts) as distributed with the typescript - * node package. - * The functionality is not supported if the ts module is consumed outside of a node module. - */ + * Get the path of the default library files (lib.d.ts) as distributed with the typescript + * node package. + * The functionality is not supported if the ts module is consumed outside of a node module. + */ function getDefaultLibFilePath(options) { // Check __dirname is defined and that we are on a node.js system. if (typeof __dirname !== "undefined") { @@ -80121,10 +86962,7 @@ var ts; throw new Error("getDefaultLibFilePath is only supported when consumed as a node module. "); } ts.getDefaultLibFilePath = getDefaultLibFilePath; - function initializeServices() { - ts.objectAllocator = getServicesObjectAllocator(); - } - initializeServices(); + ts.objectAllocator = getServicesObjectAllocator(); })(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. @@ -80189,143 +87027,144 @@ var ts; function spanInNode(node) { if (node) { switch (node.kind) { - case 205 /* VariableStatement */: + case 208 /* VariableStatement */: // Span on first variable declaration return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 223 /* VariableDeclaration */: - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: + case 226 /* VariableDeclaration */: + case 149 /* PropertyDeclaration */: + case 148 /* PropertySignature */: return spanInVariableDeclaration(node); - case 144 /* Parameter */: + case 146 /* Parameter */: return spanInParameterDeclaration(node); - case 225 /* FunctionDeclaration */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 150 /* Constructor */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: + case 228 /* FunctionDeclaration */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + case 152 /* Constructor */: + case 186 /* FunctionExpression */: + case 187 /* ArrowFunction */: return spanInFunctionDeclaration(node); - case 204 /* Block */: + case 207 /* Block */: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } - // Fall through - case 231 /* ModuleBlock */: + // falls through + case 234 /* ModuleBlock */: return spanInBlock(node); - case 256 /* CatchClause */: + case 260 /* CatchClause */: return spanInBlock(node.block); - case 207 /* ExpressionStatement */: + case 210 /* ExpressionStatement */: // span on the expression return textSpan(node.expression); - case 216 /* ReturnStatement */: + case 219 /* ReturnStatement */: // span on return keyword and expression if present return textSpan(node.getChildAt(0), node.expression); - case 210 /* WhileStatement */: + case 213 /* WhileStatement */: // Span on while(...) return textSpanEndingAtNextToken(node, node.expression); - case 209 /* DoStatement */: + case 212 /* DoStatement */: // span in statement of the do statement return spanInNode(node.statement); - case 222 /* DebuggerStatement */: + case 225 /* DebuggerStatement */: // span on debugger keyword return textSpan(node.getChildAt(0)); - case 208 /* IfStatement */: + case 211 /* IfStatement */: // set on if(..) span return textSpanEndingAtNextToken(node, node.expression); - case 219 /* LabeledStatement */: + case 222 /* LabeledStatement */: // span in statement return spanInNode(node.statement); - case 215 /* BreakStatement */: - case 214 /* ContinueStatement */: + case 218 /* BreakStatement */: + case 217 /* ContinueStatement */: // On break or continue keyword and label if present return textSpan(node.getChildAt(0), node.label); - case 211 /* ForStatement */: + case 214 /* ForStatement */: return spanInForStatement(node); - case 212 /* ForInStatement */: + case 215 /* ForInStatement */: // span of for (a in ...) return textSpanEndingAtNextToken(node, node.expression); - case 213 /* ForOfStatement */: + case 216 /* ForOfStatement */: // span in initializer return spanInInitializerOfForLike(node); - case 218 /* SwitchStatement */: + case 221 /* SwitchStatement */: // span on switch(...) return textSpanEndingAtNextToken(node, node.expression); - case 253 /* CaseClause */: - case 254 /* DefaultClause */: + case 257 /* CaseClause */: + case 258 /* DefaultClause */: // span in first statement of the clause return spanInNode(node.statements[0]); - case 221 /* TryStatement */: + case 224 /* TryStatement */: // span in try block return spanInBlock(node.tryBlock); - case 220 /* ThrowStatement */: + case 223 /* ThrowStatement */: // span in throw ... return textSpan(node, node.expression); - case 240 /* ExportAssignment */: + case 243 /* ExportAssignment */: // span on export = id return textSpan(node, node.expression); - case 234 /* ImportEqualsDeclaration */: + case 237 /* ImportEqualsDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleReference); - case 235 /* ImportDeclaration */: + case 238 /* ImportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 241 /* ExportDeclaration */: + case 244 /* ExportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 230 /* ModuleDeclaration */: + case 233 /* ModuleDeclaration */: // span on complete module if it is instantiated if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return undefined; } - case 226 /* ClassDeclaration */: - case 229 /* EnumDeclaration */: - case 260 /* EnumMember */: - case 174 /* BindingElement */: + // falls through + case 229 /* ClassDeclaration */: + case 232 /* EnumDeclaration */: + case 264 /* EnumMember */: + case 176 /* BindingElement */: // span on complete node return textSpan(node); - case 217 /* WithStatement */: + case 220 /* WithStatement */: // span in statement return spanInNode(node.statement); - case 145 /* Decorator */: + case 147 /* Decorator */: return spanInNodeArray(node.parent.decorators); - case 172 /* ObjectBindingPattern */: - case 173 /* ArrayBindingPattern */: + case 174 /* ObjectBindingPattern */: + case 175 /* ArrayBindingPattern */: return spanInBindingPattern(node); // No breakpoint in interface, type alias - case 227 /* InterfaceDeclaration */: - case 228 /* TypeAliasDeclaration */: + case 230 /* InterfaceDeclaration */: + case 231 /* TypeAliasDeclaration */: return undefined; // Tokens: - case 24 /* SemicolonToken */: + case 25 /* SemicolonToken */: case 1 /* EndOfFileToken */: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile)); - case 25 /* CommaToken */: + case 26 /* CommaToken */: return spanInPreviousNode(node); - case 16 /* OpenBraceToken */: + case 17 /* OpenBraceToken */: return spanInOpenBraceToken(node); - case 17 /* CloseBraceToken */: + case 18 /* CloseBraceToken */: return spanInCloseBraceToken(node); - case 21 /* CloseBracketToken */: + case 22 /* CloseBracketToken */: return spanInCloseBracketToken(node); - case 18 /* OpenParenToken */: + case 19 /* OpenParenToken */: return spanInOpenParenToken(node); - case 19 /* CloseParenToken */: + case 20 /* CloseParenToken */: return spanInCloseParenToken(node); - case 55 /* ColonToken */: + case 56 /* ColonToken */: return spanInColonToken(node); - case 28 /* GreaterThanToken */: - case 26 /* LessThanToken */: + case 29 /* GreaterThanToken */: + case 27 /* LessThanToken */: return spanInGreaterThanOrLessThanToken(node); // Keywords: - case 105 /* WhileKeyword */: + case 106 /* WhileKeyword */: return spanInWhileKeyword(node); - case 81 /* ElseKeyword */: - case 73 /* CatchKeyword */: - case 86 /* FinallyKeyword */: + case 82 /* ElseKeyword */: + case 74 /* CatchKeyword */: + case 87 /* FinallyKeyword */: return spanInNextNode(node); - case 140 /* OfKeyword */: + case 142 /* OfKeyword */: return spanInOfKeyword(node); default: // Destructuring pattern in destructuring assignment @@ -80337,14 +87176,14 @@ var ts; // Set breakpoint on identifier element of destructuring pattern // a or ...c or d: x from // [a, b, ...c] or { a, b } or { d: x } from destructuring pattern - if ((node.kind === 70 /* Identifier */ || - node.kind == 196 /* SpreadElement */ || - node.kind === 257 /* PropertyAssignment */ || - node.kind === 258 /* ShorthandPropertyAssignment */) && + if ((node.kind === 71 /* Identifier */ || + node.kind === 198 /* SpreadElement */ || + node.kind === 261 /* PropertyAssignment */ || + node.kind === 262 /* ShorthandPropertyAssignment */) && ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) { return textSpan(node); } - if (node.kind === 192 /* BinaryExpression */) { + if (node.kind === 194 /* BinaryExpression */) { var binaryExpression = node; // Set breakpoint in destructuring pattern if its destructuring assignment // [a, b, c] or {a, b, c} of @@ -80353,7 +87192,7 @@ var ts; if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left)) { return spanInArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left); } - if (binaryExpression.operatorToken.kind === 57 /* EqualsToken */ && + if (binaryExpression.operatorToken.kind === 58 /* EqualsToken */ && ts.isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.parent)) { // Set breakpoint on assignment expression element of destructuring pattern // a = expression of @@ -80361,28 +87200,28 @@ var ts; // { a = expression, b, c } = someExpression return textSpan(node); } - if (binaryExpression.operatorToken.kind === 25 /* CommaToken */) { + if (binaryExpression.operatorToken.kind === 26 /* CommaToken */) { return spanInNode(binaryExpression.left); } } if (ts.isPartOfExpression(node)) { switch (node.parent.kind) { - case 209 /* DoStatement */: + case 212 /* DoStatement */: // Set span as if on while keyword return spanInPreviousNode(node); - case 145 /* Decorator */: + case 147 /* Decorator */: // Set breakpoint on the decorator emit return spanInNode(node.parent); - case 211 /* ForStatement */: - case 213 /* ForOfStatement */: + case 214 /* ForStatement */: + case 216 /* ForOfStatement */: return textSpan(node); - case 192 /* BinaryExpression */: - if (node.parent.operatorToken.kind === 25 /* CommaToken */) { + case 194 /* 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 185 /* ArrowFunction */: + case 187 /* ArrowFunction */: if (node.parent.body === node) { // If this is body of arrow function, it is allowed to have the breakpoint return textSpan(node); @@ -80391,13 +87230,13 @@ var ts; } } // If this is name of property assignment, set breakpoint in the initializer - if (node.parent.kind === 257 /* PropertyAssignment */ && + if (node.parent.kind === 261 /* 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 === 182 /* TypeAssertionExpression */ && node.parent.type === node) { + if (node.parent.kind === 184 /* TypeAssertionExpression */ && node.parent.type === node) { return spanInNextNode(node.parent.type); } // return type of function go to previous token @@ -80405,8 +87244,8 @@ var ts; return spanInPreviousNode(node); } // initializer of variable/parameter declaration go to previous node - if ((node.parent.kind === 223 /* VariableDeclaration */ || - node.parent.kind === 144 /* Parameter */)) { + if ((node.parent.kind === 226 /* VariableDeclaration */ || + node.parent.kind === 146 /* Parameter */)) { var paramOrVarDecl = node.parent; if (paramOrVarDecl.initializer === node || paramOrVarDecl.type === node || @@ -80414,7 +87253,7 @@ var ts; return spanInPreviousNode(node); } } - if (node.parent.kind === 192 /* BinaryExpression */) { + if (node.parent.kind === 194 /* BinaryExpression */) { var binaryExpression = node.parent; if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left) && (binaryExpression.right === node || @@ -80428,8 +87267,8 @@ var ts; } } function textSpanFromVariableDeclaration(variableDeclaration) { - var declarations = variableDeclaration.parent.declarations; - if (declarations && declarations[0] === variableDeclaration) { + if (variableDeclaration.parent.kind === 227 /* VariableDeclarationList */ && + variableDeclaration.parent.declarations[0] === variableDeclaration) { // First declaration - include let keyword return textSpan(ts.findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent), variableDeclaration); } @@ -80440,7 +87279,7 @@ var ts; } function spanInVariableDeclaration(variableDeclaration) { // If declaration of for in statement, just set the span in parent - if (variableDeclaration.parent.parent.kind === 212 /* ForInStatement */) { + if (variableDeclaration.parent.parent.kind === 215 /* ForInStatement */) { return spanInNode(variableDeclaration.parent.parent); } // If this is a destructuring pattern, set breakpoint in binding pattern @@ -80451,11 +87290,11 @@ var ts; // or its declaration from 'for of' if (variableDeclaration.initializer || ts.hasModifier(variableDeclaration, 1 /* Export */) || - variableDeclaration.parent.parent.kind === 213 /* ForOfStatement */) { + variableDeclaration.parent.parent.kind === 216 /* ForOfStatement */) { return textSpanFromVariableDeclaration(variableDeclaration); } - var declarations = variableDeclaration.parent.declarations; - if (declarations && declarations[0] !== variableDeclaration) { + if (variableDeclaration.parent.kind === 227 /* VariableDeclarationList */ && + 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 // we would like to set breakpoint in last binding element if that's the case, @@ -80491,7 +87330,7 @@ var ts; } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { return ts.hasModifier(functionDeclaration, 1 /* Export */) || - (functionDeclaration.parent.kind === 226 /* ClassDeclaration */ && functionDeclaration.kind !== 150 /* Constructor */); + (functionDeclaration.parent.kind === 229 /* ClassDeclaration */ && functionDeclaration.kind !== 152 /* Constructor */); } function spanInFunctionDeclaration(functionDeclaration) { // No breakpoints in the function signature @@ -80514,25 +87353,26 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 230 /* ModuleDeclaration */: + case 233 /* ModuleDeclaration */: if (ts.getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { return undefined; } + // falls through // Set on parent if on same line otherwise on first statement - case 210 /* WhileStatement */: - case 208 /* IfStatement */: - case 212 /* ForInStatement */: + case 213 /* WhileStatement */: + case 211 /* IfStatement */: + case 215 /* 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 211 /* ForStatement */: - case 213 /* ForOfStatement */: + case 214 /* ForStatement */: + case 216 /* 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 === 224 /* VariableDeclarationList */) { + if (forLikeStatement.initializer.kind === 227 /* VariableDeclarationList */) { // Declaration list - set breakpoint in first declaration var variableDeclarationList = forLikeStatement.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -80557,23 +87397,23 @@ var ts; } function spanInBindingPattern(bindingPattern) { // Set breakpoint in first binding element - var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 198 /* OmittedExpression */ ? element : undefined; }); + var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 200 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } // Empty binding pattern of binding element, set breakpoint on binding element - if (bindingPattern.parent.kind === 174 /* BindingElement */) { + if (bindingPattern.parent.kind === 176 /* BindingElement */) { return textSpan(bindingPattern.parent); } // Variable declaration is used as the span return textSpanFromVariableDeclaration(bindingPattern.parent); } function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node) { - ts.Debug.assert(node.kind !== 173 /* ArrayBindingPattern */ && node.kind !== 172 /* ObjectBindingPattern */); - var elements = node.kind === 175 /* ArrayLiteralExpression */ ? + ts.Debug.assert(node.kind !== 175 /* ArrayBindingPattern */ && node.kind !== 174 /* ObjectBindingPattern */); + var elements = node.kind === 177 /* ArrayLiteralExpression */ ? node.elements : node.properties; - var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 198 /* OmittedExpression */ ? element : undefined; }); + var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 200 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } @@ -80581,18 +87421,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 === 192 /* BinaryExpression */ ? node.parent : node); + return textSpan(node.parent.kind === 194 /* BinaryExpression */ ? node.parent : node); } // Tokens: function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 229 /* EnumDeclaration */: + case 232 /* EnumDeclaration */: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 226 /* ClassDeclaration */: + case 229 /* ClassDeclaration */: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 232 /* CaseBlock */: + case 235 /* CaseBlock */: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } // Default to parent node @@ -80600,24 +87440,25 @@ var ts; } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 231 /* ModuleBlock */: + case 234 /* ModuleBlock */: // If this is not an instantiated module block, no bp span if (ts.getModuleInstanceState(node.parent.parent) !== 1 /* Instantiated */) { return undefined; } - case 229 /* EnumDeclaration */: - case 226 /* ClassDeclaration */: + // falls through + case 232 /* EnumDeclaration */: + case 229 /* ClassDeclaration */: // Span on close brace token return textSpan(node); - case 204 /* Block */: + case 207 /* Block */: if (ts.isFunctionBlock(node.parent)) { // Span on close brace token return textSpan(node); } - // fall through - case 256 /* CatchClause */: + // falls through + case 260 /* CatchClause */: return spanInNode(ts.lastOrUndefined(node.parent.statements)); - case 232 /* CaseBlock */: + case 235 /* CaseBlock */: // breakpoint in last statement of the last clause var caseBlock = node.parent; var lastClause = ts.lastOrUndefined(caseBlock.clauses); @@ -80625,7 +87466,7 @@ var ts; return spanInNode(ts.lastOrUndefined(lastClause.statements)); } return undefined; - case 172 /* ObjectBindingPattern */: + case 174 /* 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); @@ -80641,7 +87482,7 @@ var ts; } function spanInCloseBracketToken(node) { switch (node.parent.kind) { - case 173 /* ArrayBindingPattern */: + case 175 /* 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); @@ -80656,12 +87497,12 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 209 /* DoStatement */ || - node.parent.kind === 179 /* CallExpression */ || - node.parent.kind === 180 /* NewExpression */) { + if (node.parent.kind === 212 /* DoStatement */ || + node.parent.kind === 181 /* CallExpression */ || + node.parent.kind === 182 /* NewExpression */) { return spanInPreviousNode(node); } - if (node.parent.kind === 183 /* ParenthesizedExpression */) { + if (node.parent.kind === 185 /* ParenthesizedExpression */) { return spanInNextNode(node); } // Default to parent node @@ -80670,21 +87511,21 @@ var ts; function spanInCloseParenToken(node) { // Is this close paren token of parameter list, set span in previous token switch (node.parent.kind) { - case 184 /* FunctionExpression */: - case 225 /* FunctionDeclaration */: - case 185 /* ArrowFunction */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 150 /* Constructor */: - case 210 /* WhileStatement */: - case 209 /* DoStatement */: - case 211 /* ForStatement */: - case 213 /* ForOfStatement */: - case 179 /* CallExpression */: - case 180 /* NewExpression */: - case 183 /* ParenthesizedExpression */: + case 186 /* FunctionExpression */: + case 228 /* FunctionDeclaration */: + case 187 /* ArrowFunction */: + case 151 /* MethodDeclaration */: + case 150 /* MethodSignature */: + case 153 /* GetAccessor */: + case 154 /* SetAccessor */: + case 152 /* Constructor */: + case 213 /* WhileStatement */: + case 212 /* DoStatement */: + case 214 /* ForStatement */: + case 216 /* ForOfStatement */: + case 181 /* CallExpression */: + case 182 /* NewExpression */: + case 185 /* ParenthesizedExpression */: return spanInPreviousNode(node); // Default to parent node default: @@ -80694,20 +87535,20 @@ var ts; function spanInColonToken(node) { // Is this : specifying return annotation of the function declaration if (ts.isFunctionLike(node.parent) || - node.parent.kind === 257 /* PropertyAssignment */ || - node.parent.kind === 144 /* Parameter */) { + node.parent.kind === 261 /* PropertyAssignment */ || + node.parent.kind === 146 /* Parameter */) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 182 /* TypeAssertionExpression */) { + if (node.parent.kind === 184 /* TypeAssertionExpression */) { return spanInNextNode(node); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 209 /* DoStatement */) { + if (node.parent.kind === 212 /* DoStatement */) { // Set span on while expression return textSpanEndingAtNextToken(node, node.parent.expression); } @@ -80715,7 +87556,7 @@ var ts; return spanInNode(node.parent); } function spanInOfKeyword(node) { - if (node.parent.kind === 213 /* ForOfStatement */) { + if (node.parent.kind === 216 /* ForOfStatement */) { // Set using next token return spanInNextNode(node); } @@ -80727,6 +87568,26 @@ var ts; BreakpointResolver.spanInSourceFileAtLocation = spanInSourceFileAtLocation; })(BreakpointResolver = ts.BreakpointResolver || (ts.BreakpointResolver = {})); })(ts || (ts = {})); +/// +/// +var ts; +(function (ts) { + /** + * Transform one or more nodes using the supplied transformers. + * @param source A single `Node` or an array of `Node` objects. + * @param transformers An array of `TransformerFactory` callbacks used to process the transformation. + * @param compilerOptions Optional compiler options. + */ + function transform(source, transformers, compilerOptions) { + var diagnostics = []; + compilerOptions = ts.fixupCompilerOptions(compilerOptions, diagnostics); + var nodes = ts.isArray(source) ? source : [source]; + var result = ts.transformNodes(/*resolver*/ undefined, /*emitHost*/ undefined, compilerOptions, nodes, transformers, /*allowDtsFiles*/ true); + result.diagnostics = ts.concatenate(result.diagnostics, diagnostics); + return result; + } + ts.transform = transform; +})(ts || (ts = {})); // // Copyright (c) Microsoft Corporation. All rights reserved. // @@ -80768,8 +87629,7 @@ var ts; ScriptSnapshotShimAdapter.prototype.getChangeRange = function (oldSnapshot) { var oldSnapshotShim = oldSnapshot; var encoded = this.scriptSnapshotShim.getChangeRange(oldSnapshotShim.scriptSnapshotShim); - // TODO: should this be '==='? - if (encoded == null) { + if (encoded === null) { return null; } var decoded = JSON.parse(encoded); @@ -80842,11 +87702,13 @@ var ts; }; LanguageServiceShimHostAdapter.prototype.getCompilationSettings = function () { var settingsJson = this.shimHost.getCompilationSettings(); - // TODO: should this be '==='? - if (settingsJson == null || settingsJson == "") { + if (settingsJson === null || settingsJson === "") { throw Error("LanguageServiceShimHostAdapter.getCompilationSettings: empty compilationSettings"); } - return JSON.parse(settingsJson); + var compilerOptions = JSON.parse(settingsJson); + // permit language service to handle all files (filtering should be performed on the host side) + compilerOptions.allowNonTsExtensions = true; + return compilerOptions; }; LanguageServiceShimHostAdapter.prototype.getScriptFileNames = function () { var encoded = this.shimHost.getScriptFileNames(); @@ -80869,7 +87731,7 @@ var ts; }; LanguageServiceShimHostAdapter.prototype.getLocalizedDiagnosticMessages = function () { var diagnosticMessagesJson = this.shimHost.getLocalizedDiagnosticMessages(); - if (diagnosticMessagesJson == null || diagnosticMessagesJson == "") { + if (diagnosticMessagesJson === null || diagnosticMessagesJson === "") { return null; } try { @@ -80882,7 +87744,7 @@ var ts; }; LanguageServiceShimHostAdapter.prototype.getCancellationToken = function () { var hostCancellationToken = this.shimHost.getCancellationToken(); - return new ThrottledCancellationToken(hostCancellationToken); + return new ts.ThrottledCancellationToken(hostCancellationToken); }; LanguageServiceShimHostAdapter.prototype.getCurrentDirectory = function () { return this.shimHost.getCurrentDirectory(); @@ -80906,27 +87768,6 @@ var ts; return LanguageServiceShimHostAdapter; }()); ts.LanguageServiceShimHostAdapter = LanguageServiceShimHostAdapter; - /** A cancellation that throttles calls to the host */ - var ThrottledCancellationToken = (function () { - function ThrottledCancellationToken(hostCancellationToken) { - this.hostCancellationToken = hostCancellationToken; - // Store when we last tried to cancel. Checking cancellation can be expensive (as we have - // to marshall over to the host layer). So we only bother actually checking once enough - // time has passed. - this.lastCancellationCheckTime = 0; - } - ThrottledCancellationToken.prototype.isCancellationRequested = function () { - var time = ts.timestamp(); - var duration = Math.abs(time - this.lastCancellationCheckTime); - if (duration > 10) { - // Check no more than once every 10 ms. - this.lastCancellationCheckTime = time; - return this.hostCancellationToken.isCancellationRequested(); - } - return false; - }; - return ThrottledCancellationToken; - }()); var CoreServicesShimHostAdapter = (function () { function CoreServicesShimHostAdapter(shimHost) { var _this = this; @@ -81354,11 +88195,8 @@ var ts; var compilerOptions = JSON.parse(compilerOptionsJson); var result = ts.resolveModuleName(moduleName, ts.normalizeSlashes(fileName), compilerOptions, _this.host); var resolvedFileName = result.resolvedModule ? result.resolvedModule.resolvedFileName : undefined; - if (resolvedFileName && !compilerOptions.allowJs && ts.fileExtensionIs(resolvedFileName, ".js")) { - return { - resolvedFileName: undefined, - failedLookupLocations: [] - }; + if (result.resolvedModule && result.resolvedModule.extension !== ts.Extension.Ts && result.resolvedModule.extension !== ts.Extension.Tsx && result.resolvedModule.extension !== ts.Extension.Dts) { + resolvedFileName = undefined; } return { resolvedFileName: resolvedFileName, @@ -81504,7 +88342,7 @@ var ts; this._shims.push(shim); }; TypeScriptServicesFactory.prototype.unregisterShim = function (shim) { - for (var i = 0, n = this._shims.length; i < n; i++) { + for (var i = 0; i < this._shims.length; i++) { if (this._shims[i] === shim) { delete this._shims[i]; return; @@ -81533,7 +88371,7 @@ var TypeScript; // 'toolsVersion' gets consumed by the managed side, so it's not unused. // TODO: it should be moved into a namespace though. /* @internal */ -var toolsVersion = "2.1"; +var toolsVersion = "2.3"; // MONACOCHANGE // Defining the entire module name because r.js has an issue and cannot bundle this file diff --git a/package.json b/package.json index f967f80a..e938b3e0 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,6 @@ "monaco-editor-core": "^0.8.0", "object-assign": "^4.1.0", "rimraf": "^2.5.2", - "typescript": "2.1.5" + "typescript": "2.3.4" } }