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
86 readonly [Symbol.toStringTag]: string;
\r
89 interface Array<T> {
\r
91 * Returns an object whose properties have the value 'true'
\r
92 * when they will be absent when used in a 'with' statement.
\r
94 [Symbol.unscopables](): {
\r
95 copyWithin: boolean;
\r
107 * Converts a Date object to a string.
\r
109 [Symbol.toPrimitive](hint: "default"): string;
\r
111 * Converts a Date object to a string.
\r
113 [Symbol.toPrimitive](hint: "string"): string;
\r
115 * Converts a Date object to a number.
\r
117 [Symbol.toPrimitive](hint: "number"): number;
\r
119 * Converts a Date object to a string or number.
\r
121 * @param hint The strings "number", "string", or "default" to specify what primitive to return.
\r
123 * @throws {TypeError} If 'hint' was given something other than "number", "string", or "default".
\r
124 * @returns A number if 'hint' was "number", a string if 'hint' was "string" or "default".
\r
126 [Symbol.toPrimitive](hint: string): string | number;
\r
129 interface Map<K, V> {
\r
130 readonly [Symbol.toStringTag]: string;
\r
133 interface WeakMap<K extends object, V> {
\r
134 readonly [Symbol.toStringTag]: string;
\r
138 readonly [Symbol.toStringTag]: string;
\r
141 interface WeakSet<T extends object> {
\r
142 readonly [Symbol.toStringTag]: string;
\r
146 readonly [Symbol.toStringTag]: string;
\r
149 interface Function {
\r
151 * Determines whether the given value inherits from this function if this function was used
\r
152 * as a constructor function.
\r
154 * A constructor function can control which objects are recognized as its instances by
\r
155 * 'instanceof' by overriding this method.
\r
157 [Symbol.hasInstance](value: any): boolean;
\r
160 interface GeneratorFunction {
\r
161 readonly [Symbol.toStringTag]: string;
\r
165 readonly [Symbol.toStringTag]: string;
\r
168 interface Promise<T> {
\r
169 readonly [Symbol.toStringTag]: string;
\r
172 interface PromiseConstructor {
\r
173 readonly [Symbol.species]: PromiseConstructor;
\r
178 * Matches a string with this regular expression, and returns an array containing the results of
\r
180 * @param string A string to search within.
\r
182 [Symbol.match](string: string): RegExpMatchArray | null;
\r
185 * Replaces text in a string, using this regular expression.
\r
186 * @param string A String object or string literal whose contents matching against
\r
187 * this regular expression will be replaced
\r
188 * @param replaceValue A String object or string literal containing the text to replace for every
\r
189 * successful match of this regular expression.
\r
191 [Symbol.replace](string: string, replaceValue: string): string;
\r
194 * Replaces text in a string, using this regular expression.
\r
195 * @param string A String object or string literal whose contents matching against
\r
196 * this regular expression will be replaced
\r
197 * @param replacer A function that returns the replacement text.
\r
199 [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string;
\r
202 * Finds the position beginning first substring match in a regular expression search
\r
203 * using this regular expression.
\r
205 * @param string The string to search within.
\r
207 [Symbol.search](string: string): number;
\r
210 * Returns an array of substrings that were delimited by strings in the original input that
\r
211 * match against this regular expression.
\r
213 * If the regular expression contains capturing parentheses, then each time this
\r
214 * regular expression matches, the results (including any undefined results) of the
\r
215 * capturing parentheses are spliced.
\r
217 * @param string string value to split
\r
218 * @param limit if not undefined, the output array is truncated so that it contains no more
\r
219 * than 'limit' elements.
\r
221 [Symbol.split](string: string, limit?: number): string[];
\r
224 interface RegExpConstructor {
\r
225 readonly [Symbol.species]: RegExpConstructor;
\r
230 * Matches a string or an object that supports being matched against, and returns an array
\r
231 * containing the results of that search, or null if no matches are found.
\r
232 * @param matcher An object that supports being matched against.
\r
234 match(matcher: { [Symbol.match](string: string): RegExpMatchArray | null; }): RegExpMatchArray | null;
\r
237 * Replaces text in a string, using an object that supports replacement within a string.
\r
238 * @param searchValue A object can search for and replace matches within a string.
\r
239 * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.
\r
241 replace(searchValue: { [Symbol.replace](string: string, replaceValue: string): string; }, replaceValue: string): string;
\r
244 * Replaces text in a string, using an object that supports replacement within a string.
\r
245 * @param searchValue A object can search for and replace matches within a string.
\r
246 * @param replacer A function that returns the replacement text.
\r
248 replace(searchValue: { [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; }, replacer: (substring: string, ...args: any[]) => string): string;
\r
251 * Finds the first substring match in a regular expression search.
\r
252 * @param searcher An object which supports searching within a string.
\r
254 search(searcher: { [Symbol.search](string: string): number; }): number;
\r
257 * Split a string into substrings using the specified separator and return them as an array.
\r
258 * @param splitter An object that can split a string.
\r
259 * @param limit A value used to limit the number of elements returned in the array.
\r
261 split(splitter: { [Symbol.split](string: string, limit?: number): string[]; }, limit?: number): string[];
\r
264 interface ArrayBuffer {
\r
265 readonly [Symbol.toStringTag]: string;
\r
268 interface DataView {
\r
269 readonly [Symbol.toStringTag]: string;
\r
272 interface Int8Array {
\r
273 readonly [Symbol.toStringTag]: "Int8Array";
\r
276 interface Uint8Array {
\r
277 readonly [Symbol.toStringTag]: "Uint8Array";
\r
280 interface Uint8ClampedArray {
\r
281 readonly [Symbol.toStringTag]: "Uint8ClampedArray";
\r
284 interface Int16Array {
\r
285 readonly [Symbol.toStringTag]: "Int16Array";
\r
288 interface Uint16Array {
\r
289 readonly [Symbol.toStringTag]: "Uint16Array";
\r
292 interface Int32Array {
\r
293 readonly [Symbol.toStringTag]: "Int32Array";
\r
296 interface Uint32Array {
\r
297 readonly [Symbol.toStringTag]: "Uint32Array";
\r
300 interface Float32Array {
\r
301 readonly [Symbol.toStringTag]: "Float32Array";
\r
304 interface Float64Array {
\r
305 readonly [Symbol.toStringTag]: "Float64Array";
\r
308 interface ArrayConstructor {
\r
309 readonly [Symbol.species]: ArrayConstructor;
\r
311 interface MapConstructor {
\r
312 readonly [Symbol.species]: MapConstructor;
\r
314 interface SetConstructor {
\r
315 readonly [Symbol.species]: SetConstructor;
\r
317 interface ArrayBufferConstructor {
\r
318 readonly [Symbol.species]: ArrayBufferConstructor;
\r