massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-tsserver / node_modules / typescript / lib / lib.es5.d.ts
index 76564c9c6f52c930956c3308de2afe3f9a830ae2..8d9cf1eb22b00497bdfab38547fb5c4321b586be 100644 (file)
@@ -33,12 +33,12 @@ declare function eval(x: string): any;
 \r
 /**\r
  * Converts a string to an integer.\r
- * @param s A string to convert into a number.\r
- * @param radix A value between 2 and 36 that specifies the base of the number in numString.\r
+ * @param string A string to convert into a number.\r
+ * @param radix A value between 2 and 36 that specifies the base of the number in `string`.\r
  * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\r
  * All other strings are considered decimal.\r
  */\r
-declare function parseInt(s: string, radix?: number): number;\r
+declare function parseInt(string: string, radix?: number): number;\r
 \r
 /**\r
  * Converts a string to a floating-point number.\r
@@ -84,12 +84,14 @@ declare function encodeURIComponent(uriComponent: string | number | boolean): st
 \r
 /**\r
  * Computes a new string in which certain characters have been replaced by a hexadecimal escape sequence.\r
+ * @deprecated A legacy feature for browser compatibility\r
  * @param string A string value\r
  */\r
 declare function escape(string: string): string;\r
 \r
 /**\r
  * Computes a new string in which hexadecimal escape sequences are replaced with the character that it represents.\r
+ * @deprecated A legacy feature for browser compatibility\r
  * @param string A string value\r
  */\r
 declare function unescape(string: string): string;\r
@@ -197,14 +199,14 @@ interface ObjectConstructor {
      * @param p The property name.\r
      * @param attributes Descriptor for the property. It can be for a data property or an accessor property.\r
      */\r
-    defineProperty(o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>): any;\r
+    defineProperty<T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>): T;\r
 \r
     /**\r
      * Adds one or more properties to an object, and/or modifies attributes of existing properties.\r
      * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object.\r
      * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property.\r
      */\r
-    defineProperties(o: any, properties: PropertyDescriptorMap & ThisType<any>): any;\r
+    defineProperties<T>(o: T, properties: PropertyDescriptorMap & ThisType<any>): T;\r
 \r
     /**\r
      * Prevents the modification of attributes of existing properties, and prevents the addition of new properties.\r
@@ -214,13 +216,13 @@ interface ObjectConstructor {
 \r
     /**\r
      * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.\r
-     * @param o Object on which to lock the attributes.\r
+     * @param a Object on which to lock the attributes.\r
      */\r
     freeze<T>(a: T[]): readonly T[];\r
 \r
     /**\r
      * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.\r
-     * @param o Object on which to lock the attributes.\r
+     * @param f Object on which to lock the attributes.\r
      */\r
     freeze<T extends Function>(f: T): T;\r
 \r
@@ -503,6 +505,7 @@ interface String {
     // IE extensions\r
     /**\r
      * Gets a substring beginning at the specified location and having the specified length.\r
+     * @deprecated A legacy feature for browser compatibility\r
      * @param from The starting position of the desired substring. The index of the first character in the string is zero.\r
      * @param length The number of characters to include in the returned substring.\r
      */\r
@@ -614,6 +617,23 @@ interface TemplateStringsArray extends ReadonlyArray<string> {
 interface ImportMeta {\r
 }\r
 \r
+/**\r
+ * The type for the optional second argument to `import()`.\r
+ *\r
+ * If your host environment supports additional options, this type may be\r
+ * augmented via interface merging.\r
+ */\r
+interface ImportCallOptions {\r
+    assert?: ImportAssertions;\r
+}\r
+\r
+/**\r
+ * The type for the `assert` property of the optional second argument to `import()`.\r
+ */\r
+interface ImportAssertions {\r
+    [key: string]: string;\r
+}\r
+\r
 interface Math {\r
     /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */\r
     readonly E: number;\r
@@ -944,7 +964,8 @@ interface RegExp {
     lastIndex: number;\r
 \r
     // Non-standard extensions\r
-    compile(): this;\r
+    /** @deprecated A legacy feature for browser compatibility */\r
+    compile(pattern: string, flags?: string): this;\r
 }\r
 \r
 interface RegExpConstructor {\r
@@ -955,16 +976,44 @@ interface RegExpConstructor {
     readonly prototype: RegExp;\r
 \r
     // Non-standard extensions\r
+    /** @deprecated A legacy feature for browser compatibility */\r
     $1: string;\r
+    /** @deprecated A legacy feature for browser compatibility */\r
     $2: string;\r
+    /** @deprecated A legacy feature for browser compatibility */\r
     $3: string;\r
+    /** @deprecated A legacy feature for browser compatibility */\r
     $4: string;\r
+    /** @deprecated A legacy feature for browser compatibility */\r
     $5: string;\r
+    /** @deprecated A legacy feature for browser compatibility */\r
     $6: string;\r
+    /** @deprecated A legacy feature for browser compatibility */\r
     $7: string;\r
+    /** @deprecated A legacy feature for browser compatibility */\r
     $8: string;\r
+    /** @deprecated A legacy feature for browser compatibility */\r
     $9: string;\r
+    /** @deprecated A legacy feature for browser compatibility */\r
+    input: string;\r
+    /** @deprecated A legacy feature for browser compatibility */\r
+    $_: string;\r
+    /** @deprecated A legacy feature for browser compatibility */\r
     lastMatch: string;\r
+    /** @deprecated A legacy feature for browser compatibility */\r
+    "$&": string;\r
+    /** @deprecated A legacy feature for browser compatibility */\r
+    lastParen: string;\r
+    /** @deprecated A legacy feature for browser compatibility */\r
+    "$+": string;\r
+    /** @deprecated A legacy feature for browser compatibility */\r
+    leftContext: string;\r
+    /** @deprecated A legacy feature for browser compatibility */\r
+    "$`": string;\r
+    /** @deprecated A legacy feature for browser compatibility */\r
+    rightContext: string;\r
+    /** @deprecated A legacy feature for browser compatibility */\r
+    "$'": string;\r
 }\r
 \r
 declare var RegExp: RegExpConstructor;\r
@@ -1093,7 +1142,7 @@ interface ReadonlyArray<T> {
      */\r
     toString(): string;\r
     /**\r
-     * Returns a string representation of an array. The elements are converted to string using their toLocalString methods.\r
+     * Returns a string representation of an array. The elements are converted to string using their toLocaleString methods.\r
      */\r
     toLocaleString(): string;\r
     /**\r
@@ -1227,7 +1276,7 @@ interface Array<T> {
      */\r
     toString(): string;\r
     /**\r
-     * Returns a string representation of an array. The elements are converted to string using their toLocalString methods.\r
+     * Returns a string representation of an array. The elements are converted to string using their toLocaleString methods.\r
      */\r
     toLocaleString(): string;\r
     /**\r
@@ -1281,7 +1330,7 @@ interface Array<T> {
      * Sorts an array in place.\r
      * This method mutates the array and returns a reference to the same array.\r
      * @param compareFn Function used to determine the order of the elements. It is expected to return\r
-     * a negative value if first argument is less than second argument, zero if they're equal and a positive\r
+     * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive\r
      * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.\r
      * ```ts\r
      * [11,2,22,1].sort((a, b) => a - b)\r
@@ -1460,6 +1509,17 @@ interface Promise<T> {
     catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>;\r
 }\r
 \r
+/**\r
+ * Recursively unwraps the "awaited type" of a type. Non-promise "thenables" should resolve to `never`. This emulates the behavior of `await`.\r
+ */\r
+type Awaited<T> =\r
+    T extends null | undefined ? T : // special case for `null | undefined` when not in `--strictNullChecks` mode\r
+        T extends object & { then(onfulfilled: infer F): any } ? // `await` only unwraps object types with a callable `then`. Non-object types are not unwrapped\r
+            F extends ((value: infer V) => any) ? // if the argument to `then` is callable, extracts the argument\r
+                Awaited<V> : // recursively unwrap the value\r
+                never : // the argument to `then` was not callable\r
+        T; // non-object or non-thenable\r
+\r
 interface ArrayLike<T> {\r
     readonly length: number;\r
     readonly [n: number]: T;\r
@@ -1528,7 +1588,7 @@ type Parameters<T extends (...args: any) => any> = T extends (...args: infer P)
 /**\r
  * Obtain the parameters of a constructor function type in a tuple\r
  */\r
-type ConstructorParameters<T extends new (...args: any) => any> = T extends new (...args: infer P) => any ? P : never;\r
+type ConstructorParameters<T extends abstract new (...args: any) => any> = T extends abstract new (...args: infer P) => any ? P : never;\r
 \r
 /**\r
  * Obtain the return type of a function type\r
@@ -1538,7 +1598,7 @@ type ReturnType<T extends (...args: any) => any> = T extends (...args: any) => i
 /**\r
  * Obtain the return type of a constructor function type\r
  */\r
-type InstanceType<T extends new (...args: any) => any> = T extends new (...args: any) => infer R ? R : any;\r
+type InstanceType<T extends abstract new (...args: any) => any> = T extends abstract new (...args: any) => infer R ? R : any;\r
 \r
 /**\r
  * Convert string literal type to uppercase\r
@@ -1796,7 +1856,7 @@ interface Int8Array {
     every(predicate: (value: number, index: number, array: Int8Array) => unknown, thisArg?: any): boolean;\r
 \r
     /**\r
-     * Returns the this object after filling the section identified by start and end with value\r
+     * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array\r
      * @param value value to fill array section with\r
      * @param start index to start filling the array at. If start is negative, it is treated as\r
      * length+start where length is the length of the array.\r
@@ -1966,7 +2026,7 @@ interface Int8Array {
      * Sorts an array.\r
      * @param compareFn Function used to determine the order of the elements. It is expected to return\r
      * a negative value if first argument is less than second argument, zero if they're equal and a positive\r
-     * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.\r
+     * value otherwise. If omitted, the elements are sorted in ascending order.\r
      * ```ts\r
      * [11,2,22,1].sort((a, b) => a - b)\r
      * ```\r
@@ -2078,7 +2138,7 @@ interface Uint8Array {
     every(predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any): boolean;\r
 \r
     /**\r
-     * Returns the this object after filling the section identified by start and end with value\r
+     * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array\r
      * @param value value to fill array section with\r
      * @param start index to start filling the array at. If start is negative, it is treated as\r
      * length+start where length is the length of the array.\r
@@ -2248,7 +2308,7 @@ interface Uint8Array {
      * Sorts an array.\r
      * @param compareFn Function used to determine the order of the elements. It is expected to return\r
      * a negative value if first argument is less than second argument, zero if they're equal and a positive\r
-     * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.\r
+     * value otherwise. If omitted, the elements are sorted in ascending order.\r
      * ```ts\r
      * [11,2,22,1].sort((a, b) => a - b)\r
      * ```\r
@@ -2360,7 +2420,7 @@ interface Uint8ClampedArray {
     every(predicate: (value: number, index: number, array: Uint8ClampedArray) => unknown, thisArg?: any): boolean;\r
 \r
     /**\r
-     * Returns the this object after filling the section identified by start and end with value\r
+     * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array\r
      * @param value value to fill array section with\r
      * @param start index to start filling the array at. If start is negative, it is treated as\r
      * length+start where length is the length of the array.\r
@@ -2530,7 +2590,7 @@ interface Uint8ClampedArray {
      * Sorts an array.\r
      * @param compareFn Function used to determine the order of the elements. It is expected to return\r
      * a negative value if first argument is less than second argument, zero if they're equal and a positive\r
-     * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.\r
+     * value otherwise. If omitted, the elements are sorted in ascending order.\r
      * ```ts\r
      * [11,2,22,1].sort((a, b) => a - b)\r
      * ```\r
@@ -2641,7 +2701,7 @@ interface Int16Array {
     every(predicate: (value: number, index: number, array: Int16Array) => unknown, thisArg?: any): boolean;\r
 \r
     /**\r
-     * Returns the this object after filling the section identified by start and end with value\r
+     * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array\r
      * @param value value to fill array section with\r
      * @param start index to start filling the array at. If start is negative, it is treated as\r
      * length+start where length is the length of the array.\r
@@ -2810,7 +2870,7 @@ interface Int16Array {
      * Sorts an array.\r
      * @param compareFn Function used to determine the order of the elements. It is expected to return\r
      * a negative value if first argument is less than second argument, zero if they're equal and a positive\r
-     * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.\r
+     * value otherwise. If omitted, the elements are sorted in ascending order.\r
      * ```ts\r
      * [11,2,22,1].sort((a, b) => a - b)\r
      * ```\r
@@ -2923,7 +2983,7 @@ interface Uint16Array {
     every(predicate: (value: number, index: number, array: Uint16Array) => unknown, thisArg?: any): boolean;\r
 \r
     /**\r
-     * Returns the this object after filling the section identified by start and end with value\r
+     * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array\r
      * @param value value to fill array section with\r
      * @param start index to start filling the array at. If start is negative, it is treated as\r
      * length+start where length is the length of the array.\r
@@ -3093,7 +3153,7 @@ interface Uint16Array {
      * Sorts an array.\r
      * @param compareFn Function used to determine the order of the elements. It is expected to return\r
      * a negative value if first argument is less than second argument, zero if they're equal and a positive\r
-     * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.\r
+     * value otherwise. If omitted, the elements are sorted in ascending order.\r
      * ```ts\r
      * [11,2,22,1].sort((a, b) => a - b)\r
      * ```\r
@@ -3205,7 +3265,7 @@ interface Int32Array {
     every(predicate: (value: number, index: number, array: Int32Array) => unknown, thisArg?: any): boolean;\r
 \r
     /**\r
-     * Returns the this object after filling the section identified by start and end with value\r
+     * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array\r
      * @param value value to fill array section with\r
      * @param start index to start filling the array at. If start is negative, it is treated as\r
      * length+start where length is the length of the array.\r
@@ -3375,7 +3435,7 @@ interface Int32Array {
      * Sorts an array.\r
      * @param compareFn Function used to determine the order of the elements. It is expected to return\r
      * a negative value if first argument is less than second argument, zero if they're equal and a positive\r
-     * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.\r
+     * value otherwise. If omitted, the elements are sorted in ascending order.\r
      * ```ts\r
      * [11,2,22,1].sort((a, b) => a - b)\r
      * ```\r
@@ -3487,7 +3547,7 @@ interface Uint32Array {
     every(predicate: (value: number, index: number, array: Uint32Array) => unknown, thisArg?: any): boolean;\r
 \r
     /**\r
-     * Returns the this object after filling the section identified by start and end with value\r
+     * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array\r
      * @param value value to fill array section with\r
      * @param start index to start filling the array at. If start is negative, it is treated as\r
      * length+start where length is the length of the array.\r
@@ -3656,7 +3716,7 @@ interface Uint32Array {
      * Sorts an array.\r
      * @param compareFn Function used to determine the order of the elements. It is expected to return\r
      * a negative value if first argument is less than second argument, zero if they're equal and a positive\r
-     * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.\r
+     * value otherwise. If omitted, the elements are sorted in ascending order.\r
      * ```ts\r
      * [11,2,22,1].sort((a, b) => a - b)\r
      * ```\r
@@ -3768,7 +3828,7 @@ interface Float32Array {
     every(predicate: (value: number, index: number, array: Float32Array) => unknown, thisArg?: any): boolean;\r
 \r
     /**\r
-     * Returns the this object after filling the section identified by start and end with value\r
+     * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array\r
      * @param value value to fill array section with\r
      * @param start index to start filling the array at. If start is negative, it is treated as\r
      * length+start where length is the length of the array.\r
@@ -3938,7 +3998,7 @@ interface Float32Array {
      * Sorts an array.\r
      * @param compareFn Function used to determine the order of the elements. It is expected to return\r
      * a negative value if first argument is less than second argument, zero if they're equal and a positive\r
-     * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.\r
+     * value otherwise. If omitted, the elements are sorted in ascending order.\r
      * ```ts\r
      * [11,2,22,1].sort((a, b) => a - b)\r
      * ```\r
@@ -4051,7 +4111,7 @@ interface Float64Array {
     every(predicate: (value: number, index: number, array: Float64Array) => unknown, thisArg?: any): boolean;\r
 \r
     /**\r
-     * Returns the this object after filling the section identified by start and end with value\r
+     * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array\r
      * @param value value to fill array section with\r
      * @param start index to start filling the array at. If start is negative, it is treated as\r
      * length+start where length is the length of the array.\r
@@ -4221,7 +4281,7 @@ interface Float64Array {
      * Sorts an array.\r
      * @param compareFn Function used to determine the order of the elements. It is expected to return\r
      * a negative value if first argument is less than second argument, zero if they're equal and a positive\r
-     * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.\r
+     * value otherwise. If omitted, the elements are sorted in ascending order.\r
      * ```ts\r
      * [11,2,22,1].sort((a, b) => a - b)\r
      * ```\r
@@ -4283,12 +4343,12 @@ declare var Float64Array: Float64ArrayConstructor;
 \r
 declare namespace Intl {\r
     interface CollatorOptions {\r
-        usage?: string;\r
-        localeMatcher?: string;\r
-        numeric?: boolean;\r
-        caseFirst?: string;\r
-        sensitivity?: string;\r
-        ignorePunctuation?: boolean;\r
+        usage?: string | undefined;\r
+        localeMatcher?: string | undefined;\r
+        numeric?: boolean | undefined;\r
+        caseFirst?: string | undefined;\r
+        sensitivity?: string | undefined;\r
+        ignorePunctuation?: boolean | undefined;\r
     }\r
 \r
     interface ResolvedCollatorOptions {\r
@@ -4312,17 +4372,17 @@ declare namespace Intl {
     };\r
 \r
     interface NumberFormatOptions {\r
-        localeMatcher?: string;\r
-        style?: string;\r
-        currency?: string;\r
-        currencyDisplay?: string;\r
-        currencySign?: string;\r
-        useGrouping?: boolean;\r
-        minimumIntegerDigits?: number;\r
-        minimumFractionDigits?: number;\r
-        maximumFractionDigits?: number;\r
-        minimumSignificantDigits?: number;\r
-        maximumSignificantDigits?: number;\r
+        localeMatcher?: string | undefined;\r
+        style?: string | undefined;\r
+        currency?: string | undefined;\r
+        currencyDisplay?: string | undefined;\r
+        currencySign?: string | undefined;\r
+        useGrouping?: boolean | undefined;\r
+        minimumIntegerDigits?: number | undefined;\r
+        minimumFractionDigits?: number | undefined;\r
+        maximumFractionDigits?: number | undefined;\r
+        minimumSignificantDigits?: number | undefined;\r
+        maximumSignificantDigits?: number | undefined;\r
     }\r
 \r
     interface ResolvedNumberFormatOptions {\r
@@ -4350,19 +4410,19 @@ declare namespace Intl {
     };\r
 \r
     interface DateTimeFormatOptions {\r
-        localeMatcher?: "best fit" | "lookup";\r
-        weekday?: "long" | "short" | "narrow";\r
-        era?: "long" | "short" | "narrow";\r
-        year?: "numeric" | "2-digit";\r
-        month?: "numeric" | "2-digit" | "long" | "short" | "narrow";\r
-        day?: "numeric" | "2-digit";\r
-        hour?: "numeric" | "2-digit";\r
-        minute?: "numeric" | "2-digit";\r
-        second?: "numeric" | "2-digit";\r
-        timeZoneName?: "long" | "short";\r
-        formatMatcher?: "best fit" | "basic";\r
-        hour12?: boolean;\r
-        timeZone?: string;\r
+        localeMatcher?: "best fit" | "lookup" | undefined;\r
+        weekday?: "long" | "short" | "narrow" | undefined;\r
+        era?: "long" | "short" | "narrow" | undefined;\r
+        year?: "numeric" | "2-digit" | undefined;\r
+        month?: "numeric" | "2-digit" | "long" | "short" | "narrow" | undefined;\r
+        day?: "numeric" | "2-digit" | undefined;\r
+        hour?: "numeric" | "2-digit" | undefined;\r
+        minute?: "numeric" | "2-digit" | undefined;\r
+        second?: "numeric" | "2-digit" | undefined;\r
+        timeZoneName?: "long" | "short" | undefined;\r
+        formatMatcher?: "best fit" | "basic" | undefined;\r
+        hour12?: boolean | undefined;\r
+        timeZone?: string | undefined;\r
     }\r
 \r
     interface ResolvedDateTimeFormatOptions {\r