AK-21/Graphite-Industrial-Intelligence
0
1/*! *****************************************************************************2Copyright (c) Microsoft Corporation. All rights reserved.3Licensed under the Apache License, Version 2.0 (the "License"); you may not use4this file except in compliance with the License. You may obtain a copy of the5License at http://www.apache.org/licenses/LICENSE-2.06 7THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY8KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED9WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,10MERCHANTABILITY OR NON-INFRINGEMENT.11 12See the Apache Version 2.0 License for specific language governing permissions13and limitations under the License.14***************************************************************************** */15 16 17/// <reference lib="decorators" />18/// <reference lib="decorators.legacy" />19 20/////////////////////////////21/// ECMAScript APIs22/////////////////////////////23 24declare var NaN: number;25declare var Infinity: number;26 27/**28 * Evaluates JavaScript code and executes it.29 * @param x A String value that contains valid JavaScript code.30 */31declare function eval(x: string): any;32 33/**34 * Converts a string to an integer.35 * @param string A string to convert into a number.36 * @param radix A value between 2 and 36 that specifies the base of the number in `string`.37 * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.38 * All other strings are considered decimal.39 */40declare function parseInt(string: string, radix?: number): number;41 42/**43 * Converts a string to a floating-point number.44 * @param string A string that contains a floating-point number.45 */46declare function parseFloat(string: string): number;47 48/**49 * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number).50 * @param number A numeric value.51 */52declare function isNaN(number: number): boolean;53 54/**55 * Determines whether a supplied number is finite.56 * @param number Any numeric value.57 */58declare function isFinite(number: number): boolean;59 60/**61 * Gets the unencoded version of an encoded Uniform Resource Identifier (URI).62 * @param encodedURI A value representing an encoded URI.63 */64declare function decodeURI(encodedURI: string): string;65 66/**67 * Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI).68 * @param encodedURIComponent A value representing an encoded URI component.69 */70declare function decodeURIComponent(encodedURIComponent: string): string;71 72/**73 * Encodes a text string as a valid Uniform Resource Identifier (URI)74 * @param uri A value representing an unencoded URI.75 */76declare function encodeURI(uri: string): string;77 78/**79 * Encodes a text string as a valid component of a Uniform Resource Identifier (URI).80 * @param uriComponent A value representing an unencoded URI component.81 */82declare function encodeURIComponent(uriComponent: string | number | boolean): string;83 84/**85 * Computes a new string in which certain characters have been replaced by a hexadecimal escape sequence.86 * @deprecated A legacy feature for browser compatibility87 * @param string A string value88 */89declare function escape(string: string): string;90 91/**92 * Computes a new string in which hexadecimal escape sequences are replaced with the character that it represents.93 * @deprecated A legacy feature for browser compatibility94 * @param string A string value95 */96declare function unescape(string: string): string;97 98interface Symbol {99 /** Returns a string representation of an object. */100 toString(): string;101 102 /** Returns the primitive value of the specified object. */103 valueOf(): symbol;104}105 106declare type PropertyKey = string | number | symbol;107 108interface PropertyDescriptor {109 configurable?: boolean;110 enumerable?: boolean;111 value?: any;112 writable?: boolean;113 get?(): any;114 set?(v: any): void;115}116 117interface PropertyDescriptorMap {118 [key: PropertyKey]: PropertyDescriptor;119}120 121interface Object {122 /** The initial value of Object.prototype.constructor is the standard built-in Object constructor. */123 constructor: Function;124 125 /** Returns a string representation of an object. */126 toString(): string;127 128 /** Returns a date converted to a string using the current locale. */129 toLocaleString(): string;130 131 /** Returns the primitive value of the specified object. */132 valueOf(): Object;133 134 /**135 * Determines whether an object has a property with the specified name.136 * @param v A property name.137 */138 hasOwnProperty(v: PropertyKey): boolean;139 140 /**141 * Determines whether an object exists in another object's prototype chain.142 * @param v Another object whose prototype chain is to be checked.143 */144 isPrototypeOf(v: Object): boolean;145 146 /**147 * Determines whether a specified property is enumerable.148 * @param v A property name.149 */150 propertyIsEnumerable(v: PropertyKey): boolean;151}152 153interface ObjectConstructor {154 new (value?: any): Object;155 (): any;156 (value: any): any;157 158 /** A reference to the prototype for a class of objects. */159 readonly prototype: Object;160 161 /**162 * Returns the prototype of an object.163 * @param o The object that references the prototype.164 */165 getPrototypeOf(o: any): any;166 167 /**168 * Gets the own property descriptor of the specified object.169 * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype.170 * @param o Object that contains the property.171 * @param p Name of the property.172 */173 getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;174 175 /**176 * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly177 * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions.178 * @param o Object that contains the own properties.179 */180 getOwnPropertyNames(o: any): string[];181 182 /**183 * Creates an object that has the specified prototype or that has null prototype.184 * @param o Object to use as a prototype. May be null.185 */186 create(o: object | null): any;187 188 /**189 * Creates an object that has the specified prototype, and that optionally contains specified properties.190 * @param o Object to use as a prototype. May be null191 * @param properties JavaScript object that contains one or more property descriptors.192 */193 create(o: object | null, properties: PropertyDescriptorMap & ThisType<any>): any;194 195 /**196 * Adds a property to an object, or modifies attributes of an existing property.197 * @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.198 * @param p The property name.199 * @param attributes Descriptor for the property. It can be for a data property or an accessor property.200 */201 defineProperty<T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>): T;202 203 /**204 * Adds one or more properties to an object, and/or modifies attributes of existing properties.205 * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object.206 * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property.207 */208 defineProperties<T>(o: T, properties: PropertyDescriptorMap & ThisType<any>): T;209 210 /**211 * Prevents the modification of attributes of existing properties, and prevents the addition of new properties.212 * @param o Object on which to lock the attributes.213 */214 seal<T>(o: T): T;215 216 /**217 * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.218 * @param f Object on which to lock the attributes.219 */220 freeze<T extends Function>(f: T): T;221 222 /**223 * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.224 * @param o Object on which to lock the attributes.225 */226 freeze<T extends { [idx: string]: U | null | undefined | object; }, U extends string | bigint | number | boolean | symbol>(o: T): Readonly<T>;227 228 /**229 * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.230 * @param o Object on which to lock the attributes.231 */232 freeze<T>(o: T): Readonly<T>;233 234 /**235 * Prevents the addition of new properties to an object.236 * @param o Object to make non-extensible.237 */238 preventExtensions<T>(o: T): T;239 240 /**241 * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object.242 * @param o Object to test.243 */244 isSealed(o: any): boolean;245 246 /**247 * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object.248 * @param o Object to test.249 */250 isFrozen(o: any): boolean;251 252 /**253 * Returns a value that indicates whether new properties can be added to an object.254 * @param o Object to test.255 */256 isExtensible(o: any): boolean;257 258 /**259 * Returns the names of the enumerable string properties and methods of an object.260 * @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.261 */262 keys(o: object): string[];263}264 265/**266 * Provides functionality common to all JavaScript objects.267 */268declare var Object: ObjectConstructor;269 270/**271 * Creates a new function.272 */273interface Function {274 /**275 * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function.276 * @param thisArg The object to be used as the this object.277 * @param argArray A set of arguments to be passed to the function.278 */279 apply(this: Function, thisArg: any, argArray?: any): any;280 281 /**282 * Calls a method of an object, substituting another object for the current object.283 * @param thisArg The object to be used as the current object.284 * @param argArray A list of arguments to be passed to the method.285 */286 call(this: Function, thisArg: any, ...argArray: any[]): any;287 288 /**289 * For a given function, creates a bound function that has the same body as the original function.290 * The this object of the bound function is associated with the specified object, and has the specified initial parameters.291 * @param thisArg An object to which the this keyword can refer inside the new function.292 * @param argArray A list of arguments to be passed to the new function.293 */294 bind(this: Function, thisArg: any, ...argArray: any[]): any;295 296 /** Returns a string representation of a function. */297 toString(): string;298 299 prototype: any;300 readonly length: number;301 302 // Non-standard extensions303 arguments: any;304 caller: Function;305}306 307interface FunctionConstructor {308 /**309 * Creates a new function.310 * @param args A list of arguments the function accepts.311 */312 new (...args: string[]): Function;313 (...args: string[]): Function;314 readonly prototype: Function;315}316 317declare var Function: FunctionConstructor;318 319/**320 * Extracts the type of the 'this' parameter of a function type, or 'unknown' if the function type has no 'this' parameter.321 */322type ThisParameterType<T> = T extends (this: infer U, ...args: never) => any ? U : unknown;323 324/**325 * Removes the 'this' parameter from a function type.326 */327type OmitThisParameter<T> = unknown extends ThisParameterType<T> ? T : T extends (...args: infer A) => infer R ? (...args: A) => R : T;328 329interface CallableFunction extends Function {330 /**331 * Calls the function with the specified object as the this value and the elements of specified array as the arguments.332 * @param thisArg The object to be used as the this object.333 */334 apply<T, R>(this: (this: T) => R, thisArg: T): R;335 336 /**337 * Calls the function with the specified object as the this value and the elements of specified array as the arguments.338 * @param thisArg The object to be used as the this object.339 * @param args An array of argument values to be passed to the function.340 */341 apply<T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T, args: A): R;342 343 /**344 * Calls the function with the specified object as the this value and the specified rest arguments as the arguments.345 * @param thisArg The object to be used as the this object.346 * @param args Argument values to be passed to the function.347 */348 call<T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T, ...args: A): R;349 350 /**351 * For a given function, creates a bound function that has the same body as the original function.352 * The this object of the bound function is associated with the specified object, and has the specified initial parameters.353 * @param thisArg The object to be used as the this object.354 */355 bind<T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>;356 357 /**358 * For a given function, creates a bound function that has the same body as the original function.359 * The this object of the bound function is associated with the specified object, and has the specified initial parameters.360 * @param thisArg The object to be used as the this object.361 * @param args Arguments to bind to the parameters of the function.362 */363 bind<T, A extends any[], B extends any[], R>(this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R;364}365 366interface NewableFunction extends Function {367 /**368 * Calls the function with the specified object as the this value and the elements of specified array as the arguments.369 * @param thisArg The object to be used as the this object.370 */371 apply<T>(this: new () => T, thisArg: T): void;372 /**373 * Calls the function with the specified object as the this value and the elements of specified array as the arguments.374 * @param thisArg The object to be used as the this object.375 * @param args An array of argument values to be passed to the function.376 */377 apply<T, A extends any[]>(this: new (...args: A) => T, thisArg: T, args: A): void;378 379 /**380 * Calls the function with the specified object as the this value and the specified rest arguments as the arguments.381 * @param thisArg The object to be used as the this object.382 * @param args Argument values to be passed to the function.383 */384 call<T, A extends any[]>(this: new (...args: A) => T, thisArg: T, ...args: A): void;385 386 /**387 * For a given function, creates a bound function that has the same body as the original function.388 * The this object of the bound function is associated with the specified object, and has the specified initial parameters.389 * @param thisArg The object to be used as the this object.390 */391 bind<T>(this: T, thisArg: any): T;392 393 /**394 * For a given function, creates a bound function that has the same body as the original function.395 * The this object of the bound function is associated with the specified object, and has the specified initial parameters.396 * @param thisArg The object to be used as the this object.397 * @param args Arguments to bind to the parameters of the function.398 */399 bind<A extends any[], B extends any[], R>(this: new (...args: [...A, ...B]) => R, thisArg: any, ...args: A): new (...args: B) => R;400}401 402interface IArguments {403 [index: number]: any;404 length: number;405 callee: Function;406}407 408interface String {409 /** Returns a string representation of a string. */410 toString(): string;411 412 /**413 * Returns the character at the specified index.414 * @param pos The zero-based index of the desired character.415 */416 charAt(pos: number): string;417 418 /**419 * Returns the Unicode value of the character at the specified location.420 * @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned.421 */422 charCodeAt(index: number): number;423 424 /**425 * Returns a string that contains the concatenation of two or more strings.426 * @param strings The strings to append to the end of the string.427 */428 concat(...strings: string[]): string;429 430 /**431 * Returns the position of the first occurrence of a substring, or -1 if it is not present.432 * @param searchString The substring to search for in the string433 * @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string.434 */435 indexOf(searchString: string, position?: number): number;436 437 /**438 * Returns the last occurrence of a substring in the string, or -1 if it is not present.439 * @param searchString The substring to search for.440 * @param position The index at which to begin searching. If omitted, the search begins at the end of the string.441 */442 lastIndexOf(searchString: string, position?: number): number;443 444 /**445 * Determines whether two strings are equivalent in the current locale.446 * @param that String to compare to target string447 */448 localeCompare(that: string): number;449 450 /**451 * Matches a string with a regular expression, and returns an array containing the results of that search.452 * @param regexp A variable name or string literal containing the regular expression pattern and flags.453 */454 match(regexp: string | RegExp): RegExpMatchArray | null;455 456 /**457 * Replaces text in a string, using a regular expression or search string.458 * @param searchValue A string or regular expression to search for.459 * @param replaceValue A string containing the text to replace. When the {@linkcode searchValue} is a `RegExp`, all matches are replaced if the `g` flag is set (or only those matches at the beginning, if the `y` flag is also present). Otherwise, only the first match of {@linkcode searchValue} is replaced.460 */461 replace(searchValue: string | RegExp, replaceValue: string): string;462 463 /**464 * Replaces text in a string, using a regular expression or search string.465 * @param searchValue A string to search for.466 * @param replacer A function that returns the replacement text.467 */468 replace(searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string;469 470 /**471 * Finds the first substring match in a regular expression search.472 * @param regexp The regular expression pattern and applicable flags.473 */474 search(regexp: string | RegExp): number;475 476 /**477 * Returns a section of a string.478 * @param start The index to the beginning of the specified portion of stringObj.479 * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end.480 * If this value is not specified, the substring continues to the end of stringObj.481 */482 slice(start?: number, end?: number): string;483 484 /**485 * Split a string into substrings using the specified separator and return them as an array.486 * @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned.487 * @param limit A value used to limit the number of elements returned in the array.488 */489 split(separator: string | RegExp, limit?: number): string[];490 491 /**492 * Returns the substring at the specified location within a String object.493 * @param start The zero-based index number indicating the beginning of the substring.494 * @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.495 * If end is omitted, the characters from start through the end of the original string are returned.496 */497 substring(start: number, end?: number): string;498 499 /** Converts all the alphabetic characters in a string to lowercase. */500 toLowerCase(): string;501 502 /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */503 toLocaleLowerCase(locales?: string | string[]): string;504 505 /** Converts all the alphabetic characters in a string to uppercase. */506 toUpperCase(): string;507 508 /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */509 toLocaleUpperCase(locales?: string | string[]): string;510 511 /** Removes the leading and trailing white space and line terminator characters from a string. */512 trim(): string;513 514 /** Returns the length of a String object. */515 readonly length: number;516 517 // IE extensions518 /**519 * Gets a substring beginning at the specified location and having the specified length.520 * @deprecated A legacy feature for browser compatibility521 * @param from The starting position of the desired substring. The index of the first character in the string is zero.522 * @param length The number of characters to include in the returned substring.523 */524 substr(from: number, length?: number): string;525 526 /** Returns the primitive value of the specified object. */527 valueOf(): string;528 529 readonly [index: number]: string;530}531 532interface StringConstructor {533 new (value?: any): String;534 (value?: any): string;535 readonly prototype: String;536 fromCharCode(...codes: number[]): string;537}538 539/**540 * Allows manipulation and formatting of text strings and determination and location of substrings within strings.541 */542declare var String: StringConstructor;543 544interface Boolean {545 /** Returns the primitive value of the specified object. */546 valueOf(): boolean;547}548 549interface BooleanConstructor {550 new (value?: any): Boolean;551 <T>(value?: T): boolean;552 readonly prototype: Boolean;553}554 555declare var Boolean: BooleanConstructor;556 557interface Number {558 /**559 * Returns a string representation of an object.560 * @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers.561 */562 toString(radix?: number): string;563 564 /**565 * Returns a string representing a number in fixed-point notation.566 * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.567 */568 toFixed(fractionDigits?: number): string;569 570 /**571 * Returns a string containing a number represented in exponential notation.572 * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.573 */574 toExponential(fractionDigits?: number): string;575 576 /**577 * Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.578 * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive.579 */580 toPrecision(precision?: number): string;581 582 /** Returns the primitive value of the specified object. */583 valueOf(): number;584}585 586interface NumberConstructor {587 new (value?: any): Number;588 (value?: any): number;589 readonly prototype: Number;590 591 /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */592 readonly MAX_VALUE: number;593 594 /** The closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324. */595 readonly MIN_VALUE: number;596 597 /**598 * A value that is not a number.599 * In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function.600 */601 readonly NaN: number;602 603 /**604 * A value that is less than the largest negative number that can be represented in JavaScript.605 * JavaScript displays NEGATIVE_INFINITY values as -infinity.606 */607 readonly NEGATIVE_INFINITY: number;608 609 /**610 * A value greater than the largest number that can be represented in JavaScript.611 * JavaScript displays POSITIVE_INFINITY values as infinity.612 */613 readonly POSITIVE_INFINITY: number;614}615 616/** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */617declare var Number: NumberConstructor;618 619interface TemplateStringsArray extends ReadonlyArray<string> {620 readonly raw: readonly string[];621}622 623/**624 * The type of `import.meta`.625 *626 * If you need to declare that a given property exists on `import.meta`,627 * this type may be augmented via interface merging.628 */629interface ImportMeta {630}631 632/**633 * The type for the optional second argument to `import()`.634 *635 * If your host environment supports additional options, this type may be636 * augmented via interface merging.637 */638interface ImportCallOptions {639 /** @deprecated*/ assert?: ImportAssertions;640 with?: ImportAttributes;641}642 643/**644 * The type for the `assert` property of the optional second argument to `import()`.645 * @deprecated646 */647interface ImportAssertions {648 [key: string]: string;649}650 651/**652 * The type for the `with` property of the optional second argument to `import()`.653 */654interface ImportAttributes {655 [key: string]: string;656}657 658interface Math {659 /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */660 readonly E: number;661 /** The natural logarithm of 10. */662 readonly LN10: number;663 /** The natural logarithm of 2. */664 readonly LN2: number;665 /** The base-2 logarithm of e. */666 readonly LOG2E: number;667 /** The base-10 logarithm of e. */668 readonly LOG10E: number;669 /** Pi. This is the ratio of the circumference of a circle to its diameter. */670 readonly PI: number;671 /** The square root of 0.5, or, equivalently, one divided by the square root of 2. */672 readonly SQRT1_2: number;673 /** The square root of 2. */674 readonly SQRT2: number;675 /**676 * Returns the absolute value of a number (the value without regard to whether it is positive or negative).677 * For example, the absolute value of -5 is the same as the absolute value of 5.678 * @param x A numeric expression for which the absolute value is needed.679 */680 abs(x: number): number;681 /**682 * Returns the arc cosine (or inverse cosine) of a number.683 * @param x A numeric expression.684 */685 acos(x: number): number;686 /**687 * Returns the arcsine of a number.688 * @param x A numeric expression.689 */690 asin(x: number): number;691 /**692 * Returns the arctangent of a number.693 * @param x A numeric expression for which the arctangent is needed.694 */695 atan(x: number): number;696 /**697 * Returns the angle (in radians) between the X axis and the line going through both the origin and the given point.698 * @param y A numeric expression representing the cartesian y-coordinate.699 * @param x A numeric expression representing the cartesian x-coordinate.700 */701 atan2(y: number, x: number): number;702 /**703 * Returns the smallest integer greater than or equal to its numeric argument.704 * @param x A numeric expression.705 */706 ceil(x: number): number;707 /**708 * Returns the cosine of a number.709 * @param x A numeric expression that contains an angle measured in radians.710 */711 cos(x: number): number;712 /**713 * Returns e (the base of natural logarithms) raised to a power.714 * @param x A numeric expression representing the power of e.715 */716 exp(x: number): number;717 /**718 * Returns the greatest integer less than or equal to its numeric argument.719 * @param x A numeric expression.720 */721 floor(x: number): number;722 /**723 * Returns the natural logarithm (base e) of a number.724 * @param x A numeric expression.725 */726 log(x: number): number;727 /**728 * Returns the larger of a set of supplied numeric expressions.729 * @param values Numeric expressions to be evaluated.730 */731 max(...values: number[]): number;732 /**733 * Returns the smaller of a set of supplied numeric expressions.734 * @param values Numeric expressions to be evaluated.735 */736 min(...values: number[]): number;737 /**738 * Returns the value of a base expression taken to a specified power.739 * @param x The base value of the expression.740 * @param y The exponent value of the expression.741 */742 pow(x: number, y: number): number;743 /** Returns a pseudorandom number between 0 and 1. */744 random(): number;745 /**746 * Returns a supplied numeric expression rounded to the nearest integer.747 * @param x The value to be rounded to the nearest integer.748 */749 round(x: number): number;750 /**751 * Returns the sine of a number.752 * @param x A numeric expression that contains an angle measured in radians.753 */754 sin(x: number): number;755 /**756 * Returns the square root of a number.757 * @param x A numeric expression.758 */759 sqrt(x: number): number;760 /**761 * Returns the tangent of a number.762 * @param x A numeric expression that contains an angle measured in radians.763 */764 tan(x: number): number;765}766/** An intrinsic object that provides basic mathematics functionality and constants. */767declare var Math: Math;768 769/** Enables basic storage and retrieval of dates and times. */770interface Date {771 /** Returns a string representation of a date. The format of the string depends on the locale. */772 toString(): string;773 /** Returns a date as a string value. */774 toDateString(): string;775 /** Returns a time as a string value. */776 toTimeString(): string;777 /** Returns a value as a string value appropriate to the host environment's current locale. */778 toLocaleString(): string;779 /** Returns a date as a string value appropriate to the host environment's current locale. */780 toLocaleDateString(): string;781 /** Returns a time as a string value appropriate to the host environment's current locale. */782 toLocaleTimeString(): string;783 /** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */784 valueOf(): number;785 /** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */786 getTime(): number;787 /** Gets the year, using local time. */788 getFullYear(): number;789 /** Gets the year using Universal Coordinated Time (UTC). */790 getUTCFullYear(): number;791 /** Gets the month, using local time. */792 getMonth(): number;793 /** Gets the month of a Date object using Universal Coordinated Time (UTC). */794 getUTCMonth(): number;795 /** Gets the day-of-the-month, using local time. */796 getDate(): number;797 /** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */798 getUTCDate(): number;799 /** Gets the day of the week, using local time. */800 getDay(): number;801 /** Gets the day of the week using Universal Coordinated Time (UTC). */802 getUTCDay(): number;803 /** Gets the hours in a date, using local time. */804 getHours(): number;805 /** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */806 getUTCHours(): number;807 /** Gets the minutes of a Date object, using local time. */808 getMinutes(): number;809 /** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */810 getUTCMinutes(): number;811 /** Gets the seconds of a Date object, using local time. */812 getSeconds(): number;813 /** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */814 getUTCSeconds(): number;815 /** Gets the milliseconds of a Date, using local time. */816 getMilliseconds(): number;817 /** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */818 getUTCMilliseconds(): number;819 /** Gets the difference in minutes between Universal Coordinated Time (UTC) and the time on the local computer. */820 getTimezoneOffset(): number;821 /**822 * Sets the date and time value in the Date object.823 * @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT.824 */825 setTime(time: number): number;826 /**827 * Sets the milliseconds value in the Date object using local time.828 * @param ms A numeric value equal to the millisecond value.829 */830 setMilliseconds(ms: number): number;831 /**832 * Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC).833 * @param ms A numeric value equal to the millisecond value.834 */835 setUTCMilliseconds(ms: number): number;836 837 /**838 * Sets the seconds value in the Date object using local time.839 * @param sec A numeric value equal to the seconds value.840 * @param ms A numeric value equal to the milliseconds value.841 */842 setSeconds(sec: number, ms?: number): number;843 /**844 * Sets the seconds value in the Date object using Universal Coordinated Time (UTC).845 * @param sec A numeric value equal to the seconds value.846 * @param ms A numeric value equal to the milliseconds value.847 */848 setUTCSeconds(sec: number, ms?: number): number;849 /**850 * Sets the minutes value in the Date object using local time.851 * @param min A numeric value equal to the minutes value.852 * @param sec A numeric value equal to the seconds value.853 * @param ms A numeric value equal to the milliseconds value.854 */855 setMinutes(min: number, sec?: number, ms?: number): number;856 /**857 * Sets the minutes value in the Date object using Universal Coordinated Time (UTC).858 * @param min A numeric value equal to the minutes value.859 * @param sec A numeric value equal to the seconds value.860 * @param ms A numeric value equal to the milliseconds value.861 */862 setUTCMinutes(min: number, sec?: number, ms?: number): number;863 /**864 * Sets the hour value in the Date object using local time.865 * @param hours A numeric value equal to the hours value.866 * @param min A numeric value equal to the minutes value.867 * @param sec A numeric value equal to the seconds value.868 * @param ms A numeric value equal to the milliseconds value.869 */870 setHours(hours: number, min?: number, sec?: number, ms?: number): number;871 /**872 * Sets the hours value in the Date object using Universal Coordinated Time (UTC).873 * @param hours A numeric value equal to the hours value.874 * @param min A numeric value equal to the minutes value.875 * @param sec A numeric value equal to the seconds value.876 * @param ms A numeric value equal to the milliseconds value.877 */878 setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number;879 /**880 * Sets the numeric day-of-the-month value of the Date object using local time.881 * @param date A numeric value equal to the day of the month.882 */883 setDate(date: number): number;884 /**885 * Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC).886 * @param date A numeric value equal to the day of the month.887 */888 setUTCDate(date: number): number;889 /**890 * Sets the month value in the Date object using local time.891 * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.892 * @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used.893 */894 setMonth(month: number, date?: number): number;895 /**896 * Sets the month value in the Date object using Universal Coordinated Time (UTC).897 * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.898 * @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used.899 */900 setUTCMonth(month: number, date?: number): number;901 /**902 * Sets the year of the Date object using local time.903 * @param year A numeric value for the year.904 * @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified.905 * @param date A numeric value equal for the day of the month.906 */907 setFullYear(year: number, month?: number, date?: number): number;908 /**909 * Sets the year value in the Date object using Universal Coordinated Time (UTC).910 * @param year A numeric value equal to the year.911 * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied.912 * @param date A numeric value equal to the day of the month.913 */914 setUTCFullYear(year: number, month?: number, date?: number): number;915 /** Returns a date converted to a string using Universal Coordinated Time (UTC). */916 toUTCString(): string;917 /** Returns a date as a string value in ISO format. */918 toISOString(): string;919 /** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */920 toJSON(key?: any): string;921}922 923interface DateConstructor {924 new (): Date;925 new (value: number | string): Date;926 /**927 * Creates a new Date.928 * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.929 * @param monthIndex The month as a number between 0 and 11 (January to December).930 * @param date The date as a number between 1 and 31.931 * @param hours Must be supplied if minutes is supplied. A number from 0 to 23 (midnight to 11pm) that specifies the hour.932 * @param minutes Must be supplied if seconds is supplied. A number from 0 to 59 that specifies the minutes.933 * @param seconds Must be supplied if milliseconds is supplied. A number from 0 to 59 that specifies the seconds.934 * @param ms A number from 0 to 999 that specifies the milliseconds.935 */936 new (year: number, monthIndex: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date;937 (): string;938 readonly prototype: Date;939 /**940 * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970.941 * @param s A date string942 */943 parse(s: string): number;944 /**945 * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date.946 * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.947 * @param monthIndex The month as a number between 0 and 11 (January to December).948 * @param date The date as a number between 1 and 31.949 * @param hours Must be supplied if minutes is supplied. A number from 0 to 23 (midnight to 11pm) that specifies the hour.950 * @param minutes Must be supplied if seconds is supplied. A number from 0 to 59 that specifies the minutes.951 * @param seconds Must be supplied if milliseconds is supplied. A number from 0 to 59 that specifies the seconds.952 * @param ms A number from 0 to 999 that specifies the milliseconds.953 */954 UTC(year: number, monthIndex: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number;955 /** Returns the number of milliseconds elapsed since midnight, January 1, 1970 Universal Coordinated Time (UTC). */956 now(): number;957}958 959declare var Date: DateConstructor;960 961interface RegExpMatchArray extends Array<string> {962 /**963 * The index of the search at which the result was found.964 */965 index?: number;966 /**967 * A copy of the search string.968 */969 input?: string;970 /**971 * The first match. This will always be present because `null` will be returned if there are no matches.972 */973 0: string;974}975 976interface RegExpExecArray extends Array<string> {977 /**978 * The index of the search at which the result was found.979 */980 index: number;981 /**982 * A copy of the search string.983 */984 input: string;985 /**986 * The first match. This will always be present because `null` will be returned if there are no matches.987 */988 0: string;989}990 991interface RegExp {992 /**993 * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search.994 * @param string The String object or string literal on which to perform the search.995 */996 exec(string: string): RegExpExecArray | null;997 998 /**999 * Returns a Boolean value that indicates whether or not a pattern exists in a searched string.1000 * @param string String on which to perform the search.1001 */1002 test(string: string): boolean;1003 1004 /** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */1005 readonly source: string;1006 1007 /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */1008 readonly global: boolean;1009 1010 /** Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. */1011 readonly ignoreCase: boolean;1012 1013 /** Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. */1014 readonly multiline: boolean;1015 1016 lastIndex: number;1017 1018 // Non-standard extensions1019 /** @deprecated A legacy feature for browser compatibility */1020 compile(pattern: string, flags?: string): this;1021}1022 1023interface RegExpConstructor {1024 new (pattern: RegExp | string): RegExp;1025 new (pattern: string, flags?: string): RegExp;1026 (pattern: RegExp | string): RegExp;1027 (pattern: string, flags?: string): RegExp;1028 readonly "prototype": RegExp;1029 1030 // Non-standard extensions1031 /** @deprecated A legacy feature for browser compatibility */1032 "$1": string;1033 /** @deprecated A legacy feature for browser compatibility */1034 "$2": string;1035 /** @deprecated A legacy feature for browser compatibility */1036 "$3": string;1037 /** @deprecated A legacy feature for browser compatibility */1038 "$4": string;1039 /** @deprecated A legacy feature for browser compatibility */1040 "$5": string;1041 /** @deprecated A legacy feature for browser compatibility */1042 "$6": string;1043 /** @deprecated A legacy feature for browser compatibility */1044 "$7": string;1045 /** @deprecated A legacy feature for browser compatibility */1046 "$8": string;1047 /** @deprecated A legacy feature for browser compatibility */1048 "$9": string;1049 /** @deprecated A legacy feature for browser compatibility */1050 "input": string;1051 /** @deprecated A legacy feature for browser compatibility */1052 "$_": string;1053 /** @deprecated A legacy feature for browser compatibility */1054 "lastMatch": string;1055 /** @deprecated A legacy feature for browser compatibility */1056 "$&": string;1057 /** @deprecated A legacy feature for browser compatibility */1058 "lastParen": string;1059 /** @deprecated A legacy feature for browser compatibility */1060 "$+": string;1061 /** @deprecated A legacy feature for browser compatibility */1062 "leftContext": string;1063 /** @deprecated A legacy feature for browser compatibility */1064 "$`": string;1065 /** @deprecated A legacy feature for browser compatibility */1066 "rightContext": string;1067 /** @deprecated A legacy feature for browser compatibility */1068 "$'": string;1069}1070 1071declare var RegExp: RegExpConstructor;1072 1073interface Error {1074 name: string;1075 message: string;1076 stack?: string;1077}1078 1079interface ErrorConstructor {1080 new (message?: string): Error;1081 (message?: string): Error;1082 readonly prototype: Error;1083}1084 1085declare var Error: ErrorConstructor;1086 1087interface EvalError extends Error {1088}1089 1090interface EvalErrorConstructor extends ErrorConstructor {1091 new (message?: string): EvalError;1092 (message?: string): EvalError;1093 readonly prototype: EvalError;1094}1095 1096declare var EvalError: EvalErrorConstructor;1097 1098interface RangeError extends Error {1099}1100 1101interface RangeErrorConstructor extends ErrorConstructor {1102 new (message?: string): RangeError;1103 (message?: string): RangeError;1104 readonly prototype: RangeError;1105}1106 1107declare var RangeError: RangeErrorConstructor;1108 1109interface ReferenceError extends Error {1110}1111 1112interface ReferenceErrorConstructor extends ErrorConstructor {1113 new (message?: string): ReferenceError;1114 (message?: string): ReferenceError;1115 readonly prototype: ReferenceError;1116}1117 1118declare var ReferenceError: ReferenceErrorConstructor;1119 1120interface SyntaxError extends Error {1121}1122 1123interface SyntaxErrorConstructor extends ErrorConstructor {1124 new (message?: string): SyntaxError;1125 (message?: string): SyntaxError;1126 readonly prototype: SyntaxError;1127}1128 1129declare var SyntaxError: SyntaxErrorConstructor;1130 1131interface TypeError extends Error {1132}1133 1134interface TypeErrorConstructor extends ErrorConstructor {1135 new (message?: string): TypeError;1136 (message?: string): TypeError;1137 readonly prototype: TypeError;1138}1139 1140declare var TypeError: TypeErrorConstructor;1141 1142interface URIError extends Error {1143}1144 1145interface URIErrorConstructor extends ErrorConstructor {1146 new (message?: string): URIError;1147 (message?: string): URIError;1148 readonly prototype: URIError;1149}1150 1151declare var URIError: URIErrorConstructor;1152 1153interface JSON {1154 /**1155 * Converts a JavaScript Object Notation (JSON) string into an object.1156 * @param text A valid JSON string.1157 * @param reviver A function that transforms the results. This function is called for each member of the object.1158 * If a member contains nested objects, the nested objects are transformed before the parent object is.1159 * @throws {SyntaxError} If `text` is not valid JSON.1160 */1161 parse(text: string, reviver?: (this: any, key: string, value: any) => any): any;1162 /**1163 * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.1164 * @param value A JavaScript value, usually an object or array, to be converted.1165 * @param replacer A function that transforms the results.1166 * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.1167 * @throws {TypeError} If a circular reference or a BigInt value is found.1168 */1169 stringify(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;1170 /**1171 * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.1172 * @param value A JavaScript value, usually an object or array, to be converted.1173 * @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified.1174 * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.1175 * @throws {TypeError} If a circular reference or a BigInt value is found.1176 */1177 stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string;1178}1179 1180/**1181 * An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format.1182 */1183declare var JSON: JSON;1184 1185/////////////////////////////1186/// ECMAScript Array API (specially handled by compiler)1187/////////////////////////////1188 1189interface ReadonlyArray<T> {1190 /**1191 * Gets the length of the array. This is a number one higher than the highest element defined in an array.1192 */1193 readonly length: number;1194 /**1195 * Returns a string representation of an array.1196 */1197 toString(): string;1198 /**1199 * Returns a string representation of an array. The elements are converted to string using their toLocaleString methods.1200 */