Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-tsserver / node_modules / typescript / lib / lib.es2015.core.d.ts
1 /*! *****************************************************************************
2 Copyright (c) Microsoft Corporation. All rights reserved.
3 Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4 this file except in compliance with the License. You may obtain a copy of the
5 License at http://www.apache.org/licenses/LICENSE-2.0
6
7 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8 KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9 WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10 MERCHANTABLITY OR NON-INFRINGEMENT.
11
12 See the Apache Version 2.0 License for specific language governing permissions
13 and limitations under the License.
14 ***************************************************************************** */
15
16
17
18 /// <reference no-default-lib="true"/>\r
19
20
21 interface Array<T> {\r
22     /**\r
23      * Returns the value of the first element in the array where predicate is true, and undefined\r
24      * otherwise.\r
25      * @param predicate find calls predicate once for each element of the array, in ascending\r
26      * order, until it finds one where predicate returns true. If such an element is found, find\r
27      * immediately returns that element value. Otherwise, find returns undefined.\r
28      * @param thisArg If provided, it will be used as the this value for each invocation of\r
29      * predicate. If it is not provided, undefined is used instead.\r
30      */\r
31     find<S extends T>(predicate: (this: void, value: T, index: number, obj: T[]) => value is S, thisArg?: any): S | undefined;\r
32     find(predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: any): T | undefined;\r
33 \r
34     /**\r
35      * Returns the index of the first element in the array where predicate is true, and -1\r
36      * otherwise.\r
37      * @param predicate find calls predicate once for each element of the array, in ascending\r
38      * order, until it finds one where predicate returns true. If such an element is found,\r
39      * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\r
40      * @param thisArg If provided, it will be used as the this value for each invocation of\r
41      * predicate. If it is not provided, undefined is used instead.\r
42      */\r
43     findIndex(predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: any): number;\r
44 \r
45     /**\r
46      * Returns the this object after filling the section identified by start and end with value\r
47      * @param value value to fill array section with\r
48      * @param start index to start filling the array at. If start is negative, it is treated as\r
49      * length+start where length is the length of the array.\r
50      * @param end index to stop filling the array at. If end is negative, it is treated as\r
51      * length+end.\r
52      */\r
53     fill(value: T, start?: number, end?: number): this;\r
54 \r
55     /**\r
56      * Returns the this object after copying a section of the array identified by start and end\r
57      * to the same array starting at position target\r
58      * @param target If target is negative, it is treated as length+target where length is the\r
59      * length of the array.\r
60      * @param start If start is negative, it is treated as length+start. If end is negative, it\r
61      * is treated as length+end.\r
62      * @param end If not specified, length of the this object is used as its default value.\r
63      */\r
64     copyWithin(target: number, start: number, end?: number): this;\r
65 }\r
66 \r
67 interface ArrayConstructor {\r
68     /**\r
69      * Creates an array from an array-like object.\r
70      * @param arrayLike An array-like object to convert to an array.\r
71      */\r
72     from<T>(arrayLike: ArrayLike<T>): T[];\r
73 \r
74     /**\r
75      * Creates an array from an iterable object.\r
76      * @param arrayLike An array-like object to convert to an array.\r
77      * @param mapfn A mapping function to call on every element of the array.\r
78      * @param thisArg Value of 'this' used to invoke the mapfn.\r
79      */\r
80     from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];\r
81 \r
82     /**\r
83      * Returns a new array from a set of elements.\r
84      * @param items A set of elements to include in the new array object.\r
85      */\r
86     of<T>(...items: T[]): T[];\r
87 }\r
88 \r
89 interface DateConstructor {\r
90     new (value: number | string | Date): Date;\r
91 }\r
92 \r
93 interface Function {\r
94     /**\r
95      * Returns the name of the function. Function names are read-only and can not be changed.\r
96      */\r
97     readonly name: string;\r
98 }\r
99 \r
100 interface Math {\r
101     /**\r
102      * Returns the number of leading zero bits in the 32-bit binary representation of a number.\r
103      * @param x A numeric expression.\r
104      */\r
105     clz32(x: number): number;\r
106 \r
107     /**\r
108      * Returns the result of 32-bit multiplication of two numbers.\r
109      * @param x First number\r
110      * @param y Second number\r
111      */\r
112     imul(x: number, y: number): number;\r
113 \r
114     /**\r
115      * Returns the sign of the x, indicating whether x is positive, negative or zero.\r
116      * @param x The numeric expression to test\r
117      */\r
118     sign(x: number): number;\r
119 \r
120     /**\r
121      * Returns the base 10 logarithm of a number.\r
122      * @param x A numeric expression.\r
123      */\r
124     log10(x: number): number;\r
125 \r
126     /**\r
127      * Returns the base 2 logarithm of a number.\r
128      * @param x A numeric expression.\r
129      */\r
130     log2(x: number): number;\r
131 \r
132     /**\r
133      * Returns the natural logarithm of 1 + x.\r
134      * @param x A numeric expression.\r
135      */\r
136     log1p(x: number): number;\r
137 \r
138     /**\r
139      * Returns the result of (e^x - 1), which is an implementation-dependent approximation to\r
140      * subtracting 1 from the exponential function of x (e raised to the power of x, where e\r
141      * is the base of the natural logarithms).\r
142      * @param x A numeric expression.\r
143      */\r
144     expm1(x: number): number;\r
145 \r
146     /**\r
147      * Returns the hyperbolic cosine of a number.\r
148      * @param x A numeric expression that contains an angle measured in radians.\r
149      */\r
150     cosh(x: number): number;\r
151 \r
152     /**\r
153      * Returns the hyperbolic sine of a number.\r
154      * @param x A numeric expression that contains an angle measured in radians.\r
155      */\r
156     sinh(x: number): number;\r
157 \r
158     /**\r
159      * Returns the hyperbolic tangent of a number.\r
160      * @param x A numeric expression that contains an angle measured in radians.\r
161      */\r
162     tanh(x: number): number;\r
163 \r
164     /**\r
165      * Returns the inverse hyperbolic cosine of a number.\r
166      * @param x A numeric expression that contains an angle measured in radians.\r
167      */\r
168     acosh(x: number): number;\r
169 \r
170     /**\r
171      * Returns the inverse hyperbolic sine of a number.\r
172      * @param x A numeric expression that contains an angle measured in radians.\r
173      */\r
174     asinh(x: number): number;\r
175 \r
176     /**\r
177      * Returns the inverse hyperbolic tangent of a number.\r
178      * @param x A numeric expression that contains an angle measured in radians.\r
179      */\r
180     atanh(x: number): number;\r
181 \r
182     /**\r
183      * Returns the square root of the sum of squares of its arguments.\r
184      * @param values Values to compute the square root for.\r
185      *     If no arguments are passed, the result is +0.\r
186      *     If there is only one argument, the result is the absolute value.\r
187      *     If any argument is +Infinity or -Infinity, the result is +Infinity.\r
188      *     If any argument is NaN, the result is NaN.\r
189      *     If all arguments are either +0 or −0, the result is +0.\r
190      */\r
191     hypot(...values: number[]): number;\r
192 \r
193     /**\r
194      * Returns the integral part of the a numeric expression, x, removing any fractional digits.\r
195      * If x is already an integer, the result is x.\r
196      * @param x A numeric expression.\r
197      */\r
198     trunc(x: number): number;\r
199 \r
200     /**\r
201      * Returns the nearest single precision float representation of a number.\r
202      * @param x A numeric expression.\r
203      */\r
204     fround(x: number): number;\r
205 \r
206     /**\r
207      * Returns an implementation-dependent approximation to the cube root of number.\r
208      * @param x A numeric expression.\r
209      */\r
210     cbrt(x: number): number;\r
211 }\r
212 \r
213 interface NumberConstructor {\r
214     /**\r
215      * The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1\r
216      * that is representable as a Number value, which is approximately:\r
217      * 2.2204460492503130808472633361816 x 10‍−‍16.\r
218      */\r
219     readonly EPSILON: number;\r
220 \r
221     /**\r
222      * Returns true if passed value is finite.\r
223      * Unlike the global isFinite, Number.isFinite doesn't forcibly convert the parameter to a\r
224      * number. Only finite values of the type number, result in true.\r
225      * @param number A numeric value.\r
226      */\r
227     isFinite(number: unknown): boolean;\r
228 \r
229     /**\r
230      * Returns true if the value passed is an integer, false otherwise.\r
231      * @param number A numeric value.\r
232      */\r
233     isInteger(number: unknown): boolean;\r
234 \r
235     /**\r
236      * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a\r
237      * number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter\r
238      * to a number. Only values of the type number, that are also NaN, result in true.\r
239      * @param number A numeric value.\r
240      */\r
241     isNaN(number: unknown): boolean;\r
242 \r
243     /**\r
244      * Returns true if the value passed is a safe integer.\r
245      * @param number A numeric value.\r
246      */\r
247     isSafeInteger(number: unknown): boolean;\r
248 \r
249     /**\r
250      * The value of the largest integer n such that n and n + 1 are both exactly representable as\r
251      * a Number value.\r
252      * The value of Number.MAX_SAFE_INTEGER is 9007199254740991 2^53 − 1.\r
253      */\r
254     readonly MAX_SAFE_INTEGER: number;\r
255 \r
256     /**\r
257      * The value of the smallest integer n such that n and n − 1 are both exactly representable as\r
258      * a Number value.\r
259      * The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)).\r
260      */\r
261     readonly MIN_SAFE_INTEGER: number;\r
262 \r
263     /**\r
264      * Converts a string to a floating-point number.\r
265      * @param string A string that contains a floating-point number.\r
266      */\r
267     parseFloat(string: string): number;\r
268 \r
269     /**\r
270      * Converts A string to an integer.\r
271      * @param s A string to convert into a number.\r
272      * @param radix A value between 2 and 36 that specifies the base of the number in numString.\r
273      * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\r
274      * All other strings are considered decimal.\r
275      */\r
276     parseInt(string: string, radix?: number): number;\r
277 }\r
278 \r
279 interface ObjectConstructor {\r
280     /**\r
281      * Copy the values of all of the enumerable own properties from one or more source objects to a\r
282      * target object. Returns the target object.\r
283      * @param target The target object to copy to.\r
284      * @param source The source object from which to copy properties.\r
285      */\r
286     assign<T, U>(target: T, source: U): T & U;\r
287 \r
288     /**\r
289      * Copy the values of all of the enumerable own properties from one or more source objects to a\r
290      * target object. Returns the target object.\r
291      * @param target The target object to copy to.\r
292      * @param source1 The first source object from which to copy properties.\r
293      * @param source2 The second source object from which to copy properties.\r
294      */\r
295     assign<T, U, V>(target: T, source1: U, source2: V): T & U & V;\r
296 \r
297     /**\r
298      * Copy the values of all of the enumerable own properties from one or more source objects to a\r
299      * target object. Returns the target object.\r
300      * @param target The target object to copy to.\r
301      * @param source1 The first source object from which to copy properties.\r
302      * @param source2 The second source object from which to copy properties.\r
303      * @param source3 The third source object from which to copy properties.\r
304      */\r
305     assign<T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;\r
306 \r
307     /**\r
308      * Copy the values of all of the enumerable own properties from one or more source objects to a\r
309      * target object. Returns the target object.\r
310      * @param target The target object to copy to.\r
311      * @param sources One or more source objects from which to copy properties\r
312      */\r
313     assign(target: object, ...sources: any[]): any;\r
314 \r
315     /**\r
316      * Returns an array of all symbol properties found directly on object o.\r
317      * @param o Object to retrieve the symbols from.\r
318      */\r
319     getOwnPropertySymbols(o: any): symbol[];\r
320 \r
321     /**\r
322      * Returns the names of the enumerable string properties and methods of an object.\r
323      * @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.\r
324      */\r
325     keys(o: {}): string[];\r
326 \r
327     /**\r
328      * Returns true if the values are the same value, false otherwise.\r
329      * @param value1 The first value.\r
330      * @param value2 The second value.\r
331      */\r
332     is(value1: any, value2: any): boolean;\r
333 \r
334     /**\r
335      * Sets the prototype of a specified object o to object proto or null. Returns the object o.\r
336      * @param o The object to change its prototype.\r
337      * @param proto The value of the new prototype or null.\r
338      */\r
339     setPrototypeOf(o: any, proto: object | null): any;\r
340 }\r
341 \r
342 interface ReadonlyArray<T> {\r
343     /**\r
344      * Returns the value of the first element in the array where predicate is true, and undefined\r
345      * otherwise.\r
346      * @param predicate find calls predicate once for each element of the array, in ascending\r
347      * order, until it finds one where predicate returns true. If such an element is found, find\r
348      * immediately returns that element value. Otherwise, find returns undefined.\r
349      * @param thisArg If provided, it will be used as the this value for each invocation of\r
350      * predicate. If it is not provided, undefined is used instead.\r
351      */\r
352     find<S extends T>(predicate: (this: void, value: T, index: number, obj: readonly T[]) => value is S, thisArg?: any): S | undefined;\r
353     find(predicate: (value: T, index: number, obj: readonly T[]) => unknown, thisArg?: any): T | undefined;\r
354 \r
355     /**\r
356      * Returns the index of the first element in the array where predicate is true, and -1\r
357      * otherwise.\r
358      * @param predicate find calls predicate once for each element of the array, in ascending\r
359      * order, until it finds one where predicate returns true. If such an element is found,\r
360      * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\r
361      * @param thisArg If provided, it will be used as the this value for each invocation of\r
362      * predicate. If it is not provided, undefined is used instead.\r
363      */\r
364     findIndex(predicate: (value: T, index: number, obj: readonly T[]) => unknown, thisArg?: any): number;\r
365 }\r
366 \r
367 interface RegExp {\r
368     /**\r
369      * Returns a string indicating the flags of the regular expression in question. This field is read-only.\r
370      * The characters in this string are sequenced and concatenated in the following order:\r
371      *\r
372      *    - "g" for global\r
373      *    - "i" for ignoreCase\r
374      *    - "m" for multiline\r
375      *    - "u" for unicode\r
376      *    - "y" for sticky\r
377      *\r
378      * If no flags are set, the value is the empty string.\r
379      */\r
380     readonly flags: string;\r
381 \r
382     /**\r
383      * Returns a Boolean value indicating the state of the sticky flag (y) used with a regular\r
384      * expression. Default is false. Read-only.\r
385      */\r
386     readonly sticky: boolean;\r
387 \r
388     /**\r
389      * Returns a Boolean value indicating the state of the Unicode flag (u) used with a regular\r
390      * expression. Default is false. Read-only.\r
391      */\r
392     readonly unicode: boolean;\r
393 }\r
394 \r
395 interface RegExpConstructor {\r
396     new (pattern: RegExp | string, flags?: string): RegExp;\r
397     (pattern: RegExp | string, flags?: string): RegExp;\r
398 }\r
399 \r
400 interface String {\r
401     /**\r
402      * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point\r
403      * value of the UTF-16 encoded code point starting at the string element at position pos in\r
404      * the String resulting from converting this object to a String.\r
405      * If there is no element at that position, the result is undefined.\r
406      * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos.\r
407      */\r
408     codePointAt(pos: number): number | undefined;\r
409 \r
410     /**\r
411      * Returns true if searchString appears as a substring of the result of converting this\r
412      * object to a String, at one or more positions that are\r
413      * greater than or equal to position; otherwise, returns false.\r
414      * @param searchString search string\r
415      * @param position If position is undefined, 0 is assumed, so as to search all of the String.\r
416      */\r
417     includes(searchString: string, position?: number): boolean;\r
418 \r
419     /**\r
420      * Returns true if the sequence of elements of searchString converted to a String is the\r
421      * same as the corresponding elements of this object (converted to a String) starting at\r
422      * endPosition – length(this). Otherwise returns false.\r
423      */\r
424     endsWith(searchString: string, endPosition?: number): boolean;\r
425 \r
426     /**\r
427      * Returns the String value result of normalizing the string into the normalization form\r
428      * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms.\r
429      * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default\r
430      * is "NFC"\r
431      */\r
432     normalize(form: "NFC" | "NFD" | "NFKC" | "NFKD"): string;\r
433 \r
434     /**\r
435      * Returns the String value result of normalizing the string into the normalization form\r
436      * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms.\r
437      * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default\r
438      * is "NFC"\r
439      */\r
440     normalize(form?: string): string;\r
441 \r
442     /**\r
443      * Returns a String value that is made from count copies appended together. If count is 0,\r
444      * the empty string is returned.\r
445      * @param count number of copies to append\r
446      */\r
447     repeat(count: number): string;\r
448 \r
449     /**\r
450      * Returns true if the sequence of elements of searchString converted to a String is the\r
451      * same as the corresponding elements of this object (converted to a String) starting at\r
452      * position. Otherwise returns false.\r
453      */\r
454     startsWith(searchString: string, position?: number): boolean;\r
455 \r
456     /**\r
457      * Returns an `<a>` HTML anchor element and sets the name attribute to the text value\r
458      * @param name\r
459      */\r
460     anchor(name: string): string;\r
461 \r
462     /** Returns a `<big>` HTML element */\r
463     big(): string;\r
464 \r
465     /** Returns a `<blink>` HTML element */\r
466     blink(): string;\r
467 \r
468     /** Returns a `<b>` HTML element */\r
469     bold(): string;\r
470 \r
471     /** Returns a `<tt>` HTML element */\r
472     fixed(): string;\r
473 \r
474     /** Returns a `<font>` HTML element and sets the color attribute value */\r
475     fontcolor(color: string): string;\r
476 \r
477     /** Returns a `<font>` HTML element and sets the size attribute value */\r
478     fontsize(size: number): string;\r
479 \r
480     /** Returns a `<font>` HTML element and sets the size attribute value */\r
481     fontsize(size: string): string;\r
482 \r
483     /** Returns an `<i>` HTML element */\r
484     italics(): string;\r
485 \r
486     /** Returns an `<a>` HTML element and sets the href attribute value */\r
487     link(url: string): string;\r
488 \r
489     /** Returns a `<small>` HTML element */\r
490     small(): string;\r
491 \r
492     /** Returns a `<strike>` HTML element */\r
493     strike(): string;\r
494 \r
495     /** Returns a `<sub>` HTML element */\r
496     sub(): string;\r
497 \r
498     /** Returns a `<sup>` HTML element */\r
499     sup(): string;\r
500 }\r
501 \r
502 interface StringConstructor {\r
503     /**\r
504      * Return the String value whose elements are, in order, the elements in the List elements.\r
505      * If length is 0, the empty string is returned.\r
506      */\r
507     fromCodePoint(...codePoints: number[]): string;\r
508 \r
509     /**\r
510      * String.raw is intended for use as a tag function of a Tagged Template String. When called\r
511      * as such the first argument will be a well formed template call site object and the rest\r
512      * parameter will contain the substitution values.\r
513      * @param template A well-formed template string call site representation.\r
514      * @param substitutions A set of substitution values.\r
515      */\r
516     raw(template: TemplateStringsArray, ...substitutions: any[]): string;\r
517 }\r