Skip to content

Commit

Permalink
Merge branch 'master' into js-declaration-fixes-mk2
Browse files Browse the repository at this point in the history
  • Loading branch information
weswigham committed May 8, 2020
2 parents c827007 + e4950b2 commit 128ef93
Show file tree
Hide file tree
Showing 117 changed files with 17,224 additions and 6,914 deletions.
47 changes: 38 additions & 9 deletions lib/cs/diagnosticMessages.generated.json

Large diffs are not rendered by default.

46 changes: 36 additions & 10 deletions lib/de/diagnosticMessages.generated.json

Large diffs are not rendered by default.

44 changes: 35 additions & 9 deletions lib/es/diagnosticMessages.generated.json

Large diffs are not rendered by default.

40 changes: 33 additions & 7 deletions lib/fr/diagnosticMessages.generated.json

Large diffs are not rendered by default.

44 changes: 35 additions & 9 deletions lib/it/diagnosticMessages.generated.json

Large diffs are not rendered by default.

44 changes: 35 additions & 9 deletions lib/ja/diagnosticMessages.generated.json

Large diffs are not rendered by default.

40 changes: 33 additions & 7 deletions lib/ko/diagnosticMessages.generated.json

Large diffs are not rendered by default.

17 changes: 4 additions & 13 deletions lib/lib.es2015.core.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,6 @@ interface Array<T> {
* @param end If not specified, length of the this object is used as its default value.
*/
copyWithin(target: number, start: number, end?: number): this;

/**
* Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
* @param start The zero-based location in the array from which to start removing elements.
* @param deleteCount The number of elements to remove. If deleteCount is omitted, or if its value is equal to or larger
* than array.length - start (that is, if it is equal to or greater than the number of elements left in the array,
* starting at start), then all the elements from start to the end of the array will be deleted.
*/
splice(start: number, deleteCount?: number): T[];
}

interface ArrayConstructor {
Expand Down Expand Up @@ -233,27 +224,27 @@ interface NumberConstructor {
* number. Only finite values of the type number, result in true.
* @param number A numeric value.
*/
isFinite(number: number): boolean;
isFinite(number: unknown): boolean;

/**
* Returns true if the value passed is an integer, false otherwise.
* @param number A numeric value.
*/
isInteger(number: number): boolean;
isInteger(number: unknown): boolean;

/**
* Returns a Boolean value that indicates whether a value is the reserved value NaN (not a
* number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter
* to a number. Only values of the type number, that are also NaN, result in true.
* @param number A numeric value.
*/
isNaN(number: number): boolean;
isNaN(number: unknown): boolean;

/**
* Returns true if the value passed is a safe integer.
* @param number A numeric value.
*/
isSafeInteger(number: number): boolean;
isSafeInteger(number: unknown): boolean;

/**
* The value of the largest integer n such that n and n + 1 are both exactly representable as
Expand Down
2 changes: 1 addition & 1 deletion lib/lib.es2015.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ and limitations under the License.
/// <reference lib="es5" />
/// <reference lib="es2015.core" />
/// <reference lib="es2015.collection" />
/// <reference lib="es2015.iterable" />
/// <reference lib="es2015.generator" />
/// <reference lib="es2015.promise" />
/// <reference lib="es2015.iterable" />
/// <reference lib="es2015.proxy" />
/// <reference lib="es2015.reflect" />
/// <reference lib="es2015.symbol" />
Expand Down
2 changes: 1 addition & 1 deletion lib/lib.es2015.symbol.wellknown.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ interface Int8Array {
}

interface Uint8Array {
readonly [Symbol.toStringTag]: "UInt8Array";
readonly [Symbol.toStringTag]: "Uint8Array";
}

interface Uint8ClampedArray {
Expand Down
2 changes: 1 addition & 1 deletion lib/lib.es2018.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ and limitations under the License.


/// <reference lib="es2017" />
/// <reference lib="es2018.asyncgenerator" />
/// <reference lib="es2018.asynciterable" />
/// <reference lib="es2018.asyncgenerator" />
/// <reference lib="es2018.promise" />
/// <reference lib="es2018.regexp" />
/// <reference lib="es2018.intl" />
170 changes: 16 additions & 154 deletions lib/lib.es2019.array.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ and limitations under the License.
/// <reference no-default-lib="true"/>


type FlatArray<Arr, Depth extends number> = {
"done": Arr,
"recur": Arr extends ReadonlyArray<infer InnerArr>
? FlatArray<InnerArr, [-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][Depth]>
: Arr
}[Depth extends -1 ? "done" : "recur"];

interface ReadonlyArray<T> {

/**
Expand All @@ -42,95 +49,11 @@ interface ReadonlyArray<T> {
*
* @param depth The maximum recursion depth
*/
flat<U>(this:
ReadonlyArray<U[][][][]> |

ReadonlyArray<ReadonlyArray<U[][][]>> |
ReadonlyArray<ReadonlyArray<U[][]>[]> |
ReadonlyArray<ReadonlyArray<U[]>[][]> |
ReadonlyArray<ReadonlyArray<U>[][][]> |

ReadonlyArray<ReadonlyArray<ReadonlyArray<U[][]>>> |
ReadonlyArray<ReadonlyArray<ReadonlyArray<U>[][]>> |
ReadonlyArray<ReadonlyArray<ReadonlyArray<U>>[][]> |
ReadonlyArray<ReadonlyArray<ReadonlyArray<U>[]>[]> |
ReadonlyArray<ReadonlyArray<ReadonlyArray<U[]>>[]> |
ReadonlyArray<ReadonlyArray<ReadonlyArray<U[]>[]>> |

ReadonlyArray<ReadonlyArray<ReadonlyArray<ReadonlyArray<U[]>>>> |
ReadonlyArray<ReadonlyArray<ReadonlyArray<ReadonlyArray<U>[]>>> |
ReadonlyArray<ReadonlyArray<ReadonlyArray<ReadonlyArray<U>>[]>> |
ReadonlyArray<ReadonlyArray<ReadonlyArray<ReadonlyArray<U>>>[]> |

ReadonlyArray<ReadonlyArray<ReadonlyArray<ReadonlyArray<ReadonlyArray<U>>>>>,
depth: 4): U[];

/**
* Returns a new array with all sub-array elements concatenated into it recursively up to the
* specified depth.
*
* @param depth The maximum recursion depth
*/
flat<U>(this:
ReadonlyArray<U[][][]> |

ReadonlyArray<ReadonlyArray<U>[][]> |
ReadonlyArray<ReadonlyArray<U[]>[]> |
ReadonlyArray<ReadonlyArray<U[][]>> |

ReadonlyArray<ReadonlyArray<ReadonlyArray<U[]>>> |
ReadonlyArray<ReadonlyArray<ReadonlyArray<U>[]>> |
ReadonlyArray<ReadonlyArray<ReadonlyArray<U>>[]> |

ReadonlyArray<ReadonlyArray<ReadonlyArray<ReadonlyArray<U>>>>,
depth: 3): U[];

/**
* Returns a new array with all sub-array elements concatenated into it recursively up to the
* specified depth.
*
* @param depth The maximum recursion depth
*/
flat<U>(this:
ReadonlyArray<U[][]> |

ReadonlyArray<ReadonlyArray<U[]>> |
ReadonlyArray<ReadonlyArray<U>[]> |

ReadonlyArray<ReadonlyArray<ReadonlyArray<U>>>,
depth: 2): U[];

/**
* Returns a new array with all sub-array elements concatenated into it recursively up to the
* specified depth.
*
* @param depth The maximum recursion depth
*/
flat<U>(this:
ReadonlyArray<U[]> |
ReadonlyArray<ReadonlyArray<U>>,
depth?: 1
): U[];

/**
* Returns a new array with all sub-array elements concatenated into it recursively up to the
* specified depth.
*
* @param depth The maximum recursion depth
*/
flat<U>(this:
ReadonlyArray<U>,
depth: 0
): U[];

/**
* Returns a new array with all sub-array elements concatenated into it recursively up to the
* specified depth. If no depth is provided, flat method defaults to the depth of 1.
*
* @param depth The maximum recursion depth
*/
flat<U>(depth?: number): any[];
}
flat<A, D extends number = 1>(
this: A,
depth?: D
): FlatArray<A, D>[]
}

interface Array<T> {

Expand All @@ -155,69 +78,8 @@ interface Array<T> {
*
* @param depth The maximum recursion depth
*/
flat<U>(this: U[][][][][][][][], depth: 7): U[];

/**
* Returns a new array with all sub-array elements concatenated into it recursively up to the
* specified depth.
*
* @param depth The maximum recursion depth
*/
flat<U>(this: U[][][][][][][], depth: 6): U[];

/**
* Returns a new array with all sub-array elements concatenated into it recursively up to the
* specified depth.
*
* @param depth The maximum recursion depth
*/
flat<U>(this: U[][][][][][], depth: 5): U[];

/**
* Returns a new array with all sub-array elements concatenated into it recursively up to the
* specified depth.
*
* @param depth The maximum recursion depth
*/
flat<U>(this: U[][][][][], depth: 4): U[];

/**
* Returns a new array with all sub-array elements concatenated into it recursively up to the
* specified depth.
*
* @param depth The maximum recursion depth
*/
flat<U>(this: U[][][][], depth: 3): U[];

/**
* Returns a new array with all sub-array elements concatenated into it recursively up to the
* specified depth.
*
* @param depth The maximum recursion depth
*/
flat<U>(this: U[][][], depth: 2): U[];

/**
* Returns a new array with all sub-array elements concatenated into it recursively up to the
* specified depth.
*
* @param depth The maximum recursion depth
*/
flat<U>(this: U[][], depth?: 1): U[];

/**
* Returns a new array with all sub-array elements concatenated into it recursively up to the
* specified depth.
*
* @param depth The maximum recursion depth
*/
flat<U>(this: U[], depth: 0): U[];

/**
* Returns a new array with all sub-array elements concatenated into it recursively up to the
* specified depth. If no depth is provided, flat method defaults to the depth of 1.
*
* @param depth The maximum recursion depth
*/
flat<U>(depth?: number): any[];
flat<A, D extends number = 1>(
this: A,
depth?: D
): FlatArray<A, D>[]
}
2 changes: 1 addition & 1 deletion lib/lib.es5.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1274,7 +1274,7 @@ interface Array<T> {
* @param start The zero-based location in the array from which to start removing elements.
* @param deleteCount The number of elements to remove.
*/
splice(start: number, deleteCount: number): T[];
splice(start: number, deleteCount?: number): T[];
/**
* Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
* @param start The zero-based location in the array from which to start removing elements.
Expand Down
7 changes: 7 additions & 0 deletions lib/lib.esnext.string.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,11 @@ interface String {
* @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.
*/
replaceAll(searchValue: string | RegExp, replaceValue: string): string;

/**
* Replace all instances of a substring in a string, using a regular expression or search string.
* @param searchValue A string to search for.
* @param replacer A function that returns the replacement text.
*/
replaceAll(searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string;
}
Loading

0 comments on commit 128ef93

Please sign in to comment.