1 /*! *****************************************************************************
2 Copyright (c) Microsoft Corporation. All rights reserved.
3 Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4 this file except in compliance with the License. You may obtain a copy of the
5 License at http://www.apache.org/licenses/LICENSE-2.0
7 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8 KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9 WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10 MERCHANTABLITY OR NON-INFRINGEMENT.
12 See the Apache Version 2.0 License for specific language governing permissions
13 and limitations under the License.
14 ***************************************************************************** */
18 /// <reference no-default-lib="true"/>
\r
21 /// <reference lib="es2015.symbol" />
\r
23 interface SymbolConstructor {
\r
25 * A method that determines if a constructor object recognizes an object as one of the
\r
26 * constructor’s instances. Called by the semantics of the instanceof operator.
\r
28 readonly hasInstance: symbol;
\r
31 * A Boolean value that if true indicates that an object should flatten to its array elements
\r
32 * by Array.prototype.concat.
\r
34 readonly isConcatSpreadable: symbol;
\r
37 * A regular expression method that matches the regular expression against a string. Called
\r
38 * by the String.prototype.match method.
\r
40 readonly match: symbol;
\r
43 * A regular expression method that replaces matched substrings of a string. Called by the
\r
44 * String.prototype.replace method.
\r
46 readonly replace: symbol;
\r
49 * A regular expression method that returns the index within a string that matches the
\r
50 * regular expression. Called by the String.prototype.search method.
\r
52 readonly search: symbol;
\r
55 * A function valued property that is the constructor function that is used to create
\r
58 readonly species: symbol;
\r
61 * A regular expression method that splits a string at the indices that match the regular
\r
62 * expression. Called by the String.prototype.split method.
\r
64 readonly split: symbol;
\r
67 * A method that converts an object to a corresponding primitive value.
\r
68 * Called by the ToPrimitive abstract operation.
\r
70 readonly toPrimitive: symbol;
\r
73 * A String value that is used in the creation of the default string description of an object.
\r
74 * Called by the built-in method Object.prototype.toString.
\r
76 readonly toStringTag: symbol;
\r
79 * An Object whose own property names are property names that are excluded from the 'with'
\r
80 * environment bindings of the associated objects.
\r
82 readonly unscopables: symbol;
\r
87 * Converts a Symbol object to a symbol.
\r
89 [Symbol.toPrimitive](hint: string): symbol;
\r
91 readonly [Symbol.toStringTag]: string;
\r
94 interface Array<T> {
\r
96 * Returns an object whose properties have the value 'true'
\r
97 * when they will be absent when used in a 'with' statement.
\r
99 [Symbol.unscopables](): {
\r
100 copyWithin: boolean;
\r
104 findIndex: boolean;
\r
112 * Converts a Date object to a string.
\r
114 [Symbol.toPrimitive](hint: "default"): string;
\r
116 * Converts a Date object to a string.
\r
118 [Symbol.toPrimitive](hint: "string"): string;
\r
120 * Converts a Date object to a number.
\r
122 [Symbol.toPrimitive](hint: "number"): number;
\r
124 * Converts a Date object to a string or number.
\r
126 * @param hint The strings "number", "string", or "default" to specify what primitive to return.
\r
128 * @throws {TypeError} If 'hint' was given something other than "number", "string", or "default".
\r
129 * @returns A number if 'hint' was "number", a string if 'hint' was "string" or "default".
\r
131 [Symbol.toPrimitive](hint: string): string | number;
\r
134 interface Map<K, V> {
\r
135 readonly [Symbol.toStringTag]: string;
\r
138 interface WeakMap<K extends object, V> {
\r
139 readonly [Symbol.toStringTag]: string;
\r
143 readonly [Symbol.toStringTag]: string;
\r
146 interface WeakSet<T extends object> {
\r
147 readonly [Symbol.toStringTag]: string;
\r
151 readonly [Symbol.toStringTag]: string;
\r
154 interface Function {
\r
156 * Determines whether the given value inherits from this function if this function was used
\r
157 * as a constructor function.
\r
159 * A constructor function can control which objects are recognized as its instances by
\r
160 * 'instanceof' by overriding this method.
\r
162 [Symbol.hasInstance](value: any): boolean;
\r
165 interface GeneratorFunction {
\r
166 readonly [Symbol.toStringTag]: string;
\r
170 readonly [Symbol.toStringTag]: string;
\r
173 interface Promise<T> {
\r
174 readonly [Symbol.toStringTag]: string;
\r
177 interface PromiseConstructor {
\r
178 readonly [Symbol.species]: PromiseConstructor;
\r
183 * Matches a string with this regular expression, and returns an array containing the results of
\r
185 * @param string A string to search within.
\r
187 [Symbol.match](string: string): RegExpMatchArray | null;
\r
190 * Replaces text in a string, using this regular expression.
\r
191 * @param string A String object or string literal whose contents matching against
\r
192 * this regular expression will be replaced
\r
193 * @param replaceValue A String object or string literal containing the text to replace for every
\r
194 * successful match of this regular expression.
\r
196 [Symbol.replace](string: string, replaceValue: string): string;
\r
199 * Replaces text in a string, using this regular expression.
\r
200 * @param string A String object or string literal whose contents matching against
\r
201 * this regular expression will be replaced
\r
202 * @param replacer A function that returns the replacement text.
\r
204 [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string;
\r
207 * Finds the position beginning first substring match in a regular expression search
\r
208 * using this regular expression.
\r
210 * @param string The string to search within.
\r
212 [Symbol.search](string: string): number;
\r
215 * Returns an array of substrings that were delimited by strings in the original input that
\r
216 * match against this regular expression.
\r
218 * If the regular expression contains capturing parentheses, then each time this
\r
219 * regular expression matches, the results (including any undefined results) of the
\r
220 * capturing parentheses are spliced.
\r
222 * @param string string value to split
\r
223 * @param limit if not undefined, the output array is truncated so that it contains no more
\r
224 * than 'limit' elements.
\r
226 [Symbol.split](string: string, limit?: number): string[];
\r
229 interface RegExpConstructor {
\r
230 readonly [Symbol.species]: RegExpConstructor;
\r
235 * Matches a string or an object that supports being matched against, and returns an array
\r
236 * containing the results of that search, or null if no matches are found.
\r
237 * @param matcher An object that supports being matched against.
\r
239 match(matcher: { [Symbol.match](string: string): RegExpMatchArray | null; }): RegExpMatchArray | null;
\r
242 * Replaces text in a string, using an object that supports replacement within a string.
\r
243 * @param searchValue A object can search for and replace matches within a string.
\r
244 * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.
\r
246 replace(searchValue: { [Symbol.replace](string: string, replaceValue: string): string; }, replaceValue: string): string;
\r
249 * Replaces text in a string, using an object that supports replacement within a string.
\r
250 * @param searchValue A object can search for and replace matches within a string.
\r
251 * @param replacer A function that returns the replacement text.
\r
253 replace(searchValue: { [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; }, replacer: (substring: string, ...args: any[]) => string): string;
\r
256 * Finds the first substring match in a regular expression search.
\r
257 * @param searcher An object which supports searching within a string.
\r
259 search(searcher: { [Symbol.search](string: string): number; }): number;
\r
262 * Split a string into substrings using the specified separator and return them as an array.
\r
263 * @param splitter An object that can split a string.
\r
264 * @param limit A value used to limit the number of elements returned in the array.
\r
266 split(splitter: { [Symbol.split](string: string, limit?: number): string[]; }, limit?: number): string[];
\r
269 interface ArrayBuffer {
\r
270 readonly [Symbol.toStringTag]: string;
\r
273 interface DataView {
\r
274 readonly [Symbol.toStringTag]: string;
\r
277 interface Int8Array {
\r
278 readonly [Symbol.toStringTag]: "Int8Array";
\r
281 interface Uint8Array {
\r
282 readonly [Symbol.toStringTag]: "Uint8Array";
\r
285 interface Uint8ClampedArray {
\r
286 readonly [Symbol.toStringTag]: "Uint8ClampedArray";
\r
289 interface Int16Array {
\r
290 readonly [Symbol.toStringTag]: "Int16Array";
\r
293 interface Uint16Array {
\r
294 readonly [Symbol.toStringTag]: "Uint16Array";
\r
297 interface Int32Array {
\r
298 readonly [Symbol.toStringTag]: "Int32Array";
\r
301 interface Uint32Array {
\r
302 readonly [Symbol.toStringTag]: "Uint32Array";
\r
305 interface Float32Array {
\r
306 readonly [Symbol.toStringTag]: "Float32Array";
\r
309 interface Float64Array {
\r
310 readonly [Symbol.toStringTag]: "Float64Array";
\r
313 interface ArrayConstructor {
\r
314 readonly [Symbol.species]: ArrayConstructor;
\r
316 interface MapConstructor {
\r
317 readonly [Symbol.species]: MapConstructor;
\r
319 interface SetConstructor {
\r
320 readonly [Symbol.species]: SetConstructor;
\r
322 interface ArrayBufferConstructor {
\r
323 readonly [Symbol.species]: ArrayBufferConstructor;
\r