1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | declare const one0: unique symbol;
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | declare const one1: unique symbol;
|
18 |
|
19 | interface Boolean {
|
20 | readonly [one0]: unique symbol;
|
21 | }
|
22 | interface BooleanConstructor {
|
23 | readonly [one0]: unique symbol;
|
24 | }
|
25 | declare const Boolean: BooleanConstructor;
|
26 |
|
27 | interface Number {
|
28 | readonly [one0]: unique symbol;
|
29 | }
|
30 | interface NumberConstructor {
|
31 | readonly [one0]: unique symbol;
|
32 | }
|
33 | declare const Number: NumberConstructor;
|
34 |
|
35 | interface String {
|
36 | readonly [one0]: unique symbol;
|
37 | }
|
38 | interface StringConstructor {
|
39 | readonly [one0]: unique symbol;
|
40 | }
|
41 | declare const String: StringConstructor;
|
42 |
|
43 | interface Function {}
|
44 | interface FunctionConstructor {
|
45 | readonly [one0]: unique symbol;
|
46 | }
|
47 | declare const Function: FunctionConstructor;
|
48 |
|
49 | interface CallableFunction extends Function {
|
50 | |
51 |
|
52 |
|
53 |
|
54 |
|
55 | apply<T, R>(this: (this: T) => R, thisArg: T): R;
|
56 | apply<T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T, args: A): R;
|
57 |
|
58 | /**
|
59 | * Calls the function with the specified object as the this value and the specified rest arguments as the arguments.
|
60 | * @param thisArg The object to be used as the this object.
|
61 | * @param args Argument values to be passed to the function.
|
62 | */
|
63 | call<T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T, ...args: A): R;
|
64 |
|
65 | /**
|
66 | * For a given function, creates a bound function that has the same body as the original function.
|
67 | * The this object of the bound function is associated with the specified object, and has the specified initial parameters.
|
68 | * @param thisArg The object to be used as the this object.
|
69 | * @param args Arguments to bind to the parameters of the function.
|
70 | */
|
71 | bind<T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R;
|
72 | bind<T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R;
|
73 | bind<T, A0, A1, A extends any[], R>(
|
74 | this: (this: T, arg0: A0, arg1: A1, ...args: A) => R,
|
75 | thisArg: T,
|
76 | arg0: A0,
|
77 | arg1: A1,
|
78 | ): (...args: A) => R;
|
79 | bind<T, A0, A1, A2, A extends any[], R>(
|
80 | this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R,
|
81 | thisArg: T,
|
82 | arg0: A0,
|
83 | arg1: A1,
|
84 | arg2: A2,
|
85 | ): (...args: A) => R;
|
86 | bind<T, A0, A1, A2, A3, A extends any[], R>(
|
87 | this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R,
|
88 | thisArg: T,
|
89 | arg0: A0,
|
90 | arg1: A1,
|
91 | arg2: A2,
|
92 | arg3: A3,
|
93 | ): (...args: A) => R;
|
94 | bind<T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R;
|
95 | }
|
96 |
|
97 | interface NewableFunction extends Function {
|
98 | |
99 |
|
100 |
|
101 |
|
102 |
|
103 | apply<T>(this: new () => T, thisArg: T): void;
|
104 | apply<T, A extends any[]>(this: new (...args: A) => T, thisArg: T, args: A): void;
|
105 |
|
106 | /**
|
107 | * Calls the function with the specified object as the this value and the specified rest arguments as the arguments.
|
108 | * @param thisArg The object to be used as the this object.
|
109 | * @param args Argument values to be passed to the function.
|
110 | */
|
111 | call<T, A extends any[]>(this: new (...args: A) => T, thisArg: T, ...args: A): void;
|
112 |
|
113 | /**
|
114 | * For a given function, creates a bound function that has the same body as the original function.
|
115 | * The this object of the bound function is associated with the specified object, and has the specified initial parameters.
|
116 | * @param thisArg The object to be used as the this object.
|
117 | * @param args Arguments to bind to the parameters of the function.
|
118 | */
|
119 | bind<A extends any[], R>(this: new (...args: A) => R, thisArg: any): new (...args: A) => R;
|
120 | bind<A0, A extends any[], R>(this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R;
|
121 | bind<A0, A1, A extends any[], R>(
|
122 | this: new (arg0: A0, arg1: A1, ...args: A) => R,
|
123 | thisArg: any,
|
124 | arg0: A0,
|
125 | arg1: A1,
|
126 | ): new (...args: A) => R;
|
127 | bind<A0, A1, A2, A extends any[], R>(
|
128 | this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R,
|
129 | thisArg: any,
|
130 | arg0: A0,
|
131 | arg1: A1,
|
132 | arg2: A2,
|
133 | ): new (...args: A) => R;
|
134 | bind<A0, A1, A2, A3, A extends any[], R>(
|
135 | this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R,
|
136 | thisArg: any,
|
137 | arg0: A0,
|
138 | arg1: A1,
|
139 | arg2: A2,
|
140 | arg3: A3,
|
141 | ): new (...args: A) => R;
|
142 | bind<AX, R>(this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R;
|
143 | }
|
144 |
|
145 | interface IArguments {
|
146 | readonly [one0]: unique symbol;
|
147 | }
|
148 |
|
149 | interface Object {}
|
150 | interface ObjectConstructor {
|
151 | |
152 |
|
153 |
|
154 |
|
155 | readonly keys: (o: {}) => string[];
|
156 | readonly [one0]: unique symbol;
|
157 | }
|
158 | declare const Object: ObjectConstructor;
|
159 |
|
160 | interface RegExp {
|
161 | readonly [one0]: unique symbol;
|
162 | }
|
163 | interface RegExpConstructor {
|
164 | readonly [one0]: unique symbol;
|
165 | }
|
166 | declare const RegExp: RegExpConstructor;
|
167 |
|
168 | interface Error {
|
169 | readonly message: string;
|
170 | readonly [one0]: unique symbol;
|
171 | }
|
172 | interface ErrorConstructor {
|
173 | new (message?: string): Error;
|
174 | readonly [one0]: unique symbol;
|
175 | }
|
176 | declare const Error: ErrorConstructor;
|
177 |
|
178 | interface Symbol {
|
179 | readonly [one0]: unique symbol;
|
180 | }
|
181 | interface SymbolConstructor {
|
182 | |
183 |
|
184 |
|
185 |
|
186 |
|
187 | readonly for: (key: string) => symbol;
|
188 | |
189 |
|
190 |
|
191 |
|
192 | readonly iterator: symbol;
|
193 | |
194 |
|
195 |
|
196 |
|
197 | readonly toPrimitive: symbol;
|
198 | readonly [one0]: unique symbol;
|
199 | }
|
200 | declare var Symbol: SymbolConstructor;
|
201 |
|
202 |
|
203 | type BufferEncoding = 'ascii' | 'utf8' | 'utf16le' | 'ucs2' | 'base64' | 'latin1' | 'hex';
|
204 | interface Buffer {
|
205 | |
206 |
|
207 |
|
208 | readonly length: number;
|
209 | readonly equals: (otherBuffer: Buffer) => boolean;
|
210 | readonly toString: (encoding: 'utf8') => string;
|
211 | readonly toInteger: () => number;
|
212 | |
213 |
|
214 |
|
215 |
|
216 |
|
217 | readonly slice: (start?: number, end?: number) => Buffer;
|
218 | readonly [n: number]: number;
|
219 | readonly [one0]: unique symbol;
|
220 | }
|
221 | interface BufferConstructor {
|
222 | |
223 |
|
224 |
|
225 |
|
226 |
|
227 | readonly from: (str: string, encoding?: BufferEncoding) => Buffer;
|
228 | |
229 |
|
230 |
|
231 |
|
232 |
|
233 |
|
234 |
|
235 |
|
236 | readonly concat: (list: Buffer[]) => Buffer;
|
237 | readonly [one0]: unique symbol;
|
238 | }
|
239 |
|
240 |
|
241 |
|
242 |
|
243 |
|
244 | declare var Buffer: BufferConstructor;
|
245 |
|
246 | interface Console {
|
247 | |
248 |
|
249 |
|
250 | readonly log: (message?: any, ...optionalParams: any[]) => void;
|
251 | readonly [one0]: unique symbol;
|
252 | }
|
253 |
|
254 | declare var console: Console;
|
255 |
|
256 | interface IteratorResult<T> {
|
257 | readonly done: boolean;
|
258 | readonly value: T;
|
259 | readonly [one0]: unique symbol;
|
260 | }
|
261 |
|
262 | interface Iterator<T> {
|
263 | readonly next: (value?: any) => IteratorResult<T>;
|
264 | readonly [one0]: unique symbol;
|
265 | }
|
266 |
|
267 | interface Iterable<T> {
|
268 | readonly [Symbol.iterator]: () => Iterator<T>;
|
269 | readonly [one0]: Iterator<T>[typeof one0];
|
270 | }
|
271 |
|
272 | interface IterableIterator<T> extends Iterator<T> {
|
273 | readonly [Symbol.iterator]: () => IterableIterator<T>;
|
274 | readonly [one1]: unique symbol;
|
275 | }
|
276 |
|
277 | interface ReadonlyArray<T> extends Iterable<T> {
|
278 | readonly [Symbol.iterator]: () => IterableIterator<T>;
|
279 | |
280 |
|
281 |
|
282 | readonly length: number;
|
283 | |
284 |
|
285 |
|
286 | readonly entries: () => IterableIterator<[number, T]>;
|
287 | |
288 |
|
289 |
|
290 | readonly toString: () => string;
|
291 | |
292 |
|
293 |
|
294 |
|
295 | readonly concat: {
|
296 | <T>(...items: ConcatArray<T>[]): T[];
|
297 | <T>(...items: T[]): T[];
|
298 | <T>(...items: (T | ConcatArray<T>)[]): T[];
|
299 | };
|
300 | |
301 |
|
302 |
|
303 |
|
304 | readonly join: (separator?: string) => string;
|
305 | |
306 |
|
307 |
|
308 |
|
309 |
|
310 | readonly slice: (start?: number, end?: number) => T[];
|
311 | |
312 |
|
313 |
|
314 |
|
315 | readonly every: (callbackfn: (value: T, index: number) => boolean) => boolean;
|
316 | |
317 |
|
318 |
|
319 |
|
320 | readonly some: (callbackfn: (value: T, index: number) => boolean) => boolean;
|
321 | |
322 |
|
323 |
|
324 |
|
325 | readonly forEach: (callbackfn: (value: T, index: number) => void) => void;
|
326 | |
327 |
|
328 |
|
329 |
|
330 | readonly map: <U>(callbackfn: (value: T, index: number) => U) => U[];
|
331 | |
332 |
|
333 |
|
334 |
|
335 |
|
336 | readonly reduce: {
|
337 | (callbackfn: (previousValue: T, currentValue: T, currentIndex: number) => T, initialValue: T): T;
|
338 | <U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number) => U, initialValue: U): U;
|
339 | };
|
340 | /**
|
341 | * Returns the elements of an array that meet the condition specified in a callback function.
|
342 | * @param callbackfn A function that accepts up to two arguments. The filter method calls the callbackfn function one time for each element in the array.
|
343 | */
|
344 | readonly filter: {
|
345 | <S extends T>(callbackfn: (value: T, index: number) => value is S): S[];
|
346 | (callbackfn: (value: T, index: number) => any): T[];
|
347 | };
|
348 |
|
349 | readonly [n: number]: T;
|
350 | readonly [one1]: unique symbol;
|
351 | }
|
352 |
|
353 | type ConcatArray<T> = Array<T> | ReadonlyArray<T>;
|
354 |
|
355 | interface Array<T> extends Iterable<T> {
|
356 | readonly [Symbol.iterator]: () => IterableIterator<T>;
|
357 | |
358 |
|
359 |
|
360 | readonly length: number;
|
361 | |
362 |
|
363 |
|
364 | readonly entries: () => IterableIterator<[number, T]>;
|
365 | |
366 |
|
367 |
|
368 | readonly toString: () => string;
|
369 | |
370 |
|
371 |
|
372 |
|
373 | readonly concat: {
|
374 | <T>(...items: ConcatArray<T>[]): T[];
|
375 | <T>(...items: T[]): T[];
|
376 | <T>(...items: (T | ConcatArray<T>)[]): T[];
|
377 | };
|
378 | |
379 |
|
380 |
|
381 |
|
382 | readonly join: (separator?: string) => string;
|
383 | |
384 |
|
385 |
|
386 |
|
387 |
|
388 | readonly slice: (start?: number, end?: number) => T[];
|
389 | |
390 |
|
391 |
|
392 |
|
393 | readonly every: (callbackfn: (value: T, index: number) => boolean) => boolean;
|
394 | |
395 |
|
396 |
|
397 |
|
398 | readonly some: (callbackfn: (value: T, index: number) => boolean) => boolean;
|
399 | |
400 |
|
401 |
|
402 |
|
403 | readonly forEach: (callbackfn: (value: T, index: number) => void) => void;
|
404 | |
405 |
|
406 |
|
407 |
|
408 | readonly map: <U>(callbackfn: (value: T, index: number) => U) => U[];
|
409 |
|
410 | |
411 |
|
412 |
|
413 |
|
414 |
|
415 | reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number) => T, initialValue: T): T;
|
416 | reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number) => U, initialValue: U): U;
|
417 | /**
|
418 | * Returns the elements of an array that meet the condition specified in a callback function.
|
419 | * @param callbackfn A function that accepts up to two arguments. The filter method calls the callbackfn function one time for each element in the array.
|
420 | */
|
421 | readonly filter: {
|
422 | <S extends T>(callbackfn: (value: T, index: number) => value is S): S[];
|
423 | (callbackfn: (value: T, index: number) => any): T[];
|
424 | };
|
425 | /**
|
426 | * Removes the last element from an array and returns it.
|
427 | */
|
428 | readonly pop: () => T | undefined;
|
429 |
|
430 | |
431 |
|
432 |
|
433 |
|
434 | push(...items: T[]): number;
|
435 |
|
436 | [n: number]: T;
|
437 | readonly [one1]: ReadonlyArray<T>[typeof one1];
|
438 | }
|
439 | interface ArrayConstructor {
|
440 | readonly [one0]: unique symbol;
|
441 | }
|
442 | declare const Array: ArrayConstructor;
|
443 |
|
444 | interface Map<K, V> extends Iterable<[K, V]> {
|
445 | readonly [Symbol.iterator]: () => IterableIterator<[K, V]>;
|
446 | readonly forEach: (callbackfn: (value: V, key: K) => void) => void;
|
447 | readonly get: (key: K) => V | undefined;
|
448 | readonly has: (key: K) => boolean;
|
449 | readonly size: number;
|
450 | readonly delete: (key: K) => boolean;
|
451 | readonly set: (key: K, value: V) => this;
|
452 | readonly [one1]: ReadonlyMap<K, V>[typeof one1];
|
453 | }
|
454 | interface MapConstructor {
|
455 | new <K = any, V = any>(): Map<K, V>;
|
456 | readonly prototype: Map<any, any>;
|
457 | readonly [one0]: unique symbol;
|
458 | }
|
459 | declare var Map: MapConstructor;
|
460 |
|
461 | interface ReadonlyMap<K, V> extends Iterable<[K, V]> {
|
462 | readonly [Symbol.iterator]: () => IterableIterator<[K, V]>;
|
463 | readonly forEach: (callbackfn: (value: V, key: K) => void) => void;
|
464 | readonly get: (key: K) => V | undefined;
|
465 | readonly has: (key: K) => boolean;
|
466 | readonly size: number;
|
467 | readonly [one1]: unique symbol;
|
468 | }
|
469 |
|
470 | interface Set<T> extends Iterable<T> {
|
471 | readonly [Symbol.iterator]: () => IterableIterator<T>;
|
472 | readonly forEach: (callbackfn: (value: T) => void) => void;
|
473 | readonly has: (value: T) => boolean;
|
474 | readonly size: number;
|
475 | readonly delete: (value: T) => boolean;
|
476 | readonly add: (value: T) => this;
|
477 | readonly [one1]: ReadonlySet<T>[typeof one1];
|
478 | }
|
479 | interface SetConstructor {
|
480 | new <T = any>(values?: ReadonlyArray<T>): Set<T>;
|
481 | readonly prototype: Set<any>;
|
482 | }
|
483 | declare var Set: SetConstructor;
|
484 |
|
485 | interface ReadonlySet<T> extends Iterable<T> {
|
486 | readonly [Symbol.iterator]: () => IterableIterator<T>;
|
487 | readonly forEach: (callbackfn: (value: T) => void) => void;
|
488 | readonly has: (value: T) => boolean;
|
489 | readonly size: number;
|
490 | readonly [one1]: unique symbol;
|
491 | }
|
492 |
|
493 | interface PropertyDescriptor {
|
494 | configurable?: boolean;
|
495 | enumerable?: boolean;
|
496 | value?: any;
|
497 | writable?: boolean;
|
498 | get?(): any;
|
499 | set?(v: any): void;
|
500 | }
|
501 |
|
502 | interface TypedPropertyDescriptor<T> {
|
503 | enumerable?: boolean;
|
504 | configurable?: boolean;
|
505 | writable?: boolean;
|
506 | value?: T;
|
507 | get?: () => T;
|
508 | set?: (value: T) => void;
|
509 | }
|
510 |
|
511 | interface TemplateStringsArray extends Array<string> {}
|
512 |
|
513 | type Constructor<T> = new (...args: any[]) => T;
|
514 | type Parameters<T extends Function> = T extends (...args: infer U) => any ? U : never;
|
515 | type ReturnType<T extends Function> = T extends (...args: any[]) => infer R ? R : never;
|