yavascript 0.0.6 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +68 -19
- package/bin/darwin-arm64/yavascript +0 -0
- package/bin/darwin-x86_64/yavascript +0 -0
- package/bin/linux-aarch64/yavascript +0 -0
- package/bin/linux-amd64/yavascript +0 -0
- package/bin/windows-x86_64/yavascript.exe +0 -0
- package/lib/binary-path.js +28 -25
- package/lib/cli.js +1 -1
- package/lib/index.js +4 -2
- package/package.json +1 -1
- package/yavascript.d.ts +2178 -198
- package/bin/darwin/yavascript +0 -0
- package/bin/darwin-arm/yavascript +0 -0
- package/bin/linux/yavascript +0 -0
- package/bin/windows/yavascript.exe +0 -0
package/yavascript.d.ts
CHANGED
|
@@ -3,6 +3,71 @@
|
|
|
3
3
|
// YavaScript APIs
|
|
4
4
|
// ---------------
|
|
5
5
|
// ===============
|
|
6
|
+
/** Info about the currently-running yavascript binary */
|
|
7
|
+
declare const yavascript: {
|
|
8
|
+
/**
|
|
9
|
+
* The version of the currently-running yavascript binary.
|
|
10
|
+
*
|
|
11
|
+
* Will be something formatted like one of these:
|
|
12
|
+
* - "v0.0.7"
|
|
13
|
+
* - "v0.1.3-alpha"
|
|
14
|
+
* - "git-286a3a336849"
|
|
15
|
+
* - "git-286a3a336849-dirty"
|
|
16
|
+
*
|
|
17
|
+
* Or, more formally: either a "V" version string or a "GIT" version string:
|
|
18
|
+
* - "V" version strings start with the character 'v', followed by a semver
|
|
19
|
+
* version string, optionally followed by the character '-' and any
|
|
20
|
+
* arbitrary content afterwards.
|
|
21
|
+
* - "GIT" version strings start with the prefix "git-", followed by the
|
|
22
|
+
* first 12 digits of a git commit SHA, optionally followed by the
|
|
23
|
+
* character '-' and any arbitrary content afterwards.
|
|
24
|
+
*/
|
|
25
|
+
version: string;
|
|
26
|
+
|
|
27
|
+
/** The processor architecture we're running on. */
|
|
28
|
+
arch: "x86_64" | "arm64";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The version of the ecma262 standard supported by the currently-running yavascript binary.
|
|
32
|
+
*
|
|
33
|
+
* Will always be in the format "ES" + a year. Is never lower than ES2020.
|
|
34
|
+
*/
|
|
35
|
+
ecmaVersion: string;
|
|
36
|
+
|
|
37
|
+
/** The compilers yavascript uses internally to load files. */
|
|
38
|
+
compilers: {
|
|
39
|
+
js(
|
|
40
|
+
code: string,
|
|
41
|
+
options?: { filename?: string; expression?: boolean }
|
|
42
|
+
): string;
|
|
43
|
+
|
|
44
|
+
tsx(
|
|
45
|
+
code: string,
|
|
46
|
+
options?: { filename?: string; expression?: boolean }
|
|
47
|
+
): string;
|
|
48
|
+
|
|
49
|
+
ts(
|
|
50
|
+
code: string,
|
|
51
|
+
options?: { filename?: string; expression?: boolean }
|
|
52
|
+
): string;
|
|
53
|
+
|
|
54
|
+
jsx(
|
|
55
|
+
code: string,
|
|
56
|
+
options?: { filename?: string; expression?: boolean }
|
|
57
|
+
): string;
|
|
58
|
+
|
|
59
|
+
coffee(
|
|
60
|
+
code: string,
|
|
61
|
+
options?: { filename?: string; expression?: boolean }
|
|
62
|
+
): string;
|
|
63
|
+
|
|
64
|
+
autodetect(
|
|
65
|
+
code: string,
|
|
66
|
+
options?: { filename?: string; expression?: boolean }
|
|
67
|
+
): string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
|
|
6
71
|
/**
|
|
7
72
|
* An object representing the process's environment variables. You can read
|
|
8
73
|
* from it to read environment variables, write into it to set environment
|
|
@@ -12,30 +77,111 @@
|
|
|
12
77
|
declare const env: { [key: string]: string | undefined };
|
|
13
78
|
|
|
14
79
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
80
|
+
* Parse command line --flags into an object of flags and an array of
|
|
81
|
+
* positional arguments. This function is opinionated; if it doesn't meet your
|
|
82
|
+
* needs, you can parse the `scriptArgs` global manually.
|
|
17
83
|
*
|
|
18
|
-
*
|
|
19
|
-
* the
|
|
20
|
-
*/
|
|
21
|
-
declare function ls(
|
|
22
|
-
dir?: string,
|
|
23
|
-
options?: { relativePaths?: boolean }
|
|
24
|
-
): Array<string>;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Read a symlink.
|
|
84
|
+
* Flags `--like-this`, `--like_this`, or `--LIKE_THIS` get converted into
|
|
85
|
+
* property names `likeThis` on the returned flags object.
|
|
28
86
|
*
|
|
29
|
-
*
|
|
87
|
+
* Flags like this: `-v` get converted into into property names like this: `v`
|
|
88
|
+
* on the returned flags object.
|
|
30
89
|
*
|
|
31
|
-
*
|
|
90
|
+
* Anything that appears after `--` is considered a positional argument instead
|
|
91
|
+
* of a flag. `--` is not present in the returned positional arguments Array.
|
|
92
|
+
*
|
|
93
|
+
* Single-character flags must have a single leading dash, and multi-character
|
|
94
|
+
* flags must have two leading dashes.
|
|
95
|
+
*
|
|
96
|
+
* Flags with equals signs in them (eg. `--something=42`) are not supported.
|
|
97
|
+
* Write `--something 42` instead.
|
|
98
|
+
*
|
|
99
|
+
* Flags where you specify them multiple times, like `-vvv`, are not supported.
|
|
100
|
+
* Write something like `-v 3` instead.
|
|
101
|
+
*
|
|
102
|
+
* @param hints - An object whose keys are flag names (in camelCase) and whose values indicate what type to treat that flag as. Valid property values are `String`, `Boolean`, `Number`, and `parseScriptArgs.Path`. `parseScriptArgs.Path` will resolve relative paths into absolute paths for you. If no hints object is specified, `parseScriptArgs` will do its best to guess, based on the command-line args.
|
|
103
|
+
* @param argv - An array containing the command line flags you want to parse. If unspecified, `scriptArgs.slice(2)` will be used (we slice 2 in order to skip the yavascript binary and script name). If you pass in an array here, it should only contain command-line flags, not the binary being called.
|
|
104
|
+
*
|
|
105
|
+
* @returns An object with two properties: `flags` and `args`. `flags` is an object whose keys are camelCase flag names and whose values are strings, booleans, or numbers corresponding to the input command-line args. `args` is an Array of positional arguments, as found on the command-line.
|
|
32
106
|
*/
|
|
33
|
-
declare
|
|
107
|
+
declare const parseScriptArgs: {
|
|
108
|
+
/**
|
|
109
|
+
* Parse command line --flags into an object of flags and an array of
|
|
110
|
+
* positional arguments. This function is opinionated; if it doesn't meet your
|
|
111
|
+
* needs, you can parse the `scriptArgs` global manually.
|
|
112
|
+
*
|
|
113
|
+
* Flags `--like-this`, `--like_this`, or `--LIKE_THIS` get converted into
|
|
114
|
+
* property names `likeThis` on the returned flags object.
|
|
115
|
+
*
|
|
116
|
+
* Flags like this: `-v` get converted into into property names like this: `v`
|
|
117
|
+
* on the returned flags object.
|
|
118
|
+
*
|
|
119
|
+
* Anything that appears after `--` is considered a positional argument instead
|
|
120
|
+
* of a flag. `--` is not present in the returned positional arguments Array.
|
|
121
|
+
*
|
|
122
|
+
* Single-character flags must have a single leading dash, and multi-character
|
|
123
|
+
* flags must have two leading dashes.
|
|
124
|
+
*
|
|
125
|
+
* Flags with equals signs in them (eg. `--something=42`) are not supported.
|
|
126
|
+
* Write `--something 42` instead.
|
|
127
|
+
*
|
|
128
|
+
* Flags where you specify them multiple times, like `-vvv`, are not supported.
|
|
129
|
+
* Write something like `-v 3` instead.
|
|
130
|
+
*
|
|
131
|
+
* @param hints - An object whose keys are flag names (in camelCase) and whose values indicate what type to treat that flag as. Valid property values are `String`, `Boolean`, `Number`, and `parseScriptArgs.Path`. `parseScriptArgs.Path` will resolve relative paths into absolute paths for you. If no hints object is specified, `parseScriptArgs` will do its best to guess, based on the command-line args.
|
|
132
|
+
* @param args - An array containing the command line flags you want to parse. If unspecified, `scriptArgs.slice(2)` will be used (we slice 2 in order to skip the yavascript binary and script name). If you pass in an array here, it should only contain command-line flags, not the binary being called.
|
|
133
|
+
*
|
|
134
|
+
* @returns An object with two properties: `flags` and `args`. `flags` is an object whose keys are camelCase flag names and whose values are strings, booleans, or numbers corresponding to the input command-line args. `args` is an Array of positional arguments, as found on the command-line.
|
|
135
|
+
*/
|
|
136
|
+
(
|
|
137
|
+
hints?: {
|
|
138
|
+
[key: string]:
|
|
139
|
+
| typeof String
|
|
140
|
+
| typeof Boolean
|
|
141
|
+
| typeof Number
|
|
142
|
+
| typeof parseScriptArgs["Path"];
|
|
143
|
+
},
|
|
144
|
+
args?: Array<string>
|
|
145
|
+
): {
|
|
146
|
+
flags: { [key: string]: any };
|
|
147
|
+
args: Array<string>;
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* A hint value for {@link parseScriptArgs}. Behaves similar to the hint value
|
|
152
|
+
* `String`, except that it also resolves relative paths into absolute paths,
|
|
153
|
+
* using the following rules:
|
|
154
|
+
*
|
|
155
|
+
* - paths `./like/this` or `../like/this` get resolved relative to `pwd()`.
|
|
156
|
+
* - paths `like/this` or `this` get resolved relative to `pwd()` as if they had a leading `./`.
|
|
157
|
+
*/
|
|
158
|
+
readonly Path: unique symbol;
|
|
159
|
+
};
|
|
34
160
|
|
|
35
161
|
/**
|
|
36
|
-
* Read the contents of a file from disk
|
|
162
|
+
* Read the contents of a file from disk.
|
|
37
163
|
*/
|
|
38
|
-
declare
|
|
164
|
+
declare const readFile: {
|
|
165
|
+
/**
|
|
166
|
+
* Read the contents of a file from disk, as a UTF-8 string.
|
|
167
|
+
*/
|
|
168
|
+
(path: string): string;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Read the contents of a file from disk, as a UTF-8 string.
|
|
172
|
+
*/
|
|
173
|
+
(path: string, options: {}): string;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Read the contents of a file from disk, as a UTF-8 string.
|
|
177
|
+
*/
|
|
178
|
+
(path: string, options: { binary: false }): string;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Read the contents of a file from disk, as an ArrayBuffer.
|
|
182
|
+
*/
|
|
183
|
+
(path: string, options: { binary: true }): ArrayBuffer;
|
|
184
|
+
};
|
|
39
185
|
|
|
40
186
|
/**
|
|
41
187
|
* Write the contents of a string or ArrayBuffer to a file.
|
|
@@ -131,42 +277,215 @@ declare type CopyOptions = {
|
|
|
131
277
|
*/
|
|
132
278
|
declare function copy(from: string, to: string, options?: CopyOptions): void;
|
|
133
279
|
|
|
280
|
+
/** An object that represents a filesystem path. */
|
|
281
|
+
declare class Path {
|
|
282
|
+
/** The character used to separate path segments on this OS. */
|
|
283
|
+
static readonly OS_SEGMENT_SEPARATOR: "/" | "\\";
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* The character used to separate entries within the PATH environment
|
|
287
|
+
* variable on this OS.
|
|
288
|
+
*/
|
|
289
|
+
static readonly OS_ENV_VAR_SEPARATOR: ":" | ";";
|
|
290
|
+
|
|
291
|
+
/** Split one or more path strings into an array of path segments. */
|
|
292
|
+
static splitToSegments(inputParts: Array<string> | string): Array<string>;
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Search the provided path string or strings for a path separator character,
|
|
296
|
+
* and return it. If none is found, return `fallback`, which defaults to the
|
|
297
|
+
* OS's path segment separator.
|
|
298
|
+
*/
|
|
299
|
+
static detectSeparator<Fallback extends string | null = string>(
|
|
300
|
+
input: Array<string> | string,
|
|
301
|
+
// @ts-ignore might be instantiated with a different subtype
|
|
302
|
+
fallback: Fallback = Path.OS_SEGMENT_SEPARATOR
|
|
303
|
+
): string | Fallback;
|
|
304
|
+
|
|
305
|
+
/** Join together one or more paths. */
|
|
306
|
+
static join(...inputs: Array<string | Path | Array<string | Path>>): string;
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Turns the input path(s) into an absolute path by resolving all `.` and `..`
|
|
310
|
+
* segments, using `pwd()` as a base dir to use when resolving leading `.` or
|
|
311
|
+
* `..` segments.
|
|
312
|
+
*/
|
|
313
|
+
static resolve(
|
|
314
|
+
...inputs: Array<string | Path | Array<string | Path>>
|
|
315
|
+
): string;
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Concatenates the input path(s) and then resolves all non-leading `.` and
|
|
319
|
+
* `..` segments.
|
|
320
|
+
*/
|
|
321
|
+
static normalize(
|
|
322
|
+
...inputs: Array<string | Path | Array<string | Path>>
|
|
323
|
+
): string;
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Return whether the provided path string is absolute; that is, whether it
|
|
327
|
+
* starts with either `/` or a drive letter (ie `C:`).
|
|
328
|
+
*/
|
|
329
|
+
static isAbsolute(path: string): boolean;
|
|
330
|
+
|
|
331
|
+
/** A tagged template literal function that creates a `Path` object. */
|
|
332
|
+
static tag(
|
|
333
|
+
strings: TemplateStringsArray,
|
|
334
|
+
...values: ReadonlyArray<string | Path | Array<string | Path>>
|
|
335
|
+
): Path;
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Returns a tagged template literal that creates a `Path` object. `dir` is
|
|
339
|
+
* used as a prefix for every `Path` object created.
|
|
340
|
+
*/
|
|
341
|
+
static tagUsingBase(dir: string | Path): typeof Path.tag;
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* An array of the path segments that make up this path.
|
|
345
|
+
*
|
|
346
|
+
* For `/tmp/foo.txt`, it'd be `["", "tmp", "foo.txt"]`.
|
|
347
|
+
*
|
|
348
|
+
* For `C:\something\somewhere.txt`, it'd be `["C:", "something", "somewhere.txt"]`.
|
|
349
|
+
*/
|
|
350
|
+
segments: Array<string>;
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* The path separator that should be used to turn this path into a string.
|
|
354
|
+
*
|
|
355
|
+
* Will be either `/` or `\`.
|
|
356
|
+
*/
|
|
357
|
+
separator: string;
|
|
358
|
+
|
|
359
|
+
/** Create a new Path object using the provided input(s). */
|
|
360
|
+
constructor(...inputs: Array<string | Path | Array<string | Path>>);
|
|
361
|
+
|
|
362
|
+
/** Create a new Path object using the provided segments and separator. */
|
|
363
|
+
static from(segments: Array<string>, separator: string): Path;
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Turn this path into an absolute path by resolving all `.` and `..`
|
|
367
|
+
* segments, using `from` as a base dir to use when resolving leading `.` or
|
|
368
|
+
* `..` segments.
|
|
369
|
+
*
|
|
370
|
+
* If `from` is unspecified, it defaults to `pwd()`.
|
|
371
|
+
*/
|
|
372
|
+
resolve(from?: string | Path): Path;
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Resolve all non-leading `.` and `..` segments in this path.
|
|
376
|
+
*/
|
|
377
|
+
normalize(): Path;
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* Create a new path by appending another path's segments after this path's
|
|
381
|
+
* segments.
|
|
382
|
+
*
|
|
383
|
+
* The returned path will use this path's separator.
|
|
384
|
+
*/
|
|
385
|
+
concat(other: string | Path | Array<string | Path>): Path;
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* Return whether this path is absolute; that is, whether it starts with
|
|
389
|
+
* either `/` or a drive letter (ie `C:`).
|
|
390
|
+
*/
|
|
391
|
+
isAbsolute(): boolean;
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* Turn this path into a string by joining its segments using its separator.
|
|
395
|
+
*/
|
|
396
|
+
toString(): string;
|
|
397
|
+
}
|
|
398
|
+
|
|
134
399
|
/**
|
|
135
|
-
*
|
|
400
|
+
* The absolute path to the current file (whether script or module).
|
|
136
401
|
*
|
|
137
|
-
*
|
|
402
|
+
* Behaves the same as in Node.js, except that it's present within ES modules.
|
|
138
403
|
*/
|
|
139
|
-
declare
|
|
404
|
+
declare const __filename: string;
|
|
140
405
|
|
|
141
406
|
/**
|
|
142
|
-
*
|
|
407
|
+
* The absolute path to the directory the current file is inside of.
|
|
143
408
|
*
|
|
144
|
-
*
|
|
409
|
+
* Behaves the same as in Node.js, except that it's present within ES modules.
|
|
145
410
|
*/
|
|
146
|
-
declare
|
|
411
|
+
declare const __dirname: string;
|
|
147
412
|
|
|
148
413
|
/**
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
* The path's target file/directory must exist.
|
|
414
|
+
* Return the last component of a path string.
|
|
152
415
|
*
|
|
153
416
|
* Provides the same functionality as the unix binary of the same name.
|
|
154
417
|
*/
|
|
155
|
-
declare function
|
|
418
|
+
declare function basename(path: string | Path): string;
|
|
156
419
|
|
|
157
420
|
/**
|
|
158
|
-
*
|
|
421
|
+
* Read the contents of one of more files from disk as one UTF-8 string,
|
|
422
|
+
* print that string to stdout, then return it.
|
|
423
|
+
*/
|
|
424
|
+
declare function cat(...paths: Array<string | Path>): string;
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* Change the process's current working directory to the specified path. If no
|
|
428
|
+
* path is specified, moves to the user's home directory.
|
|
159
429
|
*
|
|
160
|
-
* Provides the same functionality as the
|
|
430
|
+
* Provides the same functionality as the shell builtin of the same name.
|
|
161
431
|
*/
|
|
162
|
-
declare function
|
|
432
|
+
declare function cd(path?: string | Path): void;
|
|
433
|
+
|
|
434
|
+
/** A string representing who a permission applies to. */
|
|
435
|
+
declare type ChmodPermissionsWho =
|
|
436
|
+
| "user"
|
|
437
|
+
| "group"
|
|
438
|
+
| "others"
|
|
439
|
+
| "all"
|
|
440
|
+
| "u"
|
|
441
|
+
| "g"
|
|
442
|
+
| "o"
|
|
443
|
+
| "a"
|
|
444
|
+
| "ug"
|
|
445
|
+
| "go"
|
|
446
|
+
| "uo";
|
|
447
|
+
|
|
448
|
+
/** A string representing the access level for the given permission. */
|
|
449
|
+
declare type ChmodPermissionsWhat =
|
|
450
|
+
| "read"
|
|
451
|
+
| "write"
|
|
452
|
+
| "execute"
|
|
453
|
+
| "readwrite"
|
|
454
|
+
| "none"
|
|
455
|
+
| "full"
|
|
456
|
+
| "r"
|
|
457
|
+
| "w"
|
|
458
|
+
| "x"
|
|
459
|
+
| "rw"
|
|
460
|
+
| "rx"
|
|
461
|
+
| "wx"
|
|
462
|
+
| "rwx";
|
|
163
463
|
|
|
164
464
|
/**
|
|
165
|
-
*
|
|
465
|
+
* Set the permission bits for the specified file.
|
|
466
|
+
*
|
|
467
|
+
* @param permissions The permission bits to set. This can be a number, a string containing an octal number, or an object.
|
|
468
|
+
* @param path The path to the file.
|
|
469
|
+
*/
|
|
470
|
+
declare function chmod(
|
|
471
|
+
permissions:
|
|
472
|
+
| number
|
|
473
|
+
| string
|
|
474
|
+
| Record<ChmodPermissionsWho, ChmodPermissionsWhat>,
|
|
475
|
+
path: string | Path
|
|
476
|
+
): void;
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* Removes the final component from a path string.
|
|
166
480
|
*
|
|
167
481
|
* Provides the same functionality as the unix binary of the same name.
|
|
168
482
|
*/
|
|
169
|
-
declare function
|
|
483
|
+
declare function dirname(path: string | Path): string;
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* Print one or more values to stdout.
|
|
487
|
+
*/
|
|
488
|
+
declare const echo: typeof console.log;
|
|
170
489
|
|
|
171
490
|
/**
|
|
172
491
|
* Returns the file extension of the file at a given path.
|
|
@@ -176,76 +495,60 @@ declare function basename(path: string): string;
|
|
|
176
495
|
* Pass `{ full: true }` to get compound extensions, eg `.d.ts` or `.test.js` instead of just `.ts`/`.js`.
|
|
177
496
|
*/
|
|
178
497
|
declare function extname(
|
|
179
|
-
pathOrFilename: string,
|
|
498
|
+
pathOrFilename: string | Path,
|
|
180
499
|
options?: { full?: boolean }
|
|
181
500
|
): string;
|
|
182
501
|
|
|
183
502
|
/**
|
|
184
|
-
*
|
|
503
|
+
* Return the contents of a directory, as absolute paths. `.` and `..` are
|
|
504
|
+
* omitted.
|
|
505
|
+
*
|
|
506
|
+
* Use the `relativePaths` option to get relative paths instead (relative to
|
|
507
|
+
* the parent directory).
|
|
185
508
|
*/
|
|
186
|
-
declare
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
* on all other OSes, it's a forward slash.
|
|
191
|
-
*/
|
|
192
|
-
OS_PATH_SEPARATOR: "/" | "\\";
|
|
193
|
-
|
|
194
|
-
/**
|
|
195
|
-
* Split a path string (or array of path strings) on / or \\, returning an
|
|
196
|
-
* Array of strings.
|
|
197
|
-
*
|
|
198
|
-
* Trailing slashes and duplicate path separators will be removed.
|
|
199
|
-
*
|
|
200
|
-
* If the path starts with `/`, the first string in the Array will be empty.
|
|
201
|
-
*/
|
|
202
|
-
split(path: string | Array<string>): Array<string>;
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* Detect which path separator is present in the given path or array of
|
|
206
|
-
* paths: `\` or `/`.
|
|
207
|
-
*
|
|
208
|
-
* If neither is present, `/` will be returned.
|
|
209
|
-
*/
|
|
210
|
-
detectSeparator(input: string | Array<string>): string;
|
|
509
|
+
declare function ls(
|
|
510
|
+
dir?: string | Path,
|
|
511
|
+
options?: { relativePaths?: boolean }
|
|
512
|
+
): Array<string>;
|
|
211
513
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
* This function does not resolve `..` or `.`. Use {@link paths.resolve} for that.
|
|
217
|
-
*/
|
|
218
|
-
join(...parts: Array<string>): string;
|
|
514
|
+
/**
|
|
515
|
+
* Print data to stdout using C-style format specifiers.
|
|
516
|
+
*/
|
|
517
|
+
declare function printf(format: string, ...args: Array<any>): void;
|
|
219
518
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
*/
|
|
227
|
-
resolve(path: string, from?: string): string;
|
|
519
|
+
/**
|
|
520
|
+
* Return the process's current working directory.
|
|
521
|
+
*
|
|
522
|
+
* Provides the same functionality as the shell builtin of the same name.
|
|
523
|
+
*/
|
|
524
|
+
declare function pwd(): string;
|
|
228
525
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
526
|
+
/**
|
|
527
|
+
* Read a symlink.
|
|
528
|
+
*
|
|
529
|
+
* Returns the target of the symlink, which may be absolute or relative.
|
|
530
|
+
*
|
|
531
|
+
* Provides the same functionality as the unix binary of the same name.
|
|
532
|
+
*/
|
|
533
|
+
declare function readlink(path: string | Path): string;
|
|
235
534
|
|
|
236
535
|
/**
|
|
237
|
-
*
|
|
536
|
+
* Get the absolute path given a relative path. Symlinks are also resolved.
|
|
238
537
|
*
|
|
239
|
-
*
|
|
538
|
+
* The path's target file/directory must exist.
|
|
539
|
+
*
|
|
540
|
+
* Provides the same functionality as the unix binary of the same name.
|
|
240
541
|
*/
|
|
241
|
-
declare
|
|
542
|
+
declare function realpath(path: string | Path): string;
|
|
242
543
|
|
|
243
544
|
/**
|
|
244
|
-
*
|
|
545
|
+
* If the file at `path` exists, update its creation/modification timestamps.
|
|
245
546
|
*
|
|
246
|
-
*
|
|
547
|
+
* Otherwise, create an empty file at that path.
|
|
548
|
+
*
|
|
549
|
+
* @param path The target path for the file.
|
|
247
550
|
*/
|
|
248
|
-
declare
|
|
551
|
+
declare function touch(path: string | Path): void;
|
|
249
552
|
|
|
250
553
|
declare type BaseExecOptions = {
|
|
251
554
|
/** Sets the current working directory for the child process. */
|
|
@@ -428,11 +731,6 @@ declare function glob(
|
|
|
428
731
|
options?: GlobOptions
|
|
429
732
|
): Array<string>;
|
|
430
733
|
|
|
431
|
-
/**
|
|
432
|
-
* Print one or more values to stdout.
|
|
433
|
-
*/
|
|
434
|
-
declare const echo: typeof console.log;
|
|
435
|
-
|
|
436
734
|
/**
|
|
437
735
|
* Remove ANSI control characters from a string.
|
|
438
736
|
*/
|
|
@@ -509,17 +807,272 @@ declare function hidden(input: string | number): string;
|
|
|
509
807
|
/** Wrap a string with the ANSI control characters that will make it print with a horizontal line through its center. */
|
|
510
808
|
declare function strikethrough(input: string | number): string;
|
|
511
809
|
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
810
|
+
/** Split `str` on newline and then return lines matching `pattern`. */
|
|
811
|
+
declare const grepString: {
|
|
812
|
+
/** Split `str` on newline and then return lines matching `pattern`. */
|
|
813
|
+
(str: string, pattern: string | RegExp): Array<string>;
|
|
814
|
+
|
|
815
|
+
/** Split `str` on newline and then return lines matching `pattern`. */
|
|
816
|
+
(
|
|
817
|
+
str: string,
|
|
818
|
+
pattern: string | RegExp,
|
|
819
|
+
options: { inverse: false }
|
|
820
|
+
): Array<string>;
|
|
821
|
+
|
|
822
|
+
/** Split `str` on newline and then return lines NOT matching `pattern`. */
|
|
823
|
+
(
|
|
824
|
+
str: string,
|
|
825
|
+
pattern: string | RegExp,
|
|
826
|
+
options: { inverse: true }
|
|
827
|
+
): Array<string>;
|
|
828
|
+
|
|
829
|
+
/** Split `str` on newline and then return lines matching `pattern`. */
|
|
830
|
+
(
|
|
831
|
+
str: string,
|
|
832
|
+
pattern: string | RegExp,
|
|
833
|
+
options: { details: false }
|
|
834
|
+
): Array<string>;
|
|
835
|
+
|
|
836
|
+
/** Split `str` on newline and then return lines matching `pattern`. */
|
|
837
|
+
(
|
|
838
|
+
str: string,
|
|
839
|
+
pattern: string | RegExp,
|
|
840
|
+
options: { inverse: false; details: false }
|
|
841
|
+
): Array<string>;
|
|
842
|
+
|
|
843
|
+
/** Split `str` on newline and then return lines NOT matching `pattern`. */
|
|
844
|
+
(
|
|
845
|
+
str: string,
|
|
846
|
+
pattern: string | RegExp,
|
|
847
|
+
options: { inverse: true; details: false }
|
|
848
|
+
): Array<string>;
|
|
849
|
+
|
|
850
|
+
/** Split `str` on newline and then return info about lines matching `pattern`. */
|
|
851
|
+
(str: string, pattern: string | RegExp, options: { details: true }): Array<{
|
|
852
|
+
lineNumber: number;
|
|
853
|
+
lineContent: string;
|
|
854
|
+
matches: RegExpMatchArray;
|
|
855
|
+
}>;
|
|
856
|
+
|
|
857
|
+
/** Split `str` on newline and then return info about lines matching `pattern`. */
|
|
858
|
+
(
|
|
859
|
+
str: string,
|
|
860
|
+
pattern: string | RegExp,
|
|
861
|
+
options: { inverse: false; details: true }
|
|
862
|
+
): Array<string>;
|
|
863
|
+
|
|
864
|
+
/** Split `str` on newline and then return info about lines NOT matching `pattern`. */
|
|
865
|
+
(
|
|
866
|
+
str: string,
|
|
867
|
+
pattern: string | RegExp,
|
|
868
|
+
options: { inverse: true; details: true }
|
|
869
|
+
): Array<string>;
|
|
870
|
+
};
|
|
871
|
+
|
|
872
|
+
/** Read the content at `path`, split it on newline, and then return lines matching `pattern`. */
|
|
873
|
+
declare const grepFile: {
|
|
874
|
+
/** Read the content at `path`, split it on newline, and then return lines matching `pattern`. */
|
|
875
|
+
(path: string, pattern: string | RegExp): Array<string>;
|
|
876
|
+
|
|
877
|
+
/** Read the content at `path`, split it on newline, and then return lines matching `pattern`. */
|
|
878
|
+
(
|
|
879
|
+
path: string,
|
|
880
|
+
pattern: string | RegExp,
|
|
881
|
+
options: { inverse: false }
|
|
882
|
+
): Array<string>;
|
|
883
|
+
|
|
884
|
+
/** Read the content at `path`, split it on newline, and then return lines NOT matching `pattern`. */
|
|
885
|
+
(
|
|
886
|
+
path: string,
|
|
887
|
+
pattern: string | RegExp,
|
|
888
|
+
options: { inverse: true }
|
|
889
|
+
): Array<string>;
|
|
890
|
+
|
|
891
|
+
/** Read the content at `path`, split it on newline, and then return lines matching `pattern`. */
|
|
892
|
+
(
|
|
893
|
+
path: string,
|
|
894
|
+
pattern: string | RegExp,
|
|
895
|
+
options: { details: false }
|
|
896
|
+
): Array<string>;
|
|
897
|
+
|
|
898
|
+
/** Read the content at `path`, split it on newline, and then return lines matching `pattern`. */
|
|
899
|
+
(
|
|
900
|
+
path: string,
|
|
901
|
+
pattern: string | RegExp,
|
|
902
|
+
options: { inverse: false; details: false }
|
|
903
|
+
): Array<string>;
|
|
904
|
+
|
|
905
|
+
/** Read the content at `path`, split it on newline, and then return lines NOT matching `pattern`. */
|
|
906
|
+
(
|
|
907
|
+
path: string,
|
|
908
|
+
pattern: string | RegExp,
|
|
909
|
+
options: { inverse: true; details: false }
|
|
910
|
+
): Array<string>;
|
|
911
|
+
|
|
912
|
+
/** Read the content at `path`, split it on newline, and then return info about lines matching `pattern`. */
|
|
913
|
+
(path: string, pattern: string | RegExp, options: { details: true }): Array<{
|
|
914
|
+
lineNumber: number;
|
|
915
|
+
lineContent: string;
|
|
916
|
+
matches: RegExpMatchArray;
|
|
917
|
+
}>;
|
|
918
|
+
|
|
919
|
+
/** Read the content at `path`, split it on newline, and then return info about lines matching `pattern`. */
|
|
920
|
+
(
|
|
921
|
+
path: string,
|
|
922
|
+
pattern: string | RegExp,
|
|
923
|
+
options: { inverse: false; details: true }
|
|
924
|
+
): Array<string>;
|
|
925
|
+
|
|
926
|
+
/** Read the content at `path`, split it on newline, and then return info about lines NOT matching `pattern`. */
|
|
927
|
+
(
|
|
928
|
+
path: string,
|
|
929
|
+
pattern: string | RegExp,
|
|
930
|
+
options: { inverse: true; details: true }
|
|
931
|
+
): Array<string>;
|
|
932
|
+
};
|
|
933
|
+
|
|
934
|
+
interface String {
|
|
935
|
+
// Same as grepString but without the first argument.
|
|
936
|
+
grep: {
|
|
937
|
+
/** Split the string on newline and then return lines matching `pattern`. */
|
|
938
|
+
(pattern: string | RegExp): Array<string>;
|
|
939
|
+
|
|
940
|
+
/** Split the string on newline and then return lines matching `pattern`. */
|
|
941
|
+
(pattern: string | RegExp, options: { inverse: false }): Array<string>;
|
|
942
|
+
|
|
943
|
+
/** Split the string on newline and then return lines NOT matching `pattern`. */
|
|
944
|
+
(pattern: string | RegExp, options: { inverse: true }): Array<string>;
|
|
945
|
+
|
|
946
|
+
/** Split the string on newline and then return lines matching `pattern`. */
|
|
947
|
+
(pattern: string | RegExp, options: { details: false }): Array<string>;
|
|
948
|
+
|
|
949
|
+
/** Split the string on newline and then return lines matching `pattern`. */
|
|
950
|
+
(
|
|
951
|
+
pattern: string | RegExp,
|
|
952
|
+
options: { inverse: false; details: false }
|
|
953
|
+
): Array<string>;
|
|
954
|
+
|
|
955
|
+
/** Split the string on newline and then return lines NOT matching `pattern`. */
|
|
956
|
+
(
|
|
957
|
+
pattern: string | RegExp,
|
|
958
|
+
options: { inverse: true; details: false }
|
|
959
|
+
): Array<string>;
|
|
960
|
+
|
|
961
|
+
/** Split the string on newline and then return info about lines matching `pattern`. */
|
|
962
|
+
(pattern: string | RegExp, options: { details: true }): Array<{
|
|
963
|
+
lineNumber: number;
|
|
964
|
+
lineContent: string;
|
|
965
|
+
matches: RegExpMatchArray;
|
|
966
|
+
}>;
|
|
967
|
+
|
|
968
|
+
/** Split the string on newline and then return info about lines matching `pattern`. */
|
|
969
|
+
(
|
|
970
|
+
pattern: string | RegExp,
|
|
971
|
+
options: { inverse: false; details: true }
|
|
972
|
+
): Array<string>;
|
|
973
|
+
|
|
974
|
+
/** Split the string on newline and then return info about lines NOT matching `pattern`. */
|
|
975
|
+
(
|
|
976
|
+
pattern: string | RegExp,
|
|
977
|
+
options: { inverse: true; details: true }
|
|
978
|
+
): Array<string>;
|
|
979
|
+
};
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
declare type TypeValidator<T> = (value: any) => value is T;
|
|
983
|
+
|
|
984
|
+
declare type CoerceToTypeValidator<V extends CoerceableToTypeValidator> =
|
|
985
|
+
V extends StringConstructor
|
|
986
|
+
? TypeValidator<string>
|
|
987
|
+
: V extends NumberConstructor
|
|
988
|
+
? TypeValidator<number>
|
|
989
|
+
: V extends BooleanConstructor
|
|
990
|
+
? TypeValidator<boolean>
|
|
991
|
+
: V extends BigIntConstructor
|
|
992
|
+
? TypeValidator<BigInt>
|
|
993
|
+
: V extends SymbolConstructor
|
|
994
|
+
? TypeValidator<Symbol>
|
|
995
|
+
: V extends RegExpConstructor
|
|
996
|
+
? TypeValidator<RegExp>
|
|
997
|
+
: V extends ArrayConstructor
|
|
998
|
+
? TypeValidator<Array<unknown>>
|
|
999
|
+
: V extends SetConstructor
|
|
1000
|
+
? TypeValidator<Set<unknown>>
|
|
1001
|
+
: V extends MapConstructor
|
|
1002
|
+
? TypeValidator<Map<unknown, unknown>>
|
|
1003
|
+
: V extends ObjectConstructor
|
|
1004
|
+
? TypeValidator<{
|
|
1005
|
+
[key: string | number | symbol]: unknown;
|
|
1006
|
+
}>
|
|
1007
|
+
: V extends DateConstructor
|
|
1008
|
+
? TypeValidator<Date>
|
|
1009
|
+
: V extends FunctionConstructor
|
|
1010
|
+
? TypeValidator<Function>
|
|
1011
|
+
: V extends ArrayBufferConstructor
|
|
1012
|
+
? TypeValidator<ArrayBuffer>
|
|
1013
|
+
: V extends SharedArrayBufferConstructor
|
|
1014
|
+
? TypeValidator<SharedArrayBuffer>
|
|
1015
|
+
: V extends DataViewConstructor
|
|
1016
|
+
? TypeValidator<DataView>
|
|
1017
|
+
: V extends Int8ArrayConstructor
|
|
1018
|
+
? TypeValidator<Int8Array>
|
|
1019
|
+
: V extends Uint8ArrayConstructor
|
|
1020
|
+
? TypeValidator<Uint8Array>
|
|
1021
|
+
: V extends Uint8ClampedArrayConstructor
|
|
1022
|
+
? TypeValidator<Uint8ClampedArray>
|
|
1023
|
+
: V extends Int16ArrayConstructor
|
|
1024
|
+
? TypeValidator<Int16Array>
|
|
1025
|
+
: V extends Uint16ArrayConstructor
|
|
1026
|
+
? TypeValidator<Uint16Array>
|
|
1027
|
+
: V extends Int32ArrayConstructor
|
|
1028
|
+
? TypeValidator<Int32Array>
|
|
1029
|
+
: V extends Uint32ArrayConstructor
|
|
1030
|
+
? TypeValidator<Uint32Array>
|
|
1031
|
+
: V extends Float32ArrayConstructor
|
|
1032
|
+
? TypeValidator<Float32Array>
|
|
1033
|
+
: V extends Float64ArrayConstructor
|
|
1034
|
+
? TypeValidator<Float64Array>
|
|
1035
|
+
: V extends RegExp
|
|
1036
|
+
? TypeValidator<string>
|
|
1037
|
+
: V extends {}
|
|
1038
|
+
? TypeValidator<{
|
|
1039
|
+
[key in keyof V]: CoerceToTypeValidator<V[key]>;
|
|
1040
|
+
}>
|
|
1041
|
+
: V extends []
|
|
1042
|
+
? TypeValidator<[]>
|
|
1043
|
+
: V extends [any]
|
|
1044
|
+
? TypeValidator<Array<CoerceToTypeValidator<V[0]>>>
|
|
1045
|
+
: V extends Array<any>
|
|
1046
|
+
? TypeValidator<Array<unknown>>
|
|
1047
|
+
: V extends {
|
|
1048
|
+
new (...args: any): any;
|
|
1049
|
+
}
|
|
1050
|
+
? TypeValidator<InstanceType<V>>
|
|
1051
|
+
: TypeValidator<V>;
|
|
1052
|
+
|
|
1053
|
+
declare type CoerceableToTypeValidator =
|
|
1054
|
+
| boolean
|
|
1055
|
+
| number
|
|
1056
|
+
| string
|
|
1057
|
+
| bigint
|
|
1058
|
+
| undefined
|
|
1059
|
+
| null
|
|
1060
|
+
| RegExp
|
|
1061
|
+
| StringConstructor
|
|
1062
|
+
| NumberConstructor
|
|
1063
|
+
| BooleanConstructor
|
|
1064
|
+
| BigIntConstructor
|
|
1065
|
+
| SymbolConstructor
|
|
1066
|
+
| RegExpConstructor
|
|
1067
|
+
| ArrayConstructor
|
|
1068
|
+
| SetConstructor
|
|
1069
|
+
| MapConstructor
|
|
1070
|
+
| ObjectConstructor
|
|
1071
|
+
| DateConstructor
|
|
1072
|
+
| FunctionConstructor
|
|
1073
|
+
| ArrayBufferConstructor
|
|
1074
|
+
| SharedArrayBufferConstructor
|
|
1075
|
+
| DataViewConstructor
|
|
523
1076
|
| Int8ArrayConstructor
|
|
524
1077
|
| Uint8ArrayConstructor
|
|
525
1078
|
| Uint8ClampedArrayConstructor
|
|
@@ -528,89 +1081,1283 @@ declare type TypedArrayConstructor =
|
|
|
528
1081
|
| Int32ArrayConstructor
|
|
529
1082
|
| Uint32ArrayConstructor
|
|
530
1083
|
| Float32ArrayConstructor
|
|
531
|
-
| Float64ArrayConstructor
|
|
1084
|
+
| Float64ArrayConstructor
|
|
1085
|
+
| {}
|
|
1086
|
+
| []
|
|
1087
|
+
| [any]
|
|
1088
|
+
| Array<any>
|
|
1089
|
+
| {
|
|
1090
|
+
new (...args: any): any;
|
|
1091
|
+
};
|
|
532
1092
|
|
|
533
|
-
declare
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
[key: string]:
|
|
549
|
-
|
|
550
|
-
|
|
1093
|
+
declare type UnwrapTypeFromCoerceableOrValidator<
|
|
1094
|
+
V extends CoerceableToTypeValidator | TypeValidator<any> | unknown
|
|
1095
|
+
> = V extends TypeValidator<infer T>
|
|
1096
|
+
? T
|
|
1097
|
+
: V extends CoerceableToTypeValidator
|
|
1098
|
+
? CoerceToTypeValidator<V> extends TypeValidator<infer T>
|
|
1099
|
+
? T
|
|
1100
|
+
: never
|
|
1101
|
+
: unknown;
|
|
1102
|
+
|
|
1103
|
+
declare const types: {
|
|
1104
|
+
// basic types
|
|
1105
|
+
any: TypeValidator<any>;
|
|
1106
|
+
unknown: TypeValidator<unknown>;
|
|
1107
|
+
anyObject: TypeValidator<{
|
|
1108
|
+
[key: string | number | symbol]: any;
|
|
1109
|
+
}>;
|
|
1110
|
+
unknownObject: TypeValidator<{}>;
|
|
1111
|
+
object: TypeValidator<{}>;
|
|
1112
|
+
Object: TypeValidator<{}>;
|
|
1113
|
+
arrayOfAny: TypeValidator<Array<any>>;
|
|
1114
|
+
arrayOfUnknown: TypeValidator<Array<unknown>>;
|
|
1115
|
+
array: TypeValidator<Array<unknown>>;
|
|
1116
|
+
Array: TypeValidator<unknown[]>;
|
|
1117
|
+
anyArray: TypeValidator<Array<any>>;
|
|
1118
|
+
boolean: TypeValidator<boolean>;
|
|
1119
|
+
Boolean: TypeValidator<boolean>;
|
|
1120
|
+
string: TypeValidator<string>;
|
|
1121
|
+
String: TypeValidator<string>;
|
|
1122
|
+
null: TypeValidator<null>;
|
|
1123
|
+
undefined: TypeValidator<undefined>;
|
|
1124
|
+
nullish: TypeValidator<null | undefined>;
|
|
1125
|
+
void: TypeValidator<null | undefined>;
|
|
1126
|
+
numberIncludingNanAndInfinities: TypeValidator<number>;
|
|
1127
|
+
number: TypeValidator<number>;
|
|
1128
|
+
Number: TypeValidator<number>;
|
|
1129
|
+
NaN: TypeValidator<number>;
|
|
1130
|
+
Infinity: TypeValidator<number>;
|
|
1131
|
+
NegativeInfinity: TypeValidator<number>;
|
|
1132
|
+
integer: TypeValidator<number>;
|
|
1133
|
+
bigint: TypeValidator<bigint>;
|
|
1134
|
+
BigInt: TypeValidator<bigint>;
|
|
1135
|
+
never: TypeValidator<never>;
|
|
1136
|
+
anyFunction: TypeValidator<(...args: any) => any>;
|
|
1137
|
+
unknownFunction: TypeValidator<(...args: Array<unknown>) => unknown>;
|
|
1138
|
+
Function: TypeValidator<(...args: Array<unknown>) => unknown>;
|
|
1139
|
+
false: TypeValidator<false>;
|
|
1140
|
+
true: TypeValidator<true>;
|
|
1141
|
+
falsy: TypeValidator<false | null | undefined | "" | 0>;
|
|
1142
|
+
truthy: <T>(target: false | "" | 0 | T | null | undefined) => target is T;
|
|
1143
|
+
nonNullOrUndefined: <T>(target: T | null | undefined) => target is T;
|
|
1144
|
+
Error: TypeValidator<Error>;
|
|
1145
|
+
Symbol: TypeValidator<symbol>;
|
|
1146
|
+
symbol: TypeValidator<symbol>;
|
|
1147
|
+
RegExp: TypeValidator<RegExp>;
|
|
1148
|
+
Date: TypeValidator<Date>;
|
|
1149
|
+
anyMap: TypeValidator<Map<any, any>>;
|
|
1150
|
+
unknownMap: TypeValidator<Map<unknown, unknown>>;
|
|
1151
|
+
map: TypeValidator<Map<unknown, unknown>>;
|
|
1152
|
+
Map: TypeValidator<Map<unknown, unknown>>;
|
|
1153
|
+
anySet: TypeValidator<Set<any>>;
|
|
1154
|
+
unknownSet: TypeValidator<Set<unknown>>;
|
|
1155
|
+
set: TypeValidator<Set<unknown>>;
|
|
1156
|
+
Set: TypeValidator<Set<unknown>>;
|
|
1157
|
+
ArrayBuffer: TypeValidator<ArrayBuffer>;
|
|
1158
|
+
SharedArrayBuffer: TypeValidator<SharedArrayBuffer>;
|
|
1159
|
+
DataView: TypeValidator<DataView>;
|
|
1160
|
+
TypedArray: TypeValidator<
|
|
1161
|
+
| Int8Array
|
|
1162
|
+
| Uint8Array
|
|
1163
|
+
| Uint8ClampedArray
|
|
1164
|
+
| Int16Array
|
|
1165
|
+
| Uint16Array
|
|
1166
|
+
| Int32Array
|
|
1167
|
+
| Uint32Array
|
|
1168
|
+
| Float32Array
|
|
1169
|
+
| Float64Array
|
|
1170
|
+
>;
|
|
1171
|
+
Int8Array: TypeValidator<Int8Array>;
|
|
1172
|
+
Uint8Array: TypeValidator<Uint8Array>;
|
|
1173
|
+
Uint8ClampedArray: TypeValidator<Uint8ClampedArray>;
|
|
1174
|
+
Int16Array: TypeValidator<Int16Array>;
|
|
1175
|
+
Uint16Array: TypeValidator<Uint16Array>;
|
|
1176
|
+
Int32Array: TypeValidator<Int32Array>;
|
|
1177
|
+
Uint32Array: TypeValidator<Uint32Array>;
|
|
1178
|
+
Float32Array: TypeValidator<Float32Array>;
|
|
1179
|
+
Float64Array: TypeValidator<Float64Array>;
|
|
1180
|
+
|
|
1181
|
+
// type constructors
|
|
1182
|
+
exactString<T extends string>(str: T): TypeValidator<T>;
|
|
1183
|
+
exactNumber<T extends number>(num: T): TypeValidator<T>;
|
|
1184
|
+
exactBigInt<T extends bigint>(num: T): TypeValidator<T>;
|
|
1185
|
+
exactSymbol<T extends symbol>(sym: T): TypeValidator<T>;
|
|
1186
|
+
hasClassName<Name extends string>(
|
|
1187
|
+
name: Name
|
|
1188
|
+
): TypeValidator<{
|
|
1189
|
+
constructor: Function & {
|
|
1190
|
+
name: Name;
|
|
1191
|
+
};
|
|
1192
|
+
}>;
|
|
1193
|
+
hasToStringTag(name: string): TypeValidator<any>;
|
|
1194
|
+
instanceOf<
|
|
1195
|
+
Klass extends Function & {
|
|
1196
|
+
prototype: any;
|
|
1197
|
+
}
|
|
1198
|
+
>(
|
|
1199
|
+
klass: Klass
|
|
1200
|
+
): TypeValidator<Klass["prototype"]>;
|
|
1201
|
+
stringMatching(regexp: RegExp): TypeValidator<string>;
|
|
1202
|
+
symbolFor(key: string): TypeValidator<symbol>;
|
|
1203
|
+
arrayOf<T extends TypeValidator<any> | CoerceableToTypeValidator | unknown>(
|
|
1204
|
+
typeValidator: T
|
|
1205
|
+
): TypeValidator<Array<UnwrapTypeFromCoerceableOrValidator<T>>>;
|
|
1206
|
+
intersection: {
|
|
1207
|
+
<
|
|
1208
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1209
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
1210
|
+
>(
|
|
1211
|
+
first: First,
|
|
1212
|
+
second: Second
|
|
1213
|
+
): TypeValidator<
|
|
1214
|
+
UnwrapTypeFromCoerceableOrValidator<First> &
|
|
1215
|
+
UnwrapTypeFromCoerceableOrValidator<Second>
|
|
1216
|
+
>;
|
|
1217
|
+
<
|
|
1218
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1219
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1220
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
1221
|
+
>(
|
|
1222
|
+
first: First,
|
|
1223
|
+
second: Second,
|
|
1224
|
+
third: Third
|
|
1225
|
+
): TypeValidator<
|
|
1226
|
+
UnwrapTypeFromCoerceableOrValidator<First> &
|
|
1227
|
+
UnwrapTypeFromCoerceableOrValidator<Second> &
|
|
1228
|
+
UnwrapTypeFromCoerceableOrValidator<Third>
|
|
1229
|
+
>;
|
|
1230
|
+
<
|
|
1231
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1232
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1233
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1234
|
+
Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
1235
|
+
>(
|
|
1236
|
+
first: First,
|
|
1237
|
+
second: Second,
|
|
1238
|
+
third: Third,
|
|
1239
|
+
fourth: Fourth
|
|
1240
|
+
): TypeValidator<
|
|
1241
|
+
UnwrapTypeFromCoerceableOrValidator<First> &
|
|
1242
|
+
UnwrapTypeFromCoerceableOrValidator<Second> &
|
|
1243
|
+
UnwrapTypeFromCoerceableOrValidator<Third> &
|
|
1244
|
+
UnwrapTypeFromCoerceableOrValidator<Fourth>
|
|
1245
|
+
>;
|
|
1246
|
+
<
|
|
1247
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1248
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1249
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1250
|
+
Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1251
|
+
Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
1252
|
+
>(
|
|
1253
|
+
first: First,
|
|
1254
|
+
second: Second,
|
|
1255
|
+
third: Third,
|
|
1256
|
+
fourth: Fourth,
|
|
1257
|
+
fifth: Fifth
|
|
1258
|
+
): TypeValidator<
|
|
1259
|
+
UnwrapTypeFromCoerceableOrValidator<First> &
|
|
1260
|
+
UnwrapTypeFromCoerceableOrValidator<Second> &
|
|
1261
|
+
UnwrapTypeFromCoerceableOrValidator<Third> &
|
|
1262
|
+
UnwrapTypeFromCoerceableOrValidator<Fourth> &
|
|
1263
|
+
UnwrapTypeFromCoerceableOrValidator<Fifth>
|
|
1264
|
+
>;
|
|
1265
|
+
<
|
|
1266
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1267
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1268
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1269
|
+
Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1270
|
+
Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1271
|
+
Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
1272
|
+
>(
|
|
1273
|
+
first: First,
|
|
1274
|
+
second: Second,
|
|
1275
|
+
third: Third,
|
|
1276
|
+
fourth: Fourth,
|
|
1277
|
+
fifth: Fifth,
|
|
1278
|
+
sixth: Sixth
|
|
1279
|
+
): TypeValidator<
|
|
1280
|
+
UnwrapTypeFromCoerceableOrValidator<First> &
|
|
1281
|
+
UnwrapTypeFromCoerceableOrValidator<Second> &
|
|
1282
|
+
UnwrapTypeFromCoerceableOrValidator<Third> &
|
|
1283
|
+
UnwrapTypeFromCoerceableOrValidator<Fourth> &
|
|
1284
|
+
UnwrapTypeFromCoerceableOrValidator<Fifth> &
|
|
1285
|
+
UnwrapTypeFromCoerceableOrValidator<Sixth>
|
|
1286
|
+
>;
|
|
1287
|
+
<
|
|
1288
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1289
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1290
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1291
|
+
Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1292
|
+
Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1293
|
+
Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1294
|
+
Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
1295
|
+
>(
|
|
1296
|
+
first: First,
|
|
1297
|
+
second: Second,
|
|
1298
|
+
third: Third,
|
|
1299
|
+
fourth: Fourth,
|
|
1300
|
+
fifth: Fifth,
|
|
1301
|
+
sixth: Sixth,
|
|
1302
|
+
seventh: Seventh
|
|
1303
|
+
): TypeValidator<
|
|
1304
|
+
UnwrapTypeFromCoerceableOrValidator<First> &
|
|
1305
|
+
UnwrapTypeFromCoerceableOrValidator<Second> &
|
|
1306
|
+
UnwrapTypeFromCoerceableOrValidator<Third> &
|
|
1307
|
+
UnwrapTypeFromCoerceableOrValidator<Fourth> &
|
|
1308
|
+
UnwrapTypeFromCoerceableOrValidator<Fifth> &
|
|
1309
|
+
UnwrapTypeFromCoerceableOrValidator<Sixth> &
|
|
1310
|
+
UnwrapTypeFromCoerceableOrValidator<Seventh>
|
|
1311
|
+
>;
|
|
1312
|
+
<
|
|
1313
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1314
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1315
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1316
|
+
Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1317
|
+
Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1318
|
+
Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1319
|
+
Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1320
|
+
Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
1321
|
+
>(
|
|
1322
|
+
first: First,
|
|
1323
|
+
second: Second,
|
|
1324
|
+
third: Third,
|
|
1325
|
+
fourth: Fourth,
|
|
1326
|
+
fifth: Fifth,
|
|
1327
|
+
sixth: Sixth,
|
|
1328
|
+
seventh: Seventh,
|
|
1329
|
+
eighth: Eighth
|
|
1330
|
+
): TypeValidator<
|
|
1331
|
+
UnwrapTypeFromCoerceableOrValidator<First> &
|
|
1332
|
+
UnwrapTypeFromCoerceableOrValidator<Second> &
|
|
1333
|
+
UnwrapTypeFromCoerceableOrValidator<Third> &
|
|
1334
|
+
UnwrapTypeFromCoerceableOrValidator<Fourth> &
|
|
1335
|
+
UnwrapTypeFromCoerceableOrValidator<Fifth> &
|
|
1336
|
+
UnwrapTypeFromCoerceableOrValidator<Sixth> &
|
|
1337
|
+
UnwrapTypeFromCoerceableOrValidator<Seventh> &
|
|
1338
|
+
UnwrapTypeFromCoerceableOrValidator<Eighth>
|
|
1339
|
+
>;
|
|
1340
|
+
<
|
|
1341
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1342
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1343
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1344
|
+
Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1345
|
+
Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1346
|
+
Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1347
|
+
Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1348
|
+
Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1349
|
+
Ninth extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
1350
|
+
>(
|
|
1351
|
+
first: First,
|
|
1352
|
+
second: Second,
|
|
1353
|
+
third: Third,
|
|
1354
|
+
fourth: Fourth,
|
|
1355
|
+
fifth: Fifth,
|
|
1356
|
+
sixth: Sixth,
|
|
1357
|
+
seventh: Seventh,
|
|
1358
|
+
eighth: Eighth,
|
|
1359
|
+
ninth: Ninth
|
|
1360
|
+
): TypeValidator<
|
|
1361
|
+
UnwrapTypeFromCoerceableOrValidator<First> &
|
|
1362
|
+
UnwrapTypeFromCoerceableOrValidator<Second> &
|
|
1363
|
+
UnwrapTypeFromCoerceableOrValidator<Third> &
|
|
1364
|
+
UnwrapTypeFromCoerceableOrValidator<Fourth> &
|
|
1365
|
+
UnwrapTypeFromCoerceableOrValidator<Fifth> &
|
|
1366
|
+
UnwrapTypeFromCoerceableOrValidator<Sixth> &
|
|
1367
|
+
UnwrapTypeFromCoerceableOrValidator<Seventh> &
|
|
1368
|
+
UnwrapTypeFromCoerceableOrValidator<Eighth> &
|
|
1369
|
+
UnwrapTypeFromCoerceableOrValidator<Ninth>
|
|
1370
|
+
>;
|
|
1371
|
+
<
|
|
1372
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1373
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1374
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1375
|
+
Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1376
|
+
Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1377
|
+
Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1378
|
+
Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1379
|
+
Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1380
|
+
Ninth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1381
|
+
Tenth extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
1382
|
+
>(
|
|
1383
|
+
first: First,
|
|
1384
|
+
second: Second,
|
|
1385
|
+
third: Third,
|
|
1386
|
+
fourth: Fourth,
|
|
1387
|
+
fifth: Fifth,
|
|
1388
|
+
sixth: Sixth,
|
|
1389
|
+
seventh: Seventh,
|
|
1390
|
+
eighth: Eighth,
|
|
1391
|
+
ninth: Ninth,
|
|
1392
|
+
tenth: Tenth
|
|
1393
|
+
): TypeValidator<
|
|
1394
|
+
UnwrapTypeFromCoerceableOrValidator<First> &
|
|
1395
|
+
UnwrapTypeFromCoerceableOrValidator<Second> &
|
|
1396
|
+
UnwrapTypeFromCoerceableOrValidator<Third> &
|
|
1397
|
+
UnwrapTypeFromCoerceableOrValidator<Fourth> &
|
|
1398
|
+
UnwrapTypeFromCoerceableOrValidator<Fifth> &
|
|
1399
|
+
UnwrapTypeFromCoerceableOrValidator<Sixth> &
|
|
1400
|
+
UnwrapTypeFromCoerceableOrValidator<Seventh> &
|
|
1401
|
+
UnwrapTypeFromCoerceableOrValidator<Eighth> &
|
|
1402
|
+
UnwrapTypeFromCoerceableOrValidator<Ninth> &
|
|
1403
|
+
UnwrapTypeFromCoerceableOrValidator<Tenth>
|
|
1404
|
+
>;
|
|
551
1405
|
};
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
1406
|
+
and: {
|
|
1407
|
+
<
|
|
1408
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1409
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
1410
|
+
>(
|
|
1411
|
+
first: First,
|
|
1412
|
+
second: Second
|
|
1413
|
+
): TypeValidator<
|
|
1414
|
+
UnwrapTypeFromCoerceableOrValidator<First> &
|
|
1415
|
+
UnwrapTypeFromCoerceableOrValidator<Second>
|
|
1416
|
+
>;
|
|
1417
|
+
<
|
|
1418
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1419
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1420
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
1421
|
+
>(
|
|
1422
|
+
first: First,
|
|
1423
|
+
second: Second,
|
|
1424
|
+
third: Third
|
|
1425
|
+
): TypeValidator<
|
|
1426
|
+
UnwrapTypeFromCoerceableOrValidator<First> &
|
|
1427
|
+
UnwrapTypeFromCoerceableOrValidator<Second> &
|
|
1428
|
+
UnwrapTypeFromCoerceableOrValidator<Third>
|
|
1429
|
+
>;
|
|
1430
|
+
<
|
|
1431
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1432
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1433
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1434
|
+
Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
1435
|
+
>(
|
|
1436
|
+
first: First,
|
|
1437
|
+
second: Second,
|
|
1438
|
+
third: Third,
|
|
1439
|
+
fourth: Fourth
|
|
1440
|
+
): TypeValidator<
|
|
1441
|
+
UnwrapTypeFromCoerceableOrValidator<First> &
|
|
1442
|
+
UnwrapTypeFromCoerceableOrValidator<Second> &
|
|
1443
|
+
UnwrapTypeFromCoerceableOrValidator<Third> &
|
|
1444
|
+
UnwrapTypeFromCoerceableOrValidator<Fourth>
|
|
1445
|
+
>;
|
|
1446
|
+
<
|
|
1447
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1448
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1449
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1450
|
+
Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1451
|
+
Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
1452
|
+
>(
|
|
1453
|
+
first: First,
|
|
1454
|
+
second: Second,
|
|
1455
|
+
third: Third,
|
|
1456
|
+
fourth: Fourth,
|
|
1457
|
+
fifth: Fifth
|
|
1458
|
+
): TypeValidator<
|
|
1459
|
+
UnwrapTypeFromCoerceableOrValidator<First> &
|
|
1460
|
+
UnwrapTypeFromCoerceableOrValidator<Second> &
|
|
1461
|
+
UnwrapTypeFromCoerceableOrValidator<Third> &
|
|
1462
|
+
UnwrapTypeFromCoerceableOrValidator<Fourth> &
|
|
1463
|
+
UnwrapTypeFromCoerceableOrValidator<Fifth>
|
|
1464
|
+
>;
|
|
1465
|
+
<
|
|
1466
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1467
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1468
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1469
|
+
Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1470
|
+
Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1471
|
+
Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
1472
|
+
>(
|
|
1473
|
+
first: First,
|
|
1474
|
+
second: Second,
|
|
1475
|
+
third: Third,
|
|
1476
|
+
fourth: Fourth,
|
|
1477
|
+
fifth: Fifth,
|
|
1478
|
+
sixth: Sixth
|
|
1479
|
+
): TypeValidator<
|
|
1480
|
+
UnwrapTypeFromCoerceableOrValidator<First> &
|
|
1481
|
+
UnwrapTypeFromCoerceableOrValidator<Second> &
|
|
1482
|
+
UnwrapTypeFromCoerceableOrValidator<Third> &
|
|
1483
|
+
UnwrapTypeFromCoerceableOrValidator<Fourth> &
|
|
1484
|
+
UnwrapTypeFromCoerceableOrValidator<Fifth> &
|
|
1485
|
+
UnwrapTypeFromCoerceableOrValidator<Sixth>
|
|
1486
|
+
>;
|
|
1487
|
+
<
|
|
1488
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1489
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1490
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1491
|
+
Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1492
|
+
Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1493
|
+
Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1494
|
+
Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
1495
|
+
>(
|
|
1496
|
+
first: First,
|
|
1497
|
+
second: Second,
|
|
1498
|
+
third: Third,
|
|
1499
|
+
fourth: Fourth,
|
|
1500
|
+
fifth: Fifth,
|
|
1501
|
+
sixth: Sixth,
|
|
1502
|
+
seventh: Seventh
|
|
1503
|
+
): TypeValidator<
|
|
1504
|
+
UnwrapTypeFromCoerceableOrValidator<First> &
|
|
1505
|
+
UnwrapTypeFromCoerceableOrValidator<Second> &
|
|
1506
|
+
UnwrapTypeFromCoerceableOrValidator<Third> &
|
|
1507
|
+
UnwrapTypeFromCoerceableOrValidator<Fourth> &
|
|
1508
|
+
UnwrapTypeFromCoerceableOrValidator<Fifth> &
|
|
1509
|
+
UnwrapTypeFromCoerceableOrValidator<Sixth> &
|
|
1510
|
+
UnwrapTypeFromCoerceableOrValidator<Seventh>
|
|
1511
|
+
>;
|
|
1512
|
+
<
|
|
1513
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1514
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1515
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1516
|
+
Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1517
|
+
Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1518
|
+
Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1519
|
+
Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1520
|
+
Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
1521
|
+
>(
|
|
1522
|
+
first: First,
|
|
1523
|
+
second: Second,
|
|
1524
|
+
third: Third,
|
|
1525
|
+
fourth: Fourth,
|
|
1526
|
+
fifth: Fifth,
|
|
1527
|
+
sixth: Sixth,
|
|
1528
|
+
seventh: Seventh,
|
|
1529
|
+
eighth: Eighth
|
|
1530
|
+
): TypeValidator<
|
|
1531
|
+
UnwrapTypeFromCoerceableOrValidator<First> &
|
|
1532
|
+
UnwrapTypeFromCoerceableOrValidator<Second> &
|
|
1533
|
+
UnwrapTypeFromCoerceableOrValidator<Third> &
|
|
1534
|
+
UnwrapTypeFromCoerceableOrValidator<Fourth> &
|
|
1535
|
+
UnwrapTypeFromCoerceableOrValidator<Fifth> &
|
|
1536
|
+
UnwrapTypeFromCoerceableOrValidator<Sixth> &
|
|
1537
|
+
UnwrapTypeFromCoerceableOrValidator<Seventh> &
|
|
1538
|
+
UnwrapTypeFromCoerceableOrValidator<Eighth>
|
|
1539
|
+
>;
|
|
1540
|
+
<
|
|
1541
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1542
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1543
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1544
|
+
Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1545
|
+
Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1546
|
+
Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1547
|
+
Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1548
|
+
Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1549
|
+
Ninth extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
1550
|
+
>(
|
|
1551
|
+
first: First,
|
|
1552
|
+
second: Second,
|
|
1553
|
+
third: Third,
|
|
1554
|
+
fourth: Fourth,
|
|
1555
|
+
fifth: Fifth,
|
|
1556
|
+
sixth: Sixth,
|
|
1557
|
+
seventh: Seventh,
|
|
1558
|
+
eighth: Eighth,
|
|
1559
|
+
ninth: Ninth
|
|
1560
|
+
): TypeValidator<
|
|
1561
|
+
UnwrapTypeFromCoerceableOrValidator<First> &
|
|
1562
|
+
UnwrapTypeFromCoerceableOrValidator<Second> &
|
|
1563
|
+
UnwrapTypeFromCoerceableOrValidator<Third> &
|
|
1564
|
+
UnwrapTypeFromCoerceableOrValidator<Fourth> &
|
|
1565
|
+
UnwrapTypeFromCoerceableOrValidator<Fifth> &
|
|
1566
|
+
UnwrapTypeFromCoerceableOrValidator<Sixth> &
|
|
1567
|
+
UnwrapTypeFromCoerceableOrValidator<Seventh> &
|
|
1568
|
+
UnwrapTypeFromCoerceableOrValidator<Eighth> &
|
|
1569
|
+
UnwrapTypeFromCoerceableOrValidator<Ninth>
|
|
1570
|
+
>;
|
|
1571
|
+
<
|
|
1572
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1573
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1574
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1575
|
+
Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1576
|
+
Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1577
|
+
Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1578
|
+
Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1579
|
+
Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1580
|
+
Ninth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1581
|
+
Tenth extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
1582
|
+
>(
|
|
1583
|
+
first: First,
|
|
1584
|
+
second: Second,
|
|
1585
|
+
third: Third,
|
|
1586
|
+
fourth: Fourth,
|
|
1587
|
+
fifth: Fifth,
|
|
1588
|
+
sixth: Sixth,
|
|
1589
|
+
seventh: Seventh,
|
|
1590
|
+
eighth: Eighth,
|
|
1591
|
+
ninth: Ninth,
|
|
1592
|
+
tenth: Tenth
|
|
1593
|
+
): TypeValidator<
|
|
1594
|
+
UnwrapTypeFromCoerceableOrValidator<First> &
|
|
1595
|
+
UnwrapTypeFromCoerceableOrValidator<Second> &
|
|
1596
|
+
UnwrapTypeFromCoerceableOrValidator<Third> &
|
|
1597
|
+
UnwrapTypeFromCoerceableOrValidator<Fourth> &
|
|
1598
|
+
UnwrapTypeFromCoerceableOrValidator<Fifth> &
|
|
1599
|
+
UnwrapTypeFromCoerceableOrValidator<Sixth> &
|
|
1600
|
+
UnwrapTypeFromCoerceableOrValidator<Seventh> &
|
|
1601
|
+
UnwrapTypeFromCoerceableOrValidator<Eighth> &
|
|
1602
|
+
UnwrapTypeFromCoerceableOrValidator<Ninth> &
|
|
1603
|
+
UnwrapTypeFromCoerceableOrValidator<Tenth>
|
|
1604
|
+
>;
|
|
556
1605
|
};
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
1606
|
+
union: {
|
|
1607
|
+
<
|
|
1608
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1609
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
1610
|
+
>(
|
|
1611
|
+
first: First,
|
|
1612
|
+
second: Second
|
|
1613
|
+
): TypeValidator<
|
|
1614
|
+
| UnwrapTypeFromCoerceableOrValidator<First>
|
|
1615
|
+
| UnwrapTypeFromCoerceableOrValidator<Second>
|
|
1616
|
+
>;
|
|
1617
|
+
<
|
|
1618
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1619
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1620
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
1621
|
+
>(
|
|
1622
|
+
first: First,
|
|
1623
|
+
second: Second,
|
|
1624
|
+
third: Third
|
|
1625
|
+
): TypeValidator<
|
|
1626
|
+
| UnwrapTypeFromCoerceableOrValidator<First>
|
|
1627
|
+
| UnwrapTypeFromCoerceableOrValidator<Second>
|
|
1628
|
+
| UnwrapTypeFromCoerceableOrValidator<Third>
|
|
1629
|
+
>;
|
|
1630
|
+
<
|
|
1631
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1632
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1633
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1634
|
+
Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
1635
|
+
>(
|
|
1636
|
+
first: First,
|
|
1637
|
+
second: Second,
|
|
1638
|
+
third: Third,
|
|
1639
|
+
fourth: Fourth
|
|
1640
|
+
): TypeValidator<
|
|
1641
|
+
| UnwrapTypeFromCoerceableOrValidator<First>
|
|
1642
|
+
| UnwrapTypeFromCoerceableOrValidator<Second>
|
|
1643
|
+
| UnwrapTypeFromCoerceableOrValidator<Third>
|
|
1644
|
+
| UnwrapTypeFromCoerceableOrValidator<Fourth>
|
|
1645
|
+
>;
|
|
1646
|
+
<
|
|
1647
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1648
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1649
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1650
|
+
Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1651
|
+
Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
1652
|
+
>(
|
|
1653
|
+
first: First,
|
|
1654
|
+
second: Second,
|
|
1655
|
+
third: Third,
|
|
1656
|
+
fourth: Fourth,
|
|
1657
|
+
fifth: Fifth
|
|
1658
|
+
): TypeValidator<
|
|
1659
|
+
| UnwrapTypeFromCoerceableOrValidator<First>
|
|
1660
|
+
| UnwrapTypeFromCoerceableOrValidator<Second>
|
|
1661
|
+
| UnwrapTypeFromCoerceableOrValidator<Third>
|
|
1662
|
+
| UnwrapTypeFromCoerceableOrValidator<Fourth>
|
|
1663
|
+
| UnwrapTypeFromCoerceableOrValidator<Fifth>
|
|
1664
|
+
>;
|
|
1665
|
+
<
|
|
1666
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1667
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1668
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1669
|
+
Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1670
|
+
Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1671
|
+
Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
1672
|
+
>(
|
|
1673
|
+
first: First,
|
|
1674
|
+
second: Second,
|
|
1675
|
+
third: Third,
|
|
1676
|
+
fourth: Fourth,
|
|
1677
|
+
fifth: Fifth,
|
|
1678
|
+
sixth: Sixth
|
|
1679
|
+
): TypeValidator<
|
|
1680
|
+
| UnwrapTypeFromCoerceableOrValidator<First>
|
|
1681
|
+
| UnwrapTypeFromCoerceableOrValidator<Second>
|
|
1682
|
+
| UnwrapTypeFromCoerceableOrValidator<Third>
|
|
1683
|
+
| UnwrapTypeFromCoerceableOrValidator<Fourth>
|
|
1684
|
+
| UnwrapTypeFromCoerceableOrValidator<Fifth>
|
|
1685
|
+
| UnwrapTypeFromCoerceableOrValidator<Sixth>
|
|
1686
|
+
>;
|
|
1687
|
+
<
|
|
1688
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1689
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1690
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1691
|
+
Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1692
|
+
Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1693
|
+
Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1694
|
+
Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
1695
|
+
>(
|
|
1696
|
+
first: First,
|
|
1697
|
+
second: Second,
|
|
1698
|
+
third: Third,
|
|
1699
|
+
fourth: Fourth,
|
|
1700
|
+
fifth: Fifth,
|
|
1701
|
+
sixth: Sixth,
|
|
1702
|
+
seventh: Seventh
|
|
1703
|
+
): TypeValidator<
|
|
1704
|
+
| UnwrapTypeFromCoerceableOrValidator<First>
|
|
1705
|
+
| UnwrapTypeFromCoerceableOrValidator<Second>
|
|
1706
|
+
| UnwrapTypeFromCoerceableOrValidator<Third>
|
|
1707
|
+
| UnwrapTypeFromCoerceableOrValidator<Fourth>
|
|
1708
|
+
| UnwrapTypeFromCoerceableOrValidator<Fifth>
|
|
1709
|
+
| UnwrapTypeFromCoerceableOrValidator<Sixth>
|
|
1710
|
+
| UnwrapTypeFromCoerceableOrValidator<Seventh>
|
|
1711
|
+
>;
|
|
1712
|
+
<
|
|
1713
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1714
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1715
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1716
|
+
Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1717
|
+
Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1718
|
+
Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1719
|
+
Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1720
|
+
Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
1721
|
+
>(
|
|
1722
|
+
first: First,
|
|
1723
|
+
second: Second,
|
|
1724
|
+
third: Third,
|
|
1725
|
+
fourth: Fourth,
|
|
1726
|
+
fifth: Fifth,
|
|
1727
|
+
sixth: Sixth,
|
|
1728
|
+
seventh: Seventh,
|
|
1729
|
+
eighth: Eighth
|
|
1730
|
+
): TypeValidator<
|
|
1731
|
+
| UnwrapTypeFromCoerceableOrValidator<First>
|
|
1732
|
+
| UnwrapTypeFromCoerceableOrValidator<Second>
|
|
1733
|
+
| UnwrapTypeFromCoerceableOrValidator<Third>
|
|
1734
|
+
| UnwrapTypeFromCoerceableOrValidator<Fourth>
|
|
1735
|
+
| UnwrapTypeFromCoerceableOrValidator<Fifth>
|
|
1736
|
+
| UnwrapTypeFromCoerceableOrValidator<Sixth>
|
|
1737
|
+
| UnwrapTypeFromCoerceableOrValidator<Seventh>
|
|
1738
|
+
| UnwrapTypeFromCoerceableOrValidator<Eighth>
|
|
1739
|
+
>;
|
|
1740
|
+
<
|
|
1741
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1742
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1743
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1744
|
+
Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1745
|
+
Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1746
|
+
Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1747
|
+
Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1748
|
+
Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1749
|
+
Ninth extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
1750
|
+
>(
|
|
1751
|
+
first: First,
|
|
1752
|
+
second: Second,
|
|
1753
|
+
third: Third,
|
|
1754
|
+
fourth: Fourth,
|
|
1755
|
+
fifth: Fifth,
|
|
1756
|
+
sixth: Sixth,
|
|
1757
|
+
seventh: Seventh,
|
|
1758
|
+
eighth: Eighth,
|
|
1759
|
+
ninth: Ninth
|
|
1760
|
+
): TypeValidator<
|
|
1761
|
+
| UnwrapTypeFromCoerceableOrValidator<First>
|
|
1762
|
+
| UnwrapTypeFromCoerceableOrValidator<Second>
|
|
1763
|
+
| UnwrapTypeFromCoerceableOrValidator<Third>
|
|
1764
|
+
| UnwrapTypeFromCoerceableOrValidator<Fourth>
|
|
1765
|
+
| UnwrapTypeFromCoerceableOrValidator<Fifth>
|
|
1766
|
+
| UnwrapTypeFromCoerceableOrValidator<Sixth>
|
|
1767
|
+
| UnwrapTypeFromCoerceableOrValidator<Seventh>
|
|
1768
|
+
| UnwrapTypeFromCoerceableOrValidator<Eighth>
|
|
1769
|
+
| UnwrapTypeFromCoerceableOrValidator<Ninth>
|
|
1770
|
+
>;
|
|
1771
|
+
<
|
|
1772
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1773
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1774
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1775
|
+
Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1776
|
+
Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1777
|
+
Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1778
|
+
Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1779
|
+
Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1780
|
+
Ninth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1781
|
+
Tenth extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
1782
|
+
>(
|
|
1783
|
+
first: First,
|
|
1784
|
+
second: Second,
|
|
1785
|
+
third: Third,
|
|
1786
|
+
fourth: Fourth,
|
|
1787
|
+
fifth: Fifth,
|
|
1788
|
+
sixth: Sixth,
|
|
1789
|
+
seventh: Seventh,
|
|
1790
|
+
eighth: Eighth,
|
|
1791
|
+
ninth: Ninth,
|
|
1792
|
+
tenth: Tenth
|
|
1793
|
+
): TypeValidator<
|
|
1794
|
+
| UnwrapTypeFromCoerceableOrValidator<First>
|
|
1795
|
+
| UnwrapTypeFromCoerceableOrValidator<Second>
|
|
1796
|
+
| UnwrapTypeFromCoerceableOrValidator<Third>
|
|
1797
|
+
| UnwrapTypeFromCoerceableOrValidator<Fourth>
|
|
1798
|
+
| UnwrapTypeFromCoerceableOrValidator<Fifth>
|
|
1799
|
+
| UnwrapTypeFromCoerceableOrValidator<Sixth>
|
|
1800
|
+
| UnwrapTypeFromCoerceableOrValidator<Seventh>
|
|
1801
|
+
| UnwrapTypeFromCoerceableOrValidator<Eighth>
|
|
1802
|
+
| UnwrapTypeFromCoerceableOrValidator<Ninth>
|
|
1803
|
+
| UnwrapTypeFromCoerceableOrValidator<Tenth>
|
|
1804
|
+
>;
|
|
562
1805
|
};
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
1806
|
+
or: {
|
|
1807
|
+
<
|
|
1808
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1809
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
1810
|
+
>(
|
|
1811
|
+
first: First,
|
|
1812
|
+
second: Second
|
|
1813
|
+
): TypeValidator<
|
|
1814
|
+
| UnwrapTypeFromCoerceableOrValidator<First>
|
|
1815
|
+
| UnwrapTypeFromCoerceableOrValidator<Second>
|
|
1816
|
+
>;
|
|
1817
|
+
<
|
|
1818
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1819
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1820
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
1821
|
+
>(
|
|
1822
|
+
first: First,
|
|
1823
|
+
second: Second,
|
|
1824
|
+
third: Third
|
|
1825
|
+
): TypeValidator<
|
|
1826
|
+
| UnwrapTypeFromCoerceableOrValidator<First>
|
|
1827
|
+
| UnwrapTypeFromCoerceableOrValidator<Second>
|
|
1828
|
+
| UnwrapTypeFromCoerceableOrValidator<Third>
|
|
1829
|
+
>;
|
|
1830
|
+
<
|
|
1831
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1832
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1833
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1834
|
+
Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
1835
|
+
>(
|
|
1836
|
+
first: First,
|
|
1837
|
+
second: Second,
|
|
1838
|
+
third: Third,
|
|
1839
|
+
fourth: Fourth
|
|
1840
|
+
): TypeValidator<
|
|
1841
|
+
| UnwrapTypeFromCoerceableOrValidator<First>
|
|
1842
|
+
| UnwrapTypeFromCoerceableOrValidator<Second>
|
|
1843
|
+
| UnwrapTypeFromCoerceableOrValidator<Third>
|
|
1844
|
+
| UnwrapTypeFromCoerceableOrValidator<Fourth>
|
|
1845
|
+
>;
|
|
1846
|
+
<
|
|
1847
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1848
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1849
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1850
|
+
Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1851
|
+
Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
1852
|
+
>(
|
|
1853
|
+
first: First,
|
|
1854
|
+
second: Second,
|
|
1855
|
+
third: Third,
|
|
1856
|
+
fourth: Fourth,
|
|
1857
|
+
fifth: Fifth
|
|
1858
|
+
): TypeValidator<
|
|
1859
|
+
| UnwrapTypeFromCoerceableOrValidator<First>
|
|
1860
|
+
| UnwrapTypeFromCoerceableOrValidator<Second>
|
|
1861
|
+
| UnwrapTypeFromCoerceableOrValidator<Third>
|
|
1862
|
+
| UnwrapTypeFromCoerceableOrValidator<Fourth>
|
|
1863
|
+
| UnwrapTypeFromCoerceableOrValidator<Fifth>
|
|
1864
|
+
>;
|
|
1865
|
+
<
|
|
1866
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1867
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1868
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1869
|
+
Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1870
|
+
Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1871
|
+
Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
1872
|
+
>(
|
|
1873
|
+
first: First,
|
|
1874
|
+
second: Second,
|
|
1875
|
+
third: Third,
|
|
1876
|
+
fourth: Fourth,
|
|
1877
|
+
fifth: Fifth,
|
|
1878
|
+
sixth: Sixth
|
|
1879
|
+
): TypeValidator<
|
|
1880
|
+
| UnwrapTypeFromCoerceableOrValidator<First>
|
|
1881
|
+
| UnwrapTypeFromCoerceableOrValidator<Second>
|
|
1882
|
+
| UnwrapTypeFromCoerceableOrValidator<Third>
|
|
1883
|
+
| UnwrapTypeFromCoerceableOrValidator<Fourth>
|
|
1884
|
+
| UnwrapTypeFromCoerceableOrValidator<Fifth>
|
|
1885
|
+
| UnwrapTypeFromCoerceableOrValidator<Sixth>
|
|
1886
|
+
>;
|
|
1887
|
+
<
|
|
1888
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1889
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1890
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1891
|
+
Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1892
|
+
Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1893
|
+
Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1894
|
+
Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
1895
|
+
>(
|
|
1896
|
+
first: First,
|
|
1897
|
+
second: Second,
|
|
1898
|
+
third: Third,
|
|
1899
|
+
fourth: Fourth,
|
|
1900
|
+
fifth: Fifth,
|
|
1901
|
+
sixth: Sixth,
|
|
1902
|
+
seventh: Seventh
|
|
1903
|
+
): TypeValidator<
|
|
1904
|
+
| UnwrapTypeFromCoerceableOrValidator<First>
|
|
1905
|
+
| UnwrapTypeFromCoerceableOrValidator<Second>
|
|
1906
|
+
| UnwrapTypeFromCoerceableOrValidator<Third>
|
|
1907
|
+
| UnwrapTypeFromCoerceableOrValidator<Fourth>
|
|
1908
|
+
| UnwrapTypeFromCoerceableOrValidator<Fifth>
|
|
1909
|
+
| UnwrapTypeFromCoerceableOrValidator<Sixth>
|
|
1910
|
+
| UnwrapTypeFromCoerceableOrValidator<Seventh>
|
|
1911
|
+
>;
|
|
1912
|
+
<
|
|
1913
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1914
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1915
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1916
|
+
Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1917
|
+
Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1918
|
+
Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1919
|
+
Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1920
|
+
Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
1921
|
+
>(
|
|
1922
|
+
first: First,
|
|
1923
|
+
second: Second,
|
|
1924
|
+
third: Third,
|
|
1925
|
+
fourth: Fourth,
|
|
1926
|
+
fifth: Fifth,
|
|
1927
|
+
sixth: Sixth,
|
|
1928
|
+
seventh: Seventh,
|
|
1929
|
+
eighth: Eighth
|
|
1930
|
+
): TypeValidator<
|
|
1931
|
+
| UnwrapTypeFromCoerceableOrValidator<First>
|
|
1932
|
+
| UnwrapTypeFromCoerceableOrValidator<Second>
|
|
1933
|
+
| UnwrapTypeFromCoerceableOrValidator<Third>
|
|
1934
|
+
| UnwrapTypeFromCoerceableOrValidator<Fourth>
|
|
1935
|
+
| UnwrapTypeFromCoerceableOrValidator<Fifth>
|
|
1936
|
+
| UnwrapTypeFromCoerceableOrValidator<Sixth>
|
|
1937
|
+
| UnwrapTypeFromCoerceableOrValidator<Seventh>
|
|
1938
|
+
| UnwrapTypeFromCoerceableOrValidator<Eighth>
|
|
1939
|
+
>;
|
|
1940
|
+
<
|
|
1941
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1942
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1943
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1944
|
+
Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1945
|
+
Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1946
|
+
Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1947
|
+
Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1948
|
+
Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1949
|
+
Ninth extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
1950
|
+
>(
|
|
1951
|
+
first: First,
|
|
1952
|
+
second: Second,
|
|
1953
|
+
third: Third,
|
|
1954
|
+
fourth: Fourth,
|
|
1955
|
+
fifth: Fifth,
|
|
1956
|
+
sixth: Sixth,
|
|
1957
|
+
seventh: Seventh,
|
|
1958
|
+
eighth: Eighth,
|
|
1959
|
+
ninth: Ninth
|
|
1960
|
+
): TypeValidator<
|
|
1961
|
+
| UnwrapTypeFromCoerceableOrValidator<First>
|
|
1962
|
+
| UnwrapTypeFromCoerceableOrValidator<Second>
|
|
1963
|
+
| UnwrapTypeFromCoerceableOrValidator<Third>
|
|
1964
|
+
| UnwrapTypeFromCoerceableOrValidator<Fourth>
|
|
1965
|
+
| UnwrapTypeFromCoerceableOrValidator<Fifth>
|
|
1966
|
+
| UnwrapTypeFromCoerceableOrValidator<Sixth>
|
|
1967
|
+
| UnwrapTypeFromCoerceableOrValidator<Seventh>
|
|
1968
|
+
| UnwrapTypeFromCoerceableOrValidator<Eighth>
|
|
1969
|
+
| UnwrapTypeFromCoerceableOrValidator<Ninth>
|
|
1970
|
+
>;
|
|
1971
|
+
<
|
|
1972
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1973
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1974
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1975
|
+
Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1976
|
+
Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1977
|
+
Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1978
|
+
Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1979
|
+
Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1980
|
+
Ninth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
1981
|
+
Tenth extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
1982
|
+
>(
|
|
1983
|
+
first: First,
|
|
1984
|
+
second: Second,
|
|
1985
|
+
third: Third,
|
|
1986
|
+
fourth: Fourth,
|
|
1987
|
+
fifth: Fifth,
|
|
1988
|
+
sixth: Sixth,
|
|
1989
|
+
seventh: Seventh,
|
|
1990
|
+
eighth: Eighth,
|
|
1991
|
+
ninth: Ninth,
|
|
1992
|
+
tenth: Tenth
|
|
1993
|
+
): TypeValidator<
|
|
1994
|
+
| UnwrapTypeFromCoerceableOrValidator<First>
|
|
1995
|
+
| UnwrapTypeFromCoerceableOrValidator<Second>
|
|
1996
|
+
| UnwrapTypeFromCoerceableOrValidator<Third>
|
|
1997
|
+
| UnwrapTypeFromCoerceableOrValidator<Fourth>
|
|
1998
|
+
| UnwrapTypeFromCoerceableOrValidator<Fifth>
|
|
1999
|
+
| UnwrapTypeFromCoerceableOrValidator<Sixth>
|
|
2000
|
+
| UnwrapTypeFromCoerceableOrValidator<Seventh>
|
|
2001
|
+
| UnwrapTypeFromCoerceableOrValidator<Eighth>
|
|
2002
|
+
| UnwrapTypeFromCoerceableOrValidator<Ninth>
|
|
2003
|
+
| UnwrapTypeFromCoerceableOrValidator<Tenth>
|
|
2004
|
+
>;
|
|
567
2005
|
};
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
2006
|
+
mapOf<
|
|
2007
|
+
K extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2008
|
+
V extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
2009
|
+
>(
|
|
2010
|
+
keyType: K,
|
|
2011
|
+
valueType: V
|
|
2012
|
+
): TypeValidator<
|
|
2013
|
+
Map<
|
|
2014
|
+
UnwrapTypeFromCoerceableOrValidator<K>,
|
|
2015
|
+
UnwrapTypeFromCoerceableOrValidator<V>
|
|
2016
|
+
>
|
|
2017
|
+
>;
|
|
2018
|
+
setOf<T extends TypeValidator<any> | CoerceableToTypeValidator | unknown>(
|
|
2019
|
+
itemType: T
|
|
2020
|
+
): TypeValidator<Set<UnwrapTypeFromCoerceableOrValidator<T>>>;
|
|
2021
|
+
maybe<T extends TypeValidator<any> | CoerceableToTypeValidator | unknown>(
|
|
2022
|
+
itemType: T
|
|
2023
|
+
): TypeValidator<UnwrapTypeFromCoerceableOrValidator<T> | undefined | null>;
|
|
2024
|
+
objectWithProperties<
|
|
2025
|
+
T extends {
|
|
2026
|
+
[key: string | number | symbol]:
|
|
2027
|
+
| TypeValidator<any>
|
|
2028
|
+
| CoerceableToTypeValidator
|
|
2029
|
+
| unknown;
|
|
2030
|
+
}
|
|
2031
|
+
>(
|
|
2032
|
+
properties: T
|
|
2033
|
+
): TypeValidator<{
|
|
2034
|
+
[key in keyof T]: UnwrapTypeFromCoerceableOrValidator<T[key]>;
|
|
2035
|
+
}>;
|
|
2036
|
+
objectWithOnlyTheseProperties<
|
|
2037
|
+
T extends {
|
|
2038
|
+
[key: string | number | symbol]:
|
|
2039
|
+
| TypeValidator<any>
|
|
2040
|
+
| CoerceableToTypeValidator
|
|
2041
|
+
| unknown;
|
|
2042
|
+
}
|
|
2043
|
+
>(
|
|
2044
|
+
properties: T
|
|
2045
|
+
): TypeValidator<{
|
|
2046
|
+
[key in keyof T]: UnwrapTypeFromCoerceableOrValidator<T[key]>;
|
|
2047
|
+
}>;
|
|
2048
|
+
|
|
2049
|
+
mappingObjectOf<
|
|
2050
|
+
Values extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2051
|
+
Keys extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
2052
|
+
>(
|
|
2053
|
+
keyType: Keys,
|
|
2054
|
+
valueType: Values
|
|
2055
|
+
): TypeValidator<
|
|
2056
|
+
Record<
|
|
2057
|
+
UnwrapTypeFromCoerceableOrValidator<Keys> extends string | number | symbol
|
|
2058
|
+
? UnwrapTypeFromCoerceableOrValidator<Keys>
|
|
2059
|
+
: never,
|
|
2060
|
+
UnwrapTypeFromCoerceableOrValidator<Values>
|
|
2061
|
+
>
|
|
2062
|
+
>;
|
|
2063
|
+
record<
|
|
2064
|
+
Values extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2065
|
+
Keys extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
2066
|
+
>(
|
|
2067
|
+
keyType: Keys,
|
|
2068
|
+
valueType: Values
|
|
2069
|
+
): TypeValidator<
|
|
2070
|
+
Record<
|
|
2071
|
+
UnwrapTypeFromCoerceableOrValidator<Keys> extends string | number | symbol
|
|
2072
|
+
? UnwrapTypeFromCoerceableOrValidator<Keys>
|
|
2073
|
+
: never,
|
|
2074
|
+
UnwrapTypeFromCoerceableOrValidator<Values>
|
|
2075
|
+
>
|
|
2076
|
+
>;
|
|
2077
|
+
partialObjectWithProperties<
|
|
2078
|
+
T extends {
|
|
2079
|
+
[key: string | number | symbol]:
|
|
2080
|
+
| TypeValidator<any>
|
|
2081
|
+
| CoerceableToTypeValidator
|
|
2082
|
+
| unknown;
|
|
2083
|
+
}
|
|
2084
|
+
>(
|
|
2085
|
+
properties: T
|
|
2086
|
+
): TypeValidator<{
|
|
2087
|
+
[key in keyof T]:
|
|
2088
|
+
| UnwrapTypeFromCoerceableOrValidator<T[key]>
|
|
2089
|
+
| null
|
|
2090
|
+
| undefined;
|
|
2091
|
+
}>;
|
|
2092
|
+
tuple: {
|
|
2093
|
+
<
|
|
2094
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2095
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
2096
|
+
>(
|
|
2097
|
+
first: First,
|
|
2098
|
+
second: Second
|
|
2099
|
+
): TypeValidator<
|
|
2100
|
+
[
|
|
2101
|
+
UnwrapTypeFromCoerceableOrValidator<First>,
|
|
2102
|
+
UnwrapTypeFromCoerceableOrValidator<Second>
|
|
2103
|
+
]
|
|
2104
|
+
>;
|
|
2105
|
+
<
|
|
2106
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2107
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2108
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
2109
|
+
>(
|
|
2110
|
+
first: First,
|
|
2111
|
+
second: Second,
|
|
2112
|
+
third: Third
|
|
2113
|
+
): TypeValidator<
|
|
2114
|
+
[
|
|
2115
|
+
UnwrapTypeFromCoerceableOrValidator<First>,
|
|
2116
|
+
UnwrapTypeFromCoerceableOrValidator<Second>,
|
|
2117
|
+
UnwrapTypeFromCoerceableOrValidator<Third>
|
|
2118
|
+
]
|
|
2119
|
+
>;
|
|
2120
|
+
<
|
|
2121
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2122
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2123
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2124
|
+
Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
2125
|
+
>(
|
|
2126
|
+
first: First,
|
|
2127
|
+
second: Second,
|
|
2128
|
+
third: Third,
|
|
2129
|
+
fourth: Fourth
|
|
2130
|
+
): TypeValidator<
|
|
2131
|
+
[
|
|
2132
|
+
UnwrapTypeFromCoerceableOrValidator<First>,
|
|
2133
|
+
UnwrapTypeFromCoerceableOrValidator<Second>,
|
|
2134
|
+
UnwrapTypeFromCoerceableOrValidator<Third>,
|
|
2135
|
+
UnwrapTypeFromCoerceableOrValidator<Fourth>
|
|
2136
|
+
]
|
|
2137
|
+
>;
|
|
2138
|
+
<
|
|
2139
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2140
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2141
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2142
|
+
Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2143
|
+
Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
2144
|
+
>(
|
|
2145
|
+
first: First,
|
|
2146
|
+
second: Second,
|
|
2147
|
+
third: Third,
|
|
2148
|
+
fourth: Fourth,
|
|
2149
|
+
fifth: Fifth
|
|
2150
|
+
): TypeValidator<
|
|
2151
|
+
[
|
|
2152
|
+
UnwrapTypeFromCoerceableOrValidator<First>,
|
|
2153
|
+
UnwrapTypeFromCoerceableOrValidator<Second>,
|
|
2154
|
+
UnwrapTypeFromCoerceableOrValidator<Third>,
|
|
2155
|
+
UnwrapTypeFromCoerceableOrValidator<Fourth>,
|
|
2156
|
+
UnwrapTypeFromCoerceableOrValidator<Fifth>
|
|
2157
|
+
]
|
|
2158
|
+
>;
|
|
2159
|
+
<
|
|
2160
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2161
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2162
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2163
|
+
Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2164
|
+
Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2165
|
+
Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
2166
|
+
>(
|
|
2167
|
+
first: First,
|
|
2168
|
+
second: Second,
|
|
2169
|
+
third: Third,
|
|
2170
|
+
fourth: Fourth,
|
|
2171
|
+
fifth: Fifth,
|
|
2172
|
+
sixth: Sixth
|
|
2173
|
+
): TypeValidator<
|
|
2174
|
+
[
|
|
2175
|
+
UnwrapTypeFromCoerceableOrValidator<First>,
|
|
2176
|
+
UnwrapTypeFromCoerceableOrValidator<Second>,
|
|
2177
|
+
UnwrapTypeFromCoerceableOrValidator<Third>,
|
|
2178
|
+
UnwrapTypeFromCoerceableOrValidator<Fourth>,
|
|
2179
|
+
UnwrapTypeFromCoerceableOrValidator<Fifth>,
|
|
2180
|
+
UnwrapTypeFromCoerceableOrValidator<Sixth>
|
|
2181
|
+
]
|
|
2182
|
+
>;
|
|
2183
|
+
<
|
|
2184
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2185
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2186
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2187
|
+
Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2188
|
+
Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2189
|
+
Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2190
|
+
Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
2191
|
+
>(
|
|
2192
|
+
first: First,
|
|
2193
|
+
second: Second,
|
|
2194
|
+
third: Third,
|
|
2195
|
+
fourth: Fourth,
|
|
2196
|
+
fifth: Fifth,
|
|
2197
|
+
sixth: Sixth,
|
|
2198
|
+
seventh: Seventh
|
|
2199
|
+
): TypeValidator<
|
|
2200
|
+
[
|
|
2201
|
+
UnwrapTypeFromCoerceableOrValidator<First>,
|
|
2202
|
+
UnwrapTypeFromCoerceableOrValidator<Second>,
|
|
2203
|
+
UnwrapTypeFromCoerceableOrValidator<Third>,
|
|
2204
|
+
UnwrapTypeFromCoerceableOrValidator<Fourth>,
|
|
2205
|
+
UnwrapTypeFromCoerceableOrValidator<Fifth>,
|
|
2206
|
+
UnwrapTypeFromCoerceableOrValidator<Sixth>,
|
|
2207
|
+
UnwrapTypeFromCoerceableOrValidator<Seventh>
|
|
2208
|
+
]
|
|
2209
|
+
>;
|
|
2210
|
+
<
|
|
2211
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2212
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2213
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2214
|
+
Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2215
|
+
Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2216
|
+
Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2217
|
+
Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2218
|
+
Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
2219
|
+
>(
|
|
2220
|
+
first: First,
|
|
2221
|
+
second: Second,
|
|
2222
|
+
third: Third,
|
|
2223
|
+
fourth: Fourth,
|
|
2224
|
+
fifth: Fifth,
|
|
2225
|
+
sixth: Sixth,
|
|
2226
|
+
seventh: Seventh,
|
|
2227
|
+
eighth: Eighth
|
|
2228
|
+
): TypeValidator<
|
|
2229
|
+
[
|
|
2230
|
+
UnwrapTypeFromCoerceableOrValidator<First>,
|
|
2231
|
+
UnwrapTypeFromCoerceableOrValidator<Second>,
|
|
2232
|
+
UnwrapTypeFromCoerceableOrValidator<Third>,
|
|
2233
|
+
UnwrapTypeFromCoerceableOrValidator<Fourth>,
|
|
2234
|
+
UnwrapTypeFromCoerceableOrValidator<Fifth>,
|
|
2235
|
+
UnwrapTypeFromCoerceableOrValidator<Sixth>,
|
|
2236
|
+
UnwrapTypeFromCoerceableOrValidator<Seventh>,
|
|
2237
|
+
UnwrapTypeFromCoerceableOrValidator<Eighth>
|
|
2238
|
+
]
|
|
2239
|
+
>;
|
|
2240
|
+
<
|
|
2241
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2242
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2243
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2244
|
+
Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2245
|
+
Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2246
|
+
Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2247
|
+
Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2248
|
+
Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2249
|
+
Ninth extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
2250
|
+
>(
|
|
2251
|
+
first: First,
|
|
2252
|
+
second: Second,
|
|
2253
|
+
third: Third,
|
|
2254
|
+
fourth: Fourth,
|
|
2255
|
+
fifth: Fifth,
|
|
2256
|
+
sixth: Sixth,
|
|
2257
|
+
seventh: Seventh,
|
|
2258
|
+
eighth: Eighth,
|
|
2259
|
+
ninth: Ninth
|
|
2260
|
+
): TypeValidator<
|
|
2261
|
+
[
|
|
2262
|
+
UnwrapTypeFromCoerceableOrValidator<First>,
|
|
2263
|
+
UnwrapTypeFromCoerceableOrValidator<Second>,
|
|
2264
|
+
UnwrapTypeFromCoerceableOrValidator<Third>,
|
|
2265
|
+
UnwrapTypeFromCoerceableOrValidator<Fourth>,
|
|
2266
|
+
UnwrapTypeFromCoerceableOrValidator<Fifth>,
|
|
2267
|
+
UnwrapTypeFromCoerceableOrValidator<Sixth>,
|
|
2268
|
+
UnwrapTypeFromCoerceableOrValidator<Seventh>,
|
|
2269
|
+
UnwrapTypeFromCoerceableOrValidator<Eighth>,
|
|
2270
|
+
UnwrapTypeFromCoerceableOrValidator<Ninth>
|
|
2271
|
+
]
|
|
2272
|
+
>;
|
|
2273
|
+
<
|
|
2274
|
+
First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2275
|
+
Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2276
|
+
Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2277
|
+
Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2278
|
+
Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2279
|
+
Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2280
|
+
Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2281
|
+
Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2282
|
+
Ninth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,
|
|
2283
|
+
Tenth extends TypeValidator<any> | CoerceableToTypeValidator | unknown
|
|
2284
|
+
>(
|
|
2285
|
+
first: First,
|
|
2286
|
+
second: Second,
|
|
2287
|
+
third: Third,
|
|
2288
|
+
fourth: Fourth,
|
|
2289
|
+
fifth: Fifth,
|
|
2290
|
+
sixth: Sixth,
|
|
2291
|
+
seventh: Seventh,
|
|
2292
|
+
eighth: Eighth,
|
|
2293
|
+
ninth: Ninth,
|
|
2294
|
+
tenth: Tenth
|
|
2295
|
+
): TypeValidator<
|
|
2296
|
+
[
|
|
2297
|
+
UnwrapTypeFromCoerceableOrValidator<First>,
|
|
2298
|
+
UnwrapTypeFromCoerceableOrValidator<Second>,
|
|
2299
|
+
UnwrapTypeFromCoerceableOrValidator<Third>,
|
|
2300
|
+
UnwrapTypeFromCoerceableOrValidator<Fourth>,
|
|
2301
|
+
UnwrapTypeFromCoerceableOrValidator<Fifth>,
|
|
2302
|
+
UnwrapTypeFromCoerceableOrValidator<Sixth>,
|
|
2303
|
+
UnwrapTypeFromCoerceableOrValidator<Seventh>,
|
|
2304
|
+
UnwrapTypeFromCoerceableOrValidator<Eighth>,
|
|
2305
|
+
UnwrapTypeFromCoerceableOrValidator<Ninth>,
|
|
2306
|
+
UnwrapTypeFromCoerceableOrValidator<Tenth>
|
|
2307
|
+
]
|
|
2308
|
+
>;
|
|
600
2309
|
};
|
|
601
|
-
AsyncGenerator(value: any): value is AsyncGenerator<unknown, any, unknown>;
|
|
602
|
-
AsyncGeneratorFunction(value: any): value is AsyncGeneratorFunction;
|
|
603
2310
|
|
|
604
|
-
|
|
2311
|
+
coerce: <V extends CoerceableToTypeValidator | TypeValidator<any> | unknown>(
|
|
2312
|
+
value: V
|
|
2313
|
+
) => TypeValidator<UnwrapTypeFromCoerceableOrValidator<V>>;
|
|
605
2314
|
|
|
2315
|
+
FILE: TypeValidator<FILE>;
|
|
2316
|
+
Module: TypeValidator<{ [key: string]: unknown }>;
|
|
2317
|
+
Path: TypeValidator<Path>;
|
|
606
2318
|
JSX: {
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
2319
|
+
unknownElement: TypeValidator<
|
|
2320
|
+
JSX.Element<{ [key: string | symbol | number]: unknown }, unknown>
|
|
2321
|
+
>;
|
|
2322
|
+
anyElement: TypeValidator<JSX.Element<any, any>>;
|
|
2323
|
+
Element: TypeValidator<
|
|
2324
|
+
JSX.Element<{ [key: string | symbol | number]: unknown }, unknown>
|
|
2325
|
+
>;
|
|
2326
|
+
Fragment: TypeValidator<JSX.Fragment>;
|
|
611
2327
|
};
|
|
612
2328
|
};
|
|
613
2329
|
|
|
2330
|
+
declare const is: <T extends TypeValidator<any> | CoerceableToTypeValidator>(
|
|
2331
|
+
value: any,
|
|
2332
|
+
type: T
|
|
2333
|
+
) => value is UnwrapTypeFromCoerceableOrValidator<T>;
|
|
2334
|
+
|
|
2335
|
+
declare const assert: {
|
|
2336
|
+
/**
|
|
2337
|
+
* Throws an error if `value` is not truthy.
|
|
2338
|
+
*
|
|
2339
|
+
* @param value - The value to test for truthiness
|
|
2340
|
+
* @param message - An optional error message to use. If unspecified, "Assertion failed" will be used.
|
|
2341
|
+
*/
|
|
2342
|
+
<ValueType>(
|
|
2343
|
+
value: ValueType,
|
|
2344
|
+
message?: string
|
|
2345
|
+
): asserts value is ValueType extends null | undefined | false | 0 | ""
|
|
2346
|
+
? never
|
|
2347
|
+
: ValueType;
|
|
2348
|
+
|
|
2349
|
+
/**
|
|
2350
|
+
* Throws an error if `value` is not of the type `type`.
|
|
2351
|
+
*
|
|
2352
|
+
* `type` should be either a {@link TypeValidator}, or a value which can be coerced into one via {@link types.coerce}.
|
|
2353
|
+
*/
|
|
2354
|
+
type: <T extends TypeValidator<any> | CoerceableToTypeValidator>(
|
|
2355
|
+
value: any,
|
|
2356
|
+
type: T,
|
|
2357
|
+
optionalMessage?: string
|
|
2358
|
+
) => asserts value is UnwrapTypeFromCoerceableOrValidator<T>;
|
|
2359
|
+
};
|
|
2360
|
+
|
|
614
2361
|
/**
|
|
615
2362
|
* The data source of a pipe operation; either an in-memory object, or a
|
|
616
2363
|
* file stream.
|
|
@@ -647,7 +2394,7 @@ declare type PipeSource =
|
|
|
647
2394
|
* - Use `intoNew` to put data into a new object.
|
|
648
2395
|
* - Use `path` or `fd` to create a new file handle and put data into it.
|
|
649
2396
|
*/
|
|
650
|
-
|
|
2397
|
+
declare type PipeDestination =
|
|
651
2398
|
| ArrayBuffer
|
|
652
2399
|
| SharedArrayBuffer
|
|
653
2400
|
| DataView
|
|
@@ -690,6 +2437,25 @@ declare function pipe<Dest extends PipeDestination>(
|
|
|
690
2437
|
: never;
|
|
691
2438
|
};
|
|
692
2439
|
|
|
2440
|
+
/**
|
|
2441
|
+
* Launch the Yavascript REPL (read-eval-print-loop).
|
|
2442
|
+
*
|
|
2443
|
+
* @param context Variables to make available as globals within the repl.
|
|
2444
|
+
* @param lang The langauge to use in the repl. Defaults to "javascript".
|
|
2445
|
+
*/
|
|
2446
|
+
declare function startRepl(
|
|
2447
|
+
context?: { [key: string]: any },
|
|
2448
|
+
lang?:
|
|
2449
|
+
| "js"
|
|
2450
|
+
| "javascript"
|
|
2451
|
+
| "ts"
|
|
2452
|
+
| "typescript"
|
|
2453
|
+
| "jsx"
|
|
2454
|
+
| "tsx"
|
|
2455
|
+
| "coffee"
|
|
2456
|
+
| "coffeescript"
|
|
2457
|
+
): void;
|
|
2458
|
+
|
|
693
2459
|
/**
|
|
694
2460
|
* Returns the absolute path to the root folder of the git/hg repo.
|
|
695
2461
|
*
|
|
@@ -738,10 +2504,10 @@ declare namespace JSX {
|
|
|
738
2504
|
* expression.
|
|
739
2505
|
*
|
|
740
2506
|
* Note that if you change this, you need to verify that the following
|
|
741
|
-
* expression always evaluates to `true` (by changing {@link
|
|
742
|
-
* and {@link
|
|
2507
|
+
* expression always evaluates to `true` (by changing {@link types.JSX.Element}
|
|
2508
|
+
* and {@link types.JSX.Fragment}):
|
|
743
2509
|
* ```jsx
|
|
744
|
-
*
|
|
2510
|
+
* types.JSX.Element(<a />) && types.JSX.Fragment(<></>)
|
|
745
2511
|
* ```
|
|
746
2512
|
*
|
|
747
2513
|
* Failure to uphold this guarantee indicates a bug.
|
|
@@ -758,10 +2524,10 @@ declare namespace JSX {
|
|
|
758
2524
|
* expression.
|
|
759
2525
|
*
|
|
760
2526
|
* Note that if you change this, you need to verify that the following
|
|
761
|
-
* expression always evaluates to `true` (by changing {@link
|
|
762
|
-
* and {@link
|
|
2527
|
+
* expression always evaluates to `true` (by changing {@link types.JSX.Element}
|
|
2528
|
+
* and {@link types.JSX.Fragment}):
|
|
763
2529
|
* ```jsx
|
|
764
|
-
*
|
|
2530
|
+
* types.JSX.Element(<a />) && types.JSX.Fragment(<></>)
|
|
765
2531
|
* ```
|
|
766
2532
|
*
|
|
767
2533
|
* Failure to uphold this guarantee indicates a bug.
|
|
@@ -825,6 +2591,51 @@ declare namespace JSX {
|
|
|
825
2591
|
};
|
|
826
2592
|
}
|
|
827
2593
|
|
|
2594
|
+
declare const YAML: {
|
|
2595
|
+
/**
|
|
2596
|
+
* Parse a YAML document (`input`) into a JSON-compatible value.
|
|
2597
|
+
*/
|
|
2598
|
+
parse(
|
|
2599
|
+
input: string,
|
|
2600
|
+
reviver?: (this: any, key: string, value: any) => any
|
|
2601
|
+
): any;
|
|
2602
|
+
|
|
2603
|
+
/**
|
|
2604
|
+
* Convert a JSON-compatible value into a YAML document.
|
|
2605
|
+
*/
|
|
2606
|
+
stringify(
|
|
2607
|
+
input: any,
|
|
2608
|
+
replacer?:
|
|
2609
|
+
| ((this: any, key: string, value: any) => any)
|
|
2610
|
+
| (number | string)[]
|
|
2611
|
+
| null,
|
|
2612
|
+
indent?: number
|
|
2613
|
+
): string;
|
|
2614
|
+
};
|
|
2615
|
+
|
|
2616
|
+
declare const CSV: {
|
|
2617
|
+
/**
|
|
2618
|
+
* Parse a CSV string into an Array of Arrays of strings.
|
|
2619
|
+
*
|
|
2620
|
+
* The outer array holds the rows, and the inner arrays hold the items in
|
|
2621
|
+
* each row.
|
|
2622
|
+
*/
|
|
2623
|
+
parse(input: string): Array<Array<string>>;
|
|
2624
|
+
|
|
2625
|
+
/**
|
|
2626
|
+
* Convert an Array of Arrays of strings into a CSV string.
|
|
2627
|
+
*
|
|
2628
|
+
* The outer array holds the rows, and the inner arrays hold the items in
|
|
2629
|
+
* each row.
|
|
2630
|
+
*/
|
|
2631
|
+
stringify(input: Array<Array<string>>): string;
|
|
2632
|
+
};
|
|
2633
|
+
|
|
2634
|
+
interface RegExpConstructor {
|
|
2635
|
+
/** See https://github.com/tc39/proposal-regex-escaping */
|
|
2636
|
+
escape(str: any): string;
|
|
2637
|
+
}
|
|
2638
|
+
|
|
828
2639
|
// prettier-ignore
|
|
829
2640
|
/** Any integer in the range [0, 255]. */
|
|
830
2641
|
declare type byte =
|
|
@@ -852,6 +2663,27 @@ declare var boolean: BooleanConstructor;
|
|
|
852
2663
|
declare var bigint: BigIntConstructor;
|
|
853
2664
|
declare var symbol: SymbolConstructor;
|
|
854
2665
|
|
|
2666
|
+
declare type TypedArray =
|
|
2667
|
+
| Int8Array
|
|
2668
|
+
| Uint8Array
|
|
2669
|
+
| Uint8ClampedArray
|
|
2670
|
+
| Int16Array
|
|
2671
|
+
| Uint16Array
|
|
2672
|
+
| Int32Array
|
|
2673
|
+
| Uint32Array
|
|
2674
|
+
| Float32Array
|
|
2675
|
+
| Float64Array;
|
|
2676
|
+
declare type TypedArrayConstructor =
|
|
2677
|
+
| Int8ArrayConstructor
|
|
2678
|
+
| Uint8ArrayConstructor
|
|
2679
|
+
| Uint8ClampedArrayConstructor
|
|
2680
|
+
| Int16ArrayConstructor
|
|
2681
|
+
| Uint16ArrayConstructor
|
|
2682
|
+
| Int32ArrayConstructor
|
|
2683
|
+
| Uint32ArrayConstructor
|
|
2684
|
+
| Float32ArrayConstructor
|
|
2685
|
+
| Float64ArrayConstructor;
|
|
2686
|
+
|
|
855
2687
|
// ==========================================
|
|
856
2688
|
// ------------------------------------------
|
|
857
2689
|
// QuickJS APIs, which YavaScript builds upon
|
|
@@ -915,7 +2747,7 @@ declare interface FILE {
|
|
|
915
2747
|
close(): void;
|
|
916
2748
|
|
|
917
2749
|
/** Outputs the string with the UTF-8 encoding. */
|
|
918
|
-
puts(
|
|
2750
|
+
puts(...strings: Array<string>): void;
|
|
919
2751
|
|
|
920
2752
|
/**
|
|
921
2753
|
* Formatted printf.
|
|
@@ -974,7 +2806,7 @@ declare interface FILE {
|
|
|
974
2806
|
putByte(value: number): void;
|
|
975
2807
|
}
|
|
976
2808
|
|
|
977
|
-
declare module "std" {
|
|
2809
|
+
declare module "quickjs:std" {
|
|
978
2810
|
/**
|
|
979
2811
|
* Exit the process with the provided status code.
|
|
980
2812
|
*
|
|
@@ -1015,6 +2847,15 @@ declare module "std" {
|
|
|
1015
2847
|
basename?: string
|
|
1016
2848
|
): { [key: string]: any };
|
|
1017
2849
|
|
|
2850
|
+
/**
|
|
2851
|
+
* Return the resolved path to a module.
|
|
2852
|
+
*
|
|
2853
|
+
* @param filename - The relative or absolute path to the file to import. Relative paths are resolved relative to the file calling `importModule`, or `basename` if present.
|
|
2854
|
+
* @param basename - If present and `filename` is a relative path, `filename` will be resolved relative to this basename.
|
|
2855
|
+
* @returns The resolved module path.
|
|
2856
|
+
*/
|
|
2857
|
+
export function resolveModule(filename: string, basename?: string): string;
|
|
2858
|
+
|
|
1018
2859
|
/**
|
|
1019
2860
|
* Load the file `filename` and return it as a string assuming UTF-8 encoding.
|
|
1020
2861
|
*
|
|
@@ -1029,7 +2870,7 @@ declare module "std" {
|
|
|
1029
2870
|
*
|
|
1030
2871
|
* @param stackLevels - How many levels up the stack to search for a filename. Defaults to 0, which uses the current stack frame.
|
|
1031
2872
|
*/
|
|
1032
|
-
export function getFileNameFromStack(stackLevels
|
|
2873
|
+
export function getFileNameFromStack(stackLevels?: number): string;
|
|
1033
2874
|
|
|
1034
2875
|
/**
|
|
1035
2876
|
* Return a boolean indicating whether the provided value is a FILE object.
|
|
@@ -1078,7 +2919,7 @@ declare module "std" {
|
|
|
1078
2919
|
export function tmpfile(): FILE;
|
|
1079
2920
|
|
|
1080
2921
|
/** Equivalent to `std.out.puts(str)`. */
|
|
1081
|
-
export function puts(
|
|
2922
|
+
export function puts(...strings: Array<string>): void;
|
|
1082
2923
|
|
|
1083
2924
|
/** Equivalent to `std.out.printf(fmt, ...args)` */
|
|
1084
2925
|
export function printf(fmt: string, ...args: Array<any>): void;
|
|
@@ -1240,7 +3081,7 @@ declare module "std" {
|
|
|
1240
3081
|
export function parseExtJSON(str: string): any;
|
|
1241
3082
|
}
|
|
1242
3083
|
|
|
1243
|
-
declare module "os" {
|
|
3084
|
+
declare module "quickjs:os" {
|
|
1244
3085
|
/**
|
|
1245
3086
|
* Open a file handle. Returns a number; the file descriptor.
|
|
1246
3087
|
*
|
|
@@ -1533,16 +3374,19 @@ declare module "os" {
|
|
|
1533
3374
|
/** Sleep for `delay_ms` milliseconds. */
|
|
1534
3375
|
export function sleep(delay_ms: number): void;
|
|
1535
3376
|
|
|
1536
|
-
export type
|
|
3377
|
+
export type OSTimer = { [Symbol.toStringTag]: "OSTimer" };
|
|
1537
3378
|
|
|
1538
3379
|
/** Call the function func after delay ms. Return a handle to the timer. */
|
|
1539
|
-
export function setTimeout(
|
|
3380
|
+
export function setTimeout(
|
|
3381
|
+
func: (...args: any) => any,
|
|
3382
|
+
delay: number
|
|
3383
|
+
): OSTimer;
|
|
1540
3384
|
|
|
1541
3385
|
/** Cancel a timer. */
|
|
1542
|
-
export function clearTimeout(handle:
|
|
3386
|
+
export function clearTimeout(handle: OSTimer): void;
|
|
1543
3387
|
|
|
1544
|
-
/** Return a string representing the platform: "linux", "darwin", "win32" or "js". */
|
|
1545
|
-
export var platform: "linux" | "darwin" | "win32" | "js";
|
|
3388
|
+
/** Return a string representing the platform: "linux", "darwin", "win32", "freebsd", or "js" (emscripten). */
|
|
3389
|
+
export var platform: "linux" | "darwin" | "win32" | "freebsd" | "js";
|
|
1546
3390
|
|
|
1547
3391
|
/**
|
|
1548
3392
|
* Things that can be put into Worker.postMessage.
|
|
@@ -1630,6 +3474,12 @@ declare module "os" {
|
|
|
1630
3474
|
|
|
1631
3475
|
/** `access` Unix system call; checks if a file is readable, writable, executable, and/or exists (use {@link R_OK}, {@link W_OK}, {@link X_OK}, and/or {@link F_OK} for `accessMode`). Throws a descriptive error (with errno property) if the requested access is not available; otherwise, returns undefined. */
|
|
1632
3476
|
export function access(path: string, accessMode: number): void;
|
|
3477
|
+
|
|
3478
|
+
/** gets the path to the executable which is executing this JS code. might be a relative path or symlink. */
|
|
3479
|
+
export function execPath(): string;
|
|
3480
|
+
|
|
3481
|
+
/** changes the access permission bits of the file at `path` using the octal number `mode`. */
|
|
3482
|
+
export function chmod(path: string, mode: number): void;
|
|
1633
3483
|
}
|
|
1634
3484
|
|
|
1635
3485
|
/**
|
|
@@ -1783,10 +3633,13 @@ declare class Module {
|
|
|
1783
3633
|
*
|
|
1784
3634
|
* The key for each property in this object should be a file extension
|
|
1785
3635
|
* string with a leading dot, eg `".jsx"`. The value for each property should
|
|
1786
|
-
* be a function which receives the filepath to a module, and
|
|
1787
|
-
*
|
|
1788
|
-
* code that corresponds to that module. In
|
|
1789
|
-
* compile the contents of the file from one format into JavaScript.
|
|
3636
|
+
* be a function which receives (1) the filepath to a module, and (2) that
|
|
3637
|
+
* file's content as a UTF-8 string, and the function should return a string
|
|
3638
|
+
* containing JavaScript code that corresponds to that module. In most cases,
|
|
3639
|
+
* these functions will compile the contents of the file from one format into JavaScript.
|
|
3640
|
+
*
|
|
3641
|
+
* The function does not have to use the second 'content' argument it
|
|
3642
|
+
* receives (ie. when loading binary files).
|
|
1790
3643
|
*
|
|
1791
3644
|
* By adding to this object, you can make it possible to import non-js
|
|
1792
3645
|
* filetypes; compile-to-JS languages like JSX, TypeScript, and CoffeeScript
|
|
@@ -1797,8 +3650,7 @@ declare class Module {
|
|
|
1797
3650
|
* ```js
|
|
1798
3651
|
* import * as std from "std";
|
|
1799
3652
|
*
|
|
1800
|
-
* Module.compilers[".txt"] = (filename) => {
|
|
1801
|
-
* const content = std.loadFile(filename);
|
|
3653
|
+
* Module.compilers[".txt"] = (filename, content) => {
|
|
1802
3654
|
* return `export default ${JSON.stringify(content)}`;
|
|
1803
3655
|
* }
|
|
1804
3656
|
* ```
|
|
@@ -1815,8 +3667,30 @@ declare class Module {
|
|
|
1815
3667
|
* {@link Module.searchExtensions}.
|
|
1816
3668
|
*/
|
|
1817
3669
|
static compilers: {
|
|
1818
|
-
[extensionWithDot: string]: (filename: string) => string;
|
|
3670
|
+
[extensionWithDot: string]: (filename: string, content: string) => string;
|
|
1819
3671
|
};
|
|
3672
|
+
|
|
3673
|
+
/**
|
|
3674
|
+
* Create a virtual built-in module whose exports consist of the own
|
|
3675
|
+
* enumerable properties of `obj`.
|
|
3676
|
+
*/
|
|
3677
|
+
static define(name: string, obj: { [key: string]: any }): void;
|
|
3678
|
+
|
|
3679
|
+
/**
|
|
3680
|
+
* Resolves a require/import request from `fromFile` into a canonicalized path.
|
|
3681
|
+
*
|
|
3682
|
+
* To change native module resolution behavior, replace this function with
|
|
3683
|
+
* your own implementation.
|
|
3684
|
+
*/
|
|
3685
|
+
static resolve(name: string, fromFile: string): string;
|
|
3686
|
+
|
|
3687
|
+
/**
|
|
3688
|
+
* Reads the contents of the given resolved module name into a string.
|
|
3689
|
+
*
|
|
3690
|
+
* To change native module loading behavior, replace this function with your
|
|
3691
|
+
* own implementation.
|
|
3692
|
+
*/
|
|
3693
|
+
static read(modulePath: string): string;
|
|
1820
3694
|
}
|
|
1821
3695
|
|
|
1822
3696
|
/**
|
|
@@ -1851,4 +3725,110 @@ declare class Module {
|
|
|
1851
3725
|
* will use those, too. It will search in the same order as the strings appear
|
|
1852
3726
|
* in the `Module.searchExtensions` array.
|
|
1853
3727
|
*/
|
|
1854
|
-
declare var require: (source: string) =>
|
|
3728
|
+
declare var require: ((source: string) => any) & {
|
|
3729
|
+
/**
|
|
3730
|
+
* Resolves the normalized path to a modules, relative to the calling file.
|
|
3731
|
+
*/
|
|
3732
|
+
resolve: (source: string) => string;
|
|
3733
|
+
};
|
|
3734
|
+
|
|
3735
|
+
declare var setTimeout: typeof import("quickjs:os").setTimeout;
|
|
3736
|
+
declare var clearTimeout: typeof import("quickjs:os").clearTimeout;
|
|
3737
|
+
|
|
3738
|
+
declare type Interval = { [Symbol.toStringTag]: "Interval" };
|
|
3739
|
+
|
|
3740
|
+
declare function setInterval(func: (...args: any) => any, ms: number): Interval;
|
|
3741
|
+
declare function clearInterval(interval: Interval): void;
|
|
3742
|
+
|
|
3743
|
+
interface StringConstructor {
|
|
3744
|
+
/**
|
|
3745
|
+
* A no-op template literal tag.
|
|
3746
|
+
*
|
|
3747
|
+
* https://github.com/tc39/proposal-string-cooked
|
|
3748
|
+
*/
|
|
3749
|
+
cooked(
|
|
3750
|
+
strings: readonly string[] | ArrayLike<string>,
|
|
3751
|
+
...substitutions: any[]
|
|
3752
|
+
): string;
|
|
3753
|
+
|
|
3754
|
+
/**
|
|
3755
|
+
* Remove leading minimum indentation from the string.
|
|
3756
|
+
* The first line of the string must be empty.
|
|
3757
|
+
*
|
|
3758
|
+
* https://github.com/tc39/proposal-string-dedent
|
|
3759
|
+
*/
|
|
3760
|
+
dedent: {
|
|
3761
|
+
/**
|
|
3762
|
+
* Remove leading minimum indentation from the string.
|
|
3763
|
+
* The first line of the string must be empty.
|
|
3764
|
+
*
|
|
3765
|
+
* https://github.com/tc39/proposal-string-dedent
|
|
3766
|
+
*/
|
|
3767
|
+
(input: string): string;
|
|
3768
|
+
|
|
3769
|
+
/**
|
|
3770
|
+
* Remove leading minimum indentation from the template literal.
|
|
3771
|
+
* The first line of the string must be empty.
|
|
3772
|
+
*
|
|
3773
|
+
* https://github.com/tc39/proposal-string-dedent
|
|
3774
|
+
*/
|
|
3775
|
+
(
|
|
3776
|
+
strings: readonly string[] | ArrayLike<string>,
|
|
3777
|
+
...substitutions: any[]
|
|
3778
|
+
): string;
|
|
3779
|
+
|
|
3780
|
+
/**
|
|
3781
|
+
* Wrap another template tag function such that tagged literals
|
|
3782
|
+
* become dedented before being passed to the wrapped function.
|
|
3783
|
+
*
|
|
3784
|
+
* https://www.npmjs.com/package/string-dedent#usage
|
|
3785
|
+
*/
|
|
3786
|
+
<
|
|
3787
|
+
Func extends (
|
|
3788
|
+
strings: readonly string[] | ArrayLike<string>,
|
|
3789
|
+
...substitutions: any[]
|
|
3790
|
+
) => string
|
|
3791
|
+
>(
|
|
3792
|
+
input: Func
|
|
3793
|
+
): Func;
|
|
3794
|
+
};
|
|
3795
|
+
}
|
|
3796
|
+
|
|
3797
|
+
interface ObjectConstructor {
|
|
3798
|
+
/**
|
|
3799
|
+
* Convert the specified value to a primitive value.
|
|
3800
|
+
*
|
|
3801
|
+
* The provided hint indicates a preferred return type, which may or may not
|
|
3802
|
+
* be respected by the engine.
|
|
3803
|
+
*
|
|
3804
|
+
* See the abstract operation "ToPrimitive" in the ECMAScript standard for
|
|
3805
|
+
* more info.
|
|
3806
|
+
*/
|
|
3807
|
+
toPrimitive(
|
|
3808
|
+
input: any,
|
|
3809
|
+
hint: "string" | "number" | "default"
|
|
3810
|
+
): string | number | bigint | boolean | undefined | symbol | null;
|
|
3811
|
+
}
|
|
3812
|
+
|
|
3813
|
+
interface SymbolConstructor {
|
|
3814
|
+
/**
|
|
3815
|
+
* A method that changes the result of using the `typeof` operator on the
|
|
3816
|
+
* object. Called by the semantics of the typeof operator.
|
|
3817
|
+
*
|
|
3818
|
+
* Note that the following semantics will come into play when use of the
|
|
3819
|
+
* `typeof` operator causes the engine to call a `Symbol.typeofValue` method
|
|
3820
|
+
* on an object:
|
|
3821
|
+
*
|
|
3822
|
+
* - If the method returns any value other than one of the string values
|
|
3823
|
+
* which are normally the result of using the `typeof` operator, the engine
|
|
3824
|
+
* behaves as if no `Symbol.typeofValue` method was present on the object.
|
|
3825
|
+
* - If an error is thrown from this method, or an error is thrown while
|
|
3826
|
+
* accessing this property, the error will be silently ignored, and the
|
|
3827
|
+
* engine will behave as if no `Symbol.typeofValue` method was present on
|
|
3828
|
+
* the object.
|
|
3829
|
+
* - If this property is present on an object, but the value of that property
|
|
3830
|
+
* is not a function, the engine will not consider that value when
|
|
3831
|
+
* determining the result of the `typeof` operation (it'll ignore it).
|
|
3832
|
+
*/
|
|
3833
|
+
readonly typeofValue: unique symbol;
|
|
3834
|
+
}
|