diff --git a/Jakefile.js b/Jakefile.js
index f0cc878ad98ed..17d0b83153a36 100644
--- a/Jakefile.js
+++ b/Jakefile.js
@@ -162,18 +162,53 @@ var harnessSources = harnessCoreSources.concat([
return path.join(serverDirectory, f);
}));
-var librarySourceMap = [
- { target: "lib.core.d.ts", sources: ["header.d.ts", "core.d.ts"] },
- { target: "lib.dom.d.ts", sources: ["importcore.d.ts", "intl.d.ts", "dom.generated.d.ts"], },
- { target: "lib.webworker.d.ts", sources: ["importcore.d.ts", "intl.d.ts", "webworker.generated.d.ts"], },
- { target: "lib.scriptHost.d.ts", sources: ["importcore.d.ts", "scriptHost.d.ts"], },
- { target: "lib.d.ts", sources: ["header.d.ts", "core.d.ts", "intl.d.ts", "dom.generated.d.ts", "webworker.importscripts.d.ts", "scriptHost.d.ts"], },
- { target: "lib.core.es6.d.ts", sources: ["header.d.ts", "core.d.ts", "es6.d.ts"]},
- { target: "lib.es6.d.ts", sources: ["header.d.ts", "es6.d.ts", "core.d.ts", "intl.d.ts", "dom.generated.d.ts", "dom.es6.d.ts", "webworker.importscripts.d.ts", "scriptHost.d.ts"] },
- { target: "lib.core.es7.d.ts", sources: ["header.d.ts", "core.d.ts", "es6.d.ts", "es7.d.ts"]},
- { target: "lib.es7.d.ts", sources: ["header.d.ts", "es6.d.ts", "es7.d.ts", "core.d.ts", "intl.d.ts", "dom.generated.d.ts", "dom.es6.d.ts", "webworker.importscripts.d.ts", "scriptHost.d.ts"] }
+var es6LibrarySources = [
+ "es6.array.d.ts",
+ "es6.collection.d.ts",
+ "es6.function.d.ts",
+ "es6.generator.d.ts",
+ "es6.iterable.d.ts",
+ "es6.math.d.ts",
+ "es6.number.d.ts",
+ "es6.object.d.ts",
+ "es6.promise.d.ts",
+ "es6.proxy.d.ts",
+ "es6.reflect.d.ts",
+ "es6.regexp.d.ts",
+ "es6.string.d.ts",
+ "es6.symbol.d.ts",
+ "es6.symbol.wellknown.d.ts",
];
+var es6LibrarySourceMap = es6LibrarySources.map(function(source) {
+ return { target: "lib." + source, sources: [source ] };
+});
+
+var es7LibrarySource = [ "es7.array.include.d.ts" ];
+
+var es7LibrarySourceMap = es7LibrarySource.map(function(source) {
+ return { target: "lib." + source, sources: [source] };
+})
+
+var hostsLibrarySources = ["dom.generated.d.ts", "webworker.importscripts.d.ts", "scripthost.d.ts"]
+
+var librarySourceMap = [
+ // Host library
+ { target: "lib.dom.d.ts", sources: ["dom.generated.d.ts"], },
+ { target: "lib.dom.iterable.d.ts", sources: ["dom.iterable.d.ts"], },
+ { target: "lib.webworker.d.ts", sources: ["webworker.generated.d.ts"], },
+ { target: "lib.scripthost.d.ts", sources: ["scripthost.d.ts"], },
+
+ // JavaScript library
+ { target: "lib.es5.d.ts", sources: ["header.d.ts", "es5.d.ts"] },
+ { target: "lib.es6.d.ts", sources: ["header.d.ts", "es6.d.ts"] },
+ { target: "lib.es7.d.ts", sources: ["header.d.ts", "es7.d.ts"] },
+
+ // JavaScript + all host library
+ { target: "lib.d.ts", sources: ["header.d.ts", "es5.d.ts"].concat(hostsLibrarySources), },
+ { target: "lib.full.es6.d.ts", sources: ["header.d.ts", "es5.d.ts"].concat(es6LibrarySources, hostsLibrarySources), },
+].concat(es6LibrarySourceMap, es7LibrarySourceMap);
+
var libraryTargets = librarySourceMap.map(function (f) {
return path.join(builtLocalDirectory, f.target);
});
diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts
index 3916d0022c8b4..77e4aabfdd8e3 100644
--- a/src/compiler/utilities.ts
+++ b/src/compiler/utilities.ts
@@ -2629,7 +2629,7 @@ namespace ts {
namespace ts {
export function getDefaultLibFileName(options: CompilerOptions): string {
- return options.target === ScriptTarget.ES6 ? "lib.es6.d.ts" : "lib.d.ts";
+ return options.target === ScriptTarget.ES6 ? "lib.full.es6.d.ts" : "lib.d.ts";
}
export function textSpanEnd(span: TextSpan) {
diff --git a/src/harness/harness.ts b/src/harness/harness.ts
index df64cf61277a9..38d88e6744501 100644
--- a/src/harness/harness.ts
+++ b/src/harness/harness.ts
@@ -809,8 +809,9 @@ namespace Harness {
const lineFeed = "\n";
export const defaultLibFileName = "lib.d.ts";
- export const defaultLibSourceFile = createSourceFileAndAssertInvariants(defaultLibFileName, IO.readFile(libFolder + "lib.core.d.ts"), /*languageVersion*/ ts.ScriptTarget.Latest);
- export const defaultES6LibSourceFile = createSourceFileAndAssertInvariants(defaultLibFileName, IO.readFile(libFolder + "lib.core.es6.d.ts"), /*languageVersion*/ ts.ScriptTarget.Latest);
+ export const defaultLibSourceFile = createSourceFileAndAssertInvariants(defaultLibFileName, IO.readFile(libFolder + "lib.es5.d.ts"), /*languageVersion*/ ts.ScriptTarget.Latest);
+ // TODO (yuisu): we should not use the lib.full.es6.d.ts. We will fix this when all the work for library modularization is in
+ export const defaultES6LibSourceFile = createSourceFileAndAssertInvariants(defaultLibFileName, IO.readFile(libFolder + "lib.full.es6.d.ts"), /*languageVersion*/ ts.ScriptTarget.Latest);
// Cache these between executions so we don't have to re-parse them for every test
export const fourslashFileName = "fourslash.ts";
@@ -1605,7 +1606,7 @@ namespace Harness {
}
export function isLibraryFile(filePath: string): boolean {
- return (Path.getFileName(filePath) === "lib.d.ts") || (Path.getFileName(filePath) === "lib.core.d.ts");
+ return (Path.getFileName(filePath) === "lib.d.ts") || (Path.getFileName(filePath) === "lib.es5.d.ts");
}
export function isBuiltFile(filePath: string): boolean {
diff --git a/src/lib/dom.es6.d.ts b/src/lib/dom.iterable.d.ts
similarity index 79%
rename from src/lib/dom.es6.d.ts
rename to src/lib/dom.iterable.d.ts
index e83b8531011da..4f6378f038eca 100644
--- a/src/lib/dom.es6.d.ts
+++ b/src/lib/dom.iterable.d.ts
@@ -1,3 +1,5 @@
+///
+
interface DOMTokenList {
[Symbol.iterator](): IterableIterator;
}
diff --git a/src/lib/core.d.ts b/src/lib/es5.d.ts
similarity index 93%
rename from src/lib/core.d.ts
rename to src/lib/es5.d.ts
index cc30bdd4adbfb..2d86c3f5b98cb 100644
--- a/src/lib/core.d.ts
+++ b/src/lib/es5.d.ts
@@ -1247,6 +1247,8 @@ interface TypedPropertyDescriptor {
set?: (value: T) => void;
}
+declare type PropertyKey = string | number | symbol;
+
declare type ClassDecorator = (target: TFunction) => TFunction | void;
declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void;
declare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void;
@@ -3904,3 +3906,204 @@ interface Float64ArrayConstructor {
from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array;
}
declare const Float64Array: Float64ArrayConstructor;
+
+/////////////////////////////
+/// ECMAScript Internationalization API
+/////////////////////////////
+
+declare module Intl {
+ interface CollatorOptions {
+ usage?: string;
+ localeMatcher?: string;
+ numeric?: boolean;
+ caseFirst?: string;
+ sensitivity?: string;
+ ignorePunctuation?: boolean;
+ }
+
+ interface ResolvedCollatorOptions {
+ locale: string;
+ usage: string;
+ sensitivity: string;
+ ignorePunctuation: boolean;
+ collation: string;
+ caseFirst: string;
+ numeric: boolean;
+ }
+
+ interface Collator {
+ compare(x: string, y: string): number;
+ resolvedOptions(): ResolvedCollatorOptions;
+ }
+ var Collator: {
+ new (locales?: string[], options?: CollatorOptions): Collator;
+ new (locale?: string, options?: CollatorOptions): Collator;
+ (locales?: string[], options?: CollatorOptions): Collator;
+ (locale?: string, options?: CollatorOptions): Collator;
+ supportedLocalesOf(locales: string[], options?: CollatorOptions): string[];
+ supportedLocalesOf(locale: string, options?: CollatorOptions): string[];
+ }
+
+ interface NumberFormatOptions {
+ localeMatcher?: string;
+ style?: string;
+ currency?: string;
+ currencyDisplay?: string;
+ useGrouping?: boolean;
+ minimumIntegerDigits?: number;
+ minimumFractionDigits?: number;
+ maximumFractionDigits?: number;
+ minimumSignificantDigits?: number;
+ maximumSignificantDigits?: number;
+ }
+
+ interface ResolvedNumberFormatOptions {
+ locale: string;
+ numberingSystem: string;
+ style: string;
+ currency?: string;
+ currencyDisplay?: string;
+ minimumIntegerDigits: number;
+ minimumFractionDigits: number;
+ maximumFractionDigits: number;
+ minimumSignificantDigits?: number;
+ maximumSignificantDigits?: number;
+ useGrouping: boolean;
+ }
+
+ interface NumberFormat {
+ format(value: number): string;
+ resolvedOptions(): ResolvedNumberFormatOptions;
+ }
+ var NumberFormat: {
+ new (locales?: string[], options?: NumberFormatOptions): NumberFormat;
+ new (locale?: string, options?: NumberFormatOptions): NumberFormat;
+ (locales?: string[], options?: NumberFormatOptions): NumberFormat;
+ (locale?: string, options?: NumberFormatOptions): NumberFormat;
+ supportedLocalesOf(locales: string[], options?: NumberFormatOptions): string[];
+ supportedLocalesOf(locale: string, options?: NumberFormatOptions): string[];
+ }
+
+ interface DateTimeFormatOptions {
+ localeMatcher?: string;
+ weekday?: string;
+ era?: string;
+ year?: string;
+ month?: string;
+ day?: string;
+ hour?: string;
+ minute?: string;
+ second?: string;
+ timeZoneName?: string;
+ formatMatcher?: string;
+ hour12?: boolean;
+ timeZone?: string;
+ }
+
+ interface ResolvedDateTimeFormatOptions {
+ locale: string;
+ calendar: string;
+ numberingSystem: string;
+ timeZone: string;
+ hour12?: boolean;
+ weekday?: string;
+ era?: string;
+ year?: string;
+ month?: string;
+ day?: string;
+ hour?: string;
+ minute?: string;
+ second?: string;
+ timeZoneName?: string;
+ }
+
+ interface DateTimeFormat {
+ format(date?: Date | number): string;
+ resolvedOptions(): ResolvedDateTimeFormatOptions;
+ }
+ var DateTimeFormat: {
+ new (locales?: string[], options?: DateTimeFormatOptions): DateTimeFormat;
+ new (locale?: string, options?: DateTimeFormatOptions): DateTimeFormat;
+ (locales?: string[], options?: DateTimeFormatOptions): DateTimeFormat;
+ (locale?: string, options?: DateTimeFormatOptions): DateTimeFormat;
+ supportedLocalesOf(locales: string[], options?: DateTimeFormatOptions): string[];
+ supportedLocalesOf(locale: string, options?: DateTimeFormatOptions): string[];
+ }
+}
+
+interface String {
+ /**
+ * Determines whether two strings are equivalent in the current locale.
+ * @param that String to compare to target string
+ * @param locales An 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.
+ * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details.
+ */
+ localeCompare(that: string, locales: string[], options?: Intl.CollatorOptions): number;
+
+ /**
+ * Determines whether two strings are equivalent in the current locale.
+ * @param that String to compare to target string
+ * @param locale Locale tag. 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.
+ * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details.
+ */
+ localeCompare(that: string, locale: string, options?: Intl.CollatorOptions): number;
+}
+
+interface Number {
+ /**
+ * Converts a number to a string by using the current or specified locale.
+ * @param locales An 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.
+ * @param options An object that contains one or more properties that specify comparison options.
+ */
+ toLocaleString(locales?: string[], options?: Intl.NumberFormatOptions): string;
+
+ /**
+ * Converts a number to a string by using the current or specified locale.
+ * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used.
+ * @param options An object that contains one or more properties that specify comparison options.
+ */
+ toLocaleString(locale?: string, options?: Intl.NumberFormatOptions): string;
+}
+
+interface Date {
+ /**
+ * Converts a date and time to a string by using the current or specified locale.
+ * @param locales An 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.
+ * @param options An object that contains one or more properties that specify comparison options.
+ */
+ toLocaleString(locales?: string[], options?: Intl.DateTimeFormatOptions): string;
+ /**
+ * Converts a date to a string by using the current or specified locale.
+ * @param locales An 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.
+ * @param options An object that contains one or more properties that specify comparison options.
+ */
+ toLocaleDateString(locales?: string[], options?: Intl.DateTimeFormatOptions): string;
+
+ /**
+ * Converts a time to a string by using the current or specified locale.
+ * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used.
+ * @param options An object that contains one or more properties that specify comparison options.
+ */
+ toLocaleTimeString(locale?: string[], options?: Intl.DateTimeFormatOptions): string;
+
+ /**
+ * Converts a date and time to a string by using the current or specified locale.
+ * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used.
+ * @param options An object that contains one or more properties that specify comparison options.
+ */
+ toLocaleString(locale?: string, options?: Intl.DateTimeFormatOptions): string;
+
+ /**
+ * Converts a date to a string by using the current or specified locale.
+ * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used.
+ * @param options An object that contains one or more properties that specify comparison options.
+ */
+ toLocaleDateString(locale?: string, options?: Intl.DateTimeFormatOptions): string;
+
+ /**
+ * Converts a time to a string by using the current or specified locale.
+ * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used.
+ * @param options An object that contains one or more properties that specify comparison options.
+ */
+ toLocaleTimeString(locale?: string, options?: Intl.DateTimeFormatOptions): string;
+}
\ No newline at end of file
diff --git a/src/lib/es6.array.d.ts b/src/lib/es6.array.d.ts
new file mode 100644
index 0000000000000..1643f928637f8
--- /dev/null
+++ b/src/lib/es6.array.d.ts
@@ -0,0 +1,67 @@
+interface Array {
+ /**
+ * Returns the value of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ find(predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T;
+
+ /**
+ * Returns the index of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ findIndex(predicate: (value: T) => boolean, thisArg?: any): number;
+
+ /**
+ * Returns the this object after filling the section identified by start and end with value
+ * @param value value to fill array section with
+ * @param start index to start filling the array at. If start is negative, it is treated as
+ * length+start where length is the length of the array.
+ * @param end index to stop filling the array at. If end is negative, it is treated as
+ * length+end.
+ */
+ fill(value: T, start?: number, end?: number): T[];
+
+ /**
+ * Returns the this object after copying a section of the array identified by start and end
+ * to the same array starting at position target
+ * @param target If target is negative, it is treated as length+target where length is the
+ * length of the array.
+ * @param start If start is negative, it is treated as length+start. If end is negative, it
+ * is treated as length+end.
+ * @param end If not specified, length of the this object is used as its default value.
+ */
+ copyWithin(target: number, start: number, end?: number): T[];
+}
+
+interface ArrayConstructor {
+ /**
+ * Creates an array from an array-like object.
+ * @param arrayLike An array-like object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): Array;
+
+
+ /**
+ * Creates an array from an array-like object.
+ * @param arrayLike An array-like object to convert to an array.
+ */
+ from(arrayLike: ArrayLike): Array;
+
+ /**
+ * Returns a new array from a set of elements.
+ * @param items A set of elements to include in the new array object.
+ */
+ of(...items: T[]): Array;
+}
\ No newline at end of file
diff --git a/src/lib/es6.collection.d.ts b/src/lib/es6.collection.d.ts
new file mode 100644
index 0000000000000..1df453bce05c2
--- /dev/null
+++ b/src/lib/es6.collection.d.ts
@@ -0,0 +1,71 @@
+
+interface Map {
+ clear(): void;
+ delete(key: K): boolean;
+ forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void;
+ get(key: K): V;
+ has(key: K): boolean;
+ set(key: K, value?: V): Map;
+ readonly size: number;
+}
+
+interface MapConstructor {
+ new (): Map;
+ new (): Map;
+ readonly prototype: Map;
+}
+declare var Map: MapConstructor;
+
+interface WeakMap {
+ clear(): void;
+ delete(key: K): boolean;
+ get(key: K): V;
+ has(key: K): boolean;
+ set(key: K, value?: V): WeakMap;
+
+}
+
+interface WeakMapConstructor {
+ new (): WeakMap;
+ new (): WeakMap;
+ readonly prototype: WeakMap;
+}
+declare var WeakMap: WeakMapConstructor;
+
+interface Set {
+ add(value: T): Set;
+ clear(): void;
+ delete(value: T): boolean;
+ entries(): IterableIterator<[T, T]>;
+ forEach(callbackfn: (value: T, index: T, set: Set) => void, thisArg?: any): void;
+ has(value: T): boolean;
+ keys(): IterableIterator;
+ readonly size: number;
+ values(): IterableIterator;
+ [Symbol.iterator]():IterableIterator;
+ readonly [Symbol.toStringTag]: "Set";
+}
+
+interface SetConstructor {
+ new (): Set;
+ new (): Set;
+ new (iterable: Iterable): Set;
+ readonly prototype: Set;
+}
+declare var Set: SetConstructor;
+
+interface WeakSet {
+ add(value: T): WeakSet;
+ clear(): void;
+ delete(value: T): boolean;
+ has(value: T): boolean;
+ readonly [Symbol.toStringTag]: "WeakSet";
+}
+
+interface WeakSetConstructor {
+ new (): WeakSet;
+ new (): WeakSet;
+ new (iterable: Iterable): WeakSet;
+ readonly prototype: WeakSet;
+}
+declare var WeakSet: WeakSetConstructor;
diff --git a/src/lib/es6.d.ts b/src/lib/es6.d.ts
index 5a0812aad7727..60379ecaa4eda 100644
--- a/src/lib/es6.d.ts
+++ b/src/lib/es6.d.ts
@@ -1,1333 +1,15 @@
-declare type PropertyKey = string | number | symbol;
-
-interface Symbol {
- /** Returns a string representation of an object. */
- toString(): string;
-
- /** Returns the primitive value of the specified object. */
- valueOf(): Object;
-
- readonly [Symbol.toStringTag]: "Symbol";
-}
-
-interface SymbolConstructor {
- /**
- * A reference to the prototype.
- */
- readonly prototype: Symbol;
-
- /**
- * Returns a new unique Symbol value.
- * @param description Description of the new Symbol object.
- */
- (description?: string|number): symbol;
-
- /**
- * Returns a Symbol object from the global symbol registry matching the given key if found.
- * Otherwise, returns a new symbol with this key.
- * @param key key to search for.
- */
- for(key: string): symbol;
-
- /**
- * Returns a key from the global symbol registry matching the given Symbol if found.
- * Otherwise, returns a undefined.
- * @param sym Symbol to find the key for.
- */
- keyFor(sym: symbol): string;
-
- // Well-known Symbols
-
- /**
- * A method that determines if a constructor object recognizes an object as one of the
- * constructor’s instances. Called by the semantics of the instanceof operator.
- */
- readonly hasInstance: symbol;
-
- /**
- * A Boolean value that if true indicates that an object should flatten to its array elements
- * by Array.prototype.concat.
- */
- readonly isConcatSpreadable: symbol;
-
- /**
- * A method that returns the default iterator for an object. Called by the semantics of the
- * for-of statement.
- */
- readonly iterator: symbol;
-
- /**
- * A regular expression method that matches the regular expression against a string. Called
- * by the String.prototype.match method.
- */
- readonly match: symbol;
-
- /**
- * A regular expression method that replaces matched substrings of a string. Called by the
- * String.prototype.replace method.
- */
- readonly replace: symbol;
-
- /**
- * A regular expression method that returns the index within a string that matches the
- * regular expression. Called by the String.prototype.search method.
- */
- readonly search: symbol;
-
- /**
- * A function valued property that is the constructor function that is used to create
- * derived objects.
- */
- readonly species: symbol;
-
- /**
- * A regular expression method that splits a string at the indices that match the regular
- * expression. Called by the String.prototype.split method.
- */
- readonly split: symbol;
-
- /**
- * A method that converts an object to a corresponding primitive value.
- * Called by the ToPrimitive abstract operation.
- */
- readonly toPrimitive: symbol;
-
- /**
- * A String value that is used in the creation of the default string description of an object.
- * Called by the built-in method Object.prototype.toString.
- */
- readonly toStringTag: symbol;
-
- /**
- * An Object whose own property names are property names that are excluded from the 'with'
- * environment bindings of the associated objects.
- */
- readonly unscopables: symbol;
-}
-declare var Symbol: SymbolConstructor;
-
-interface Object {
- /**
- * Determines whether an object has a property with the specified name.
- * @param v A property name.
- */
- hasOwnProperty(v: PropertyKey): boolean;
-
- /**
- * Determines whether a specified property is enumerable.
- * @param v A property name.
- */
- propertyIsEnumerable(v: PropertyKey): boolean;
-}
-
-interface ObjectConstructor {
- /**
- * Copy the values of all of the enumerable own properties from one or more source objects to a
- * target object. Returns the target object.
- * @param target The target object to copy to.
- * @param source The source object from which to copy properties.
- */
- assign(target: T, source: U): T & U;
-
- /**
- * Copy the values of all of the enumerable own properties from one or more source objects to a
- * target object. Returns the target object.
- * @param target The target object to copy to.
- * @param source1 The first source object from which to copy properties.
- * @param source2 The second source object from which to copy properties.
- */
- assign(target: T, source1: U, source2: V): T & U & V;
-
- /**
- * Copy the values of all of the enumerable own properties from one or more source objects to a
- * target object. Returns the target object.
- * @param target The target object to copy to.
- * @param source1 The first source object from which to copy properties.
- * @param source2 The second source object from which to copy properties.
- * @param source3 The third source object from which to copy properties.
- */
- assign(target: T, source1: U, source2: V, source3: W): T & U & V & W;
-
- /**
- * Copy the values of all of the enumerable own properties from one or more source objects to a
- * target object. Returns the target object.
- * @param target The target object to copy to.
- * @param sources One or more source objects from which to copy properties
- */
- assign(target: any, ...sources: any[]): any;
-
- /**
- * Returns an array of all symbol properties found directly on object o.
- * @param o Object to retrieve the symbols from.
- */
- getOwnPropertySymbols(o: any): symbol[];
-
- /**
- * Returns true if the values are the same value, false otherwise.
- * @param value1 The first value.
- * @param value2 The second value.
- */
- is(value1: any, value2: any): boolean;
-
- /**
- * Sets the prototype of a specified object o to object proto or null. Returns the object o.
- * @param o The object to change its prototype.
- * @param proto The value of the new prototype or null.
- */
- setPrototypeOf(o: any, proto: any): any;
-
- /**
- * Gets the own property descriptor of the specified object.
- * An own property descriptor is one that is defined directly on the object and is not
- * inherited from the object's prototype.
- * @param o Object that contains the property.
- * @param p Name of the property.
- */
- getOwnPropertyDescriptor(o: any, propertyKey: PropertyKey): PropertyDescriptor;
-
- /**
- * Adds a property to an object, or modifies attributes of an existing property.
- * @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.
- * @param p The property name.
- * @param attributes Descriptor for the property. It can be for a data property or an accessor
- * property.
- */
- defineProperty(o: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): any;
-}
-
-interface Function {
- /**
- * Returns the name of the function. Function names are read-only and can not be changed.
- */
- readonly name: string;
-
- /**
- * Determines whether the given value inherits from this function if this function was used
- * as a constructor function.
- *
- * A constructor function can control which objects are recognized as its instances by
- * 'instanceof' by overriding this method.
- */
- [Symbol.hasInstance](value: any): boolean;
-}
-
-interface NumberConstructor {
- /**
- * The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1
- * that is representable as a Number value, which is approximately:
- * 2.2204460492503130808472633361816 x 10−16.
- */
- readonly EPSILON: number;
-
- /**
- * Returns true if passed value is finite.
- * Unlike the global isFinite, Number.isFinite doesn't forcibly convert the parameter to a
- * number. Only finite values of the type number, result in true.
- * @param number A numeric value.
- */
- isFinite(number: number): boolean;
-
- /**
- * Returns true if the value passed is an integer, false otherwise.
- * @param number A numeric value.
- */
- isInteger(number: number): 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;
-
- /**
- * Returns true if the value passed is a safe integer.
- * @param number A numeric value.
- */
- isSafeInteger(number: number): boolean;
-
- /**
- * The value of the largest integer n such that n and n + 1 are both exactly representable as
- * a Number value.
- * The value of Number.MIN_SAFE_INTEGER is 9007199254740991 2^53 − 1.
- */
- readonly MAX_SAFE_INTEGER: number;
-
- /**
- * The value of the smallest integer n such that n and n − 1 are both exactly representable as
- * a Number value.
- * The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)).
- */
- readonly MIN_SAFE_INTEGER: number;
-
- /**
- * Converts a string to a floating-point number.
- * @param string A string that contains a floating-point number.
- */
- parseFloat(string: string): number;
-
- /**
- * Converts A string to an integer.
- * @param s A string to convert into a number.
- * @param radix A value between 2 and 36 that specifies the base of the number in numString.
- * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.
- * All other strings are considered decimal.
- */
- parseInt(string: string, radix?: number): number;
-}
-
-interface Array {
- /** Iterator */
- [Symbol.iterator](): IterableIterator;
-
- /**
- * Returns an object whose properties have the value 'true'
- * when they will be absent when used in a 'with' statement.
- */
- [Symbol.unscopables](): {
- copyWithin: boolean;
- entries: boolean;
- fill: boolean;
- find: boolean;
- findIndex: boolean;
- keys: boolean;
- values: boolean;
- };
-
- /**
- * Returns an array of key, value pairs for every entry in the array
- */
- entries(): IterableIterator<[number, T]>;
-
- /**
- * Returns an list of keys in the array
- */
- keys(): IterableIterator;
-
- /**
- * Returns an list of values in the array
- */
- values(): IterableIterator;
-
- /**
- * Returns the value of the first element in the array where predicate is true, and undefined
- * otherwise.
- * @param predicate find calls predicate once for each element of the array, in ascending
- * order, until it finds one where predicate returns true. If such an element is found, find
- * immediately returns that element value. Otherwise, find returns undefined.
- * @param thisArg If provided, it will be used as the this value for each invocation of
- * predicate. If it is not provided, undefined is used instead.
- */
- find(predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T;
-
- /**
- * Returns the index of the first element in the array where predicate is true, and undefined
- * otherwise.
- * @param predicate find calls predicate once for each element of the array, in ascending
- * order, until it finds one where predicate returns true. If such an element is found, find
- * immediately returns that element value. Otherwise, find returns undefined.
- * @param thisArg If provided, it will be used as the this value for each invocation of
- * predicate. If it is not provided, undefined is used instead.
- */
- findIndex(predicate: (value: T) => boolean, thisArg?: any): number;
-
- /**
- * Returns the this object after filling the section identified by start and end with value
- * @param value value to fill array section with
- * @param start index to start filling the array at. If start is negative, it is treated as
- * length+start where length is the length of the array.
- * @param end index to stop filling the array at. If end is negative, it is treated as
- * length+end.
- */
- fill(value: T, start?: number, end?: number): T[];
-
- /**
- * Returns the this object after copying a section of the array identified by start and end
- * to the same array starting at position target
- * @param target If target is negative, it is treated as length+target where length is the
- * length of the array.
- * @param start If start is negative, it is treated as length+start. If end is negative, it
- * is treated as length+end.
- * @param end If not specified, length of the this object is used as its default value.
- */
- copyWithin(target: number, start: number, end?: number): T[];
-}
-
-interface IArguments {
- /** Iterator */
- [Symbol.iterator](): IterableIterator;
-}
-
-interface ArrayConstructor {
- /**
- * Creates an array from an array-like object.
- * @param arrayLike An array-like object to convert to an array.
- * @param mapfn A mapping function to call on every element of the array.
- * @param thisArg Value of 'this' used to invoke the mapfn.
- */
- from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): Array;
-
- /**
- * Creates an array from an iterable object.
- * @param iterable An iterable object to convert to an array.
- * @param mapfn A mapping function to call on every element of the array.
- * @param thisArg Value of 'this' used to invoke the mapfn.
- */
- from(iterable: Iterable, mapfn: (v: T, k: number) => U, thisArg?: any): Array;
-
- /**
- * Creates an array from an array-like object.
- * @param arrayLike An array-like object to convert to an array.
- */
- from(arrayLike: ArrayLike): Array;
-
- /**
- * Creates an array from an iterable object.
- * @param iterable An iterable object to convert to an array.
- */
- from(iterable: Iterable): Array;
-
- /**
- * Returns a new array from a set of elements.
- * @param items A set of elements to include in the new array object.
- */
- of(...items: T[]): Array;
-}
-
-interface String {
- /** Iterator */
- [Symbol.iterator](): IterableIterator;
-
- /**
- * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point
- * value of the UTF-16 encoded code point starting at the string element at position pos in
- * the String resulting from converting this object to a String.
- * If there is no element at that position, the result is undefined.
- * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos.
- */
- codePointAt(pos: number): number;
-
- /**
- * Returns true if searchString appears as a substring of the result of converting this
- * object to a String, at one or more positions that are
- * greater than or equal to position; otherwise, returns false.
- * @param searchString search string
- * @param position If position is undefined, 0 is assumed, so as to search all of the String.
- */
- includes(searchString: string, position?: number): boolean;
-
- /**
- * Returns true if the sequence of elements of searchString converted to a String is the
- * same as the corresponding elements of this object (converted to a String) starting at
- * endPosition – length(this). Otherwise returns false.
- */
- endsWith(searchString: string, endPosition?: number): boolean;
-
- /**
- * Returns the String value result of normalizing the string into the normalization form
- * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms.
- * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default
- * is "NFC"
- */
- normalize(form?: string): string;
-
- /**
- * Returns a String value that is made from count copies appended together. If count is 0,
- * T is the empty String is returned.
- * @param count number of copies to append
- */
- repeat(count: number): string;
-
- /**
- * Returns true if the sequence of elements of searchString converted to a String is the
- * same as the corresponding elements of this object (converted to a String) starting at
- * position. Otherwise returns false.
- */
- startsWith(searchString: string, position?: number): boolean;
-
- // Overloads for objects with methods of well-known symbols.
-
- /**
- * Matches a string an object that supports being matched against, and returns an array containing the results of that search.
- * @param matcher An object that supports being matched against.
- */
- match(matcher: { [Symbol.match](string: string): RegExpMatchArray; }): RegExpMatchArray;
-
- /**
- * Replaces text in a string, using an object that supports replacement within a string.
- * @param searchValue A object can search for and replace matches within a string.
- * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.
- */
- replace(searchValue: { [Symbol.replace](string: string, replaceValue: string): string; }, replaceValue: string): string;
-
- /**
- * Replaces text in a string, using an object that supports replacement within a string.
- * @param searchValue A object can search for and replace matches within a string.
- * @param replacer A function that returns the replacement text.
- */
- replace(searchValue: { [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; }, replacer: (substring: string, ...args: any[]) => string): string;
-
- /**
- * Finds the first substring match in a regular expression search.
- * @param searcher An object which supports searching within a string.
- */
- search(searcher: { [Symbol.search](string: string): number; }): number;
-
- /**
- * Split a string into substrings using the specified separator and return them as an array.
- * @param splitter An object that can split a string.
- * @param limit A value used to limit the number of elements returned in the array.
- */
- split(splitter: { [Symbol.split](string: string, limit?: number): string[]; }, limit?: number): string[];
-
- /**
- * Returns an HTML anchor element and sets the name attribute to the text value
- * @param name
- */
- anchor(name: string): string;
-
- /** Returns a HTML element */
- big(): string;
-
- /** Returns a