yavascript 0.0.13 → 0.14.0

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.
@@ -1986,7 +1986,7 @@ ${MIT}
1986
1986
  }),
1987
1987
  /* --- dist/yavascript.d.ts?contentString --- */
1988
1988
  "dist/yavascript.d.ts?contentString": (function (exports, _kame_require_, module, __filename, __dirname, _kame_dynamic_import_) {
1989
- module.exports = "// ===============\n// ---------------\n// YavaScript APIs\n// ---------------\n// ===============\n/**\n * Prints a link to the YavaScript help docs for the currently-running version\n * of YavaScript.\n *\n * For the latest help docs, see:\n * https://github.com/suchipi/yavascript/blob/main/meta/generated-docs/README.md\n */\ndeclare function help(): void;\n\n/**\n * The `yavascript` global contains metadata about the currently-running\n * yavascript binary, as well as access to yavascript's compilers for\n * compile-to-js languages.\n */\ndeclare const yavascript: {\n /**\n * The version of the currently-running yavascript binary.\n *\n * Will be something formatted like one of these:\n * - \"v0.0.7\"\n * - \"v0.1.3-alpha\"\n * - \"git-286a3a336849\"\n * - \"git-286a3a336849-dirty\"\n *\n * Or, more formally: either a \"V\" version string or a \"GIT\" version string:\n * - \"V\" version strings start with the character 'v', followed by a semver\n * version string, optionally followed by the character '-' and any\n * arbitrary content afterwards.\n * - \"GIT\" version strings start with the prefix \"git-\", followed by the\n * first 12 digits of a git commit SHA, optionally followed by the\n * character '-' and any arbitrary content afterwards.\n */\n version: string;\n\n /**\n * The processor architecture of the currently-running `yavascript` binary.\n */\n arch: \"x86_64\" | \"arm64\";\n\n /**\n * The version of the ecma262 standard supported by the currently-running\n * yavascript binary.\n *\n * Currently, this is always \"ES2020\", but if future versions of yavascript\n * support a newer version of the standard, this will change. In that event,\n * this property will always be in the format of \"ES\" + a year, and will never\n * be lower than ES2020.\n */\n ecmaVersion: string;\n\n /**\n * The compilers yavascript uses internally to load files.\n *\n * Each function returns a JavaScript source code string.\n */\n compilers: {\n /**\n * The function yavascript uses internally to load JavaScript files.\n *\n * You might think this would be a no-op, but we do some CommonJS/ECMAScript\n * Module interop transformations here.\n */\n js(\n code: string,\n options?: { filename?: string; expression?: boolean }\n ): string;\n\n /**\n * The function yavascript uses internally to load [TypeScript JSX](https://www.typescriptlang.org/docs/handbook/jsx.html) files.\n *\n * yavascript uses [Sucrase 3.35.0](https://sucrase.io/) to load TypeScript JSX syntax. yavascript doesn't do typechecking of TypeScript syntax.\n */\n tsx(\n code: string,\n options?: { filename?: string; expression?: boolean }\n ): string;\n\n /**\n * The function yavascript uses internally to load [TypeScript](https://www.typescriptlang.org/) files.\n *\n * yavascript uses [Sucrase 3.35.0](https://sucrase.io/) to load TypeScript syntax. yavascript doesn't do typechecking of TypeScript syntax.\n */\n ts(\n code: string,\n options?: { filename?: string; expression?: boolean }\n ): string;\n\n /**\n * The function yavascript uses internally to load JSX files.\n *\n * yavascript uses [Sucrase 3.35.0](https://sucrase.io/) to load JSX syntax.\n *\n * See {@link JSX} for info about configuring JSX pragma, swapping out the\n * default `createElement` implementation, etc.\n */\n jsx(\n code: string,\n options?: { filename?: string; expression?: boolean }\n ): string;\n\n /**\n * The function yavascript uses internally to load [CoffeeScript](https://coffeescript.org/) files.\n *\n * yavascript embeds CoffeeScript 2.7.0.\n */\n coffee(\n code: string,\n options?: { filename?: string; expression?: boolean }\n ): string;\n\n /**\n * The function yavascript uses internally to load [Civet](https://civet.dev/) files.\n *\n * yavascript embeds Civet 0.9.0.\n */\n civet(\n code: string,\n options?: { filename?: string; expression?: boolean }\n ): string;\n\n /**\n * The function yavascript uses internally to load files which don't have an\n * extension.\n *\n * It tries to parse the file as each of the following languages, in order,\n * until it finds one which doesn't have a syntax error:\n *\n * - JSX\n * - TSX\n * - Civet\n * - CoffeeScript\n *\n * If none of the languages work, the file's original content gets used so\n * that a syntax error can be reported to the user.\n */\n autodetect(\n code: string,\n options?: { filename?: string; expression?: boolean }\n ): string;\n };\n};\n\n/**\n * An object representing the process's environment variables. You can read\n * from it to read environment variables, write into it to set environment\n * variables, and/or delete properties from it to unset environment variables.\n * Any value you write will be coerced into a string.\n */\ndeclare const env: { [key: string]: string | undefined };\n\n/**\n * A function which parses command line `--flags` into an object of flags and an\n * array of positional arguments. This function is opinionated; if it doesn't\n * meet your needs, you can parse the {@link scriptArgs} global manually.\n *\n * Flags `--like-this`, `--like_this`, or `--LIKE_THIS` get converted into\n * property names `likeThis` on the returned flags object.\n *\n * Flags like this: `-v` get converted into into property names like this: `v`\n * on the returned flags object.\n *\n * Anything that appears after `--` is considered a positional argument instead\n * of a flag. `--` is not present in the returned positional arguments Array.\n *\n * `parseScriptArgs` accepts two optional parameters: `hints` and `argv`.\n *\n * ## hints\n *\n * If present, `hints` should be an object whose keys are flag names (in\n * lowerCamelCase) and whose values indicate what type to treat that flag as.\n * Valid property values are `String`, `Boolean`, `Number`, and `Path`. `Path`\n * will resolve relative paths into absolute paths for you. If no hints object\n * is specified, `parseScriptArgs` will do its best to guess the types.\n *\n * ## argv\n *\n * The `argv` parameter, if present, should be an array containing the command\n * line flags you want to parse. If you don't provide one, `scriptArgs.slice(2)`\n * will be used (we slice 2 in order to skip the yavascript binary and script\n * name). If you pass in an array here, it should only contain command-line\n * flags, not the binary being called.\n *\n * ## Return Value\n *\n * `parseScriptArgs` returns an object with three properties: `flags`, `args`,\n * and `metadata`.\n *\n * - `flags` is an object whose keys are lowerCamelCase flag names and whose\n * values are strings, booleans, numbers, or `Path`s corresponding to the\n * input command-line args.\n * - `args` is an Array of positional arguments, as found on the command-line.\n * - `metadata` contains information about what name and type the flags got\n * mapped to.\n *\n * @param hints - An object whose keys are flag names (in lowerCamelCase) and\n * whose values indicate what type to treat that flag as. Valid property values\n * are `String`, `Boolean`, `Number`, and `Path`. `Path` will resolve relative\n * paths into absolute paths for you. If no hints object is specified,\n * `parseScriptArgs` will do its best to guess, based on the command-line args.\n * @param argv - An array containing the command line flags you want to parse.\n * If unspecified, `scriptArgs.slice(2)` will be used (we slice 2 in order to\n * skip the yavascript binary and script name). If you pass in an array here, it\n * should only contain command-line flags, not the binary being called.\n *\n * @returns A {@link ParseScriptArgsResult}, which is an object with three\n * properties: `flags`, `args`, and `metadata`. `flags` is an object whose keys\n * are camelCase flag names and whose values are strings, booleans, numbers, or\n * `Path`s corresponding to the input command-line args. `args` is an Array of\n * positional arguments, as found on the command-line. `metadata` contains\n * information about what name and type the flags got mapped to.\n */\ndeclare function parseScriptArgs(\n hints?: {\n [key: string]: typeof String | typeof Boolean | typeof Number | typeof Path;\n },\n args?: Array<string>\n): ParseScriptArgsResult;\n\n/**\n * The return type of {@link parseScriptArgs}.\n *\n * The `flags` property contains the values for any command-line `--flags`, with\n * key names converted to `lowerCamelCase`.\n *\n * The `args` property contains an array of those command-line arguments which\n * weren't associated with a flag.\n *\n * The `metadata` property contains information about the parsing process,\n * including what case changes were applied to the keys, which hints were used,\n * and which properties had their type guessed because no corresponding hint was\n * available.\n */\ndeclare interface ParseScriptArgsResult {\n /**\n * The values for any command-line `--flags`, with key names converted to `lowerCamelCase`.\n */\n flags: { [key: string]: any };\n /**\n * An array of those command-line arguments which weren't associated with a flag.\n */\n args: Array<string>;\n /**\n * Information about the parsing process, including what case changes were\n * applied to the keys, which hints were used, and which properties had their\n * type guessed because no corresponding hint was available.\n */\n metadata: {\n /**\n * An object whose keys are the verbatim flags from the command-line, and\n * whose values are the lowerCamelCase names they were converted to in the\n * `flags` property of the {@link ParseScriptArgsResult}.\n */\n keys: {\n [key: string]: string | undefined;\n };\n /**\n * An object whose keys are the lowerCamelCase flag names, and whose values\n * are strings indicating the hint values that were specified for those\n * flags.\n */\n hints: {\n [key: string]: \"path\" | \"number\" | \"boolean\" | \"string\" | undefined;\n };\n /**\n * An object indicating which flags we inferred the type of, because no\n * corresponding hint was present.\n *\n * The keys are the lowerCamelCase flag names, and the values are strings\n * indicating what type we guessed for that flag.\n *\n * If you're seeing incorrect inference, consider passing a `hints` argument\n * to {@link parseScriptArgs}.\n */\n guesses: {\n [key: string]: \"number\" | \"boolean\" | \"string\" | undefined;\n };\n };\n}\n\n/**\n * Read the contents of a file from disk.\n *\n * With no options specified, it reads the file as UTF-8 and returns a string:\n *\n * ```ts\n * const contents = readFile(\"README.md\");\n * console.log(contents);\n * // \"# yavascript\\n\\nYavaScript is a cross-platform bash-like script runner and repl which is distributed as a single\\nstatically-linked binary...\"\n * ```\n *\n * But, if you pass `{ binary: true }` as the second argument, it returns an\n * ArrayBuffer containing the raw bytes from the file:\n *\n * ```ts\n * const contents = readFile(\"README.md\", { binary: true });\n * console.log(contents);\n * // ArrayBuffer {\n * // │0x00000000│ 23 20 79 61 76 61 73 63 72 69 70 74 0A 0A 59 61\n * // │0x00000010│ 76 61 53 63 72 69 70 74 20 69 73 20 61 20 63 72\n * // │0x00000020│ 6F 73 73 2D 70 6C 61 74 66 6F 72 6D 20 62 61 73\n * // │0x00000030│ 68 2D 6C 69 6B 65 20 73 63 72 69 70 74 20 72 75\n * // ...\n * ```\n */\ndeclare const readFile: {\n /**\n * Read the contents of a file from disk, as a UTF-8 string.\n */\n (path: string | Path): string;\n\n /**\n * Read the contents of a file from disk, as a UTF-8 string.\n */\n (path: string | Path, options: {}): string;\n\n /**\n * Read the contents of a file from disk, as a UTF-8 string.\n */\n (path: string | Path, options: { binary: false }): string;\n\n /**\n * Read the contents of a file from disk, as an ArrayBuffer.\n */\n (path: string | Path, options: { binary: true }): ArrayBuffer;\n};\n\n/**\n * Write the contents of a string or ArrayBuffer to a file.\n *\n * Strings are written using the UTF-8 encoding.\n */\ndeclare function writeFile(\n path: string | Path,\n data: string | ArrayBuffer\n): void;\n\n/**\n * Function which returns true if the path points to a regular file.\n */\ndeclare function isFile(path: string | Path): boolean;\n\n/**\n * Function which returns true if the path points to a directory, or if the\n * path points to a symlink which points to a directory. Otherwise, it returns\n * false.\n */\ndeclare function isDir(path: string | Path): boolean;\n\n/**\n * Returns true if the path points to a symlink.\n */\ndeclare function isLink(path: string | Path): boolean;\n\n/**\n * Returns true if the resource at the provided path can be executed by the\n * current user.\n *\n * If nothing exists at that path, an error will be thrown.\n */\ndeclare function isExecutable(path: string | Path): boolean;\n\n/**\n * Returns true if the resource at the provided path can be read by the current\n * user.\n *\n * If nothing exists at that path, an error will be thrown.\n */\ndeclare function isReadable(path: string | Path): boolean;\n\n/**\n * Returns true if a resource at the provided path could be written to by the\n * current user.\n */\ndeclare function isWritable(path: string | Path): boolean;\n\n/**\n * Delete the file or directory at the specified path.\n *\n * If the directory isn't empty, its contents will be deleted, too.\n *\n * Provides the same functionality as the command `rm -rf`.\n */\ndeclare function remove(path: string | Path): void;\n\n/**\n * Returns true if a file or directory exists at the specified path.\n *\n * Provides the same functionality as the command `test -e`.\n */\ndeclare function exists(path: string | Path): boolean;\n\n/**\n * Copies a file or folder from one location to another.\n * Folders are copied recursively.\n *\n * Provides the same functionality as the command `cp -R`.\n */\ndeclare function copy(\n from: string | Path,\n to: string | Path,\n options?: CopyOptions\n): void;\n\n/**\n * Options for {@link copy}.\n */\ndeclare type CopyOptions = {\n /**\n * What to do when attempting to copy something into a location where\n * something else already exists.\n *\n * Defaults to \"error\".\n */\n whenTargetExists?: \"overwrite\" | \"skip\" | \"error\";\n\n /** Options which control logging. */\n logging?: {\n /**\n * If provided, this function will be called multiple times as `copy`\n * traverses the filesystem, to help you understand what's going on and/or\n * troubleshoot things. In most cases, it makes sense to use a logging\n * function here, like so:\n *\n * ```js\n * copy(\"./source\", \"./destination\", {\n * logging: { trace: console.log },\n * });\n * ```\n *\n * Defaults to the current value of {@link logger.trace}. `logger.trace`\n * defaults to a no-op function.\n */\n trace?: (...args: Array<any>) => void;\n\n /**\n * An optional, user-provided logging function to be used for informational\n * messages.\n *\n * Defaults to the current value of {@link logger.info}. `logger.info`\n * defaults to a function which writes to stderr.\n */\n info?: (...args: Array<any>) => void;\n };\n};\n\n/**\n * Rename the file or directory at the specified path.\n *\n * Provides the same functionality as the command `mv`.\n */\ndeclare function rename(from: string | Path, to: string | Path): void;\n\n/**\n * A class which represents a filesystem path. The class contains various\n * methods that make it easy to work with filesystem paths; there are methods\n * for adding/removing path components, converting between absolute and relative\n * paths, getting the basename and dirname, and more.\n *\n * All functions in yavascript which accept path strings as arguments also\n * accept Path objects. As such, it is recommended that all filesystem paths in\n * your programs are Path objects rather than strings.\n *\n * Every Path object has two properties: `segments` and `separator`. `segments`\n * is an Array of strings containing all the non-slash portions of the path. For\n * example, the path \"one/two/three\" would have segments `[\"one\", \"two\",\n * \"three\"]`. `separator` is which slash is used to separate the segments;\n * either `\"/\"` or `\"\\\"`.\n *\n * A Path object can represent either a POSIX-style path or a win32-style path.\n * For the win32 style, UNC paths are supported. POSIX-style paths starting with\n * \"/\" (eg. \"/usr/bin\") have an empty string at the beginning of their segments\n * array to represent the left-hand-side of the leading slash. For instance,\n * \"/usr/bin\" would have segments `[\"\", \"usr\", \"bin\"]`.\n */\ndeclare class Path {\n /**\n * The character used to separate path segments on the current operating\n * system where yavascript is running.\n *\n * Its value is either a forward slash (`\"/\"`) or a backslash (`\"\\\"`). Its value\n * is a backslash on windows, and a forward slash on all other operating\n * systems.\n */\n static readonly OS_SEGMENT_SEPARATOR: \"/\" | \"\\\\\";\n\n /**\n * The character used to separate entries within the system's `PATH`\n * environment variable on the current operating system where yavascript is\n * running.\n *\n * The `PATH` environment variable contains a list of folders wherein\n * command-line programs can be found, separated by either a colon (`:`) or a\n * semicolon (`;`). The value of `OS_ENV_VAR_SEPARATOR` is a semicolon on\n * windows, and a colon on all other operating systems.\n *\n * The `PATH` environment variable can be accessed by yavascript programs via\n * `env.PATH`. Therefore, one can contain a list of all entries in the `PATH`\n * environment variable via:\n *\n * ```ts\n * const folders: Array<string> = env.PATH.split(Path.OS_ENV_VAR_SEPARATOR);\n * ```\n */\n static readonly OS_ENV_VAR_SEPARATOR: \":\" | \";\";\n\n /**\n * A Set of filename extension strings that command-line programs may end with\n * on the current operating system where yavascript is running. For instance,\n * on Windows, programs often end with \".exe\". Each of these strings contains\n * a leading dot (`.`).\n *\n * On windows, this value is based on the `PATHEXT` environment variable,\n * which defaults to \".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC\"\n * on Windows Vista and up. If `PATHEXT` is not defined, that default value is\n * used.\n *\n * On all other operating systems, this Set is empty.\n */\n static readonly OS_PROGRAM_EXTENSIONS: ReadonlySet<string>;\n\n /**\n * Converts a string (or array of strings) into an array of path segment\n * strings (the parts between the slashes).\n *\n * Example:\n *\n * ```ts\n * const input = [\"hi\", \"there/every/one\", \"yeah\\\\yup\"];\n * const result = Path.splitToSegments(input);\n * // result is [\"hi\", \"there\", \"every\", \"one\", \"yeah\", \"yup\"]\n * ```\n */\n static splitToSegments(inputParts: Array<string> | string): Array<string>;\n\n /**\n * Searches the provided path string or strings for a path separator character\n * (either forward slash or backslash), and returns the one it finds. If\n * neither is found, it returns the `fallback` arg, which defaults to the\n * current OS's path segment separator (`Path.OS_SEGMENT_SEPARATOR`).\n */\n static detectSeparator<Fallback extends string | null = string>(\n input: Array<string> | string,\n // @ts-ignore might be instantiated with a different subtype\n fallback: Fallback = Path.OS_SEGMENT_SEPARATOR\n ): string | Fallback;\n\n /**\n * Creates a new Path by concatenating the input path(s) and then resolving all\n * non-leading `.` and `..` segments. In other words:\n *\n * - Segments containing `.` are removed\n * - Segments containing `..` are removed, along with the segment preceding\n * them.\n *\n * Note that any `.` or `..` segments at the beginning of the path (ie.\n * \"leading segments\") are not removed.\n */\n static normalize(\n ...inputs: Array<string | Path | Array<string | Path>>\n ): Path;\n\n /**\n * Returns a boolean indicating whether the provided path is absolute; that\n * is, whether it starts with either a slash (`/` or `\\`) or a drive letter\n * (ie `C:`).\n *\n * Note that Windows UNC Paths (eg. `\\\\MYSERVER\\share$\\`) are considered\n * absolute.\n */\n static isAbsolute(path: string | Path): boolean;\n\n /**\n * Creates a new Path containing the user-provided segments and separator. In\n * most cases, you won't need to do this, and can use `new Path(...)` instead.\n *\n * If unspecified, the `separator` parameter defaults to\n * `Path.OS_SEGMENT_SEPARATOR`.\n */\n static fromRaw(segments: Array<string>, separator?: string): Path;\n\n /**\n * Creates a new Path object using the provided input(s), which will be\n * concatenated together in order left-to-right.\n */\n constructor(...inputs: Array<string | Path | Array<string | Path>>);\n\n /**\n * An array of the path segments that make up this path.\n *\n * For `/tmp/foo.txt`, it'd be `[\"\", \"tmp\", \"foo.txt\"]`.\n *\n * For `C:\\something\\somewhere.txt`, it'd be `[\"C:\", \"something\", \"somewhere.txt\"]`.\n */\n segments: Array<string>;\n\n /**\n * The path separator that should be used to turn this path into a string.\n *\n * Will be either `\"/\"` or `\"\\\"`.\n */\n separator: string;\n\n /**\n * Creates a new Path by resolving all non-leading `.` and `..` segments in\n * the target Path. In other words:\n *\n * - Segments containing `.` are removed\n * - Segments containing `..` are removed, along with the segment preceding\n * them.\n *\n * Note that any `.` or `..` segments at the beginning of the path (ie.\n * \"leading segments\") are not removed.\n */\n normalize(): Path;\n\n /**\n * Creates a new Path by appending additional path segments onto the end of\n * the target Path's segments.\n *\n * The returned Path will use the same separator as the target Path.\n */\n concat(...other: Array<string | Path | Array<string | Path>>): Path;\n\n /**\n * Returns a boolean indicating whether the target Path is absolute; that\n * is, whether it starts with either a slash (`/` or `\\`) or a drive letter\n * (ie `C:`).\n *\n * Note that Windows UNC Paths (eg. `\\\\MYSERVER\\share$\\`) are considered\n * absolute.\n */\n isAbsolute(): boolean;\n\n /**\n * Creates a new Path object containing the same segments and separator as\n * the target Path.\n *\n * Note that although it contains the same segments, the new Path does not use\n * the same Array instance for segments as the target Path is was cloned from.\n */\n clone(): this;\n\n /**\n * Creates a new Path which expresses the target Path relative to `dir`.\n *\n * @param dir - The directory to create a new path relative to.\n * @param options - Options that affect the resulting path (see {@link PathRelativeToOptions}).\n */\n relativeTo(dir: Path | string, options?: PathRelativeToOptions): Path;\n\n /**\n * Turns the target Path into a string by joining its segments using its\n * separator as the delimiter.\n */\n toString(): string;\n\n /**\n * Alias for `toString`. The presence of this method causes Path objects to be\n * serialized as strings when they (or an object referencing them) get(s) passed\n * into JSON.stringify.\n */\n toJSON(): string;\n\n /**\n * Returns the final segment of the target Path. If the target Path has no\n * segments, an empty string (`\"\"`) is returned.\n */\n basename(): string;\n\n /**\n * Returns the trailing file extension of this path.\n *\n * @param options - Works the same as the options parameter for the global {@link extname} (see {@link ExtnameOptions}).\n */\n extname(options?: ExtnameOptions): string;\n\n /**\n * Creates a new Path containing all of the segments in the target Path except\n * for the last one; ie. the path to the directory that contains the target Path.\n */\n dirname(): Path;\n\n /**\n * Returns a boolean indicating whether the target Path starts with the\n * provided value, by comparing one path segment at a time.\n *\n * The starting segments of the target Path must *exactly* match the segments in the\n * provided value.\n *\n * This means that, given two Paths A and B:\n *\n * ```\n * A: Path { /home/user/.config }\n * B: Path { /home/user/.config2 }\n * ```\n *\n * Path B does *not* start with Path A, because `\".config\" !== \".config2\"`.\n */\n startsWith(value: string | Path | Array<string | Path>): boolean;\n\n /**\n * Returns a boolean indicating whether the target Path ends with the provided\n * value, by comparing one path segment at a time.\n *\n * The ending segments of the target Path must *exactly* match the segments in the\n * provided value.\n *\n * This means that, given two Paths A and B:\n *\n * ```\n * A: Path { /home/1user/.config }\n * B: Path { user/.config }\n * ```\n *\n * Path A does *not* end with Path B, because `\"1user\" !== \"user\"`.\n */\n endsWith(value: string | Path | Array<string | Path>): boolean;\n\n /**\n * Returns the index at which `value` appears in the target Path's segments,\n * or `-1` if `value` doesn't appear in the target Path.\n *\n * @param value - The value to search for. If the value contains more than one path segment, the returned index will refer to the location of the value's first path segment.\n * @param fromIndex - The index into the target Path's segments to begin searching at. Defaults to `0`.\n */\n indexOf(\n value: string | Path | Array<string | Path>,\n fromIndex?: number | undefined\n ): number;\n\n /**\n * Returns a boolean indicating whether `value` appears in the target Path.\n *\n * @param value - The value to search for.\n * @param fromIndex - The index into the target Path's segments to begin searching at. Defaults to `0`.\n */\n includes(\n value: string | Path | Array<string | Path>,\n fromIndex?: number | undefined\n ): boolean;\n\n /**\n * Creates a new Path based on the target Path wherein the segments in `value`\n * have been replaced with the segments in `replacement`. If the segments in\n * `value` are not present in the target Path, a clone of the target Path is\n * returned.\n *\n * Note that only the first match is replaced. To replace more than one match,\n * use {@link Path.prototype.replaceAll}.\n *\n * @param value - What should be replaced\n * @param replacement - What it should be replaced with\n *\n * See also {@link Path.prototype.replaceLast}.\n */\n replace(\n value: string | Path | Array<string | Path>,\n replacement: string | Path | Array<string | Path>\n ): Path;\n\n /**\n * Creates a new Path based on the target Path wherein all occurrences of the\n * segments in `value` have been replaced with the segments in `replacement`.\n * If the segments in `value` are not present in the target Path, a clone of\n * the target Path is returned.\n *\n * Note that all matches are replaced. To replace only the first match,\n * use {@link Path.prototype.replace}.\n *\n * @param value - What should be replaced\n * @param replacement - What it should be replaced with\n *\n * See also {@link Path.prototype.replaceLast}.\n */\n replaceAll(\n value: string | Path | Array<string | Path>,\n replacement: string | Path | Array<string | Path>\n ): Path;\n\n /**\n * Creates a new Path based on the target Path but with the final segment\n * replaced with `replacement`.\n *\n * If the target Path has no segments, the newly created Path will be the same\n * as `new Path(replacement)`; ie. non-empty.\n *\n * @param replacement - The new final segment(s) for the returned Path\n */\n replaceLast(replacement: string | Path | Array<string | Path>): Path;\n}\n\n/**\n * Options for {@link Path.prototype.relativeTo}.\n */\ndeclare interface PathRelativeToOptions {\n /**\n * Defaults to false. When true, a leading `./` will be omitted from the\n * path, if present. Note that a leading `../` will never be omitted.\n */\n noLeadingDot?: boolean;\n}\n\n/**\n * The absolute path to the currently-executing file (whether script or module).\n *\n * Behaves the same as in Node.js, except that it's also present within ES\n * modules.\n *\n * Example: `/home/suchipi/some-folder/some-file.js`\n */\ndeclare var __filename: string;\n\n/**\n * The absolute path to the directory containing the currently-executing file.\n *\n * Behaves the same as in Node.js, except that it's also present within ES\n * modules.\n *\n * Example: `/home/suchipi/some-folder`\n */\ndeclare var __dirname: string;\n\n/**\n * Return the last component of a path string.\n *\n * Provides the same functionality as the unix binary of the same name.\n *\n * > Example: `basename(\"/home/suchipi/something\")` returns `\"something\"`, the last part.\n */\ndeclare function basename(path: string | Path): string;\n\n/**\n * Reads the contents of one or more files from disk as either one UTF-8 string\n * or one ArrayBuffer.\n *\n * Provides the same functionality as the unix binary of the same name.\n *\n * > Example: If you have a file called `hi.txt` in the current working\n * > directory, and it contains the text \"hello\", running `cat(\"hi.txt\")`\n * > returns `\"hello\"`.\n */\ndeclare const cat: {\n /**\n * Read the contents of one or more files from disk, as one UTF-8 string.\n */\n (paths: string | Path | Array<string | Path>): string;\n\n /**\n * Read the contents of one or more files from disk, as one UTF-8 string.\n */\n (paths: string | Path | Array<string | Path>, options: {}): string;\n\n /**\n * Read the contents of one or more files from disk, as one UTF-8 string.\n */\n (\n paths: string | Path | Array<string | Path>,\n options: { binary: false }\n ): string;\n\n /**\n * Read the contents of one or more files from disk, as one ArrayBuffer.\n */\n (\n paths: string | Path | Array<string | Path>,\n options: { binary: true }\n ): ArrayBuffer;\n};\n\n/**\n * Changes the process's current working directory to the specified path. If no\n * path is specified, moves to the user's home directory.\n *\n * Provides the same functionality as the shell builtin of the same name.\n */\ndeclare function cd(path?: string | Path): void;\n\n/**\n * Set the permission bits for the specified file.\n *\n * Provides the same functionality as the unix binary of the same name.\n */\ndeclare const chmod: Chmod;\n\n/**\n * The interface for the global function `chmod`, which has two call signatures.\n */\ninterface Chmod {\n /**\n * Set the permission bits for the specified file.\n *\n * Provides the same functionality as the unix binary of the same name.\n *\n * @param permissions The permission bits to set. This can be a number, or a string containing an octal number.\n * @param path The path to the file.\n */\n (permissions: number | string, path: string | Path): void;\n\n /**\n * Apply a change to the permission bits for the specified file.\n *\n * Provides the same functionality as the unix binary of the same name.\n *\n * @param operation What to do to the bits; can be \"add\", \"set\", or \"remove\".\n * @param permissions An object describing the changes (see below).\n * @param path The path to the file.\n *\n * Each of the `permissions` object's own property keys must be one of these\n * strings:\n *\n * - `\"user\"`\n * - `\"group\"`\n * - `\"others\"`\n * - `\"all\"` (meaning \"user\", \"group\", and \"others\")\n * - `\"u\"` (alias for \"user\")\n * - `\"g\"` (alias for \"group\")\n * - `\"o\"` (alias for \"others\")\n * - `\"a\"` (alias for \"all\")\n * - `\"ug\"` (\"user\" plus \"group\")\n * - `\"go\"` (\"group\" plus \"others\")\n * - `\"uo\"` (\"user\" plus \"others\")\n *\n * and their values must be one of these strings:\n *\n * - `\"read\"` (permission to read the contents of the file)\n * - `\"write\"` (permission to write to the file's contents)\n * - `\"execute\"` (permission to run the file as an executable)\n * - `\"readwrite\"` (both \"read\" and \"write\")\n * - `\"none\"` (no permissions)\n * - `\"full\"` (\"read\", \"write\", and \"execute\")\n * - `\"r\"` (alias for \"read\")\n * - `\"w\"` (alias for \"write\")\n * - `\"x\"` (alias for \"execute\")\n * - `\"rw\"` (alias for \"readwrite\")\n * - `\"rx\"` (\"read\" and \"execute\")\n * - `\"wx\"` (\"write\" and \"execute\")\n * - `\"rwx\"` (alias for \"full\")\n *\n * Some example objects:\n *\n * ```json\n * { user: \"readwrite\", group: \"read\", others: \"none\" }\n * { ug: \"rw\", o: \"w\" }\n * { all: \"full\" }\n * ```\n */\n (\n operation: Chmod.Operation,\n permissions: Record<Chmod.Who, Chmod.Permission>,\n path: string | Path\n ): void;\n}\n\ndeclare namespace Chmod {\n /** A string representing who a permission applies to. */\n export type Who =\n | \"user\"\n | \"group\"\n | \"others\"\n | \"all\"\n | \"u\"\n | \"g\"\n | \"o\"\n | \"a\"\n | \"ug\"\n | \"go\"\n | \"uo\";\n\n /** A string representing how the permissions should be changed. */\n export type Operation = \"add\" | \"set\" | \"remove\";\n\n /** A string representing the access level for the given permission. */\n export type Permission =\n | \"read\"\n | \"write\"\n | \"execute\"\n | \"readwrite\"\n | \"none\"\n | \"full\"\n | \"r\"\n | \"w\"\n | \"x\"\n | \"rw\"\n | \"rx\"\n | \"wx\"\n | \"rwx\";\n}\n\n/**\n * Removes the final component from a path string.\n *\n * Provides the same functionality as the unix binary of the same name.\n *\n * > Example: `dirname(\"/home/suchipi/something\")` returns\n * > `\"/home/suchipi\"`, everything except the last part.\n */\ndeclare function dirname(path: string | Path): Path;\n\n/**\n * Print one or more values to stdout.\n *\n * Provides the same functionality as the shell builtin of the same name.\n *\n * > NOTE: This can print any value, not just strings.\n *\n * `echo` is functionally identical to `console.log`.\n */\ndeclare const echo: typeof console.log;\n\n/**\n * Exit the yavascript process.\n *\n * Provides the same functionality as the shell builtin of the same name.\n *\n * If exit is called with an argument, that argument is used as the exit code.\n * Otherwise, `exit.code` is used, which defaults to 0.\n *\n * `exit.code` will also be used as the exit status code for the yavascript\n * process if the process exits normally.\n *\n * > Attempting to call `exit` or set `exit.code` within a Worker will fail and\n * > throw an error.\n */\ndeclare const exit: {\n (code?: number): never;\n code: number;\n};\n\n/**\n * Returns the file extension of the file at a given path.\n *\n * If the file has no extension (eg `Makefile`, etc), then `''` will be\n * returned.\n *\n * @param pathOrFilename The input path\n * @param options Options which affect the return value. See {@link ExtnameOptions}.\n */\ndeclare function extname(\n pathOrFilename: string | Path,\n options?: ExtnameOptions\n): string;\n\n/**\n * Options for {@link extname} and {@link Path.prototype.extname}.\n */\ndeclare interface ExtnameOptions {\n /**\n * Whether to get compound extensions, like `.d.ts` or `.test.js`, instead of\n * just the final extension (`.ts` or `.js` in this example).\n */\n full?: boolean;\n}\n\n/**\n * Returns the contents of a directory, as absolute paths. `.` and `..` are\n * omitted.\n *\n * If `ls()` is called with no directory, the present working directory\n * (`pwd()`) is used.\n */\ndeclare function ls(dir?: string | Path): Array<Path>;\n\n/**\n * Create a directory (folder).\n *\n * Provides the same functionality as the unix binary of the same name.\n */\ndeclare function mkdir(\n path: string | Path,\n options?: {\n recursive?: boolean;\n mode?: number;\n logging?: {\n trace?: (...args: Array<any>) => void;\n info?: (...args: Array<any>) => void;\n };\n }\n): void;\n\n/**\n * Create a directory (folder) and all parents, recursively\n *\n * Alias for `mkdir(path, { recursive: true })`.\n *\n * Provides the same functionality as `mkdir -p`.\n */\ndeclare function mkdirp(\n path: string | Path,\n options?: {\n mode?: number;\n logging?: {\n trace?: (...args: Array<any>) => void;\n info?: (...args: Array<any>) => void;\n };\n }\n): void;\n\n/**\n * Print data to stdout using C-style format specifiers.\n *\n * The same formats as the [standard C library\n * printf](https://en.cppreference.com/w/c/io/fprintf) are supported. Integer\n * format types (e.g. `%d`) truncate the Numbers or BigInts to 32 bits. Use the\n * l modifier (e.g. `%ld`) to truncate to 64 bits.\n */\ndeclare function printf(format: string, ...args: Array<any>): void;\n\n/**\n * Returns the process's current working directory.\n *\n * Provides the same functionality as the shell builtin of the same name.\n */\ndeclare const pwd: {\n /**\n * Returns the process's current working directory.\n *\n * Provides the same functionality as the shell builtin of the same name.\n */\n (): Path;\n\n /**\n * A frozen, read-only `Path` object containing what `pwd()` was when\n * yavascript first started up.\n */\n readonly initial: Path;\n};\n\n/**\n * Reads a symlink.\n *\n * Returns the target of the symlink, which may be absolute or relative.\n *\n * Provides the same functionality as the unix binary of the same name.\n */\ndeclare function readlink(path: string | Path): Path;\n\n/**\n * Get the absolute path given a relative path. Symlinks are also resolved.\n *\n * The path's target file/directory must exist.\n *\n * Provides the same functionality as the unix binary of the same name.\n *\n * > If you want to convert a relative path to an absolute path, but the path's\n * > target might NOT exist, use {@link Path.normalize}.\n */\ndeclare function realpath(path: string | Path): Path;\n\n/**\n * `sleep` and `sleep.sync` block the current thread for at least the specified\n * number of milliseconds, but maybe a tiny bit longer.\n *\n * `sleep.async` returns a Promise which resolves in at least the specified\n * number of milliseconds, but maybe a tiny bit longer.\n *\n * `sleep` and `sleep.sync` block the current thread. `sleep.async` doesn't\n * block the current thread.\n *\n * \"Blocking the thread\" means no other JavaScript code can run while `sleep` or\n * `sleep.sync` is running. If this is not the behavior you want, use\n * `sleep.async` instead.\n */\ndeclare var sleep: {\n /**\n * Blocks the current thread for at least the specified number of\n * milliseconds, but maybe a tiny bit longer.\n *\n * alias for `sleep.sync`.\n *\n * @param milliseconds - The number of milliseconds to block for.\n *\n * No other JavaScript code can run while `sleep()` is running. If this is\n * not the behavior you want, use `sleep.async` instead.\n */\n (milliseconds: number): void;\n\n /**\n * Blocks the current thread for at least the specified number of\n * milliseconds, but maybe a tiny bit longer.\n *\n * @param milliseconds - The number of milliseconds to block for.\n *\n * No other JavaScript code can run while `sleep.sync` is running. If this is\n * not the behavior you want, use `sleep.async` instead.\n */\n sync(milliseconds: number): void;\n\n /**\n * Returns a Promise which resolves in at least the specified number of\n * milliseconds, maybe a little longer.\n *\n * @param milliseconds - The number of milliseconds to wait before the returned Promise should be resolved.\n *\n * `sleep.async` doesn't block the current thread, so other JavaScript code\n * (registered event handlers, async functions, timers, etc) can run while\n * `sleep.async`'s return Promise is waiting to resolve. If this is not the\n * behavior you want, use `sleep.sync` instead.\n *\n * The Promise returned by `sleep.async` will never get rejected. It will only\n * ever get resolved.\n */\n async(milliseconds: number): Promise<void>;\n};\n\n/**\n * If the file at `path` exists, update its creation/modification timestamps.\n *\n * Otherwise, create an empty file at that path.\n *\n * @param path The target path for the file.\n */\ndeclare function touch(path: string | Path): void;\n\n/**\n * Searches the system for the path to a program named `binaryName`.\n *\n * If the program can't be found, `null` is returned.\n *\n * @param binaryName The program to search for\n * @param options Options which affect how the search is performed\n * @param options.searchPaths A list of folders where programs may be found. Defaults to `env.PATH?.split(Path.OS_ENV_VAR_SEPARATOR) || []`.\n * @param options.suffixes A list of filename extension suffixes to include in the search, ie [\".exe\"]. Defaults to `Path.OS_PROGRAM_EXTENSIONS`.\n * @param options.trace A logging function that will be called at various times during the execution of `which`. Defaults to {@link logger.trace}.\n */\ndeclare function which(binaryName: string, options?: WhichOptions): Path | null;\n\ndeclare type WhichOptions = {\n /**\n * A list of folders where programs may be found. Defaults to\n * `env.PATH?.split(Path.OS_ENV_VAR_SEPARATOR) || []`.\n */\n searchPaths?: Array<Path | string>;\n\n /**\n * A list of filename extension suffixes to include in the search, ie\n * `[\".exe\"]`. Defaults to {@link Path.OS_PROGRAM_EXTENSIONS}.\n */\n suffixes?: Array<string>;\n\n /** Options which control logging. */\n logging?: {\n /**\n * If provided, this logging function will be called multiple times as\n * `which` runs, to help you understand what's going on and/or troubleshoot\n * things. In most cases, it makes sense to use a function from `console`\n * here, like so:\n *\n * ```js\n * which(\"bash\", {\n * logging: { trace: console.log }\n * });\n * ```\n *\n * Defaults to the current value of {@link logger.trace}. `logger.trace`\n * defaults to a no-op function.\n */\n trace?: (...args: Array<any>) => void;\n };\n};\n\n/** The type of the return value of {@link whoami}. */\ndeclare interface WhoAmIResult {\n name: string;\n uid: number;\n gid: number;\n}\n\n/**\n * Get info about the user the yavascript process is executing as.\n *\n * Provides functionality similar to the unix binaries `whoami` and `id`.\n *\n * NOTE: Doesn't work on Windows; throws an error.\n */\ndeclare function whoami(): WhoAmIResult;\n\n/**\n * Runs a child process and blocks until it exits. You can call it with either a\n * string or an array of strings.\n *\n * When calling `exec` with an array of strings, the first string in the array\n * is the program to run, and the rest of the strings in the array are arguments\n * to the program, eg:\n *\n * ```ts\n * exec([\"echo\", \"hi\", \"there\"]);\n * exec([\"printf\", \"something with spaces\\n\"]);\n * ```\n *\n * When calling with a string instead of an array, the string will be split into\n * separate arguments using the following rules:\n *\n * - The program and its arguments will be determined by splitting the input\n * string on whitespace, except:\n * - Stuff in single or double-quotes will be preserved as a single argument\n * - Double and single quotes can be \"glued\" together (eg `\"bla\"'bla'` becomes\n * `blabla`)\n * - The escape sequences `\\n`, `\\r`, `\\t`, `\\v`, `\\0`, and `\\\\` can be used\n * inside of quotes get replaced with newline, carriage return, tab,\n * vertical tab, nul, and `\\` characters, respectively\n *\n * For example:\n *\n * ```ts\n * exec(`echo hi there`);\n * exec(`printf \"something with spaces\\n\"`);\n * ```\n *\n * The intent is that it behaves similarly to what you would expect from a UNIX\n * shell, but only the \"safe\" features. \"Unsafe\" features like environment\n * variable expansion (`$VAR` or `${VAR}`), subshells (\\`echo hi\\` or `$(echo\n * hi)`), and redirection (`> /dev/null` or `2>&1 `) are not supported. To use\n * those features, shell out to `bash` or `sh` directly via eg `exec(['bash',\n * '-c', 'your command string'])`, but be aware of the security implications of\n * doing so.\n *\n * `exec` also supports a second argument, an options object which supports the\n * following keys (all are optional):\n *\n * | Property | Purpose |\n * | ------------------------------ | --------------------------------------------------- |\n * | cwd (string) | current working directory for the child process |\n * | env (object) | environment variables for the process |\n * | failOnNonZeroStatus (boolean) | whether to throw error on nonzero exit status |\n * | captureOutput (boolean/string) | controls how stdout/stderr is directed |\n * | logging (object) | controls how/whether info messages are logged |\n * | block (boolean) | whether to wait for child process exit now or later |\n *\n * The return value of `exec` varies depending on the options passed:\n *\n * - When `captureOutput` is true or \"utf-8\", an object will be returned with\n * `stdout` and `stderr` properties, both strings.\n * - When `captureOutput` is \"arraybuffer\", an object will be returned with\n * `stdout` and `stderr` properties, both `ArrayBuffer`s.\n * - When `failOnNonZeroStatus` is false, an object will be returned with\n * `status` (the exit code; number or undefined) and `signal` (the signal that\n * killed the process; number or undefined).\n * - When `captureOutput` is non-false and `failOnNonZeroStatus` is false, an\n * object will be returned with four properties (the two associated with\n * `failOnNonZeroStatus`, and the two associated with `captureOutput`).\n * - When `captureOutput` is false or unspecified, and `failOnNonZeroStatus` is\n * true or unspecified, undefined will be returned.\n * - If `block` is false, an object with a \"wait\" method is returned instead,\n * which blocks the calling thread until the process exits, and then returns\n * one of the values described above.\n */\ndeclare const exec: Exec;\n\ndeclare type BaseExecOptions = {\n /** Sets the current working directory for the child process. */\n cwd?: string | Path;\n\n /** Sets environment variables within the process. */\n env?: { [key: string | number]: string | number | boolean };\n\n /** Options which control logging. */\n logging?: {\n /**\n * If provided, this logging function will be called multiple times as\n * `exec` runs, to help you understand what's going on and/or troubleshoot\n * things. In most cases, it makes sense to use a function from `console`\n * here, like so:\n *\n * ```js\n * exec([\"echo\", \"hi\"], {\n * logging: { trace: console.log },\n * });\n * ```\n *\n * Defaults to the current value of {@link logger.trace}. `logger.trace`\n * defaults to a no-op function.\n */\n trace?: (...args: Array<any>) => void;\n\n /**\n * An optional, user-provided logging function to be used for informational\n * messages. Less verbose than `logging.trace`.\n *\n * Defaults to the current value of {@link logger.info}. `logger.info`\n * defaults to a function which logs to stderr.\n */\n info?: (...args: Array<any>) => void;\n };\n\n /**\n * Whether an Error should be thrown when the process exits with a nonzero\n * status code.\n *\n * Defaults to true.\n */\n failOnNonZeroStatus?: boolean;\n\n /**\n * If true, stdout and stderr will be collected into strings or array buffers\n * and returned instead of being printed to the screen.\n *\n * Defaults to false. true is an alias for \"utf8\".\n */\n captureOutput?: boolean | \"utf8\" | \"arraybuffer\";\n\n /**\n * If true, exec doesn't return until the process is done running. If false,\n * exec returns an object with a \"wait\" method which can be used to wait for\n * the process to be done running.\n *\n * Defaults to true.\n */\n block?: boolean;\n};\n\ndeclare interface Exec {\n /**\n * Runs a child process using the provided arguments.\n *\n * When `args` is an Array, the first value in the Array is the program to\n * run.\n *\n * @param args - The command to run.\n * @param options - Options; see {@link BaseExecOptions}\n */\n <\n ExecOptions extends BaseExecOptions = {\n failOnNonZeroStatus: true;\n captureOutput: false;\n block: true;\n }\n >(\n args: Array<string | Path | number> | string | Path,\n options?: ExecOptions\n ): ExecOptions[\"block\"] extends false\n ? { wait(): ExecWaitResult<ExecOptions> }\n : ExecWaitResult<ExecOptions>;\n\n /**\n * Parse the provided value into an array of command-line argument strings,\n * using the same logic that {@link exec} and {@link ChildProcess} use.\n */\n toArgv(args: Array<string | Path | number> | string | Path): Array<string>;\n}\n\n/**\n * `$(...)` is an alias for `exec(..., { captureOutput: true, failOnNonZeroStatus: true })`.\n *\n * It's often used to capture the output of a program:\n *\n * ```ts\n * const result = $(`echo hi`).stdout;\n * // result is 'hi\\n'\n * ```\n *\n * For more info, see {@link exec}.\n */\ndeclare function $(args: Array<string | Path | number> | string | Path): {\n stdout: string;\n stderr: string;\n};\n\ntype ExecWaitResult<ExecOptions extends BaseExecOptions> = ExecOptions extends\n | { captureOutput: true | \"utf8\" | \"arraybuffer\" }\n | { failOnNonZeroStatus: false }\n ? (ExecOptions[\"captureOutput\"] extends true | \"utf8\"\n ? { stdout: string; stderr: string }\n : {}) &\n (ExecOptions[\"captureOutput\"] extends \"arraybuffer\"\n ? { stdout: ArrayBuffer; stderr: ArrayBuffer }\n : {}) &\n (ExecOptions[\"failOnNonZeroStatus\"] extends false\n ?\n | { status: number; signal: undefined }\n | { status: undefined; signal: number }\n : {})\n : void;\n\n/**\n * A class which represents a child process. The process may or may not be\n * running.\n *\n * This class is the API used internally by the {@link exec} function to spawn child\n * processes.\n *\n * Generally, you should not need to use the `ChildProcess` class directly, and\n * should use {@link exec} or {@link $} instead. However, you may need to use it in some\n * special cases, like when specifying custom stdio for a process, or spawning a\n * non-blocking long-running process.\n */\ndeclare interface ChildProcess {\n /**\n * The argv for the process. The first entry in this array is the program to\n * run.\n */\n args: Array<string>;\n\n /** The current working directory for the process. */\n cwd: Path;\n\n /** The environment variables for the process. */\n env: { [key: string]: string };\n\n /**\n * The standard I/O streams for the process. Generally these are the same as\n * `std.in`, `std.out`, and `std.err`, but they can be customized to write\n * output elsewhere.\n */\n stdio: {\n /** Where the process reads stdin from */\n in: FILE;\n /** Where the process writes stdout to */\n out: FILE;\n /** Where the process writes stderr to */\n err: FILE;\n };\n\n pid: number | null;\n\n /** Spawns the process and returns its pid (process id). */\n start(): number;\n\n /** Blocks the calling thread until the process exits or is killed. */\n waitUntilComplete():\n | { status: number; signal: undefined }\n | { status: undefined; signal: number };\n}\n\n/**\n * Options to be passed to the ChildProcess constructor. Their purposes and\n * types match the same-named properties found on the resulting ChildProcess.\n */\ndeclare type ChildProcessOptions = {\n /** The current working directory for the process. */\n cwd?: string | Path;\n\n /** The environment variables for the process. */\n env?: { [key: string]: string };\n\n /**\n * The standard I/O streams for the process. Generally these are the same as\n * `std.in`, `std.out`, and `std.err`, but they can be customized to write\n * output elsewhere.\n */\n stdio?: {\n /** Where the process reads stdin from */\n in?: FILE;\n /** Where the process writes stdout to */\n out?: FILE;\n /** Where the process writes stderr to */\n err?: FILE;\n };\n\n /** Options which control logging */\n logging?: {\n /**\n * Optional trace function which, if present, will be called at various\n * times to provide information about the lifecycle of the process.\n *\n * Defaults to the current value of {@link logger.trace}. `logger.trace`\n * defaults to a function which writes to stderr.\n */\n trace?: (...args: Array<any>) => void;\n };\n};\n\ndeclare interface ChildProcessConstructor {\n /**\n * Construct a new ChildProcess.\n *\n * @param args - The argv for the process. The first entry in this array is the program to run.\n * @param options - Options for the process (cwd, env, stdio, etc)\n */\n new (\n args: string | Path | Array<string | number | Path>,\n options?: ChildProcessOptions\n ): ChildProcess;\n\n readonly prototype: ChildProcess;\n}\n\ndeclare var ChildProcess: ChildProcessConstructor;\n\n/**\n * Searches the filesystem in order to resolve [UNIX-style glob\n * strings](https://man7.org/linux/man-pages/man7/glob.7.html) into an array of\n * matching filesystem paths.\n *\n * Glob strings assist in succinctly finding and describing a set of files on\n * disk. For instance, to find the path of every `.js` file in the `src` folder,\n * one might write `src/*.js`.\n *\n * The function `glob` can be used to turn one or more of these \"glob strings\" into an array of\n * `Path` objects.\n *\n * `glob` uses [minimatch](https://www.npmjs.com/package/minimatch) with its\n * default options, which means it supports features like brace expanstion,\n * \"globstar\" (**) matching, and other features you would expect from a modern\n * globbing solution.\n *\n * > When specifying more than one pattern string, paths must match ALL of the\n * > patterns to be included in the returned Array. In other words, it uses\n * > \"logical AND\" behavior when you give it more than one pattern.\n */\ndeclare function glob(\n patterns: string | Array<string>,\n options?: GlobOptions\n): Array<Path>;\n\n/**\n * Options for {@link glob}.\n */\ndeclare type GlobOptions = {\n /**\n * Whether to treat symlinks to directories as if they themselves were\n * directories, traversing into them.\n *\n * Defaults to false.\n */\n followSymlinks?: boolean;\n\n /** Options which control logging. */\n logging?: {\n /**\n * If provided, this function will be called multiple times as `glob`\n * traverses the filesystem, to help you understand what's going on and/or\n * troubleshoot things. In most cases, it makes sense to use a logging\n * function here, like so:\n *\n * ```js\n * glob([\"./*.js\"], {\n * logging: { trace: console.log }\n * });\n * ```\n *\n * Defaults to the current value of {@link logger.trace}. `logger.trace`\n * defaults to a no-op function.\n */\n trace?: (...args: Array<any>) => void;\n\n /**\n * An optional, user-provided logging function to be used for informational\n * messages. Less verbose than `logging.trace`.\n *\n * Defaults to the current value of {@link logger.info}. `logger.info`\n * defaults to a function which writes to stderr.\n */\n info?: (...args: Array<any>) => void;\n };\n\n /**\n * Directory to interpret glob patterns relative to. Defaults to `pwd()`.\n */\n dir?: string | Path;\n};\n\n/**\n * Prints special ANSI escape characters to stdout which instruct your terminal\n * emulator to clear the screen and clear your terminal scrollback.\n *\n * Identical to {@link console.clear}.\n */\ndeclare function clear(): void;\n\ninterface Console {\n /**\n * Logs its arguments to stdout, with a newline appended.\n *\n * Any value can be logged, not just strings. Non-string values will be\n * formatted using {@link inspect}.\n *\n * Functionally identical to {@link console.info}, {@link echo}, and\n * {@link print}. Contrast with {@link console.error}, which prints to stderr\n * instead of stdout.\n */\n log(message?: any, ...optionalParams: any[]): void;\n\n /**\n * Logs its arguments to stdout, with a newline appended.\n *\n * Any value can be logged, not just strings. Non-string values will be\n * formatted using {@link inspect}.\n *\n * Functionally identical to {@link console.log}, {@link echo}, and\n * {@link print}. Contrast with {@link console.error}, which prints to stderr\n * instead of stdout.\n */\n info(message?: any, ...optionalParams: any[]): void;\n\n /**\n * Logs its arguments to stderr, with a newline appended.\n *\n * Any value can be logged, not just strings. Non-string values will be\n * formatted using {@link inspect}.\n *\n * Functionally identical to {@link console.error}. Contrast with\n * {@link console.log}, which prints to stdout instead of stderr.\n */\n warn(message?: any, ...optionalParams: any[]): void;\n\n /**\n * Logs its arguments to stderr, with a newline appended.\n *\n * Any value can be logged, not just strings. Non-string values will be\n * formatted using {@link inspect}.\n *\n * Functionally identical to {@link console.warn}. Contrast with\n * {@link console.log}, which prints to stdout instead of stderr.\n */\n error(message?: any, ...optionalParams: any[]): void;\n\n /**\n * Prints special ANSI escape characters to stdout which instruct your terminal\n * emulator to clear the screen and clear your terminal scrollback.\n *\n * Identical to {@link clear}.\n */\n clear(): void;\n}\n\ndeclare var console: Console;\n\n/**\n * `print` is an alias for {@link console.log}, which prints values to stdout.\n *\n * Any value can be logged, not just strings. Non-string values will be\n * formatted using {@link inspect}.\n */\ndeclare function print(...args: any): void;\n\n/**\n * Removes ANSI control characters from a string.\n */\ndeclare function stripAnsi(input: string | number | Path): string;\n\n/**\n * Wraps a string in double quotes, and escapes any double-quotes inside using `\\\"`.\n */\ndeclare function quote(input: string | number | Path): string;\n\n// Colors\n\n/** Wraps a string with the ANSI control characters that will make it print as black text. */\ndeclare function black(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it print as red text. */\ndeclare function red(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it print as green text. */\ndeclare function green(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it print as yellow text. */\ndeclare function yellow(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it print as blue text. */\ndeclare function blue(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it print as magenta text. */\ndeclare function magenta(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it print as cyan text. */\ndeclare function cyan(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it print as white text. */\ndeclare function white(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it print as gray text. (Alias for {@link grey}.) */\ndeclare function gray(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it print as grey text. (Alias for {@link gray}.) */\ndeclare function grey(input: string | number | Path): string;\n\n// Background Colors\n\n/** Wraps a string with the ANSI control characters that will make it have a black background when printed. */\ndeclare function bgBlack(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it have a red background when printed. */\ndeclare function bgRed(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it have a green background when printed. */\ndeclare function bgGreen(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it have a yellow background when printed. */\ndeclare function bgYellow(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it have a blue background when printed. */\ndeclare function bgBlue(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it have a magenta background when printed. */\ndeclare function bgMagenta(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it have a cyan background when printed. */\ndeclare function bgCyan(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it have a white background when printed. */\ndeclare function bgWhite(input: string | number | Path): string;\n\n// Modifiers\n\n/** Prefixes a string with the ANSI control character that resets all styling. */\ndeclare function reset(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it print with a bold style. */\ndeclare function bold(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it print with a dimmed style. */\ndeclare function dim(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it print italicized. */\ndeclare function italic(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it print underlined. */\ndeclare function underline(input: string | number | Path): string;\n/** Wraps a string with ANSI control characters that will make it print with its foreground (text) and background colors swapped. */\ndeclare function inverse(input: string | number | Path): string;\n/** Wraps a string with ANSI control characters that will make it print as hidden. */\ndeclare function hidden(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it print with a horizontal line through its center. */\ndeclare function strikethrough(input: string | number | Path): string;\n\n/**\n * Splits the string passed into it on `\\n` and then returns the lines matching\n * the specified pattern, as an array of strings or detail objects.\n *\n * @param str - The string to search through.\n * @param pattern - The pattern to find. Can be a string or a RegExp.\n * @param options - Options which control matching behavior.\n *\n * See also {@link grepFile} and {@link String.prototype.grep}.\n */\ndeclare const grepString: {\n (\n str: string,\n pattern: string | RegExp,\n options: GrepOptions & { details: true }\n ): Array<GrepMatchDetail>;\n\n (str: string, pattern: string | RegExp, options?: GrepOptions): Array<string>;\n};\n\n/**\n * Reads the file content at `path`, splits it on `\\n`, and then returns the\n * lines matching the specified pattern, as an array of strings or detail objects.\n *\n * @param str - The string to search through.\n * @param pattern - The pattern to find. Can be a string or a RegExp.\n * @param options - Options which control matching behavior.\n *\n * See also {@link grepString} and {@link String.prototype.grep}.\n */\ndeclare const grepFile: {\n (\n path: string | Path,\n pattern: string | RegExp,\n options: GrepOptions & { details: true }\n ): Array<GrepMatchDetail>;\n\n (\n path: string | Path,\n pattern: string | RegExp,\n options?: GrepOptions\n ): Array<string>;\n};\n\ninterface String {\n // Same as grepString but without the first argument.\n /**\n * Splits the target string on `\\n` and then returns the lines matching the\n * specified pattern, as an array of strings or detail objects.\n *\n * @param str - The string to search through.\n * @param pattern - The pattern to find. Can be a string or a RegExp.\n * @param options - Options which control matching behavior.\n *\n * See also {@link grepString} and {@link grepFile}.\n */\n grep: {\n (\n pattern: string | RegExp,\n options: GrepOptions & { details: true }\n ): Array<GrepMatchDetail>;\n\n (pattern: string | RegExp, options?: GrepOptions): Array<string>;\n };\n}\n\ndeclare interface GrepOptions {\n /**\n * When `inverse` is true, the grep function returns those lines which DON'T\n * match the pattern, instead of those which do. Defaults to `false`.\n */\n inverse?: boolean;\n\n /**\n * When `details` is true, the grep function returns an array of\n * {@link GrepMatchDetail} objects instead of an array of strings. Defaults to\n * `false`.\n */\n details?: boolean;\n}\n\n/**\n * When `grepString`, `grepFile`, or `String.prototype.grep` are called with the\n * `{ details: true }` option set, an Array of `GrepMatchDetail` objects is\n * returned.\n */\ndeclare interface GrepMatchDetail {\n lineNumber: number;\n lineContent: string;\n matches: RegExpMatchArray;\n}\n\n/**\n * The `types` namespace object contains various functions which can be used to\n * identify the type of a value at runtime. It is based on\n * [pheno](https://github.com/suchipi/pheno), with some yavascript-specific\n * extensions.\n *\n * ## Usage\n *\n * To check that a value is of a type, use `is`. To assert that a value is of a\n * type, use `assert.type`:\n *\n * ```ts\n * is(\"hi\", types.string); // true\n * is(\"hi\", types.number); // false\n * is({ blah: 42 }, types.objectWithProperties({ blah: types.number })); // true\n *\n * assert.type(\"hi\", types.string);\n * assert.type(\"hi\", types.number); // throws\n * assert.type({ blah: 42 }, types.objectWithProperties({ blah: types.number }));\n * ```\n *\n * In many cases, you can use a \"normal\" JavaScript value for the type instead\n * of something from the `types` namespace. For instance, the following code\n * block is equivalent to the previous one:\n *\n * ```ts\n * is(\"hi\", String); // true\n * is(\"hi\", Number); // false\n * is({ blah: 42 }, { blah: Number }); // true\n *\n * assert.type(\"hi\", String);\n * assert.type(\"hi\", Number); // throws\n * assert.type({ blah: 42 }, { blah: Number });\n * ```\n *\n * For more info about using \"normal\" values, see the \"Coercion\" heading below.\n *\n * ## Explanation\n *\n * There are two kinds of function properties found on the `types` namespace:\n * those which return a boolean, and those which return a function. Functions\n * which return a boolean are called \"type validators\", and can be used to check\n * the type of a value. For example, `types.number` is a type validator:\n *\n * ```ts\n * is(42, types.number); // returns true\n * ```\n *\n * The other kind of function is a function which returns a function. These are\n * called \"type validator constructors\", because the function they return is a\n * type validator. They are used to construct complex type validators. For\n * example, `types.exactString` is a type validator constructor:\n *\n * ```ts\n * const myType = types.exactString(\"potato\");\n * // myType is a function which returns true or false\n *\n * is(\"eggplant\", myType); // returns false\n * is(\"potato\", myType); // returns true\n * ```\n *\n * ## List of Functions\n *\n * ### Type Validators\n *\n * Here is a list of all the type validators:\n *\n * - `any`\n * - `anyArray`\n * - `anyFunction`\n * - `anyMap`\n * - `anyObject`\n * - `anySet`\n * - `anyTypeValidator`\n * - `array` (alias of `arrayOfUnknown`)\n * - `arrayOfAny`\n * - `arrayOfUnknown`\n * - `Array` (alias of `arrayOfUnknown`)\n * - `bigint`\n * - `BigInt` (alias of `bigint`)\n * - `boolean`\n * - `Boolean` (alias of `boolean`)\n * - `Date`\n * - `Error`\n * - `false`\n * - `falsy`\n * - `Function` (alias of `unknownFunction`)\n * - `Infinity`\n * - `integer`\n * - `map` (alias of `unknownMap`)\n * - `Map` (alias of `unknownMap`)\n * - `NaN`\n * - `NegativeInfinity`\n * - `never`\n * - `nonNullOrUndefined`\n * - `null`\n * - `nullish`\n * - `void` (alias of `nullish`)\n * - `number` (doesn't include NaN, Infinity, or -Infinity)\n * - `Number` (alias of `number`)\n * - `numberIncludingNanAndInfinities`\n * - `object` (alias of `unknownObject`)\n * - `Object` (alias of `unknownObject`)\n * - `objectOrNull`\n * - `RegExp`\n * - `set` (alias of `unknownSet`)\n * - `Set` (alias of `unknownSet`)\n * - `string`\n * - `String` (alias of `string`)\n * - `Symbol`\n * - `symbol` (alias of `Symbol`)\n * - `true`\n * - `truthy`\n * - `undefined`\n * - `unknown`\n * - `unknownFunction`\n * - `unknownMap`\n * - `unknownObject`\n * - `unknownSet`\n * - `unknownTypeValidator`\n * - `ArrayBuffer`\n * - `SharedArrayBuffer`\n * - `DataView`\n * - `TypedArray`\n * - `Int8Array`\n * - `Uint8Array`\n * - `Uint8ClampedArray`\n * - `Int16Array`\n * - `Uint16Array`\n * - `Int32Array`\n * - `Uint32Array`\n * - `Float32Array`\n * - `Float64Array`\n * - `FILE`\n * - `Path`\n * - `JSX.Element` (alias of `JSX.unknownElement`)\n * - `JSX.unknownElement`\n * - `JSX.anyElement`\n * - `JSX.Fragment`\n *\n * ### Type Validator Constructors\n *\n * And all the type validator constructors:\n *\n * - `and`\n * - `arrayOf`\n * - `exactBigInt`\n * - `exactNumber`\n * - `exactString`\n * - `exactSymbol`\n * - `hasClassName`\n * - `hasToStringTag`\n * - `instanceOf`\n * - `intersection`\n * - `mapOf`\n * - `mappingObjectOf`\n * - `maybe`\n * - `objectWithOnlyTheseProperties`\n * - `objectWithProperties`\n * - `or`\n * - `optional`\n * - `partialObjectWithProperties`\n * - `record`\n * - `setOf`\n * - `stringMatching`\n * - `symbolFor`\n * - `union`\n *\n * ## Coercion\n *\n * There is also a function, `types.coerce`, which returns an appropriate type\n * validator value for a given input value, using the following logic:\n *\n * | Input value | Output validator |\n * | ----------------------------- | ---------------------------------- |\n * | `String` or `string` global | `types.string` |\n * | `Number` or `number` global | `types.number` |\n * | `Boolean` or `boolean` global | `types.boolean` |\n * | `BigInt` or `bigint` global | `types.bigint` |\n * | `Symbol` global | `types.Symbol` |\n * | `RegExp` global | `types.RegExp` |\n * | `Array` global | `types.arrayOfUnknown` |\n * | `Set` global | `types.unknownSet` |\n * | `Map` global | `types.unknownMap` |\n * | `Object` global | `types.unknownObject` |\n * | `Date` global | `types.Date` |\n * | `Function` global | `types.unknownFunction` |\n * | `ArrayBuffer` global | `types.ArrayBuffer` |\n * | `SharedArrayBuffer` global | `types.SharedArrayBuffer` |\n * | `DataView` global | `types.DataView` |\n * | `Int8Array` global | `types.Int8Array` |\n * | `Uint8Array` global | `types.Uint8Array` |\n * | `Uint8ClampedArray` global | `types.Uint8ClampedArray` |\n * | `Int16Array` global | `types.Int16Array` |\n * | `Uint16Array` global | `types.Uint16Array` |\n * | `Int32Array` global | `types.Int32Array` |\n * | `Uint32Array` global | `types.Uint32Array` |\n * | `Float32Array` global | `types.Float32Array` |\n * | `Float64Array` global | `types.Float64Array` |\n * | `Path` global | `types.Path` |\n * | Any RegExp value | Validator for matching strings |\n * | Empty array | Validator for empty arrays |\n * | Array with one item | Validator for array of that item |\n * | Array with multiple items | Validator for tuple of those types |\n * | Class constructor function | Validator for instances of it |\n * | Any Object value | Validator for same-shaped object |\n * | null | `types.null` |\n * | undefined | `types.undefined` |\n * | true | `types.true` |\n * | false | `types.false` |\n * | NaN | `types.NaN` |\n * | Infinity | `types.Infinity` |\n * | `-Infinity` | `types.NegativeInfinity` |\n * | Any string value | `types.exactString(<the value>)` |\n * | Any 'normal' number value | `types.exactNumber(<the value>)` |\n * | Any Symbol value | `types.exactSymbol(<the value>)` |\n * | Any BigInt value | `types.exactBigInt(<the value>)` |\n *\n * > All type constructors, as well as `is` and `assert.type`, do coercion\n * > automatically! This means that in many cases, you do not need to access\n * > properties from the `types` namespace.\n */\ndeclare const types: {\n // basic types\n any: TypeValidator<any>;\n unknown: TypeValidator<unknown>;\n anyObject: TypeValidator<{\n [key: string | number | symbol]: any;\n }>;\n unknownObject: TypeValidator<{}>;\n object: TypeValidator<{}>;\n Object: TypeValidator<{}>;\n arrayOfAny: TypeValidator<Array<any>>;\n arrayOfUnknown: TypeValidator<Array<unknown>>;\n array: TypeValidator<Array<unknown>>;\n Array: TypeValidator<unknown[]>;\n anyArray: TypeValidator<Array<any>>;\n boolean: TypeValidator<boolean>;\n Boolean: TypeValidator<boolean>;\n string: TypeValidator<string>;\n String: TypeValidator<string>;\n null: TypeValidator<null>;\n undefined: TypeValidator<undefined>;\n nullish: TypeValidator<null | undefined>;\n void: TypeValidator<null | undefined>;\n numberIncludingNanAndInfinities: TypeValidator<number>;\n number: TypeValidator<number>;\n Number: TypeValidator<number>;\n NaN: TypeValidator<number>;\n Infinity: TypeValidator<number>;\n NegativeInfinity: TypeValidator<number>;\n integer: TypeValidator<number>;\n bigint: TypeValidator<bigint>;\n BigInt: TypeValidator<bigint>;\n never: TypeValidator<never>;\n anyFunction: TypeValidator<(...args: any) => any>;\n unknownFunction: TypeValidator<(...args: Array<unknown>) => unknown>;\n Function: TypeValidator<(...args: Array<unknown>) => unknown>;\n false: TypeValidator<false>;\n true: TypeValidator<true>;\n falsy: TypeValidator<false | null | undefined | \"\" | 0>;\n truthy: <T>(target: false | \"\" | 0 | T | null | undefined) => target is T;\n nonNullOrUndefined: <T>(target: T | null | undefined) => target is T;\n Error: TypeValidator<Error>;\n Symbol: TypeValidator<symbol>;\n symbol: TypeValidator<symbol>;\n RegExp: TypeValidator<RegExp>;\n Date: TypeValidator<Date>;\n anyMap: TypeValidator<Map<any, any>>;\n unknownMap: TypeValidator<Map<unknown, unknown>>;\n map: TypeValidator<Map<unknown, unknown>>;\n Map: TypeValidator<Map<unknown, unknown>>;\n anySet: TypeValidator<Set<any>>;\n unknownSet: TypeValidator<Set<unknown>>;\n set: TypeValidator<Set<unknown>>;\n Set: TypeValidator<Set<unknown>>;\n ArrayBuffer: TypeValidator<ArrayBuffer>;\n SharedArrayBuffer: TypeValidator<SharedArrayBuffer>;\n DataView: TypeValidator<DataView>;\n TypedArray: TypeValidator<\n | Int8Array\n | Uint8Array\n | Uint8ClampedArray\n | Int16Array\n | Uint16Array\n | Int32Array\n | Uint32Array\n | Float32Array\n | Float64Array\n >;\n Int8Array: TypeValidator<Int8Array>;\n Uint8Array: TypeValidator<Uint8Array>;\n Uint8ClampedArray: TypeValidator<Uint8ClampedArray>;\n Int16Array: TypeValidator<Int16Array>;\n Uint16Array: TypeValidator<Uint16Array>;\n Int32Array: TypeValidator<Int32Array>;\n Uint32Array: TypeValidator<Uint32Array>;\n Float32Array: TypeValidator<Float32Array>;\n Float64Array: TypeValidator<Float64Array>;\n\n // type constructors\n exactString<T extends string>(str: T): TypeValidator<T>;\n exactNumber<T extends number>(num: T): TypeValidator<T>;\n exactBigInt<T extends bigint>(num: T): TypeValidator<T>;\n exactSymbol<T extends symbol>(sym: T): TypeValidator<T>;\n hasClassName<Name extends string>(\n name: Name\n ): TypeValidator<{ constructor: Function & { name: Name } }>;\n hasToStringTag(name: string): TypeValidator<any>;\n instanceOf<Klass extends Function & { prototype: any }>(\n klass: Klass\n ): TypeValidator<Klass[\"prototype\"]>;\n stringMatching(regexp: RegExp): TypeValidator<string>;\n symbolFor(key: string): TypeValidator<symbol>;\n arrayOf<T extends TypeValidator<any> | CoerceableToTypeValidator | unknown>(\n typeValidator: T\n ): TypeValidator<Array<UnwrapTypeFromCoerceableOrValidator<T>>>;\n intersection: {\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second\n ): TypeValidator<\n UnwrapTypeFromCoerceableOrValidator<First> &\n UnwrapTypeFromCoerceableOrValidator<Second>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third\n ): TypeValidator<\n UnwrapTypeFromCoerceableOrValidator<First> &\n UnwrapTypeFromCoerceableOrValidator<Second> &\n UnwrapTypeFromCoerceableOrValidator<Third>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth\n ): TypeValidator<\n UnwrapTypeFromCoerceableOrValidator<First> &\n UnwrapTypeFromCoerceableOrValidator<Second> &\n UnwrapTypeFromCoerceableOrValidator<Third> &\n UnwrapTypeFromCoerceableOrValidator<Fourth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth\n ): TypeValidator<\n UnwrapTypeFromCoerceableOrValidator<First> &\n UnwrapTypeFromCoerceableOrValidator<Second> &\n UnwrapTypeFromCoerceableOrValidator<Third> &\n UnwrapTypeFromCoerceableOrValidator<Fourth> &\n UnwrapTypeFromCoerceableOrValidator<Fifth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth\n ): TypeValidator<\n UnwrapTypeFromCoerceableOrValidator<First> &\n UnwrapTypeFromCoerceableOrValidator<Second> &\n UnwrapTypeFromCoerceableOrValidator<Third> &\n UnwrapTypeFromCoerceableOrValidator<Fourth> &\n UnwrapTypeFromCoerceableOrValidator<Fifth> &\n UnwrapTypeFromCoerceableOrValidator<Sixth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh\n ): TypeValidator<\n UnwrapTypeFromCoerceableOrValidator<First> &\n UnwrapTypeFromCoerceableOrValidator<Second> &\n UnwrapTypeFromCoerceableOrValidator<Third> &\n UnwrapTypeFromCoerceableOrValidator<Fourth> &\n UnwrapTypeFromCoerceableOrValidator<Fifth> &\n UnwrapTypeFromCoerceableOrValidator<Sixth> &\n UnwrapTypeFromCoerceableOrValidator<Seventh>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh,\n eighth: Eighth\n ): TypeValidator<\n UnwrapTypeFromCoerceableOrValidator<First> &\n UnwrapTypeFromCoerceableOrValidator<Second> &\n UnwrapTypeFromCoerceableOrValidator<Third> &\n UnwrapTypeFromCoerceableOrValidator<Fourth> &\n UnwrapTypeFromCoerceableOrValidator<Fifth> &\n UnwrapTypeFromCoerceableOrValidator<Sixth> &\n UnwrapTypeFromCoerceableOrValidator<Seventh> &\n UnwrapTypeFromCoerceableOrValidator<Eighth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Ninth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh,\n eighth: Eighth,\n ninth: Ninth\n ): TypeValidator<\n UnwrapTypeFromCoerceableOrValidator<First> &\n UnwrapTypeFromCoerceableOrValidator<Second> &\n UnwrapTypeFromCoerceableOrValidator<Third> &\n UnwrapTypeFromCoerceableOrValidator<Fourth> &\n UnwrapTypeFromCoerceableOrValidator<Fifth> &\n UnwrapTypeFromCoerceableOrValidator<Sixth> &\n UnwrapTypeFromCoerceableOrValidator<Seventh> &\n UnwrapTypeFromCoerceableOrValidator<Eighth> &\n UnwrapTypeFromCoerceableOrValidator<Ninth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Ninth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Tenth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh,\n eighth: Eighth,\n ninth: Ninth,\n tenth: Tenth\n ): TypeValidator<\n UnwrapTypeFromCoerceableOrValidator<First> &\n UnwrapTypeFromCoerceableOrValidator<Second> &\n UnwrapTypeFromCoerceableOrValidator<Third> &\n UnwrapTypeFromCoerceableOrValidator<Fourth> &\n UnwrapTypeFromCoerceableOrValidator<Fifth> &\n UnwrapTypeFromCoerceableOrValidator<Sixth> &\n UnwrapTypeFromCoerceableOrValidator<Seventh> &\n UnwrapTypeFromCoerceableOrValidator<Eighth> &\n UnwrapTypeFromCoerceableOrValidator<Ninth> &\n UnwrapTypeFromCoerceableOrValidator<Tenth>\n >;\n };\n and: {\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second\n ): TypeValidator<\n UnwrapTypeFromCoerceableOrValidator<First> &\n UnwrapTypeFromCoerceableOrValidator<Second>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third\n ): TypeValidator<\n UnwrapTypeFromCoerceableOrValidator<First> &\n UnwrapTypeFromCoerceableOrValidator<Second> &\n UnwrapTypeFromCoerceableOrValidator<Third>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth\n ): TypeValidator<\n UnwrapTypeFromCoerceableOrValidator<First> &\n UnwrapTypeFromCoerceableOrValidator<Second> &\n UnwrapTypeFromCoerceableOrValidator<Third> &\n UnwrapTypeFromCoerceableOrValidator<Fourth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth\n ): TypeValidator<\n UnwrapTypeFromCoerceableOrValidator<First> &\n UnwrapTypeFromCoerceableOrValidator<Second> &\n UnwrapTypeFromCoerceableOrValidator<Third> &\n UnwrapTypeFromCoerceableOrValidator<Fourth> &\n UnwrapTypeFromCoerceableOrValidator<Fifth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth\n ): TypeValidator<\n UnwrapTypeFromCoerceableOrValidator<First> &\n UnwrapTypeFromCoerceableOrValidator<Second> &\n UnwrapTypeFromCoerceableOrValidator<Third> &\n UnwrapTypeFromCoerceableOrValidator<Fourth> &\n UnwrapTypeFromCoerceableOrValidator<Fifth> &\n UnwrapTypeFromCoerceableOrValidator<Sixth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh\n ): TypeValidator<\n UnwrapTypeFromCoerceableOrValidator<First> &\n UnwrapTypeFromCoerceableOrValidator<Second> &\n UnwrapTypeFromCoerceableOrValidator<Third> &\n UnwrapTypeFromCoerceableOrValidator<Fourth> &\n UnwrapTypeFromCoerceableOrValidator<Fifth> &\n UnwrapTypeFromCoerceableOrValidator<Sixth> &\n UnwrapTypeFromCoerceableOrValidator<Seventh>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh,\n eighth: Eighth\n ): TypeValidator<\n UnwrapTypeFromCoerceableOrValidator<First> &\n UnwrapTypeFromCoerceableOrValidator<Second> &\n UnwrapTypeFromCoerceableOrValidator<Third> &\n UnwrapTypeFromCoerceableOrValidator<Fourth> &\n UnwrapTypeFromCoerceableOrValidator<Fifth> &\n UnwrapTypeFromCoerceableOrValidator<Sixth> &\n UnwrapTypeFromCoerceableOrValidator<Seventh> &\n UnwrapTypeFromCoerceableOrValidator<Eighth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Ninth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh,\n eighth: Eighth,\n ninth: Ninth\n ): TypeValidator<\n UnwrapTypeFromCoerceableOrValidator<First> &\n UnwrapTypeFromCoerceableOrValidator<Second> &\n UnwrapTypeFromCoerceableOrValidator<Third> &\n UnwrapTypeFromCoerceableOrValidator<Fourth> &\n UnwrapTypeFromCoerceableOrValidator<Fifth> &\n UnwrapTypeFromCoerceableOrValidator<Sixth> &\n UnwrapTypeFromCoerceableOrValidator<Seventh> &\n UnwrapTypeFromCoerceableOrValidator<Eighth> &\n UnwrapTypeFromCoerceableOrValidator<Ninth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Ninth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Tenth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh,\n eighth: Eighth,\n ninth: Ninth,\n tenth: Tenth\n ): TypeValidator<\n UnwrapTypeFromCoerceableOrValidator<First> &\n UnwrapTypeFromCoerceableOrValidator<Second> &\n UnwrapTypeFromCoerceableOrValidator<Third> &\n UnwrapTypeFromCoerceableOrValidator<Fourth> &\n UnwrapTypeFromCoerceableOrValidator<Fifth> &\n UnwrapTypeFromCoerceableOrValidator<Sixth> &\n UnwrapTypeFromCoerceableOrValidator<Seventh> &\n UnwrapTypeFromCoerceableOrValidator<Eighth> &\n UnwrapTypeFromCoerceableOrValidator<Ninth> &\n UnwrapTypeFromCoerceableOrValidator<Tenth>\n >;\n };\n union: {\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second\n ): TypeValidator<\n | UnwrapTypeFromCoerceableOrValidator<First>\n | UnwrapTypeFromCoerceableOrValidator<Second>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third\n ): TypeValidator<\n | UnwrapTypeFromCoerceableOrValidator<First>\n | UnwrapTypeFromCoerceableOrValidator<Second>\n | UnwrapTypeFromCoerceableOrValidator<Third>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth\n ): TypeValidator<\n | UnwrapTypeFromCoerceableOrValidator<First>\n | UnwrapTypeFromCoerceableOrValidator<Second>\n | UnwrapTypeFromCoerceableOrValidator<Third>\n | UnwrapTypeFromCoerceableOrValidator<Fourth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth\n ): TypeValidator<\n | UnwrapTypeFromCoerceableOrValidator<First>\n | UnwrapTypeFromCoerceableOrValidator<Second>\n | UnwrapTypeFromCoerceableOrValidator<Third>\n | UnwrapTypeFromCoerceableOrValidator<Fourth>\n | UnwrapTypeFromCoerceableOrValidator<Fifth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth\n ): TypeValidator<\n | UnwrapTypeFromCoerceableOrValidator<First>\n | UnwrapTypeFromCoerceableOrValidator<Second>\n | UnwrapTypeFromCoerceableOrValidator<Third>\n | UnwrapTypeFromCoerceableOrValidator<Fourth>\n | UnwrapTypeFromCoerceableOrValidator<Fifth>\n | UnwrapTypeFromCoerceableOrValidator<Sixth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh\n ): TypeValidator<\n | UnwrapTypeFromCoerceableOrValidator<First>\n | UnwrapTypeFromCoerceableOrValidator<Second>\n | UnwrapTypeFromCoerceableOrValidator<Third>\n | UnwrapTypeFromCoerceableOrValidator<Fourth>\n | UnwrapTypeFromCoerceableOrValidator<Fifth>\n | UnwrapTypeFromCoerceableOrValidator<Sixth>\n | UnwrapTypeFromCoerceableOrValidator<Seventh>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh,\n eighth: Eighth\n ): TypeValidator<\n | UnwrapTypeFromCoerceableOrValidator<First>\n | UnwrapTypeFromCoerceableOrValidator<Second>\n | UnwrapTypeFromCoerceableOrValidator<Third>\n | UnwrapTypeFromCoerceableOrValidator<Fourth>\n | UnwrapTypeFromCoerceableOrValidator<Fifth>\n | UnwrapTypeFromCoerceableOrValidator<Sixth>\n | UnwrapTypeFromCoerceableOrValidator<Seventh>\n | UnwrapTypeFromCoerceableOrValidator<Eighth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Ninth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh,\n eighth: Eighth,\n ninth: Ninth\n ): TypeValidator<\n | UnwrapTypeFromCoerceableOrValidator<First>\n | UnwrapTypeFromCoerceableOrValidator<Second>\n | UnwrapTypeFromCoerceableOrValidator<Third>\n | UnwrapTypeFromCoerceableOrValidator<Fourth>\n | UnwrapTypeFromCoerceableOrValidator<Fifth>\n | UnwrapTypeFromCoerceableOrValidator<Sixth>\n | UnwrapTypeFromCoerceableOrValidator<Seventh>\n | UnwrapTypeFromCoerceableOrValidator<Eighth>\n | UnwrapTypeFromCoerceableOrValidator<Ninth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Ninth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Tenth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh,\n eighth: Eighth,\n ninth: Ninth,\n tenth: Tenth\n ): TypeValidator<\n | UnwrapTypeFromCoerceableOrValidator<First>\n | UnwrapTypeFromCoerceableOrValidator<Second>\n | UnwrapTypeFromCoerceableOrValidator<Third>\n | UnwrapTypeFromCoerceableOrValidator<Fourth>\n | UnwrapTypeFromCoerceableOrValidator<Fifth>\n | UnwrapTypeFromCoerceableOrValidator<Sixth>\n | UnwrapTypeFromCoerceableOrValidator<Seventh>\n | UnwrapTypeFromCoerceableOrValidator<Eighth>\n | UnwrapTypeFromCoerceableOrValidator<Ninth>\n | UnwrapTypeFromCoerceableOrValidator<Tenth>\n >;\n };\n or: {\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second\n ): TypeValidator<\n | UnwrapTypeFromCoerceableOrValidator<First>\n | UnwrapTypeFromCoerceableOrValidator<Second>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third\n ): TypeValidator<\n | UnwrapTypeFromCoerceableOrValidator<First>\n | UnwrapTypeFromCoerceableOrValidator<Second>\n | UnwrapTypeFromCoerceableOrValidator<Third>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth\n ): TypeValidator<\n | UnwrapTypeFromCoerceableOrValidator<First>\n | UnwrapTypeFromCoerceableOrValidator<Second>\n | UnwrapTypeFromCoerceableOrValidator<Third>\n | UnwrapTypeFromCoerceableOrValidator<Fourth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth\n ): TypeValidator<\n | UnwrapTypeFromCoerceableOrValidator<First>\n | UnwrapTypeFromCoerceableOrValidator<Second>\n | UnwrapTypeFromCoerceableOrValidator<Third>\n | UnwrapTypeFromCoerceableOrValidator<Fourth>\n | UnwrapTypeFromCoerceableOrValidator<Fifth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth\n ): TypeValidator<\n | UnwrapTypeFromCoerceableOrValidator<First>\n | UnwrapTypeFromCoerceableOrValidator<Second>\n | UnwrapTypeFromCoerceableOrValidator<Third>\n | UnwrapTypeFromCoerceableOrValidator<Fourth>\n | UnwrapTypeFromCoerceableOrValidator<Fifth>\n | UnwrapTypeFromCoerceableOrValidator<Sixth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh\n ): TypeValidator<\n | UnwrapTypeFromCoerceableOrValidator<First>\n | UnwrapTypeFromCoerceableOrValidator<Second>\n | UnwrapTypeFromCoerceableOrValidator<Third>\n | UnwrapTypeFromCoerceableOrValidator<Fourth>\n | UnwrapTypeFromCoerceableOrValidator<Fifth>\n | UnwrapTypeFromCoerceableOrValidator<Sixth>\n | UnwrapTypeFromCoerceableOrValidator<Seventh>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh,\n eighth: Eighth\n ): TypeValidator<\n | UnwrapTypeFromCoerceableOrValidator<First>\n | UnwrapTypeFromCoerceableOrValidator<Second>\n | UnwrapTypeFromCoerceableOrValidator<Third>\n | UnwrapTypeFromCoerceableOrValidator<Fourth>\n | UnwrapTypeFromCoerceableOrValidator<Fifth>\n | UnwrapTypeFromCoerceableOrValidator<Sixth>\n | UnwrapTypeFromCoerceableOrValidator<Seventh>\n | UnwrapTypeFromCoerceableOrValidator<Eighth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Ninth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh,\n eighth: Eighth,\n ninth: Ninth\n ): TypeValidator<\n | UnwrapTypeFromCoerceableOrValidator<First>\n | UnwrapTypeFromCoerceableOrValidator<Second>\n | UnwrapTypeFromCoerceableOrValidator<Third>\n | UnwrapTypeFromCoerceableOrValidator<Fourth>\n | UnwrapTypeFromCoerceableOrValidator<Fifth>\n | UnwrapTypeFromCoerceableOrValidator<Sixth>\n | UnwrapTypeFromCoerceableOrValidator<Seventh>\n | UnwrapTypeFromCoerceableOrValidator<Eighth>\n | UnwrapTypeFromCoerceableOrValidator<Ninth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Ninth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Tenth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh,\n eighth: Eighth,\n ninth: Ninth,\n tenth: Tenth\n ): TypeValidator<\n | UnwrapTypeFromCoerceableOrValidator<First>\n | UnwrapTypeFromCoerceableOrValidator<Second>\n | UnwrapTypeFromCoerceableOrValidator<Third>\n | UnwrapTypeFromCoerceableOrValidator<Fourth>\n | UnwrapTypeFromCoerceableOrValidator<Fifth>\n | UnwrapTypeFromCoerceableOrValidator<Sixth>\n | UnwrapTypeFromCoerceableOrValidator<Seventh>\n | UnwrapTypeFromCoerceableOrValidator<Eighth>\n | UnwrapTypeFromCoerceableOrValidator<Ninth>\n | UnwrapTypeFromCoerceableOrValidator<Tenth>\n >;\n };\n mapOf<\n K extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n V extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n keyType: K,\n valueType: V\n ): TypeValidator<\n Map<\n UnwrapTypeFromCoerceableOrValidator<K>,\n UnwrapTypeFromCoerceableOrValidator<V>\n >\n >;\n setOf<T extends TypeValidator<any> | CoerceableToTypeValidator | unknown>(\n itemType: T\n ): TypeValidator<Set<UnwrapTypeFromCoerceableOrValidator<T>>>;\n maybe<T extends TypeValidator<any> | CoerceableToTypeValidator | unknown>(\n itemType: T\n ): TypeValidator<UnwrapTypeFromCoerceableOrValidator<T> | undefined | null>;\n objectWithProperties<\n T extends {\n [key: string | number | symbol]:\n | TypeValidator<any>\n | CoerceableToTypeValidator\n | unknown;\n }\n >(\n properties: T\n ): TypeValidator<{\n [key in keyof T]: UnwrapTypeFromCoerceableOrValidator<T[key]>;\n }>;\n objectWithOnlyTheseProperties<\n T extends {\n [key: string | number | symbol]:\n | TypeValidator<any>\n | CoerceableToTypeValidator\n | unknown;\n }\n >(\n properties: T\n ): TypeValidator<{\n [key in keyof T]: UnwrapTypeFromCoerceableOrValidator<T[key]>;\n }>;\n\n mappingObjectOf<\n Values extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Keys extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n keyType: Keys,\n valueType: Values\n ): TypeValidator<\n Record<\n UnwrapTypeFromCoerceableOrValidator<Keys> extends string | number | symbol\n ? UnwrapTypeFromCoerceableOrValidator<Keys>\n : never,\n UnwrapTypeFromCoerceableOrValidator<Values>\n >\n >;\n record<\n Values extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Keys extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n keyType: Keys,\n valueType: Values\n ): TypeValidator<\n Record<\n UnwrapTypeFromCoerceableOrValidator<Keys> extends string | number | symbol\n ? UnwrapTypeFromCoerceableOrValidator<Keys>\n : never,\n UnwrapTypeFromCoerceableOrValidator<Values>\n >\n >;\n partialObjectWithProperties<\n T extends {\n [key: string | number | symbol]:\n | TypeValidator<any>\n | CoerceableToTypeValidator\n | unknown;\n }\n >(\n properties: T\n ): TypeValidator<{\n [key in keyof T]:\n | UnwrapTypeFromCoerceableOrValidator<T[key]>\n | null\n | undefined;\n }>;\n tuple: {\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second\n ): TypeValidator<\n [\n UnwrapTypeFromCoerceableOrValidator<First>,\n UnwrapTypeFromCoerceableOrValidator<Second>\n ]\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third\n ): TypeValidator<\n [\n UnwrapTypeFromCoerceableOrValidator<First>,\n UnwrapTypeFromCoerceableOrValidator<Second>,\n UnwrapTypeFromCoerceableOrValidator<Third>\n ]\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth\n ): TypeValidator<\n [\n UnwrapTypeFromCoerceableOrValidator<First>,\n UnwrapTypeFromCoerceableOrValidator<Second>,\n UnwrapTypeFromCoerceableOrValidator<Third>,\n UnwrapTypeFromCoerceableOrValidator<Fourth>\n ]\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth\n ): TypeValidator<\n [\n UnwrapTypeFromCoerceableOrValidator<First>,\n UnwrapTypeFromCoerceableOrValidator<Second>,\n UnwrapTypeFromCoerceableOrValidator<Third>,\n UnwrapTypeFromCoerceableOrValidator<Fourth>,\n UnwrapTypeFromCoerceableOrValidator<Fifth>\n ]\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth\n ): TypeValidator<\n [\n UnwrapTypeFromCoerceableOrValidator<First>,\n UnwrapTypeFromCoerceableOrValidator<Second>,\n UnwrapTypeFromCoerceableOrValidator<Third>,\n UnwrapTypeFromCoerceableOrValidator<Fourth>,\n UnwrapTypeFromCoerceableOrValidator<Fifth>,\n UnwrapTypeFromCoerceableOrValidator<Sixth>\n ]\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh\n ): TypeValidator<\n [\n UnwrapTypeFromCoerceableOrValidator<First>,\n UnwrapTypeFromCoerceableOrValidator<Second>,\n UnwrapTypeFromCoerceableOrValidator<Third>,\n UnwrapTypeFromCoerceableOrValidator<Fourth>,\n UnwrapTypeFromCoerceableOrValidator<Fifth>,\n UnwrapTypeFromCoerceableOrValidator<Sixth>,\n UnwrapTypeFromCoerceableOrValidator<Seventh>\n ]\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh,\n eighth: Eighth\n ): TypeValidator<\n [\n UnwrapTypeFromCoerceableOrValidator<First>,\n UnwrapTypeFromCoerceableOrValidator<Second>,\n UnwrapTypeFromCoerceableOrValidator<Third>,\n UnwrapTypeFromCoerceableOrValidator<Fourth>,\n UnwrapTypeFromCoerceableOrValidator<Fifth>,\n UnwrapTypeFromCoerceableOrValidator<Sixth>,\n UnwrapTypeFromCoerceableOrValidator<Seventh>,\n UnwrapTypeFromCoerceableOrValidator<Eighth>\n ]\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Ninth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh,\n eighth: Eighth,\n ninth: Ninth\n ): TypeValidator<\n [\n UnwrapTypeFromCoerceableOrValidator<First>,\n UnwrapTypeFromCoerceableOrValidator<Second>,\n UnwrapTypeFromCoerceableOrValidator<Third>,\n UnwrapTypeFromCoerceableOrValidator<Fourth>,\n UnwrapTypeFromCoerceableOrValidator<Fifth>,\n UnwrapTypeFromCoerceableOrValidator<Sixth>,\n UnwrapTypeFromCoerceableOrValidator<Seventh>,\n UnwrapTypeFromCoerceableOrValidator<Eighth>,\n UnwrapTypeFromCoerceableOrValidator<Ninth>\n ]\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Ninth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Tenth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh,\n eighth: Eighth,\n ninth: Ninth,\n tenth: Tenth\n ): TypeValidator<\n [\n UnwrapTypeFromCoerceableOrValidator<First>,\n UnwrapTypeFromCoerceableOrValidator<Second>,\n UnwrapTypeFromCoerceableOrValidator<Third>,\n UnwrapTypeFromCoerceableOrValidator<Fourth>,\n UnwrapTypeFromCoerceableOrValidator<Fifth>,\n UnwrapTypeFromCoerceableOrValidator<Sixth>,\n UnwrapTypeFromCoerceableOrValidator<Seventh>,\n UnwrapTypeFromCoerceableOrValidator<Eighth>,\n UnwrapTypeFromCoerceableOrValidator<Ninth>,\n UnwrapTypeFromCoerceableOrValidator<Tenth>\n ]\n >;\n };\n\n coerce: <V extends CoerceableToTypeValidator | TypeValidator<any> | unknown>(\n value: V\n ) => TypeValidator<UnwrapTypeFromCoerceableOrValidator<V>>;\n\n FILE: TypeValidator<FILE>;\n Path: TypeValidator<Path>;\n JSX: {\n unknownElement: TypeValidator<\n JSX.Element<{ [key: string | symbol | number]: unknown }, unknown>\n >;\n anyElement: TypeValidator<JSX.Element<any, any>>;\n Element: TypeValidator<\n JSX.Element<{ [key: string | symbol | number]: unknown }, unknown>\n >;\n Fragment: TypeValidator<JSX.Fragment>;\n };\n};\n\ndeclare type TypeValidator<T> = (value: any) => value is T;\n\ndeclare type CoerceToTypeValidator<V extends CoerceableToTypeValidator> =\n V extends StringConstructor\n ? TypeValidator<string>\n : V extends NumberConstructor\n ? TypeValidator<number>\n : V extends BooleanConstructor\n ? TypeValidator<boolean>\n : V extends BigIntConstructor\n ? TypeValidator<BigInt>\n : V extends SymbolConstructor\n ? TypeValidator<Symbol>\n : V extends RegExpConstructor\n ? TypeValidator<RegExp>\n : V extends ArrayConstructor\n ? TypeValidator<Array<unknown>>\n : V extends SetConstructor\n ? TypeValidator<Set<unknown>>\n : V extends MapConstructor\n ? TypeValidator<Map<unknown, unknown>>\n : V extends ObjectConstructor\n ? TypeValidator<{\n [key: string | number | symbol]: unknown;\n }>\n : V extends DateConstructor\n ? TypeValidator<Date>\n : V extends FunctionConstructor\n ? TypeValidator<Function>\n : V extends ArrayBufferConstructor\n ? TypeValidator<ArrayBuffer>\n : V extends SharedArrayBufferConstructor\n ? TypeValidator<SharedArrayBuffer>\n : V extends DataViewConstructor\n ? TypeValidator<DataView>\n : V extends Int8ArrayConstructor\n ? TypeValidator<Int8Array>\n : V extends Uint8ArrayConstructor\n ? TypeValidator<Uint8Array>\n : V extends Uint8ClampedArrayConstructor\n ? TypeValidator<Uint8ClampedArray>\n : V extends Int16ArrayConstructor\n ? TypeValidator<Int16Array>\n : V extends Uint16ArrayConstructor\n ? TypeValidator<Uint16Array>\n : V extends Int32ArrayConstructor\n ? TypeValidator<Int32Array>\n : V extends Uint32ArrayConstructor\n ? TypeValidator<Uint32Array>\n : V extends Float32ArrayConstructor\n ? TypeValidator<Float32Array>\n : V extends Float64ArrayConstructor\n ? TypeValidator<Float64Array>\n : V extends RegExp\n ? TypeValidator<string>\n : V extends {}\n ? TypeValidator<{\n [key in keyof V]: CoerceToTypeValidator<V[key]>;\n }>\n : V extends []\n ? TypeValidator<[]>\n : V extends [any]\n ? TypeValidator<Array<CoerceToTypeValidator<V[0]>>>\n : V extends Array<any>\n ? TypeValidator<Array<unknown>>\n : V extends {\n new (...args: any): any;\n }\n ? TypeValidator<InstanceType<V>>\n : TypeValidator<V>;\n\ndeclare type CoerceableToTypeValidator =\n | boolean\n | number\n | string\n | bigint\n | undefined\n | null\n | RegExp\n | StringConstructor\n | NumberConstructor\n | BooleanConstructor\n | BigIntConstructor\n | SymbolConstructor\n | RegExpConstructor\n | ArrayConstructor\n | SetConstructor\n | MapConstructor\n | ObjectConstructor\n | DateConstructor\n | FunctionConstructor\n | ArrayBufferConstructor\n | SharedArrayBufferConstructor\n | DataViewConstructor\n | Int8ArrayConstructor\n | Uint8ArrayConstructor\n | Uint8ClampedArrayConstructor\n | Int16ArrayConstructor\n | Uint16ArrayConstructor\n | Int32ArrayConstructor\n | Uint32ArrayConstructor\n | Float32ArrayConstructor\n | Float64ArrayConstructor\n | {}\n | []\n | [any]\n | Array<any>\n | {\n new (...args: any): any;\n };\n\ndeclare type UnwrapTypeFromCoerceableOrValidator<\n V extends CoerceableToTypeValidator | TypeValidator<any> | unknown\n> = V extends TypeValidator<infer T>\n ? T\n : V extends CoerceableToTypeValidator\n ? CoerceToTypeValidator<V> extends TypeValidator<infer T>\n ? T\n : never\n : unknown;\n\n/**\n * Returns whether `value` is of type `type`. Useful for validating that values\n * have the correct type at runtime, in library functions or etc.\n *\n * The `type` parameter can be any of the following:\n *\n * - a TypeValidator function from the `types` namespace\n * - a global constructor like `String`, `Number`, `Boolean`, `Set`,\n * `Int8Array`, etc\n * - a user-defined class\n * - a primitive value like `true`, `false`, `null`, or `42`\n * - a Regular Expression (to match strings that match the regexp)\n * - an object or array containing any combination of the above\n *\n * Note that yavascript has the following global aliases defined, which are also\n * valid types:\n *\n * ```ts\n * const bigint = BigInt;\n * const boolean = Boolean;\n * const number = Number;\n * const string = String;\n * const symbol = Symbol;\n * ```\n *\n * ## Example\n *\n * ```ts\n * is(42, Number); // true\n * is(42, number); // true\n * is(42, types.number); // true\n *\n * is(42, String); // false\n * is(42, Set); // false\n * is(42, Array); // false\n *\n * is(42, 42); // true\n * is(42, 45); // false\n *\n * is({ kind: \"success\", data: 99 }, { kind: \"success\" }); // true\n * ```\n *\n * ```ts\n * // Defined in yavascript/src/api/is\n * declare function is(value: any, type: TypeValidator<any>): boolean;\n * ```\n *\n * See also {@link types} (which contains {@link TypeValidator}s that can be\n * used by `is`) and {@link assert.type} (which throws an error instead of\n * returning a boolean).\n */\ndeclare const is: <T extends TypeValidator<any> | CoerceableToTypeValidator>(\n value: any,\n type: T\n) => value is UnwrapTypeFromCoerceableOrValidator<T>;\n\n/**\n * Alias to {@link is}, for when using the Civet language, because `is` is a\n * reserved keyword in Civet.\n */\ndeclare const _is: typeof is;\n\ndeclare const assert: {\n /**\n * Throws an error if `value` is not truthy.\n *\n * @param value - The value to test for truthiness\n * @param message - An optional error message to use. If unspecified, \"Assertion failed\" will be used.\n */\n <ValueType>(\n value: ValueType,\n message?: string\n ): asserts value is ValueType extends null | undefined | false | 0 | \"\"\n ? never\n : ValueType;\n\n /**\n * Throws an error if its argument isn't the correct type.\n *\n * @param value - The value to test the type of\n * @param type - The type that `value` should be, as either a `TypeValidator` (from the `types.*` namespace) or a value which can be coerced into a `TypeValidator` via the `types.coerce` function, like `String`, `Boolean`, etc.\n * @param message - An optional error message to use. If unspecified, a generic-but-descriptive message will be used.\n */\n type: <T extends TypeValidator<any> | CoerceableToTypeValidator>(\n value: any,\n type: T,\n optionalMessage?: string\n ) => asserts value is UnwrapTypeFromCoerceableOrValidator<T>;\n};\n\n/**\n * This API is a work-in-progress and is subject to change at any time.\n */\ninterface InteractivePrompt {\n prompt?: () => string;\n printInput?: (input: string) => void;\n historyFileName?: string;\n getCompletions?: (\n line: string,\n pos: number\n ) => {\n // TODO refactor these to have better key names\n tab: Array<string>;\n pos: number;\n ctx: { [key: string | number | symbol]: any };\n };\n\n handleInput: (input: string) => void;\n start(): void;\n}\n\n/**\n * This API is a work-in-progress and is subject to change at any time.\n */\ninterface InteractivePromptConstructor {\n new (\n handleInput: (input: string) => void,\n options?: {\n prompt?: () => string;\n printInput?: (input: string) => void;\n historyFileName?: string;\n getCompletions?: (\n line: string,\n pos: number\n ) => {\n // TODO refactor these to have better key names\n tab: Array<string>;\n pos: number;\n ctx: { [key: string | number | symbol]: any };\n };\n }\n ): InteractivePrompt;\n\n prototype: InteractivePrompt;\n}\n\n/**\n * This API is a work-in-progress and is subject to change at any time.\n */\ndeclare var InteractivePrompt: InteractivePromptConstructor;\n\n/**\n * Launch the Yavascript REPL (read-eval-print-loop).\n *\n * @param context Variables to make available as globals within the repl.\n * @param lang The language to use in the repl. Defaults to \"javascript\".\n */\ndeclare const startRepl: {\n (\n context?: { [key: string]: any },\n lang?:\n | \"js\"\n | \"javascript\"\n | \"ts\"\n | \"typescript\"\n | \"jsx\"\n | \"tsx\"\n | \"coffee\"\n | \"coffeescript\"\n | \"civet\"\n ): void;\n\n /**\n * A special value; when expressions result in this value, the repl will\n * print nothing instead of printing this value.\n */\n NOTHING: symbol;\n};\n\n/**\n * An object that points to a git repository on disk and provides utility\n * methods for getting information from that repo.\n *\n * To use it, construct a GitRepo object, passing in the path to the repo:\n *\n * ```ts\n * // The path here is just an example\n * const repo = new GitRepo(\"/home/suchipi/Code/yavascript\");\n * ```\n *\n * Then, you can use methods/properties on the `repo` object:\n *\n * ```ts\n * console.log(repo.branchName() || repo.commitSHA());\n * ```\n */\ndeclare class GitRepo {\n /**\n * Given a path to a file or folder on disk, searches upwards through the\n * directory ancestry to find a `.git` folder, then returns the Path that\n * contains that `.git` folder. If no `.git` folder is found, an error will be\n * thrown.\n *\n * For example, if you have a git repo at `/home/suchipi/Code/my-project`,\n * such that `/home/suchipi/Code/my-project/.git` exists, calling\n * `GitRepo.findRoot(\"/home/suchipi/Code/my-project/src/index.js\")` will\n * return a `Path` object pointing to `/home/suchipi/Code/my-project`.\n *\n * This function can be useful in order to set the current working directory\n * of a script relative to the root of the git repo the script appears in. By\n * doing so, the script can be invoked from any directory.\n *\n * For instance, consider this theoretical filesystem layout:\n *\n * ```\n * my-project\n * - src\n * - my-script.js\n * - README.md\n * ```\n *\n * If `my-script.js` contained the following content:\n *\n * ```ts\n * #!/usr/bin/env yavascript\n *\n * cat(\"README.md\");\n * ```\n *\n * Then running `src/my-script.js` would print the contents of the README as\n * expected.\n *\n * However, suppose someone ran the script from a different folder:\n *\n * ```sh\n * $ cd src\n * $ ./my-script.js\n * ```\n *\n * Now an error occurs!\n *\n * To make the script resilient against this, you can use `cd` at the top of\n * the script:\n *\n * ```ts\n * #!/usr/bin/env yavascript\n *\n * // __dirname is a special variable that refers to the folder the current script is in.\n * cd(__dirname);\n * cd(\"..\");\n *\n * cat(\"README.md\");\n * ```\n *\n * However, if the location of `my-script.js` later changes, you will have to\n * remember to update the script. For instance, if `src/my-script.js` got\n * moved to `src/tools/my-script.js`, you would need to update the script like\n * so:\n *\n * ```ts\n * #!/usr/bin/env yavascript\n *\n * cd(__dirname);\n * cd(\"../..\"); // Changed this line\n *\n * cat(\"README.md\");\n * ```\n *\n * Since `README.md` will always be in the repository root, using\n * `GitRepo.findRoot` would make the `cd` resilient against file moves:\n *\n * ```ts\n * #!/usr/bin/env yavascript\n *\n * cd(GitRepo.findRoot(__dirname));\n *\n * cat(\"README.md\");\n * ```\n *\n * Depending on how you anticipate your codebase changing over time, and how\n * you expect others to use your scripts, it might make sense to use\n * `cd(__dirname)`, `cd(GitRepo.findRoot(__dirname))`, or no `cd` at all. Pick what\n * makes the most sense for your situation.\n *\n */\n static findRoot(fromPath: string | Path): Path;\n\n /**\n * Creates a new `GitRepo` object for the given repo on disk.\n */\n constructor(repoDir: string | Path);\n\n /**\n * The root folder of the git repo that this `GitRepo` object represents (the\n * folder that contains the '.git' folder).\n */\n repoDir: Path;\n\n /**\n * Returns the full SHA-1 hash string associated with the repo's current\n * commit.\n *\n * For example:\n *\n * ```ts\n * const repo = new GitRepo(\".\");\n * const sha = repo.commitSHA();\n * console.log(sha);\n * // \"2a0a15f9872406faebcac694562efeae3447a4ba\"\n * ```\n *\n * To obtain this information, the command `git rev-parse HEAD` gets run\n * within the repo's directory.\n *\n * > If the repo has unstaged or uncommitted changes, that state will NOT be\n * > reflected in the SHA-1 hash. As such, it may be desirable to use this\n * > method in conjunction with `GitRepo.prototype.isWorkingTreeDirty`.\n */\n commitSHA(): string;\n\n /**\n * If the commit SHA the git repo is currently pointed at is the tip of a\n * named branch, returns the branch name. Otherwise, returns `null`.\n *\n * This is done by running `git rev-parse --abbrev-ref HEAD` within the repo\n * directory.\n *\n * Example:\n *\n * ```ts\n * const repo = new GitRepo(\".\");\n * const branch = repo.branchName();\n * console.log(branch);\n * // \"main\"\n * ```\n *\n * > The most common situation where there is no current branch is when the\n * > repository is in \"detached HEAD\" state.\n */\n branchName(): string | null;\n\n /**\n * Returns a boolean indicating whether there are uncommited changes in the\n * git repo. `true` means there are changes, `false` means there are no\n * changes (ie. the repo is clean).\n *\n * This is done by running `git status --quiet` within the repo directory.\n */\n isWorkingTreeDirty(): boolean;\n\n /**\n * Returns a boolean indicating whether the provided path is ignored by one or\n * more `.gitignore` files in the repository.\n *\n * Example:\n *\n * ```ts\n * const repo = new GitRepo(\".\");\n * const ignoreStatus = repo.isIgnored(\"README.md\");\n * console.log(ignoreStatus);\n * // false\n * ```\n *\n * To obtain this information, the command `git check-ignore <the-path>` gets\n * run within the repo's directory.\n *\n * An error will be thrown if the provided path is not within the repository's\n * directory tree. For instance, calling `gitRepo.isIgnored(\"/tmp\")` on a\n * `gitRepo` pointed at `/home/suchipi/my-project` would throw an error,\n * because `/tmp` is not a child of `/home/suchipi/my-project`.\n *\n * > NOTE: When passing relative paths to `isIgnored`, they will be resolved\n * > relative to the repo root, NOT relative to `pwd()`. It's best practice to\n * > always pass around absolute paths in your program instead of relative\n * > ones so that this type of ambiguity is avoided.\n */\n isIgnored(path: string | Path): boolean;\n}\n\n/**\n * The logger used internally by yavascript API functions such as {@link which},\n * {@link exec}, {@link copy}, {@link glob}, and more.\n *\n * You can modify the properties on this object in order to configure the\n * amount and style of log output from yavascript API functions.\n *\n * This object behaves similarly to the shell builtin `set -x`.\n */\ndeclare const logger: {\n /**\n * This property is used as the default value for `trace` in yavascript API\n * functions which receive `logging.trace` as an option, like {@link which},\n * {@link exec}, {@link copy} and {@link glob}.\n *\n * The default value of `logger.trace` is a no-op function.\n */\n trace: (...args: Array<any>) => void;\n\n /**\n * This property is used as the default value for `info` in yavascript API\n * functions which receive `logging.info` as an option, like {@link exec},\n * {@link copy}, and {@link glob}.\n *\n * The default value of `logger.info` writes dimmed text to stdout.\n */\n info: (...args: Array<any>) => void;\n};\n\n/**\n * The properties of the `JSX` global can be modified to change how JSX syntax\n * gets compiled by yavascript. Those properties are:\n *\n * - `pragma` (string): The JavaScript expression that should be called to\n * create JSX elements. Defaults to \"JSX.createElement\".\n * - `pragmaFrag` (string): The JavaScript expression that should be used when\n * creating JSX fragments. Defaults to \"JSX.Fragment\".\n * - `createElement` (function): The function used to create JSX elements,\n * unless `JSX.pragma` has been changed.\n * - `Element` (symbol): used by the default `JSX.createElement` function to\n * identify JSX elements.\n * - `Fragment` (symbol): used by the default `JSX.createElement` function to\n * identify JSX fragments. Referenced by the default value for\n * `JSX.pragmaFrag`.\n *\n * Modifying these properties will change how JSX syntax gets compiled.\n *\n * For instance, to use React for JSX, you could either replace\n * `JSX.createElement` and `JSX.Fragment` with React's versions:\n *\n * ```ts\n * import * as React from \"npm:react\";\n *\n * JSX.createElement = React.createElement;\n * JSX.Fragment = React.Fragment;\n * ```\n *\n * Or, you could change `JSX.pragma` and `JSX.pragmaFrag` to reference React\n * directly:\n *\n * ```ts\n * JSX.pragma = \"React.createElement\";\n * JSX.pragmaFrag = \"React.Fragment\";\n * ```\n *\n * Note however, that changes to `pragma` and `pragmaFrag` will only affect JSX\n * appearing in files which are loaded _after_ the change, but changing\n * `createElement` and `Fragment` will affect all JSX syntax appearing after the\n * change, even within the same file.\n *\n * Whichever approach you take, you should also update `types.JSX.Element` and\n * `types.JSX.Fragment` such that the expression `types.JSX.Element(<a />) &&\n * types.JSX.Fragment(<></>)` is always `true`. To do that for React, you would\n * do:\n *\n * ```ts\n * types.JSX.Element = React.isValidElement;\n * types.JSX.Fragment = (value) => {\n * return React.isValidElement(value) && value.type === React.Fragment;\n * };\n * ```\n */\ndeclare namespace JSX {\n /**\n *\n * A string containing the expression that should be called to create JSX\n * elements. yavascript's internals use this string to transpile JSX syntax.\n *\n * The default value is \"JSX.createElement\".\n *\n * If changed, any JSX code loaded afterwards will use a different expression.\n *\n * Note that if you change this, you need to verify that the following\n * expression always evaluates to `true` (by changing `types.JSX.Element` and\n * `types.JSX.Fragment`):\n *\n * ```jsx\n * types.JSX.Element(<a />) && types.JSX.Fragment(<></>);\n * ```\n *\n * Failure to uphold this guarantee indicates a bug.\n *\n * For more info, including info on how to change how JSX is compiled, see\n * {@link JSX}.\n */\n export let pragma: string;\n\n /**\n * A string containing the expression that should be used as the first\n * parameter when creating JSX fragment elements. yavascript's internals use\n * this string to transpile JSX syntax.\n *\n * Defaults to \"JSX.Fragment\".\n *\n * If changed, any JSX code loaded afterwards will use a different expression.\n *\n * Note that if you change this, you need to verify that the following\n * expression always evaluates to `true` (by changing `types.JSX.Element` and\n * `types.JSX.Fragment`):\n *\n * ```jsx\n * types.JSX.Element(<a />) && types.JSX.Fragment(<></>);\n * ```\n *\n * Failure to uphold this guarantee indicates a bug.\n *\n * For more info, including info on how to change how JSX is compiled, see\n * {@link JSX}.\n */\n export let pragmaFrag: string;\n\n /**\n * `JSX.Element` is a Symbol. The default implementation of\n * `JSX.createElement` creates objects whose `$$typeof` property is set to\n * `JSX.Element`, and type validator functions under the `types.JSX.*`\n * namespace look for this property in order to determine whether an object is\n * a JSX element, as created via `JSX.createElement` or JSX syntax.\n *\n * ```jsx\n * // This gets compiled internally by yavascript into:\n * // const a = JSX.createElement('a', null);\n * const a = <a />;\n *\n * console.log(a);\n * // {\n * // $$typeof: Symbol(JSX.Element)\n * // type: \"a\"\n * // props: null\n * // key: null\n * // }\n *\n * console.log(a.$$typeof === JSX.Element);\n * // true\n * ```\n *\n * There is also a TypeScript type called `JSX.Element` which is a type for\n * the JSX element objects as created by `JSX.createElement` or JSX syntax.\n *\n * If you modify properties on the JSX global such that the default\n * implementation of `JSX.createElement` is no longer used (eg. by replacing\n * it with `React.createElement`), this value may no longer be relevant.\n * However, the default JSX element object shape is designed to match\n * React/Preact/etc.\n *\n * For more info, including info on how to change how JSX is compiled, see\n * {@link JSX}.\n *\n */\n export const Element: unique symbol;\n\n /**\n * The TypeScript type for JSX Element objects created by the default\n * implementation of `JSX.createElement`.\n */\n export interface Element<\n Props = { [key: string | symbol | number]: any },\n Type = any\n > {\n $$typeof: typeof Element;\n type: Type;\n props: Props;\n key: string | number | null;\n }\n\n /**\n *\n * `JSX.Fragment` is a Symbol which is used to indicate whether a JSX element\n * is a JSX fragment.\n *\n * ```jsx\n * // This gets compiled internally by yavascript into:\n * // const a = JSX.createElement(JSX.Fragment, null);\n * const frag = <></>;\n *\n * console.log(frag);\n * // {\n * // $$typeof: Symbol(JSX.Element)\n * // type: Symbol(JSX.Fragment)\n * // props: null\n * // key: null\n * // }\n *\n * console.log(a.type === JSX.Fragment);\n * // true\n * ```\n *\n * There is also a TypeScript type called `JSX.Fragment` which is a type for\n * the JSX fragment element objects as created by `JSX.createElement` or JSX\n * syntax.\n *\n * If you modify properties on the JSX global such that `JSX.Fragment` is no\n * longer used (eg. by replacing it with `React.Fragment`), this value may no\n * longer be relevant.\n *\n * For more info, including info on how to change how JSX is compiled, see\n * {@link JSX}.\n */\n export const Fragment: unique symbol;\n\n /**\n * The TypeScript type for JSX Element objects whose type is `JSX.Fragment`,\n * which is what yavascript creates internally when JSX fragment syntax\n * (`<></>`) is used.\n *\n * If you modify properties on the JSX global such that `JSX.Fragment` is no\n * longer used (eg. by replacing it with `React.Fragment`), this type may no\n * longer be relevant.\n */\n export type Fragment = Element<{}, typeof Fragment>;\n\n /**\n * The JSX element builder function, which gets invoked internally by\n * yavascript whenever JSX syntax is used (unless `JSX.pragma` gets changed by\n * the user).\n *\n * Note that if you change this, you need to verify that the following\n * expression always evaluates to `true` (by changing `types.JSX.Element` and\n * `types.JSX.Fragment`):\n *\n * ```jsx\n * types.JSX.Element(<a />) && types.JSX.Fragment(<></>);\n * ```\n *\n * Failure to uphold this guarantee indicates a bug.\n *\n * For more info, including info on how to change how JSX is compiled, see\n * {@link JSX}.\n *\n */\n export let createElement: {\n <Type extends string | typeof Fragment | ((...args: any) => any)>(\n type: Type\n ): Element<{}, Type>;\n <\n Type extends string | typeof Fragment | ((...args: any) => any),\n Props extends { [key: string | number | symbol]: any }\n >(\n type: Type,\n props: Props\n ): Element<Props, Type>;\n\n <\n Type extends string | typeof Fragment | ((...args: any) => any),\n Props extends { [key: string | number | symbol]: any },\n Children extends Array<any>\n >(\n type: Type,\n props: Props,\n ...children: Children\n ): Element<Props & { children: Children }, Type>;\n\n <\n Type extends string | typeof Fragment | ((...args: any) => any),\n Children extends Array<any>\n >(\n type: Type,\n ...children: Children\n ): Element<{ children: Children }, Type>;\n };\n}\n\n/**\n * The `YAML` namespace contains functions which can serialize and deserialize\n * YAML documents, following the same pattern as JavaScript's `JSON` builtin.\n */\ndeclare const YAML: {\n /**\n * Converts a YAML document string into a JavaScript value. It works the same\n * way that `JSON.parse` does, but for YAML.\n */\n parse(\n input: string,\n reviver?: (this: any, key: string, value: any) => any\n ): any;\n\n /**\n * Converts a JavaScript value into a YAML document string. It works the same\n * way that `JSON.stringify` does, but for YAML.\n */\n stringify(\n input: any,\n replacer?:\n | ((this: any, key: string, value: any) => any)\n | (number | string)[]\n | null,\n indent?: number\n ): string;\n};\n\n/**\n * Serializes or deserializes CSV data.\n *\n * The `CSV` object contains a `parse` function and a `stringify` function which\n * can be used to parse strings of CSV (comma-separated values) data into\n * arrays-of-arrays-of-strings and serialize arrays-of-arrays-of-strings into\n * strings of CSV data.\n *\n * Its interface is similar to `JSON.parse` and `JSON.stringify`, but CSV does\n * not support the spacing/replacer/reviver options that `JSON.parse` and\n * `JSON.stringify` have.\n */\ndeclare const CSV: {\n /**\n * Parse a CSV string into an Array of Arrays of strings.\n *\n * The outer array holds the rows, and the inner arrays hold the items in\n * each row.\n */\n parse(input: string): Array<Array<string>>;\n\n /**\n * Convert an Array of Arrays of strings into a CSV string.\n *\n * The outer array holds the rows, and the inner arrays hold the items in\n * each row.\n */\n stringify(input: Array<Array<string>>): string;\n};\n\n/**\n * An object with a `parse` function and a `stringify` function which can be\n * used to parse TOML document strings into objects and serialize objects into\n * TOML document strings.\n *\n * Its interface is similar to `JSON.parse` and `JSON.stringify`, but\n * `TOML.parse` and `TOML.stringify` do not support the spacing/replacer/reviver\n * options that `JSON.parse` and `JSON.stringify` do.\n */\ndeclare var TOML: {\n /**\n * Parse a TOML document string (`data`) into an object.\n */\n parse(data: string): { [key: string]: any };\n /**\n * Convert an object into a TOML document.\n */\n stringify(data: { [key: string]: any }): string;\n};\n\ninterface RegExpConstructor {\n /**\n * The function `RegExp.escape` accepts an input string and prefixes with `\\`\n * those characters in that string which have a special meaning when appearing\n * in a regular expression.\n *\n * The implementation is based on the stage 2 ECMAScript proposal of the same\n * name: https://github.com/tc39/proposal-regex-escaping\n */\n escape(str: any): string;\n}\n\ninterface StringConstructor {\n /**\n * The function `String.dedent` can be used to remove leading indentation from\n * a string. It is commonly used as a tagged template function, but you can\n * also call it and pass in a string.\n *\n * Note that the first line of the string must be empty.\n *\n * `String.dedent` is the default export from the npm package `string-dedent`.\n * See its readme on npm for more info:\n * https://www.npmjs.com/package/string-dedent\n */\n dedent: {\n /**\n * Removes leading minimum indentation from the string `input`.\n * The first line of `input` MUST be empty.\n *\n * For more info, see: https://www.npmjs.com/package/string-dedent#usage\n */\n (input: string): string;\n\n /**\n * Removes leading minimum indentation from the tagged template literal.\n * The first line of the template literal MUST be empty.\n *\n * For more info, see: https://www.npmjs.com/package/string-dedent#usage\n */\n (\n strings: readonly string[] | ArrayLike<string>,\n ...substitutions: unknown[]\n ): string;\n\n /**\n * Wrap another template tag function such that tagged literals\n * become dedented before being passed to the wrapped function.\n *\n * For more info, see: https://www.npmjs.com/package/string-dedent#usage\n */\n <\n Func extends (\n strings: readonly string[] | ArrayLike<string>,\n ...substitutions: any[]\n ) => string\n >(\n input: Func\n ): Func;\n };\n}\n\n/**\n * Opens the resource at the given path or URL using the operating system's\n * default application or handler.\n *\n * Examples:\n *\n * ```ts\n * openUrl(\"/home/me/stuff/code.txt\"); // opens code.txt in your default text editor\n * openUrl(\"code.txt\"); // same as above, using relative path\n * openUrl(\"file:///home/me/stuff/code.txt\"); // same as above, using file:// url\n *\n * openUrl(\"IMG_001.jpg\"); // opens IMG_001.jpg in your default image viewer\n *\n * openUrl(\"https://example.com/\") // opens example.com in your default web browser\n * ```\n */\ndeclare function openUrl(urlOrFilePath: string | Path): void;\n\n// prettier-ignore\n/** Any integer in the range [0, 255]. */\ndeclare type byte =\n| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 \n| 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 \n| 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 \n| 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 \n| 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 \n| 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 \n| 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 \n| 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 \n| 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 \n| 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 \n| 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 \n| 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 \n| 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 \n| 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 \n| 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 \n| 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255;\n\n// Convenience aliases to provide parity with TypeScript types.\ndeclare var number: NumberConstructor;\ndeclare var string: StringConstructor;\ndeclare var boolean: BooleanConstructor;\ndeclare var bigint: BigIntConstructor;\ndeclare var symbol: SymbolConstructor;\n\ndeclare type TypedArray =\n | Int8Array\n | Uint8Array\n | Uint8ClampedArray\n | Int16Array\n | Uint16Array\n | Int32Array\n | Uint32Array\n | Float32Array\n | Float64Array;\ndeclare type TypedArrayConstructor =\n | Int8ArrayConstructor\n | Uint8ArrayConstructor\n | Uint8ClampedArrayConstructor\n | Int16ArrayConstructor\n | Uint16ArrayConstructor\n | Int32ArrayConstructor\n | Uint32ArrayConstructor\n | Float32ArrayConstructor\n | Float64ArrayConstructor;\n\ninterface ErrorOptions {\n [key: string]: any;\n}\n\n/**\n * For compatibility with Node.js scripts, the global object is accessible via\n * the global variable named \"global\".\n */\ndeclare var global: typeof globalThis;\n\n/**\n * A `process` global is provided for rudimentary compatibility with Node.js\n * scripts. It contains a subset of the properties found on the Node.js\n * `process` global, which each forward to their corresponding yavascript API.\n *\n * For instance, `process.env` is a getter that returns {@link env}, and\n * `process.argv` is a getter that returns {@link scriptArgs}.\n *\n * If you are writing yavascript-specific code, you should use yavascript's APIs\n * instead of `process`.\n */\ndeclare var process: {\n version: string;\n versions: {\n node: string;\n yavascript: string;\n unicode: string;\n };\n arch: string;\n /** Same as the global {@link env}. */\n readonly env: { [key: string]: string | undefined };\n /** Same as the global {@link scriptArgs}. */\n readonly argv: Array<string>;\n /** Same as `scriptArgs[0]`. */\n readonly argv0: string;\n /**\n * Shortcut for `os.realpath(os.execPath())`, using the QuickJS {@link os}\n * module.\n */\n readonly execPath: string;\n /**\n * Uses `std.getExitCode()` and `std.setExitCode()` from the QuickJS\n * {@link std} module.\n */\n exitCode: number;\n /**\n * Uses `std.exit()` from the QuickJS {@link std} module.\n */\n exit(code?: number | null | undefined): void;\n};\n\n// ==========================================\n// ------------------------------------------\n// QuickJS APIs, which YavaScript builds upon\n// ------------------------------------------\n// ==========================================\ninterface ObjectConstructor {\n /**\n * Convert the specified value to a primitive value.\n *\n * The provided hint indicates a preferred return type, which may or may not\n * be respected by the engine.\n *\n * See the abstract operation \"ToPrimitive\" in the ECMAScript standard for\n * more info.\n */\n toPrimitive(\n input: any,\n hint: \"string\" | \"number\" | \"default\"\n ): string | number | bigint | boolean | undefined | symbol | null;\n\n /**\n * Returns a boolean indicating whether the specified value is a primitive value.\n */\n isPrimitive(input: any): boolean;\n}\n\ninterface StringConstructor {\n /**\n * A no-op template literal tag.\n *\n * https://github.com/tc39/proposal-string-cooked\n */\n cooked(\n strings: readonly string[] | ArrayLike<string>,\n ...substitutions: any[]\n ): string;\n}\n\ninterface SymbolConstructor {\n /**\n * A method that changes the result of using the `typeof` operator on the\n * object. Called by the semantics of the typeof operator.\n *\n * Note that the following semantics will come into play when use of the\n * `typeof` operator causes the engine to call a `Symbol.typeofValue` method\n * on an object:\n *\n * - If the method returns any value other than one of the string values\n * which are normally the result of using the `typeof` operator, the engine\n * behaves as if no `Symbol.typeofValue` method was present on the object.\n * - If an error is thrown from this method, or an error is thrown while\n * accessing this property, the error will be silently ignored, and the\n * engine will behave as if no `Symbol.typeofValue` method was present on\n * the object.\n * - If this property is present on an object, but the value of that property\n * is not a function, the engine will not consider that value when\n * determining the result of the `typeof` operation (it'll ignore it).\n */\n readonly typeofValue: unique symbol;\n\n /**\n * To override operators (+, -, ==, etc) for an object, set its\n * `Symbol.operatorSet` property to an `OperatorSet` object, which can be\n * created via `Operators.create`.\n */\n readonly operatorSet: unique symbol;\n}\n\n/**\n * An object that, if placed on another object's `Symbol.operatorSet` property,\n * will overload its operators to behave as defined by the functions this\n * OperatorSet was constructed with.\n *\n * You can create an OperatorSet via `Operators(...)` or\n * `Operators.create(...)`.\n */\ndeclare type OperatorSet = {\n /**\n * This property is not here at runtime; we just use it to make this type\n * differ from an empty object.\n */\n __is__: \"OperatorSet\";\n};\n\ninterface OperatorFunctions<Left, Right> {\n \"+\": (left: Left, right: Right) => any;\n \"-\": (left: Left, right: Right) => any;\n \"*\": (left: Left, right: Right) => any;\n \"/\": (left: Left, right: Right) => any;\n \"%\": (left: Left, right: Right) => any;\n \"**\": (left: Left, right: Right) => any;\n \"|\": (left: Left, right: Right) => any;\n \"&\": (left: Left, right: Right) => any;\n \"^\": (left: Left, right: Right) => any;\n \"<<\": (left: Left, right: Right) => any;\n \">>\": (left: Left, right: Right) => any;\n \">>>\": (left: Left, right: Right) => any;\n \"==\": (left: Left, right: Right) => any;\n \"<\": (left: Left, right: Right) => any;\n pos: (left: Left, right: Right) => any;\n neg: (left: Left, right: Right) => any;\n \"++\": (left: Left, right: Right) => any;\n \"--\": (left: Left, right: Right) => any;\n \"~\": (left: Left, right: Right) => any;\n}\n\ninterface SelfOperators<T> extends Partial<OperatorFunctions<T, T>> {\n left?: undefined;\n right?: undefined;\n}\n\ninterface LeftOperators<T, Left> extends Partial<OperatorFunctions<Left, T>> {\n left: {};\n right?: undefined;\n}\n\ninterface RightOperators<T, Right>\n extends Partial<OperatorFunctions<T, Right>> {\n left?: undefined;\n right: {};\n}\n\ninterface OperatorsConstructor {\n /**\n * Creates a new OperatorSet object, which should be placed on an object's\n * Symbol.operatorSet property.\n */\n <T>(\n selfOperators?: SelfOperators<T>,\n ...otherOperators: Array<LeftOperators<T, any> | RightOperators<T, any>>\n ): OperatorSet;\n\n /**\n * Creates a new OperatorSet object, which should be placed on an object's\n * Symbol.operatorSet property.\n */\n create: <T>(\n selfOperators?: SelfOperators<T>,\n ...otherOperators: Array<LeftOperators<T, any> | RightOperators<T, any>>\n ) => OperatorSet;\n\n /**\n * In math mode, the BigInt division and power operators can be overloaded by\n * using this function.\n */\n updateBigIntOperators(\n ops: Pick<OperatorFunctions<BigInt, BigInt>, \"/\" | \"**\">\n ): void;\n}\n\ndeclare var Operators: OperatorsConstructor;\n\ninterface Number {\n [Symbol.operatorSet]: OperatorSet;\n}\n\ninterface Boolean {\n [Symbol.operatorSet]: OperatorSet;\n}\n\ninterface String {\n [Symbol.operatorSet]: OperatorSet;\n}\n\ninterface BigInt {\n [Symbol.operatorSet]: OperatorSet;\n}\n\ninterface BigIntConstructor {\n /**\n * Return trunc(a/b).\n *\n * b = 0 raises a RangeError exception.\n */\n tdiv(a: bigint, b: bigint): bigint;\n\n /**\n * Return \\lfloor a/b \\rfloor.\n *\n * b = 0 raises a RangeError exception.\n */\n fdiv(a: bigint, b: bigint): bigint;\n\n /**\n * Return \\lceil a/b \\rceil.\n *\n * b = 0 raises a RangeError exception.\n */\n cdiv(a: bigint, b: bigint): bigint;\n\n /**\n * Return sgn(b) \\lfloor a/{|b|} \\rfloor (Euclidian division).\n *\n * b = 0 raises a RangeError exception.\n */\n ediv(a: bigint, b: bigint): bigint;\n\n /**\n * Perform trunc(a/b) and return an array of two elements. The first element\n * is the quotient, the second is the remainder.\n *\n * b = 0 raises a RangeError exception.\n */\n tdivrem(a: bigint, b: bigint): [bigint, bigint];\n\n /**\n * Perform \\lfloor a/b \\rfloor and return an array of two elements. The first\n * element is the quotient, the second is the remainder.\n *\n * b = 0 raises a RangeError exception.\n */\n fdivrem(a: bigint, b: bigint): [bigint, bigint];\n\n /**\n * Perform \\lceil a/b \\rceil and return an array of two elements. The first\n * element is the quotient, the second is the remainder.\n *\n * b = 0 raises a RangeError exception.\n */\n cdivrem(a: bigint, b: bigint): [bigint, bigint];\n\n /**\n * Perform sgn(b) \\lfloor a/{|b|} \\rfloor (Euclidian division) and return an\n * array of two elements. The first element is the quotient, the second is\n * the remainder.\n *\n * b = 0 raises a RangeError exception.\n */\n edivrem(a: bigint, b: bigint): [bigint, bigint];\n\n /**\n * Return \\lfloor \\sqrt(a) \\rfloor.\n *\n * A RangeError exception is raised if a < 0.\n */\n sqrt(a: bigint): bigint;\n\n /**\n * Return an array of two elements. The first element is\n * \\lfloor \\sqrt{a} \\rfloor. The second element is\n * a-\\lfloor \\sqrt{a} \\rfloor^2.\n *\n * A RangeError exception is raised if a < 0.\n */\n sqrtrem(a: bigint): [bigint, bigint];\n\n /**\n * Return -1 if a \\leq 0 otherwise return \\lfloor \\log2(a) \\rfloor.\n */\n floorLog2(a: bigint): bigint;\n\n /**\n * Return the number of trailing zeros in the two’s complement binary representation of a.\n *\n * Return -1 if a=0.\n */\n ctz(a: bigint): bigint;\n}\n\ndeclare type BigFloatRoundingMode = number & {\n /**\n * This property is not here at runtime; we just use it to make this type\n * differ from a normal number\n */\n __is__: \"BigFloatRoundingMode\";\n};\n\ninterface BigFloatEnvConstructor {\n /**\n * Creates a new floating point environment. Its status flags are reset.\n *\n * - If unspecified, `precision` defaults to the precision from the global floating point environment.\n * - If unspecified, `roundingMode` defaults to RNDN.\n */\n new (precision?: number, roundingMode?: BigFloatRoundingMode): BigFloatEnv;\n\n /**\n * The mantissa precision in bits of the global floating point environment.\n *\n * The initial value is 113.\n */\n get prec(): number;\n\n /**\n * The exponent size in bits of the global floating point environment,\n * assuming an IEEE 754 representation.\n *\n * The initial value is 15.\n */\n get expBits(): number;\n\n /**\n * Sets the mantissa precision of the global floating point environment to\n * `prec` and the exponent size to `expBits`, then calls the function `func`.\n * Then the precision and exponent size are reset to their previous values\n * and the return value of `func` is returned (or an exception is raised if\n * `func` raised an exception).\n *\n * If expBits is undefined, it is set to {@link BigFloatEnv.expBitsMax}.\n *\n * @param func The function to call within the modified environment\n * @param prec The mantissa precision (in bits) to use in the modified environment\n * @param expBits The exponent size (in bits) to use in the modified environment. Defaults to {@link BigFloatEnv.expBitsMax}.\n */\n setPrec<Ret>(func: () => Ret, prec: number, expBits?: number): Ret;\n\n /**\n * Integer; the minimum allowed precision. Must be at least 2.\n */\n readonly precMin: number;\n\n /**\n * Integer; the maximum allowed precision. Must be at least 113.\n */\n readonly precMax: number;\n\n /**\n * Integer; the minimum allowed exponent size in bits. Must be at least 3.\n */\n readonly expBitsMin: number;\n\n /**\n * Integer; the maximum allowed exponent size in bits. Must be at least 15.\n */\n readonly expBitsMax: number;\n\n /**\n * Round to nearest, with ties to even rounding mode.\n */\n readonly RNDN: BigFloatRoundingMode;\n\n /**\n * Round to zero rounding mode.\n */\n readonly RNDZ: BigFloatRoundingMode;\n\n /**\n * Round to -Infinity rounding mode.\n */\n readonly RNDD: BigFloatRoundingMode;\n\n /**\n * Round to +Infinity rounding mode.\n */\n readonly RNDU: BigFloatRoundingMode;\n\n /**\n * Round to nearest, with ties away from zero rounding mode.\n */\n readonly RNDNA: BigFloatRoundingMode;\n\n /**\n * Round away from zero rounding mode.\n */\n readonly RNDA: BigFloatRoundingMode;\n\n /**\n * Faithful rounding mode. The result is non-deterministically rounded to\n * -Infinity or +Infinity.\n *\n * This rounding mode usually gives a faster and deterministic running time\n * for the floating point operations.\n */\n readonly RNDF: BigFloatRoundingMode;\n\n prototype: BigFloatEnv;\n}\n\ndeclare var BigFloatEnv: BigFloatEnvConstructor;\n\n/**\n * A BigFloatEnv contains:\n *\n * - the mantissa precision in bits\n * - the exponent size in bits assuming an IEEE 754 representation;\n * - the subnormal flag (if true, subnormal floating point numbers can be generated by the floating point operations).\n * - the rounding mode\n * - the floating point status. The status flags can only be set by the floating point operations. They can be reset with BigFloatEnv.prototype.clearStatus() or with the various status flag setters.\n */\ninterface BigFloatEnv {\n /**\n * The mantissa precision, in bits.\n *\n * If precision was not specified as an argument to the BigFloatEnv\n * constructor, defaults to the precision value of the global floating-point\n * environment ({@link BigFloatEnv.prec}).\n */\n get prec(): number;\n set prec(newValue: number);\n\n /**\n * The exponent size in bits assuming an IEEE 754 representation.\n *\n * Defaults to the exponent size of the global floating-point environment\n * ({@link BigFloatEnv.expBits}).\n */\n get expBits(): number;\n set expBits(newValue: number);\n\n /**\n * The rounding mode.\n *\n * If the rounding mode was not specified as an argument to the BigFloatEnv\n * constructor, defaults to {@link BigFloatEnv.RNDN}.\n */\n get rndMode(): BigFloatRoundingMode;\n set rndMode(newMode: BigFloatRoundingMode);\n\n /** subnormal flag. It is false when expBits = expBitsMax. Defaults to false. */\n get subnormal(): boolean;\n set subnormal(newValue: boolean);\n\n /** Status flag; cleared by `clearStatus`. */\n get invalidOperation(): boolean;\n set invalidOperation(newValue: boolean);\n\n /** Status flag; cleared by `clearStatus`. */\n get divideByZero(): boolean;\n set divideByZero(newValue: boolean);\n\n /** Status flag; cleared by `clearStatus`. */\n get overflow(): boolean;\n set overflow(newValue: boolean);\n\n /** Status flag; cleared by `clearStatus`. */\n get underflow(): boolean;\n set underflow(newValue: boolean);\n\n /** Status flag; cleared by `clearStatus`. */\n get inexact(): boolean;\n set inexact(newValue: boolean);\n\n /**\n * Clear the status flags (invalidOperation, divideByZero, overflow,\n * underflow, and inexact).\n */\n clearStatus(): void;\n}\n\ninterface BigFloatConstructor {\n /**\n * If `value` is a numeric type, it is converted to BigFloat without rounding.\n *\n * If `value`` is a string, it is converted to BigFloat using the precision of the global floating point environment ({@link BigFloatEnv.prec}).\n */\n (value: number | string | BigInt | BigFloat): BigFloat;\n\n prototype: BigFloat;\n\n /**\n * The value of {@link Math.LN2} rounded to nearest, ties to even with the\n * current global precision.\n *\n * The constant values are cached for small precisions.\n */\n get LN2(): BigFloat;\n\n /**\n * The value of {@link Math.PI} rounded to nearest, ties to even with\n * the current global precision.\n *\n * The constant values are cached for small precisions.\n */\n get PI(): BigFloat;\n\n /**\n * The value of {@link Number.MIN_VALUE} as a BigFloat.\n */\n get MIN_VALUE(): BigFloat;\n\n /**\n * The value of {@link Number.MAX_VALUE} as a BigFloat.\n */\n get MAX_VALUE(): BigFloat;\n\n /**\n * The value of {@link Number.EPSILON} as a BigFloat.\n */\n get EPSILON(): BigFloat;\n\n /**\n * Rounds the floating point number `a` according to the floating point\n * environment `e` or the global environment if `e` is undefined.\n */\n fpRound(a: BigFloat, e?: BigFloatEnv): BigFloat;\n\n /**\n * Parses the string `a` as a floating point number in radix `radix`.\n *\n * The radix is 0 (default) or from 2 to 36. The radix 0 means radix 10\n * unless there is a hexadecimal or binary prefix.\n *\n * The result is rounded according to the floating point environment `e` or\n * the global environment if `e` is undefined.\n */\n parseFloat(a: string, radix?: number, e?: BigFloatEnv): BigFloat;\n\n /**\n * Returns true if `a` is a finite bigfloat. Returns false otherwise.\n */\n isFinite(a: BigFloat): boolean;\n\n /**\n * Returns true if a is a NaN bigfloat. Returns false otherwise.\n */\n isNaN(a: BigFloat): boolean;\n\n /**\n * Adds `a` and `b` together and rounds the resulting floating point number\n * according to the floating point environment `e`, or the global environment\n * if e is undefined.\n *\n * If `e` is specified, the floating point status flags on `e` are updated.\n */\n add(a: BigFloat, b: BigFloat, e?: BigFloatEnv): BigFloat;\n\n /**\n * Subtracts `b` from `a` and rounds the resulting floating point number\n * according to the floating point environment `e`, or the global environment\n * if e is undefined.\n *\n * If `e` is specified, the floating point status flags on `e` are updated.\n */\n sub(a: BigFloat, b: BigFloat, e?: BigFloatEnv): BigFloat;\n\n /**\n * Multiplies `a` and `b` together and rounds the resulting floating point\n * number according to the floating point environment `e`, or the global\n * environment if e is undefined.\n *\n * If `e` is specified, the floating point status flags on `e` are updated.\n */\n mul(a: BigFloat, b: BigFloat, e?: BigFloatEnv): BigFloat;\n\n /**\n * Divides `a` by `b` and rounds the resulting floating point number\n * according to the floating point environment `e`, or the global environment\n * if e is undefined.\n *\n * If `e` is specified, the floating point status flags on `e` are updated.\n */\n div(a: BigFloat, b: BigFloat, e?: BigFloatEnv): BigFloat;\n\n /**\n * Rounds `x` down to the nearest integer.\n *\n * No additional rounding (ie. BigFloatEnv-related rounding) is performed.\n */\n floor(x: BigFloat): BigFloat;\n\n /**\n * Rounds `x` up to the nearest integer.\n *\n * No additional rounding (ie. BigFloatEnv-related rounding) is performed.\n */\n ceil(x: BigFloat): BigFloat;\n\n /**\n * Rounds `x` to the nearest integer.\n *\n * No additional rounding (ie. BigFloatEnv-related rounding) is performed.\n */\n round(x: BigFloat): BigFloat;\n\n /**\n * Truncates the fractional part of `x`, resulting in an integer.\n *\n * No additional rounding (ie. BigFloatEnv-related rounding) is performed.\n */\n trunc(x: BigFloat): BigFloat;\n\n /**\n * Returns the absolute value of `x`.\n *\n * No additional rounding (ie. BigFloatEnv-related rounding) is performed.\n */\n abs(x: BigFloat): BigFloat;\n\n /**\n * Floating point remainder. The quotient is truncated to zero.\n *\n * `e` is an optional floating point environment.\n */\n fmod(x: BigFloat, y: BigFloat, e?: BigFloatEnv): BigFloat;\n\n /**\n * Floating point remainder. The quotient is rounded to the nearest integer\n * with ties to even.\n *\n * `e` is an optional floating point environment.\n */\n remainder(x: BigFloat, y: BigFloat, e?: BigFloatEnv): BigFloat;\n\n /**\n * Square root. Returns a rounded floating point number.\n *\n * e is an optional floating point environment.\n */\n sqrt(x: BigFloat, e?: BigFloatEnv): BigFloat;\n\n /**\n * Returns a rounded floating point number.\n *\n * `e` is an optional floating point environment.\n */\n sin(x: BigFloat, e?: BigFloatEnv): BigFloat;\n\n /**\n * Returns a rounded floating point number.\n *\n * `e` is an optional floating point environment.\n */\n cos(x: BigFloat, e?: BigFloatEnv): BigFloat;\n\n /**\n * Returns a rounded floating point number.\n *\n * `e` is an optional floating point environment.\n */\n tan(x: BigFloat, e?: BigFloatEnv): BigFloat;\n\n /**\n * Returns a rounded floating point number.\n *\n * `e` is an optional floating point environment.\n */\n asin(x: BigFloat, e?: BigFloatEnv): BigFloat;\n\n /**\n * Returns a rounded floating point number.\n *\n * `e` is an optional floating point environment.\n */\n acos(x: BigFloat, e?: BigFloatEnv): BigFloat;\n\n /**\n * Returns a rounded floating point number.\n *\n * `e` is an optional floating point environment.\n */\n atan(x: BigFloat, e?: BigFloatEnv): BigFloat;\n\n /**\n * Returns a rounded floating point number.\n *\n * `e` is an optional floating point environment.\n */\n atan2(x: BigFloat, y: BigFloat, e?: BigFloatEnv): BigFloat;\n\n /**\n * Returns a rounded floating point number.\n *\n * `e` is an optional floating point environment.\n */\n exp(x: BigFloat, e?: BigFloatEnv): BigFloat;\n\n /**\n * Returns a rounded floating point number.\n *\n * `e` is an optional floating point environment.\n */\n log(x: BigFloat, e?: BigFloatEnv): BigFloat;\n\n /**\n * Returns a rounded floating point number.\n *\n * `e` is an optional floating point environment.\n */\n pow(x: BigFloat, y: BigFloat, e?: BigFloatEnv): BigFloat;\n}\n\ndeclare var BigFloat: BigFloatConstructor;\n\n/**\n * The BigFloat type represents floating point numbers in base 2 with the IEEE 754 semantics.\n *\n * A floating point number is represented as a sign, mantissa and exponent.\n *\n * The special values NaN, +/-Infinity, +0 and -0 are supported.\n *\n * The mantissa and exponent can have any bit length with an implementation specific minimum and maximum.\n */\ninterface BigFloat {\n valueOf(): BigFloat;\n\n /** radix must be between 2 and 36 */\n toString(radix?: number): string;\n\n /**\n * Returns a string containing a number represented either in exponential or\n * fixed-point notation with a specified number of digits.\n *\n * @param precision Number of significant digits. There is no range limit on this number.\n * @param roundingMode The rounding mode to use when representing the value. Defaults to {@link BigFloatEnv.RNDNA}.\n * @param radix The base to use when representing the value. Must be an integer between 2 and 36. Defaults to 10.\n */\n toPrecision(\n precision: number,\n roundingMode?: BigFloatRoundingMode,\n radix?: number\n ): string;\n\n /**\n * Returns a string representing a number in fixed-point notation.\n *\n * @param fractionDigits Number of digits after the decimal point. There is no range limit on this number.\n * @param roundingMode The rounding mode to use when representing the value. Defaults to {@link BigFloatEnv.RNDNA}.\n * @param radix The base to use when representing the value. Must be an integer between 2 and 36. Defaults to 10.\n */\n toFixed(\n fractionDigits: number,\n roundingMode?: BigFloatRoundingMode,\n radix?: number\n ): string;\n\n /**\n * Returns a string containing a number represented in exponential notation.\n *\n * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.\n * @param roundingMode The rounding mode to use when representing the value. Defaults to {@link BigFloatEnv.RNDNA}.\n * @param radix The base to use when representing the value. Must be an integer between 2 and 36. Defaults to 10.\n */\n toExponential(\n fractionDigits: number,\n roundingMode?: BigFloatRoundingMode,\n radix?: number\n ): string;\n\n [Symbol.typeofValue]: () => \"bigfloat\";\n}\n\ndeclare type BigDecimalRoundingMode =\n | \"floor\"\n | \"ceiling\"\n | \"down\"\n | \"up\"\n | \"half-even\"\n | \"half-up\";\n\ndeclare type BigDecimalRoundingObject =\n | {\n /** must be >= 1 */\n maximumSignificantDigits: number;\n roundingMode: BigDecimalRoundingMode;\n }\n | {\n /** must be >= 0 */\n maximumFractionDigits: number;\n roundingMode: BigDecimalRoundingMode;\n };\n\ninterface BigDecimalConstructor {\n (): BigDecimal;\n (value: number | string | BigInt | BigFloat): BigDecimal;\n\n /**\n * Adds together `a` and `b` and rounds the result according to the rounding\n * object `e`. If the rounding object is not present, the operation is\n * executed with infinite precision; in other words, no rounding occurs when\n * the rounding object is not present.\n */\n add(a: BigDecimal, b: BigDecimal, e?: BigDecimalRoundingObject): BigDecimal;\n\n /**\n * Subtracts `b` from `a` and rounds the result according to the rounding\n * object `e`. If the rounding object is not present, the operation is\n * executed with infinite precision; in other words, no rounding occurs when\n * the rounding object is not present.\n */\n sub(a: BigDecimal, b: BigDecimal, e?: BigDecimalRoundingObject): BigDecimal;\n\n /**\n * Multiplies together `a` and `b` and rounds the result according to the\n * rounding object `e`. If the rounding object is not present, the operation\n * is executed with infinite precision; in other words, no rounding occurs\n * when the rounding object is not present.\n */\n mul(a: BigDecimal, b: BigDecimal, e?: BigDecimalRoundingObject): BigDecimal;\n\n /**\n * Divides `a` by `b` and rounds the result according to the rounding object\n * `e`.\n *\n * If the rounding object is not present, an attempt is made to perform the\n * operation with infinite precision. However, not all quotients can be\n * represented with infinite precision. If the quotient cannot be represented\n * with infinite precision, a RangeError is thrown.\n *\n * A RangeError is thrown when dividing by zero.\n */\n div(a: BigDecimal, b: BigDecimal, e?: BigDecimalRoundingObject): BigDecimal;\n\n /**\n * Perform the modulo operation of `a` by `b` and round the result according\n * to the rounding object `e`. If the rounding object is not present, the\n * operation is executed with infinite precision; in other words, no rounding\n * occurs when the rounding object is not present.\n */\n mod(a: BigDecimal, b: BigDecimal, e?: BigDecimalRoundingObject): BigDecimal;\n\n /**\n * Obtain the square root of `a`, rounding the result according to the\n * rounding object `e`.\n *\n * If `a` is less than zero, a RangeError will be thrown.\n *\n * Note that the rounding object is *required*.\n */\n sqrt(a: BigDecimal, e: BigDecimalRoundingObject): BigDecimal;\n\n /**\n * Rounds `a` using the rounding object `e`.\n */\n round(a: BigDecimal, e: BigDecimalRoundingObject): BigDecimal;\n\n prototype: BigDecimal;\n}\n\ndeclare var BigDecimal: BigDecimalConstructor;\n\n/**\n * The BigDecimal type represents floating point numbers in base 10.\n *\n * It is inspired from the proposal available at https://github.com/littledan/proposal-bigdecimal.\n *\n * The BigDecimal floating point numbers are always normalized and finite.\n * There is no concept of -0, Infinity or NaN. By default, all the computations\n * are done with infinite precision.\n */\ninterface BigDecimal {\n /**\n * Returns the bigdecimal primitive value corresponding to this BigDecimal.\n */\n valueOf(): BigDecimal;\n\n /**\n * Converts this BigDecimal to a string with infinite precision in base 10.\n */\n toString(): string;\n\n /**\n * Returns a string containing a number represented either in exponential or\n * fixed-point notation with a specified number of digits.\n *\n * @param precision Number of significant digits. There is no range limit on this number.\n * @param roundingMode The rounding mode to use when representing the value. Defaults to \"half-up\".\n */\n toPrecision(precision: number, roundingMode?: BigDecimalRoundingMode): string;\n\n /**\n * Returns a string representing a number in fixed-point notation.\n *\n * @param fractionDigits Number of digits after the decimal point. There is no range limit on this number.\n * @param roundingMode The rounding mode to use when representing the value. Defaults to \"half-up\".\n */\n toFixed(\n fractionDigits: number,\n roundingMode?: BigDecimalRoundingMode\n ): string;\n\n /**\n * Returns a string containing a number represented in exponential notation.\n *\n * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.\n * @param roundingMode The rounding mode to use when representing the value. Defaults to \"half-up\".\n */\n toExponential(\n fractionDigits: number,\n roundingMode?: BigDecimalRoundingMode\n ): string;\n}\n\n// Note that BigFloat and BigDecimal have custom operator overloads defined in\n// QuickJS, but TypeScript does not support operator overloading. As such,\n// TypeScript will not understand or handle unary/binary operators for BigFloat\n// and BigDecimal properly.\n\n/** npm: @suchipi/print@2.5.0. License: ISC */\n/* (with some QuickJS-specific modifications) */\n\n/*\nCopyright (c) 2016-2022, John Gardner\nCopyright (c) 2022 Lily Skye\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\nANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\nACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\nOR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n/**\n * Options for {@link inspect}.\n */\ndeclare interface InspectOptions {\n /** Whether to display non-enumerable properties. Defaults to false. */\n all?: boolean;\n\n /** Whether to invoke getter functions. Defaults to false. */\n followGetters?: boolean;\n\n /** Whether to display the indexes of iterable entries. Defaults to false. */\n indexes?: boolean;\n\n /** Hide object details after 𝑁 recursions. Defaults to Infinity. */\n maxDepth?: number;\n\n /** If true, don't identify well-known symbols as `@@…`. Defaults to false. */\n noAmp?: boolean;\n\n /** If true, don't format byte-arrays as hexadecimal. Defaults to false. */\n noHex?: boolean;\n\n /** If true, don't display function source code. Defaults to false. */\n noSource?: boolean;\n\n /** Whether to show `__proto__` properties if possible. Defaults to false. */\n proto?: boolean;\n\n /** Whether to sort properties alphabetically. When false, properties are sorted by creation order. Defaults to false. */\n sort?: boolean;\n\n /** Options that control whether and how ANSI terminal escape sequences for colours should be added to the output. Defaults to false, meaning no colours. */\n colours?: boolean | 256 | 8 | InspectColours;\n\n /** Prefix string to use for indentation. Defaults to '\\t'. */\n indent?: string;\n}\n\ndeclare interface InspectColours {\n off?: string | number;\n red?: string | number;\n grey?: string | number;\n green?: string | number;\n darkGreen?: string | number;\n punct?: string | number;\n keys?: string | number;\n keyEscape?: string | number;\n typeColour?: string | number;\n primitive?: string | number;\n escape?: string | number;\n date?: string | number;\n hexBorder?: string | number;\n hexValue?: string | number;\n hexOffset?: string | number;\n reference?: string | number;\n srcBorder?: string | number;\n srcRowNum?: string | number;\n srcRowText?: string | number;\n nul?: string | number;\n nulProt?: string | number;\n undef?: string | number;\n noExts?: string | number;\n frozen?: string | number;\n sealed?: string | number;\n regex?: string | number;\n string?: string | number;\n symbol?: string | number;\n symbolFade?: string | number;\n braces?: string | number;\n quotes?: string | number;\n empty?: string | number;\n dot?: string | number;\n}\n\ndeclare interface InspectFunction {\n /**\n * Generate a human-readable representation of a value.\n *\n * @param value - Value to inspect\n * @param options - Additional settings for refining output\n * @returns A string representation of `value`.\n */\n (value: any, options?: InspectOptions): string;\n\n /**\n * Generate a human-readable representation of a value.\n *\n * @param value - Value to inspect\n * @param key - The value's corresponding member name\n * @param options - Additional settings for refining output\n * @returns A string representation of `value`.\n */\n (value: any, key?: string | symbol, options?: InspectOptions): string;\n\n /**\n * A symbol which can be used to customize how an object gets printed.\n */\n custom: symbol;\n}\n\n/**\n * Generate a human-readable representation of a value.\n *\n * @param value - Value to inspect\n * @param key - The value's corresponding member name\n * @param options - Additional settings for refining output\n * @returns A string representation of `value`.\n */\ndeclare var inspect: InspectFunction;\n\ndeclare interface InspectCustomInputs {\n key: string | symbol;\n type: string;\n brackets: [string, string];\n oneLine: boolean;\n linesBefore: Array<string>;\n linesAfter: Array<string>;\n propLines: Array<string>;\n readonly tooDeep: boolean;\n indent: string;\n typeSuffix: string;\n opts: InspectOptions;\n colours: { [Key in keyof Required<InspectColours>]: string };\n}\n\ndeclare type Interval = { [Symbol.toStringTag]: \"Interval\" };\n\ndeclare function setInterval(func: (...args: any) => any, ms: number): Interval;\ndeclare function clearInterval(interval: Interval): void;\n\n// Definitions of the globals and modules added by quickjs-libc\n\n/**\n * Provides the command line arguments. The first argument is the script name.\n */\ndeclare var scriptArgs: Array<string>;\n\n/** An object representing a file handle. */\ndeclare interface FILE {\n /**\n * Human-readable description of where this FILE points.\n *\n * If `target` is a number, the FILE was opened with fdopen, and `target` is\n * the fd. Otherwise, `target` will be an arbitrary string that describes the\n * file; it may be the absolute path to the file, the relative path to the\n * file at time of its opening, or some other string like \"stdin\" or\n * \"tmpfile\".\n *\n * You should *not* use this property for anything other than logging and\n * debugging. It is *only* provided for debugging and/or troubleshooting\n * purposes. The value of this property could change at any time when\n * upgrading yavascript, even if upgrading by a minor or patch release.\n */\n target: string | number;\n\n /**\n * Close the file handle. Note that for files other than stdin/stdout/stderr,\n * the file will be closed automatically when the `FILE` object is\n * garbage-collected.\n */\n close(): void;\n\n /** Outputs the string with the UTF-8 encoding. */\n puts(...strings: Array<string>): void;\n\n /**\n * Formatted printf.\n *\n * The same formats as the standard C library `printf` are supported. Integer format types (e.g. `%d`) truncate the Numbers or BigInts to 32 bits. Use the `l` modifier (e.g. `%ld`) to truncate to 64 bits.\n */\n printf(fmt: string, ...args: Array<any>): void;\n\n /** Flush the buffered file. Wrapper for C `fflush`. */\n flush(): void;\n\n /** Sync the buffered file to disk. Wrapper for C `fsync`. */\n sync(): void;\n\n /**\n * Seek to a given file position (whence is `std.SEEK_*`).\n *\n * `offset` can be a number or a bigint.\n */\n seek(offset: number, whence: number): void;\n\n /** Return the current file position. */\n tell(): number;\n\n /** Return the current file position as a bigint. */\n tello(): BigInt;\n\n /** Return true if end of file. */\n eof(): boolean;\n\n /** Return the associated OS handle. */\n fileno(): number;\n\n /** Read `length` bytes from the file to the ArrayBuffer `buffer` at byte position `position` (wrapper to the libc `fread`). Returns the number of bytes read, or `0` if the end of the file has been reached. */\n read(buffer: ArrayBuffer, position: number, length: number): number;\n\n /** Write `length` bytes from the ArrayBuffer `buffer` at byte position `position` into the file (wrapper to the libc `fwrite`). Returns the number of bytes written. */\n write(buffer: ArrayBuffer, position: number, length: number): number;\n\n /**\n * Write this file into `target`, using a memory buffer of size `bufferSize`.\n *\n * If `limit` is specified, only that amount of bytes will be read and\n * written. Otherwise, data is read and written until this file reaches EOF.\n *\n * A `limit` of 0 is treated the same as not specifying a limit.\n *\n * Internally, this function uses libc `fread` and `fwrite` in a loop.\n *\n * Returns the number of bytes read and written.\n */\n writeTo(target: FILE, bufferSize: number, limit?: number): number;\n\n /**\n * Return the next line from the file, assuming UTF-8 encoding, excluding the trailing line feed or EOF.\n *\n * If the end of the file has been reached, then `null` will be returned instead of a string.\n *\n * Note: Although the trailing line feed has been removed, a carriage return (`\\r`) may still be present.\n */\n getline(): string | null;\n\n /** Read `maxSize` bytes from the file and return them as a string assuming UTF-8 encoding. If `maxSize` is not present, the file is read up its end. */\n readAsString(maxSize?: number): string;\n\n /** Return the next byte from the file. Return -1 if the end of file is reached. */\n getByte(): number;\n\n /** Write one byte to the file. */\n putByte(value: number): void;\n\n /**\n * Set the buffering mode and buffer size for the file stream (wrapper to the libc `setvbuf()`).\n *\n * Note that unlike the libc setvbuf, the \"buffer\" argument is not supported, and therefore is not present.\n *\n * @param mode The buffering mode to use. It can be one of the following values: `std._IOFBF` for full buffering, `std._IOLBF` for line buffering, or `std._IONBF` for no buffering.\n * @param size The size to resize the internal in-memory buffer for this file to.\n */\n setvbuf(mode: number, size: number): void;\n}\n\ndeclare module \"quickjs:std\" {\n /**\n * Set the exit code that the process should exit with in the future, if it\n * exits normally.\n *\n * Can only be called from the main thread.\n *\n * This exit code will only be used if the process exits \"normally\", ie, when\n * there are no more pending JS tasks/listeners. If an unhandled exception is\n * thrown, the process will always exit with status `1`, regardless of the\n * status code passed to `setExitCode`. If someone calls {@link exit} and\n * passes in a status code, that status code will take precedence over the\n * status code passed to `setExitCode`.\n *\n * @param statusCode The future exit code; 0 for success, nonzero for failure.\n */\n export function setExitCode(statusCode: number): void;\n\n /**\n * Return the exit code that was previously set by {@link setExitCode}, or 0 if\n * it hasn't yet been set.\n *\n * Can only be called from the main thread.\n */\n export function getExitCode(): number;\n\n /**\n * Exit the process with the provided status code.\n *\n * Can only be called from the main thread.\n *\n * If `statusCode` is not provided, a value previously passed into\n * {@link setExitCode} will be used. If no value was previously passed into\n * setExitCode, `0` will be used.\n *\n * @param statusCode The exit code; 0 for success, nonzero for failure.\n */\n export function exit(statusCode?: number): never;\n\n /**\n * Load the file `filename` and return it as a string assuming UTF-8 encoding.\n *\n * @param filename - The relative or absolute path to the file to load. Relative paths are resolved relative to the process's current working directory.\n */\n export function loadFile(filename: string): string;\n\n /**\n * Return a boolean indicating whether the provided value is a FILE object.\n *\n * @param value - The value to check.\n * @returns Whether the value was a `FILE` or not.\n */\n export function isFILE(value: any): boolean;\n\n /**\n * Open a file (wrapper to the libc `fopen()`).\n * Return the FILE object.\n *\n * @param filename - The relative or absolute path to the file to open. Relative paths are resolved relative to the process's current working directory.\n * @param flags - A string containing any combination of the characters 'r', 'w', 'a', '+', and/or 'b'.\n * @returns The opened FILE object.\n */\n export function open(filename: string, flags: string): FILE;\n\n /**\n * Open a process by creating a pipe (wrapper to the libc `popen()`).\n * Return the FILE object.\n *\n * @param command - The command line to execute. Gets passed via `/bin/sh -c`.\n * @param flags - A string containing any combination of the characters 'r', 'w', 'a', '+', and/or 'b'.\n * @returns The opened FILE object.\n */\n export function popen(command: string, flags: string): FILE;\n\n /**\n * Open a file from a file handle (wrapper to the libc `fdopen()`).\n * Return the FILE object.\n *\n * @param fd - The file handle to open.\n * @param flags - A string containing any combination of the characters 'r', 'w', 'a', '+', and/or 'b'.\n * @returns The opened FILE object.\n */\n export function fdopen(fd: number, flags: string): FILE;\n\n /**\n * Open a temporary file.\n * Return the FILE object.\n *\n * @returns The opened FILE object.\n */\n export function tmpfile(): FILE;\n\n /** Equivalent to `std.out.puts(str)`. */\n export function puts(...strings: Array<string>): void;\n\n /** Equivalent to `std.out.printf(fmt, ...args)` */\n export function printf(fmt: string, ...args: Array<any>): void;\n\n /** Equivalent to the libc sprintf(). */\n export function sprintf(fmt: string, ...args: Array<any>): void;\n\n /** Wrapper to the libc file stdin. */\n var in_: FILE;\n\n export { in_ as in };\n\n /** Wrapper to the libc file stdout. */\n export var out: FILE;\n\n /** Wrapper to the libc file stderr. */\n export var err: FILE;\n\n /** Constant for {@link FILE.seek}. Declares that pointer offset should be relative to the beginning of the file. See also libc `fseek()`. */\n export var SEEK_SET: number;\n\n /** Constant for {@link FILE.seek}. Declares that the offset should be relative to the current position of the FILE handle. See also libc `fseek()`. */\n export var SEEK_CUR: number;\n\n /** Constant for {@link FILE.seek}. Declares that the offset should be relative to the end of the file. See also libc `fseek()`. */\n export var SEEK_END: number;\n\n /** Constant for {@link FILE.setvbuf}. Declares that the buffer mode should be 'full buffering'. */\n export var _IOFBF: number;\n\n /** Constant for {@link FILE.setvbuf}. Declares that the buffer mode should be 'line buffering'. */\n export var _IOLBF: number;\n\n /** Constant for {@link FILE.setvbuf}. Declares that the buffer mode should be 'no buffering'. */\n export var _IONBF: number;\n\n /** Return the value of the environment variable `name` or `undefined` if it is not defined. */\n export function getenv(name: string): string | undefined;\n\n /** Set the value of the environment variable `name` to the string `value`. */\n export function setenv(name: string, value: string): void;\n\n /** Delete the environment variable `name`. */\n export function unsetenv(name: string): void;\n\n /** Return an object containing the environment variables as key-value pairs. */\n export function getenviron(): { [key: string]: string | undefined };\n\n /**\n * Return the real user ID of the calling process.\n *\n * This function throws an error on windows, because windows doesn't support\n * the same uid/gid paradigm as Unix-like operating systems.\n */\n export function getuid(): number;\n\n /**\n * Return the effective user ID of the calling process.\n *\n * This function throws an error on windows, because windows doesn't support\n * the same uid/gid paradigm as Unix-like operating systems.\n */\n export function geteuid(): number;\n\n /**\n * Return the real group ID of the calling process.\n *\n * This function throws an error on windows, because windows doesn't support\n * the same uid/gid paradigm as Unix-like operating systems.\n */\n export function getgid(): number;\n\n /**\n * Return the effective group ID of the calling process.\n *\n * This function throws an error on windows, because windows doesn't support\n * the same uid/gid paradigm as Unix-like operating systems.\n */\n export function getegid(): number;\n\n /** The type of the object returned by {@link getpwuid}. */\n export interface PasswdEntry {\n name: string;\n passwd: string;\n uid: number;\n gid: number;\n gecos: string;\n dir: string;\n shell: string;\n }\n\n /**\n * Get information from the passwd file entry for the specified user id.\n *\n * See https://linux.die.net/man/3/getpwuid.\n *\n * This function throws an error on windows, because windows doesn't support\n * the same uid/gid paradigm as Unix-like operating systems.\n */\n export function getpwuid(id: number): PasswdEntry;\n\n interface UrlGet {\n /**\n * Download `url` using the `curl` command line utility. Returns string\n * when the http status code is between 200 and 299, and throws otherwise.\n *\n * Pass an object with { full: true } as the second argument to get\n * response headers and status code.\n */\n (url: string): string;\n\n /**\n * Download `url` using the `curl` command line utility. Returns string\n * when the http status code is between 200 and 299, and throws otherwise.\n *\n * Pass an object with { full: true } as the second argument to get\n * response headers and status code.\n */\n (url: string, options: { binary: false }): string;\n\n /**\n * Download `url` using the `curl` command line utility. Returns string\n * when the http status code is between 200 and 299, and throws otherwise.\n *\n * Pass an object with { full: true } as the second argument to get\n * response headers and status code.\n */\n (url: string, options: { full: false }): string;\n\n /**\n * Download `url` using the `curl` command line utility. Returns string\n * when the http status code is between 200 and 299, and throws otherwise.\n *\n * Pass an object with { full: true } as the second argument to get\n * response headers and status code.\n */\n (url: string, options: { binary: false; full: false }): string;\n\n /**\n * Download `url` using the `curl` command line utility. Returns\n * ArrayBuffer when the http status code is between 200 and 299, and throws\n * otherwise.\n *\n * Pass an object with { full: true } as the second argument to get\n * response headers and status code.\n */\n (url: string, options: { binary: true }): ArrayBuffer;\n\n /**\n * Download `url` using the `curl` command line utility. Returns\n * ArrayBuffer when the http status code is between 200 and 299, and throws\n * otherwise.\n *\n * Pass an object with { full: true } as the second argument to get\n * response headers and status code.\n */\n (url: string, options: { binary: true; full: false }): ArrayBuffer;\n\n /**\n * Download `url` using the `curl` command line utility.\n *\n * Returns an object with three properties:\n *\n * - `response`: response body content (string)\n * - `responseHeaders`: headers separated by CRLF (string)\n * - `status`: status code (number)\n */\n (url: string, options: { full: true }): {\n status: number;\n response: string;\n responseHeaders: string;\n };\n\n /**\n * Download `url` using the `curl` command line utility.\n *\n * Returns an object with three properties:\n *\n * - `response`: response body content (string)\n * - `responseHeaders`: headers separated by CRLF (string)\n * - `status`: status code (number)\n */\n (url: string, options: { full: true; binary: false }): {\n status: number;\n response: string;\n responseHeaders: string;\n };\n\n /**\n * Download `url` using the `curl` command line utility.\n *\n * Returns an object with three properties:\n *\n * - `response`: response body content (ArrayBuffer)\n * - `responseHeaders`: headers separated by CRLF (string)\n * - `status`: status code (number)\n */\n (url: string, options: { full: true; binary: true }): {\n status: number;\n response: ArrayBuffer;\n responseHeaders: string;\n };\n }\n\n export var urlGet: UrlGet;\n\n /**\n * Parse `str` using a superset of JSON.parse. The following extensions are accepted:\n *\n * - Single line and multiline comments\n * - unquoted properties (ASCII-only Javascript identifiers)\n * - trailing comma in array and object definitions\n * - single quoted strings\n * - `\\f` and `\\v` are accepted as space characters\n * - leading plus in numbers\n * - octal (0o prefix) and hexadecimal (0x prefix) numbers\n */\n export function parseExtJSON(str: string): any;\n\n /**\n * A wrapper around the standard C [strftime](https://en.cppreference.com/w/c/chrono/strftime).\n * Formats a time/date into a format as specified by the user.\n *\n * @param maxBytes - The number of bytes to allocate for the string that will be returned\n * @param format - Format string, using `%`-prefixed sequences as found in [this table](https://en.cppreference.com/w/c/chrono/strftime#Format_string).\n * @param time - The Date object (or unix timestamp, in ms) to render.\n */\n export function strftime(\n maxBytes: number,\n format: string,\n time: Date | number\n ): string;\n}\n\ndeclare module \"quickjs:os\" {\n /**\n * Open a file handle. Returns a number; the file descriptor.\n *\n * @param filename - The path to the file to open.\n * @param flags - Numeric flags that set the mode to use when opening the file. See `os.O_*`\n * @param mode - Octal access mask. Defaults to 0o666.\n */\n export function open(filename: string, flags: number, mode?: number): number;\n\n /** POSIX open flag, used in {@link open}. */\n export var O_RDONLY: number;\n\n /** POSIX open flag, used in {@link open}. */\n export var O_WRONLY: number;\n\n /** POSIX open flag, used in {@link open}. */\n export var O_RDWR: number;\n\n /** POSIX open flag, used in {@link open}. */\n export var O_APPEND: number;\n\n /** POSIX open flag, used in {@link open}. */\n export var O_CREAT: number;\n\n /** POSIX open flag, used in {@link open}. */\n export var O_EXCL: number;\n\n /** POSIX open flag, used in {@link open}. */\n export var O_TRUNC: number;\n\n /**\n * Windows-specific open flag: open the file in binary mode (which is the default). Used in {@link open}.\n *\n * NOTE: this property is only present on windows\n */\n export var O_BINARY: number | undefined;\n\n /**\n * Windows-specific open flag: open the file in text mode. The default is binary mode. Used in {@link open}.\n *\n * NOTE: this property is only present on windows\n */\n export var O_TEXT: number | undefined;\n\n /** Close the file with descriptor `fd`. */\n export function close(fd: number): void;\n\n interface OsSeek {\n /** Seek in the file. Use `std.SEEK_*` for `whence`. `offset` is either a number or a bigint. If `offset` is a bigint, a bigint is returned too. */\n (fd: number, offset: number, whence: number): number;\n\n /** Seek in the file. Use `std.SEEK_*` for `whence`. `offset` is either a number or a bigint. If `offset` is a bigint, a bigint is returned too. */\n (fd: number, offset: BigInt, whence: number): BigInt;\n }\n\n /** Seek in the file. Use `std.SEEK_*` for `whence`. `offset` is either a number or a bigint. If `offset` is a bigint, a bigint is returned too. */\n export var seek: OsSeek;\n\n /** Read `length` bytes from the file with descriptor `fd` to the ArrayBuffer `buffer` at byte position `offset`. Return the number of read bytes. */\n export function read(\n fd: number,\n buffer: ArrayBuffer,\n offset: number,\n length: number\n ): number;\n\n /** Write `length` bytes to the file with descriptor `fd` from the ArrayBuffer `buffer` at byte position `offset`. Return the number of written bytes. */\n export function write(\n fd: number,\n buffer: ArrayBuffer,\n offset: number,\n length: number\n ): number;\n\n /** Return `true` if the file opened with descriptor `fd` is a TTY (terminal). */\n export function isatty(fd: number): boolean;\n\n /** Return the TTY size as `[width, height]` or `null` if not available. */\n export function ttyGetWinSize(fd: number): null | [number, number];\n\n /** Set the TTY in raw mode. */\n export function ttySetRaw(fd: number): void;\n\n /** Remove a file. */\n export function remove(filename: string): void;\n\n /** Rename a file. */\n export function rename(oldname: string, newname: string): void;\n\n /** Return the canonicalized absolute pathname of `path`. */\n export function realpath(path: string): string;\n\n /** Return the current working directory. */\n export function getcwd(): string;\n\n /** Change the current directory. */\n export function chdir(path: string): void;\n\n /** Create a directory at `path`. */\n export function mkdir(path: string, mode?: number): void;\n\n export type Stats = {\n dev: number;\n ino: number;\n mode: number;\n nlink: number;\n uid: number;\n gid: number;\n rdev: number;\n size: number;\n blocks: number;\n atime: number;\n mtime: number;\n ctime: number;\n };\n\n /**\n * Return a stats object with the following fields:\n *\n * - `dev`\n * - `ino`\n * - `mode`\n * - `nlink`\n * - `uid`\n * - `gid`\n * - `rdev`\n * - `size`\n * - `blocks`\n * - `atime`\n * - `mtime`\n * - `ctime`\n *\n * The times are specified in milliseconds since 1970. `lstat()` is the same as `stat()` except that it returns information about the link itself.\n */\n export function stat(path: string): Stats;\n\n /**\n * Return a stats object with the following fields:\n *\n * - `dev`\n * - `ino`\n * - `mode`\n * - `nlink`\n * - `uid`\n * - `gid`\n * - `rdev`\n * - `size`\n * - `blocks`\n * - `atime`\n * - `mtime`\n * - `ctime`\n *\n * The times are specified in milliseconds since 1970. `lstat()` is the same as `stat()` except that it returns information about the link itself.\n */\n export function lstat(path: string): Stats;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * Mask for getting type of file from mode.\n */\n export var S_IFMT: number;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * File type: named pipe (fifo)\n */\n export var S_IFIFO: number;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * File type: character special\n */\n export var S_IFCHR: number;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * File type: directory\n */\n export var S_IFDIR: number;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * File type: block special\n */\n export var S_IFBLK: number;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * File type: regular\n */\n export var S_IFREG: number;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * File type: socket\n *\n * NOTE: this property is not present on windows\n */\n export var S_IFSOCK: number | undefined;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * File type: symbolic link\n *\n * NOTE: this property is not present on windows\n */\n export var S_IFLNK: number | undefined;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * Flag: set group id on execution\n *\n * NOTE: this property is not present on windows\n */\n export var S_ISGID: number | undefined;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * Flag: set user id on execution\n *\n * NOTE: this property is not present on windows\n */\n export var S_ISUID: number | undefined;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * Mask for getting RWX permissions for owner\n */\n export var S_IRWXU: number;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * Permission: read for owner\n */\n export var S_IRUSR: number;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * Permission: write for owner\n */\n export var S_IWUSR: number;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * Permission: execute for owner\n */\n export var S_IXUSR: number;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * Mask for getting RWX permissions for group\n */\n export var S_IRWXG: number;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * Permission: read for group\n */\n export var S_IRGRP: number;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * Permission: write for group\n */\n export var S_IWGRP: number;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * Permission: execute for group\n */\n export var S_IXGRP: number;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * Mask for getting RWX permissions for others\n */\n export var S_IRWXO: number;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * Permission: read for others\n */\n export var S_IROTH: number;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * Permission: write for others\n */\n export var S_IWOTH: number;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * Permission: execute for others\n */\n export var S_IXOTH: number;\n\n /**\n * Change the access and modification times of the file path.\n *\n * The times are specified in milliseconds since 1970.\n */\n export function utimes(path: string, atime: number, mtime: number): void;\n\n /** Create a link at `linkpath` containing the string `target`. */\n export function symlink(target: string, linkpath: string): void;\n\n /** Return the link target. */\n export function readlink(path: string): string;\n\n /** Return an array of strings containing the filenames of the directory `path`. */\n export function readdir(path: string): Array<string>;\n\n /** Add a read handler to the file with descriptor `fd`. `func` is called each time there is data pending for `fd`. A single read handler per file handle is supported. Use `func = null` to remove the handler. */\n export function setReadHandler(fd: number, func: null | (() => void)): void;\n\n /** Add a write handler to the file with descriptor `fd`. `func` is called each time data can be written to `fd`. A single write handler per file handle is supported. Use `func = null` to remove the handler. */\n export function setWriteHandler(fd: number, func: null | (() => void)): void;\n\n /** Call the function `func` when the signal `signal` happens. Only a single handler per signal number is supported. Use `null` to set the default handler or `undefined` to ignore the signal. Signal handlers can only be defined in the main thread. */\n export function signal(\n signal: number,\n func: null | undefined | (() => void)\n ): void;\n\n /** POSIX signal number. */\n export var SIGINT: number;\n\n /** POSIX signal number. */\n export var SIGABRT: number;\n\n /** POSIX signal number. */\n export var SIGFPE: number;\n\n /** POSIX signal number. */\n export var SIGILL: number;\n\n /** POSIX signal number. */\n export var SIGSEGV: number;\n\n /** POSIX signal number. */\n export var SIGTERM: number;\n\n /** POSIX signal number. NOTE: this signal is not present on windows. */\n export var SIGQUIT: number | undefined;\n\n /** POSIX signal number. NOTE: this signal is not present on windows. */\n export var SIGPIPE: number | undefined;\n\n /** POSIX signal number. NOTE: this signal is not present on windows. */\n export var SIGALRM: number | undefined;\n\n /** POSIX signal number. NOTE: this signal is not present on windows. */\n export var SIGUSR1: number | undefined;\n\n /** POSIX signal number. NOTE: this signal is not present on windows. */\n export var SIGUSR2: number | undefined;\n\n /** POSIX signal number. NOTE: this signal is not present on windows. */\n export var SIGCHLD: number | undefined;\n\n /** POSIX signal number. NOTE: this signal is not present on windows. */\n export var SIGCONT: number | undefined;\n\n /** POSIX signal number. NOTE: this signal is not present on windows. */\n export var SIGSTOP: number | undefined;\n\n /** POSIX signal number. NOTE: this signal is not present on windows. */\n export var SIGTSTP: number | undefined;\n\n /** POSIX signal number. NOTE: this signal is not present on windows. */\n export var SIGTTIN: number | undefined;\n\n /** POSIX signal number. NOTE: this signal is not present on windows. */\n export var SIGTTOU: number | undefined;\n\n /** Send the signal `sig` to the process `pid`. Use `os.SIG*` constants. */\n export function kill(pid: number, sig: number): void;\n\n export type ExecOptions = {\n /** Boolean (default = true). If true, wait until the process is terminated. In this case, `exec` returns the exit code if positive or the negated signal number if the process was interrupted by a signal. If false, do not block and return the process id of the child. */\n block?: boolean;\n\n /** Boolean (default = true). If true, the file is searched in the `PATH` environment variable. */\n usePath?: boolean;\n\n /** String (default = `args[0]`). Set the file to be executed. */\n file?: string;\n\n /** String. If present, set the working directory of the new process. */\n cwd?: string;\n\n /** If present, set the file descriptor in the child for stdin. */\n stdin?: number;\n\n /** If present, set the file descriptor in the child for stdout. */\n stdout?: number;\n\n /** If present, set the file descriptor in the child for stderr. */\n stderr?: number;\n\n /** Object. If present, set the process environment from the object key-value pairs. Otherwise use the same environment as the current process. To get the current process's environment variables as on object, use `std.getenviron()`. */\n env?: { [key: string | number]: string | number | boolean };\n\n /** Integer. If present, the process uid with `setuid`. */\n uid?: number;\n\n /** Integer. If present, the process gid with `setgid`. */\n gid?: number;\n };\n\n /** Execute a process with the arguments args, and the provided options (if any). */\n export function exec(args: Array<string>, options?: ExecOptions): number;\n\n /**\n * `waitpid` Unix system call. Returns the array [ret, status].\n *\n * From man waitpid(2):\n *\n * waitpid(): on success, returns the process ID of the child whose state has changed; if WNOHANG was specified and one or more child(ren) specified by pid exist, but have not yet changed state, then 0 is returned.\n */\n export function waitpid(pid: number, options?: number): [number, number];\n\n /** Constant for the `options` argument of `waitpid`. */\n export var WNOHANG: number;\n /** Constant for the `options` argument of `waitpid`. */\n export var WUNTRACED: number;\n\n /** Function to be used to interpret the 'status' return value of `waitpid`. */\n export function WEXITSTATUS(status: number): number;\n /** Function to be used to interpret the 'status' return value of `waitpid`. */\n export function WTERMSIG(status: number): number;\n /** Function to be used to interpret the 'status' return value of `waitpid`. */\n export function WSTOPSIG(status: number): number;\n\n /** Function to be used to interpret the 'status' return value of `waitpid`. */\n export function WIFEXITED(status: number): boolean;\n /** Function to be used to interpret the 'status' return value of `waitpid`. */\n export function WIFSIGNALED(status: number): boolean;\n /** Function to be used to interpret the 'status' return value of `waitpid`. */\n export function WIFSTOPPED(status: number): boolean;\n /** Function to be used to interpret the 'status' return value of `waitpid`. */\n export function WIFCONTINUED(status: number): boolean;\n\n /** `dup` Unix system call. */\n export function dup(fd: number): number;\n\n /** `dup2` Unix system call. */\n export function dup2(oldfd: number, newfd: number): number;\n\n /** `pipe` Unix system call. Return two handles as `[read_fd, write_fd]`. */\n export function pipe(): [number, number];\n\n /** Sleep for `delay_ms` milliseconds. */\n export function sleep(delay_ms: number): void;\n\n export type OSTimer = { [Symbol.toStringTag]: \"OSTimer\" };\n\n /** Call the function func after delay ms. Return a handle to the timer. */\n export function setTimeout(\n func: (...args: any) => any,\n delay: number\n ): OSTimer;\n\n /** Cancel a timer. */\n export function clearTimeout(handle: OSTimer): void;\n\n /** Return a string representing the platform: \"linux\", \"darwin\", \"win32\", \"freebsd\", or \"js\" (emscripten). */\n export var platform: \"linux\" | \"darwin\" | \"win32\" | \"freebsd\" | \"js\";\n\n /**\n * Things that can be put into Worker.postMessage.\n *\n * NOTE: This is effectively the same stuff as supported by the structured\n * clone algorithm, but without support for Map/Set (not supported in\n * QuickJS yet).\n */\n export type StructuredClonable =\n | string\n | number\n | boolean\n | null\n | undefined\n | Boolean\n | String\n | Date\n | RegExp\n | ArrayBuffer\n | Int8Array\n | Uint8Array\n | Uint8ClampedArray\n | Int16Array\n | Uint16Array\n | Int32Array\n | Uint32Array\n | Float32Array\n | Float64Array\n | BigInt64Array\n | BigUint64Array\n | DataView\n | Array<StructuredClonable>\n | SharedArrayBuffer\n // Map and Set not yet supported\n // | Map<StructuredClonable, StructuredClonable>\n // | Set<StructuredClonable>\n | { [key: string | number]: StructuredClonable };\n\n export class Worker {\n /**\n * Constructor to create a new thread (worker) with an API close to the\n * `WebWorkers`. `moduleFilename` is a string specifying the module\n * filename which is executed in the newly created thread. As for\n * dynamically imported module, it is relative to the current script or\n * module path. Threads normally don’t share any data and communicate\n * between each other with messages. Nested workers are not supported.\n */\n constructor(moduleFilename: string);\n\n /**\n * In the created worker, Worker.parent represents the parent worker and is\n * used to send or receive messages.\n */\n static parent: Worker;\n\n /**\n * Send a message to the corresponding worker. msg is cloned in the\n * destination worker using an algorithm similar to the HTML structured\n * clone algorithm. SharedArrayBuffer are shared between workers.\n *\n * Current limitations: Map and Set are not supported yet.\n */\n postMessage(msg: StructuredClonable): void;\n\n /**\n * Set a function which is called each time a message is received. The\n * function is called with a single argument. It is an object with a data\n * property containing the received message. The thread is not terminated\n * if there is at least one non null onmessage handler.\n */\n onmessage: null | ((event: { data: StructuredClonable }) => void);\n }\n\n /** constant for {@link access}(); test for read permission. */\n export var R_OK: number;\n\n /** constant for {@link access}(); test for write permission. */\n export var W_OK: number;\n\n /** constant for {@link access}(); test for execute (search) permission. */\n export var X_OK: number;\n\n /** constant for {@link access}(); test for existence of file. */\n export var F_OK: number;\n\n /** `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. */\n export function access(path: string, accessMode: number): void;\n\n /** gets the path to the executable which is executing this JS code. might be a relative path or symlink. */\n export function execPath(): string;\n\n /** changes the access permission bits of the file at `path` using the octal number `mode`. */\n export function chmod(path: string, mode: number): void;\n}\n\ndeclare var setTimeout: typeof import(\"quickjs:os\").setTimeout;\ndeclare var clearTimeout: typeof import(\"quickjs:os\").clearTimeout;\n\n/**\n * An object which lets you configure the module loader (import/export/require).\n * You can change these properties to add support for importing new filetypes.\n */\ninterface ModuleDelegate {\n /**\n * A list of filetype extensions that may be omitted from an import specifier\n * string.\n *\n * Defaults to `[\".js\"]`. You can add more strings to this array to\n * make the engine search for additional files when resolving a\n * require/import.\n *\n * See the doc comment on {@link require} for more information.\n *\n * NOTE: If you add a new extension to this array, you will likely also want\n * to add to {@link compilers}.\n */\n searchExtensions: Array<string>;\n\n /**\n * User-defined functions which will handle getting the JavaScript code\n * associated with a module.\n *\n * The key for each property in this object should be a file extension\n * string with a leading dot, eg `\".jsx\"`. The value for each property should\n * be a function which receives (1) the filepath to a module, and (2) that\n * file's content as a UTF-8 string, and the function should return a string\n * containing JavaScript code that corresponds to that module. In most cases,\n * these functions will compile the contents of the file from one format into JavaScript.\n *\n * The function does not have to use the second 'content' argument it\n * receives (ie. when loading binary files).\n *\n * By adding to this object, you can make it possible to import non-js\n * filetypes; compile-to-JS languages like JSX, TypeScript, and CoffeeScript\n * can be compiled at import time, and asset files like .txt files or .png\n * files can be converted into an appropriate data structure at import time.\n *\n * As an example, to make it possible to import .txt files, you might do:\n * ```js\n * import * as std from \"std\";\n *\n * ModuleDelegate.compilers[\".txt\"] = (filename, content) => {\n * return `export default ${JSON.stringify(content)}`;\n * }\n * ```\n * (leveraging `JSON.stringify`'s ability to escape quotes).\n *\n * Then, later in your code, you can do:\n * ```js\n * import names from \"./names.txt\";\n * ```\n *\n * And `names` will be a string containing the contents of names.txt.\n *\n * NOTE: When adding to this object, you may also wish to add to\n * {@link searchExtensions}.\n */\n compilers: {\n [extensionWithDot: string]: (filename: string, content: string) => string;\n };\n\n /**\n * An Array containing the names of all the built-in modules, such as\n * \"quickjs:std\", \"quickjs:bytecode\", etc.\n *\n * `quickjs:engine`'s `defineBuiltinModule` function adds to the end of this\n * array.\n */\n builtinModuleNames: Array<string>;\n\n /**\n * Resolves a require/import request from `fromFile` into a canonicalized\n * path.\n *\n * To change native module resolution behavior, replace this function with\n * your own implementation. Note that you must handle\n * `ModuleDelegate.searchExtensions` yourself in your replacement\n * implementation.\n */\n resolve(name: string, fromFile: string): string;\n\n /**\n * Reads the contents of the given resolved module name into a string.\n *\n * To change native module loading behavior, replace this function with your\n * own implementation. Note that you must handle `ModuleDelegate.compilers`\n * yourself in your replacement implementation.\n */\n read(modulePath: string): string;\n}\n\ninterface RequireFunction {\n /**\n * Synchronously import a module.\n *\n * `source` will be resolved relative to the calling file.\n *\n * If `source` does not have a file extension, and a file without an extension\n * cannot be found, the engine will check for files with the extensions in\n * {@link ModuleDelegate.searchExtensions}, and use one of those if present.\n * This behavior also happens when using normal `import` statements.\n *\n * For example, if you write:\n *\n * ```js\n * import something from \"./somewhere\";\n * ```\n *\n * but there's no file named `somewhere` in the same directory as the file\n * where that import appears, and `ModuleDelegate.searchExtensions` is the\n * default value:\n *\n * ```js\n * [\".js\"]\n * ```\n *\n * then the engine will look for `somewhere.js`. If that doesn't exist, the\n * engine will look for `somewhere/index.js`. If *that* doesn't exist, an\n * error will be thrown.\n *\n * If you add more extensions to `ModuleDelegate.searchExtensions`, then the\n * engine will use those, too. It will search in the same order as the strings\n * appear in the `ModuleDelegate.searchExtensions` array.\n */\n (source: string): any;\n\n /**\n * Resolves the normalized path to a modules, relative to the calling file.\n */\n resolve: (source: string) => string;\n}\n\n// global added by QJMS_InitContext\ndeclare var require: RequireFunction;\n\n// gets set per-module by QJMS_SetModuleImportMeta\ninterface ImportMeta {\n /**\n * A URL representing the current module.\n *\n * Usually starts with `file://`.\n */\n url: string;\n\n /**\n * Whether the current module is the \"main\" module, meaning that it is the\n * entrypoint file that's been loaded, or, in other terms, the first\n * user-authored module that's been loaded.\n */\n main: boolean;\n\n /**\n * Equivalent to `globalThis.require`. Provided for compatibility with tools\n * that can leverage a CommonJS require function via `import.meta.require`.\n */\n require: RequireFunction;\n\n /**\n * Resolves a module specifier based on the current module's path.\n *\n * Equivalent to `globalThis.require.resolve`.\n *\n * Behaves similarly to [the browser\n * import.meta.resolve](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import.meta/resolve),\n * but it does not ensure that the returned string is a valid URL, because it\n * delegates directly to {@link ModuleDelegate.resolve} to resolve the name.\n * If you want this to return URL strings, change `ModuleDelegate.resolve` and\n * `ModuleDelegate.read` to work with URL strings.\n */\n resolve: RequireFunction[\"resolve\"];\n}\n\ndeclare module \"quickjs:engine\" {\n /**\n * Return whether the provided resolved module path is set as the main module.\n *\n * In other words, return what the value of `import.meta.main` would be within\n * the module.\n *\n * The main module can be set via {@link setMainModule}.\n */\n export function isMainModule(resolvedFilepath: string): boolean;\n\n /**\n * Set the main module to the module with the provided resolved path.\n *\n * This will affect the value of `import.meta.main` for modules loaded in the\n * future, but it will NOT retroactively change the value of\n * `import.meta.main` in existing already-loaded modules.\n */\n export function setMainModule(resolvedFilepath: string): void;\n\n /**\n * Evaluate the string `code` as a script (global eval).\n *\n * @param code - The code to evaluate.\n * @param options - An optional object containing the following optional properties:\n * @property backtraceBarrier - Boolean (default = false). If true, error backtraces do not list the stack frames below the evalScript.\n * @property filename - String (default = \"<evalScript>\"). The filename to associate with the code being executed.\n * @returns The result of the evaluation.\n */\n export function evalScript(\n code: string,\n options?: { backtraceBarrier?: boolean; filename?: string }\n ): any;\n\n /**\n * Evaluate the file `filename` as a script (global eval).\n *\n * @param filename - The relative or absolute path to the file to load. Relative paths are resolved relative to the process's current working directory.\n * @returns The result of the evaluation.\n */\n export function runScript(filename: string): any;\n\n /**\n * Evaluate the file `filename` as a module. Effectively a synchronous dynamic `import()`.\n *\n * @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.\n * @param basename - If present and `filename` is a relative path, `filename` will be resolved relative to this basename.\n * @returns The result of the evaluation (module namespace object).\n */\n export function importModule(\n filename: string,\n basename?: string\n ): { [key: string]: any };\n\n /**\n * Return the resolved path to a module.\n *\n * @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.\n * @param basename - If present and `filename` is a relative path, `filename` will be resolved relative to this basename.\n * @returns The resolved module path.\n */\n export function resolveModule(filename: string, basename?: string): string;\n\n /**\n * Read the script of module filename from an active stack frame, then return it as a string.\n *\n * If there isn't a valid filename for the specified stack frame, an error will be thrown.\n *\n * @param stackLevels - How many levels up the stack to search for a filename. Defaults to 0, which uses the current stack frame.\n */\n export function getFileNameFromStack(stackLevels?: number): string;\n\n /**\n * Returns true if `target` is a module namespace object.\n */\n export function isModuleNamespace(target: any): boolean;\n\n /**\n * Create a virtual built-in module whose exports consist of the own\n * enumerable properties of `obj`.\n */\n export function defineBuiltinModule(\n name: string,\n obj: { [key: string]: any }\n ): void;\n\n /**\n * An object which lets you configure the module loader (import/export/require).\n * You can change these properties to add support for importing new filetypes.\n */\n export const ModuleDelegate: ModuleDelegate;\n\n /**\n * Manually invoke the cycle removal algorithm (garbage collector).\n *\n * The cycle removal algorithm is automatically started when needed, so this\n * function is useful in case of specific memory constraints or for testing.\n */\n export function gc(): void;\n}\n\ndeclare module \"quickjs:bytecode\" {\n /**\n * Convert the module or script in the specified file into bytecode.\n *\n * When converted back to a value, it will be a function.\n */\n export function fromFile(\n path: string,\n options?: {\n byteSwap?: boolean;\n sourceType?: \"module\" | \"script\";\n encodedFileName?: string;\n }\n ): ArrayBuffer;\n\n /**\n * Convert the provided value into bytecode. Doesn't work with all values.\n */\n export function fromValue(\n value: any,\n options?: { byteSwap?: boolean }\n ): ArrayBuffer;\n\n /**\n * Convert the provided bytecode into a value.\n */\n export function toValue(bytecode: ArrayBuffer): any;\n}\n\ndeclare module \"quickjs:context\" {\n /**\n * A separate global context (or 'realm') within which code can be executed.\n */\n export class Context {\n /**\n * Create a new global context (or 'realm') within code can be executed.\n *\n * @param options Options for what globals/modules/etc to make available within the context.\n *\n * The following globals are always present, regardless of options:\n *\n * - Object\n * - Function\n * - Error\n * - EvalError\n * - RangeError\n * - ReferenceError\n * - SyntaxError\n * - TypeError\n * - URIError\n * - InternalError\n * - AggregateError\n * - Array\n * - parseInt\n * - parseFloat\n * - isNaN\n * - isFinite\n * - decodeURI\n * - decodeURIComponent\n * - encodeURI\n * - encodeURIComponent\n * - escape\n * - unescape\n * - Infinity\n * - NaN\n * - undefined\n * - __date_clock\n * - Number\n * - Boolean\n * - String\n * - Math\n * - Reflect\n * - Symbol\n * - eval (but it doesn't work unless the `eval` option is enabled)\n * - globalThis\n *\n * Note that new contexts don't have a `scriptArgs` global. If you need one\n * to be present in the new context, you can add one onto the Context's\n * `globalThis` property.\n */\n constructor(options?: {\n /** Enables `Date`. Defaults to `true` */\n date?: boolean;\n\n /** Enables `eval`. Defaults to `true` */\n eval?: boolean;\n\n /** Enables `String.prototype.normalize`. Defaults to `true`. */\n stringNormalize?: boolean;\n\n /** Enables `RegExp`. Defaults to `true`. */\n regExp?: boolean;\n\n /** Enables `JSON`. Defaults to `true`. */\n json?: boolean;\n\n /** Enables `Proxy`. Defaults to `true`. */\n proxy?: boolean;\n\n /** Enables `Map` and `Set`. Defaults to `true`. */\n mapSet?: boolean;\n\n /**\n * Enables:\n *\n * - ArrayBuffer\n * - SharedArrayBuffer\n * - Uint8ClampedArray\n * - Int8Array\n * - Uint8Array\n * - Int16Array\n * - Uint16Array\n * - Int32Array\n * - Uint32Array\n * - BigInt64Array\n * - BigUint64Array\n * - Float32Array\n * - Float64Array\n * - DataView\n *\n * Defaults to `true`.\n */\n typedArrays?: boolean;\n\n /**\n * Enables:\n *\n * - Promise\n * - async functions\n * - async iterators\n * - async generators\n *\n * Defaults to `true`.\n */\n promise?: boolean;\n\n /** Enables `BigInt`. Defaults to `true`. */\n bigint?: boolean;\n\n /** Enables `BigFloat`. Defaults to `true`. */\n bigfloat?: boolean;\n\n /** Enables `BigDecimal`. Defaults to `true`. */\n bigdecimal?: boolean;\n\n /**\n * Enables:\n *\n * - Operators\n * - OperatorSet creation\n * - operator overloading\n *\n * Defaults to `true`.\n */\n operators?: boolean;\n\n /** Enables `\"use math\"`. Defaults to `true`. */\n useMath?: boolean;\n\n /** Enables `inspect`. Defaults to `true`. */\n inspect?: boolean;\n /** Enables `console`. Defaults to `true`. */\n console?: boolean;\n /** Enables `print`. Defaults to `true`. */\n print?: boolean;\n /** Enables `require`. Defaults to `true`. */\n moduleGlobals?: boolean;\n /**\n * Enables `setTimeout`, `clearTimeout`, `setInterval`, and\n * `clearInterval`. Defaults to `true`.\n */\n timers?: boolean;\n\n /** Enable builtin modules. */\n modules?: {\n /** Enables the \"quickjs:std\" module. Defaults to `true`. */\n \"quickjs:std\"?: boolean;\n /** Enables the \"quickjs:os\" module. Defaults to `true`. */\n \"quickjs:os\"?: boolean;\n /** Enables the \"quickjs:bytecode\" module. Defaults to `true`. */\n \"quickjs:bytecode\"?: boolean;\n /** Enables the \"quickjs:context\" module. Defaults to `true`. */\n \"quickjs:context\"?: boolean;\n /** Enables the \"quickjs:engine\" module. Defaults to `true`. */\n \"quickjs:engine\"?: boolean;\n /** Enables the \"quickjs:encoding\" module. Defaults to `true`. */\n \"quickjs:encoding\"?: boolean;\n };\n });\n\n /**\n * The `globalThis` object used by this context.\n *\n * You can add to or remove from it to change what is visible to the context.\n */\n globalThis: typeof globalThis;\n\n /**\n * Runs code within the context and returns the result.\n *\n * @param code The code to run.\n */\n eval(code: string): any;\n }\n}\n\n// WHATWG encoding spec at https://encoding.spec.whatwg.org/ would be better,\n// but this is better than nothing\ndeclare module \"quickjs:encoding\" {\n export function toUtf8(input: ArrayBuffer): string;\n export function fromUtf8(input: string): ArrayBuffer;\n}\n\ndeclare const std: typeof import(\"quickjs:std\");\ndeclare const os: typeof import(\"quickjs:os\");\n\n// undocumented from quickjs, but it's there\n/** Get the current unix timestamp with microsecond precision. */\ndeclare function __date_clock(): number;\n";
1989
+ module.exports = "// ===============\n// ---------------\n// YavaScript APIs\n// ---------------\n// ===============\n/**\n * Prints a link to the YavaScript help docs for the currently-running version\n * of YavaScript.\n *\n * For the latest help docs, see:\n * https://github.com/suchipi/yavascript/blob/main/meta/generated-docs/README.md\n */\ndeclare function help(): void;\n\n/**\n * The `yavascript` global contains metadata about the currently-running\n * yavascript binary, as well as access to yavascript's compilers for\n * compile-to-js languages.\n */\ndeclare const yavascript: {\n /**\n * The version of the currently-running yavascript binary.\n *\n * Will be something formatted like one of these:\n * - \"v0.0.7\"\n * - \"v0.1.3-alpha\"\n * - \"git-286a3a336849\"\n * - \"git-286a3a336849-dirty\"\n *\n * Or, more formally: either a \"V\" version string or a \"GIT\" version string:\n * - \"V\" version strings start with the character 'v', followed by a semver\n * version string, optionally followed by the character '-' and any\n * arbitrary content afterwards.\n * - \"GIT\" version strings start with the prefix \"git-\", followed by the\n * first 12 digits of a git commit SHA, optionally followed by the\n * character '-' and any arbitrary content afterwards.\n */\n version: string;\n\n /**\n * The processor architecture of the currently-running `yavascript` binary.\n */\n arch: \"x86_64\" | \"arm64\";\n\n /**\n * The version of the ecma262 standard supported by the currently-running\n * yavascript binary.\n *\n * Currently, this is always \"ES2020\", but if future versions of yavascript\n * support a newer version of the standard, this will change. In that event,\n * this property will always be in the format of \"ES\" + a year, and will never\n * be lower than ES2020.\n */\n ecmaVersion: string;\n\n /**\n * The compilers yavascript uses internally to load files.\n *\n * Each function returns a JavaScript source code string.\n */\n compilers: {\n /**\n * The function yavascript uses internally to load JavaScript files.\n *\n * You might think this would be a no-op, but we do some CommonJS/ECMAScript\n * Module interop transformations here.\n */\n js(\n code: string,\n options?: { filename?: string; expression?: boolean }\n ): string;\n\n /**\n * The function yavascript uses internally to load [TypeScript JSX](https://www.typescriptlang.org/docs/handbook/jsx.html) files.\n *\n * yavascript uses [Sucrase 3.35.0](https://sucrase.io/) to load TypeScript JSX syntax. yavascript doesn't do typechecking of TypeScript syntax.\n */\n tsx(\n code: string,\n options?: { filename?: string; expression?: boolean }\n ): string;\n\n /**\n * The function yavascript uses internally to load [TypeScript](https://www.typescriptlang.org/) files.\n *\n * yavascript uses [Sucrase 3.35.0](https://sucrase.io/) to load TypeScript syntax. yavascript doesn't do typechecking of TypeScript syntax.\n */\n ts(\n code: string,\n options?: { filename?: string; expression?: boolean }\n ): string;\n\n /**\n * The function yavascript uses internally to load JSX files.\n *\n * yavascript uses [Sucrase 3.35.0](https://sucrase.io/) to load JSX syntax.\n *\n * See {@link JSX} for info about configuring JSX pragma, swapping out the\n * default `createElement` implementation, etc.\n */\n jsx(\n code: string,\n options?: { filename?: string; expression?: boolean }\n ): string;\n\n /**\n * The function yavascript uses internally to load [CoffeeScript](https://coffeescript.org/) files.\n *\n * yavascript embeds CoffeeScript 2.7.0.\n */\n coffee(\n code: string,\n options?: { filename?: string; expression?: boolean }\n ): string;\n\n /**\n * The function yavascript uses internally to load [Civet](https://civet.dev/) files.\n *\n * yavascript embeds Civet 0.9.0.\n */\n civet(\n code: string,\n options?: { filename?: string; expression?: boolean }\n ): string;\n\n /**\n * The function yavascript uses internally to load files which don't have an\n * extension.\n *\n * It tries to parse the file as each of the following languages, in order,\n * until it finds one which doesn't have a syntax error:\n *\n * - JSX\n * - TSX\n * - Civet\n * - CoffeeScript\n *\n * If none of the languages work, the file's original content gets used so\n * that a syntax error can be reported to the user.\n */\n autodetect(\n code: string,\n options?: { filename?: string; expression?: boolean }\n ): string;\n };\n};\n\n/**\n * An object representing the process's environment variables. You can read\n * from it to read environment variables, write into it to set environment\n * variables, and/or delete properties from it to unset environment variables.\n * Any value you write will be coerced into a string.\n */\ndeclare const env: { [key: string]: string | undefined };\n\n/**\n * A function which parses command line `--flags` into an object of flags and an\n * array of positional arguments. This function is opinionated; if it doesn't\n * meet your needs, you can parse the {@link scriptArgs} global manually.\n *\n * Flags `--like-this`, `--like_this`, or `--LIKE_THIS` get converted into\n * property names `likeThis` on the returned flags object.\n *\n * Flags like this: `-v` get converted into into property names like this: `v`\n * on the returned flags object.\n *\n * Anything that appears after `--` is considered a positional argument instead\n * of a flag. `--` is not present in the returned positional arguments Array.\n *\n * `parseScriptArgs` accepts two optional parameters: `hints` and `argv`.\n *\n * ## hints\n *\n * If present, `hints` should be an object whose keys are flag names (in\n * lowerCamelCase) and whose values indicate what type to treat that flag as.\n * Valid property values are `String`, `Boolean`, `Number`, and `Path`. `Path`\n * will resolve relative paths into absolute paths for you. If no hints object\n * is specified, `parseScriptArgs` will do its best to guess the types.\n *\n * ## argv\n *\n * The `argv` parameter, if present, should be an array containing the command\n * line flags you want to parse. If you don't provide one, `scriptArgs.slice(2)`\n * will be used (we slice 2 in order to skip the yavascript binary and script\n * name). If you pass in an array here, it should only contain command-line\n * flags, not the binary being called.\n *\n * ## Return Value\n *\n * `parseScriptArgs` returns an object with three properties: `flags`, `args`,\n * and `metadata`.\n *\n * - `flags` is an object whose keys are lowerCamelCase flag names and whose\n * values are strings, booleans, numbers, or `Path`s corresponding to the\n * input command-line args.\n * - `args` is an Array of positional arguments, as found on the command-line.\n * - `metadata` contains information about what name and type the flags got\n * mapped to.\n *\n * @param hints - An object whose keys are flag names (in lowerCamelCase) and\n * whose values indicate what type to treat that flag as. Valid property values\n * are `String`, `Boolean`, `Number`, and `Path`. `Path` will resolve relative\n * paths into absolute paths for you. If no hints object is specified,\n * `parseScriptArgs` will do its best to guess, based on the command-line args.\n * @param argv - An array containing the command line flags you want to parse.\n * If unspecified, `scriptArgs.slice(2)` will be used (we slice 2 in order to\n * skip the yavascript binary and script name). If you pass in an array here, it\n * should only contain command-line flags, not the binary being called.\n *\n * @returns A {@link ParseScriptArgsResult}, which is an object with three\n * properties: `flags`, `args`, and `metadata`. `flags` is an object whose keys\n * are camelCase flag names and whose values are strings, booleans, numbers, or\n * `Path`s corresponding to the input command-line args. `args` is an Array of\n * positional arguments, as found on the command-line. `metadata` contains\n * information about what name and type the flags got mapped to.\n */\ndeclare function parseScriptArgs(\n hints?: {\n [key: string]: typeof String | typeof Boolean | typeof Number | typeof Path;\n },\n args?: Array<string>\n): ParseScriptArgsResult;\n\n/**\n * The return type of {@link parseScriptArgs}.\n *\n * The `flags` property contains the values for any command-line `--flags`, with\n * key names converted to `lowerCamelCase`.\n *\n * The `args` property contains an array of those command-line arguments which\n * weren't associated with a flag.\n *\n * The `metadata` property contains information about the parsing process,\n * including what case changes were applied to the keys, which hints were used,\n * and which properties had their type guessed because no corresponding hint was\n * available.\n */\ndeclare interface ParseScriptArgsResult {\n /**\n * The values for any command-line `--flags`, with key names converted to `lowerCamelCase`.\n */\n flags: { [key: string]: any };\n /**\n * An array of those command-line arguments which weren't associated with a flag.\n */\n args: Array<string>;\n /**\n * Information about the parsing process, including what case changes were\n * applied to the keys, which hints were used, and which properties had their\n * type guessed because no corresponding hint was available.\n */\n metadata: {\n /**\n * An object whose keys are the verbatim flags from the command-line, and\n * whose values are the lowerCamelCase names they were converted to in the\n * `flags` property of the {@link ParseScriptArgsResult}.\n */\n keys: {\n [key: string]: string | undefined;\n };\n /**\n * An object whose keys are the lowerCamelCase flag names, and whose values\n * are strings indicating the hint values that were specified for those\n * flags.\n */\n hints: {\n [key: string]: \"path\" | \"number\" | \"boolean\" | \"string\" | undefined;\n };\n /**\n * An object indicating which flags we inferred the type of, because no\n * corresponding hint was present.\n *\n * The keys are the lowerCamelCase flag names, and the values are strings\n * indicating what type we guessed for that flag.\n *\n * If you're seeing incorrect inference, consider passing a `hints` argument\n * to {@link parseScriptArgs}.\n */\n guesses: {\n [key: string]: \"number\" | \"boolean\" | \"string\" | undefined;\n };\n };\n}\n\n/**\n * Read the contents of a file from disk.\n *\n * With no options specified, it reads the file as UTF-8 and returns a string:\n *\n * ```ts\n * const contents = readFile(\"README.md\");\n * console.log(contents);\n * // \"# yavascript\\n\\nYavaScript is a cross-platform bash-like script runner and repl which is distributed as a single\\nstatically-linked binary...\"\n * ```\n *\n * But, if you pass `{ binary: true }` as the second argument, it returns an\n * ArrayBuffer containing the raw bytes from the file:\n *\n * ```ts\n * const contents = readFile(\"README.md\", { binary: true });\n * console.log(contents);\n * // ArrayBuffer {\n * // │0x00000000│ 23 20 79 61 76 61 73 63 72 69 70 74 0A 0A 59 61\n * // │0x00000010│ 76 61 53 63 72 69 70 74 20 69 73 20 61 20 63 72\n * // │0x00000020│ 6F 73 73 2D 70 6C 61 74 66 6F 72 6D 20 62 61 73\n * // │0x00000030│ 68 2D 6C 69 6B 65 20 73 63 72 69 70 74 20 72 75\n * // ...\n * ```\n */\ndeclare const readFile: {\n /**\n * Read the contents of a file from disk, as a UTF-8 string.\n */\n (path: string | Path): string;\n\n /**\n * Read the contents of a file from disk, as a UTF-8 string.\n */\n (path: string | Path, options: {}): string;\n\n /**\n * Read the contents of a file from disk, as a UTF-8 string.\n */\n (path: string | Path, options: { binary: false }): string;\n\n /**\n * Read the contents of a file from disk, as an ArrayBuffer.\n */\n (path: string | Path, options: { binary: true }): ArrayBuffer;\n};\n\n/**\n * Write the contents of a string or ArrayBuffer to a file.\n *\n * Strings are written using the UTF-8 encoding.\n */\ndeclare function writeFile(\n path: string | Path,\n data: string | ArrayBuffer\n): void;\n\n/**\n * Function which returns true if the path points to a regular file.\n */\ndeclare function isFile(path: string | Path): boolean;\n\n/**\n * Function which returns true if the path points to a directory, or if the\n * path points to a symlink which points to a directory. Otherwise, it returns\n * false.\n */\ndeclare function isDir(path: string | Path): boolean;\n\n/**\n * Returns true if the path points to a symlink.\n */\ndeclare function isLink(path: string | Path): boolean;\n\n/**\n * Returns true if the resource at the provided path can be executed by the\n * current user.\n *\n * If nothing exists at that path, an error will be thrown.\n */\ndeclare function isExecutable(path: string | Path): boolean;\n\n/**\n * Returns true if the resource at the provided path can be read by the current\n * user.\n *\n * If nothing exists at that path, an error will be thrown.\n */\ndeclare function isReadable(path: string | Path): boolean;\n\n/**\n * Returns true if a resource at the provided path could be written to by the\n * current user.\n */\ndeclare function isWritable(path: string | Path): boolean;\n\n/**\n * Delete the file or directory at the specified path.\n *\n * If the directory isn't empty, its contents will be deleted, too.\n *\n * Provides the same functionality as the command `rm -rf`.\n */\ndeclare function remove(path: string | Path): void;\n\n/**\n * Returns true if a file or directory exists at the specified path.\n *\n * Provides the same functionality as the command `test -e`.\n */\ndeclare function exists(path: string | Path): boolean;\n\n/**\n * Copies a file or folder from one location to another.\n * Folders are copied recursively.\n *\n * Provides the same functionality as the command `cp -R`.\n */\ndeclare function copy(\n from: string | Path,\n to: string | Path,\n options?: CopyOptions\n): void;\n\n/**\n * Options for {@link copy}.\n */\ndeclare type CopyOptions = {\n /**\n * What to do when attempting to copy something into a location where\n * something else already exists.\n *\n * Defaults to \"error\".\n */\n whenTargetExists?: \"overwrite\" | \"skip\" | \"error\";\n\n /** Options which control logging. */\n logging?: {\n /**\n * If provided, this function will be called multiple times as `copy`\n * traverses the filesystem, to help you understand what's going on and/or\n * troubleshoot things. In most cases, it makes sense to use a logging\n * function here, like so:\n *\n * ```js\n * copy(\"./source\", \"./destination\", {\n * logging: { trace: console.log },\n * });\n * ```\n *\n * Defaults to the current value of {@link logger.trace}. `logger.trace`\n * defaults to a no-op function.\n */\n trace?: (...args: Array<any>) => void;\n\n /**\n * An optional, user-provided logging function to be used for informational\n * messages.\n *\n * Defaults to the current value of {@link logger.info}. `logger.info`\n * defaults to a function which writes to stderr.\n */\n info?: (...args: Array<any>) => void;\n };\n};\n\n/**\n * Rename the file or directory at the specified path.\n *\n * Provides the same functionality as the command `mv`.\n */\ndeclare function rename(from: string | Path, to: string | Path): void;\n\n/**\n * A class which represents a filesystem path. The class contains various\n * methods that make it easy to work with filesystem paths; there are methods\n * for adding/removing path components, converting between absolute and relative\n * paths, getting the basename and dirname, and more.\n *\n * All functions in yavascript which accept path strings as arguments also\n * accept Path objects. As such, it is recommended that all filesystem paths in\n * your programs are Path objects rather than strings.\n *\n * Every Path object has two properties: `segments` and `separator`. `segments`\n * is an Array of strings containing all the non-slash portions of the path. For\n * example, the path \"one/two/three\" would have segments `[\"one\", \"two\",\n * \"three\"]`. `separator` is which slash is used to separate the segments;\n * either `\"/\"` or `\"\\\"`.\n *\n * A Path object can represent either a POSIX-style path or a win32-style path.\n * For the win32 style, UNC paths are supported. POSIX-style paths starting with\n * \"/\" (eg. \"/usr/bin\") have an empty string at the beginning of their segments\n * array to represent the left-hand-side of the leading slash. For instance,\n * \"/usr/bin\" would have segments `[\"\", \"usr\", \"bin\"]`.\n */\ndeclare class Path {\n /**\n * The character used to separate path segments on the current operating\n * system where yavascript is running.\n *\n * Its value is either a forward slash (`\"/\"`) or a backslash (`\"\\\"`). Its value\n * is a backslash on windows, and a forward slash on all other operating\n * systems.\n */\n static readonly OS_SEGMENT_SEPARATOR: \"/\" | \"\\\\\";\n\n /**\n * The character used to separate entries within the system's `PATH`\n * environment variable on the current operating system where yavascript is\n * running.\n *\n * The `PATH` environment variable contains a list of folders wherein\n * command-line programs can be found, separated by either a colon (`:`) or a\n * semicolon (`;`). The value of `OS_ENV_VAR_SEPARATOR` is a semicolon on\n * windows, and a colon on all other operating systems.\n *\n * The `PATH` environment variable can be accessed by yavascript programs via\n * `env.PATH`. Therefore, one can contain a list of all entries in the `PATH`\n * environment variable via:\n *\n * ```ts\n * const folders: Array<string> = env.PATH.split(Path.OS_ENV_VAR_SEPARATOR);\n * ```\n */\n static readonly OS_ENV_VAR_SEPARATOR: \":\" | \";\";\n\n /**\n * A Set of filename extension strings that command-line programs may end with\n * on the current operating system where yavascript is running. For instance,\n * on Windows, programs often end with \".exe\". Each of these strings contains\n * a leading dot (`.`).\n *\n * On windows, this value is based on the `PATHEXT` environment variable,\n * which defaults to \".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC\"\n * on Windows Vista and up. If `PATHEXT` is not defined, that default value is\n * used.\n *\n * On all other operating systems, this Set is empty.\n */\n static readonly OS_PROGRAM_EXTENSIONS: ReadonlySet<string>;\n\n /**\n * Converts a string (or array of strings) into an array of path segment\n * strings (the parts between the slashes).\n *\n * Example:\n *\n * ```ts\n * const input = [\"hi\", \"there/every/one\", \"yeah\\\\yup\"];\n * const result = Path.splitToSegments(input);\n * // result is [\"hi\", \"there\", \"every\", \"one\", \"yeah\", \"yup\"]\n * ```\n */\n static splitToSegments(inputParts: Array<string> | string): Array<string>;\n\n /**\n * Searches the provided path string or strings for a path separator character\n * (either forward slash or backslash), and returns the one it finds. If\n * neither is found, it returns the `fallback` arg, which defaults to the\n * current OS's path segment separator (`Path.OS_SEGMENT_SEPARATOR`).\n */\n static detectSeparator<Fallback extends string | null = string>(\n input: Array<string> | string,\n // @ts-ignore might be instantiated with a different subtype\n fallback: Fallback = Path.OS_SEGMENT_SEPARATOR\n ): string | Fallback;\n\n /**\n * Creates a new Path by concatenating the input path(s) and then resolving all\n * non-leading `.` and `..` segments. In other words:\n *\n * - Segments containing `.` are removed\n * - Segments containing `..` are removed, along with the segment preceding\n * them.\n *\n * Note that any `.` or `..` segments at the beginning of the path (ie.\n * \"leading segments\") are not removed.\n */\n static normalize(\n ...inputs: Array<string | Path | Array<string | Path>>\n ): Path;\n\n /**\n * Returns a boolean indicating whether the provided path is absolute; that\n * is, whether it starts with either a slash (`/` or `\\`) or a drive letter\n * (ie `C:`).\n *\n * Note that Windows UNC Paths (eg. `\\\\MYSERVER\\share$\\`) are considered\n * absolute.\n */\n static isAbsolute(path: string | Path): boolean;\n\n /**\n * Creates a new Path containing the user-provided segments and separator. In\n * most cases, you won't need to do this, and can use `new Path(...)` instead.\n *\n * If unspecified, the `separator` parameter defaults to\n * `Path.OS_SEGMENT_SEPARATOR`.\n */\n static fromRaw(segments: Array<string>, separator?: string): Path;\n\n /**\n * Creates a new Path object using the provided input(s), which will be\n * concatenated together in order left-to-right.\n */\n constructor(...inputs: Array<string | Path | Array<string | Path>>);\n\n /**\n * An array of the path segments that make up this path.\n *\n * For `/tmp/foo.txt`, it'd be `[\"\", \"tmp\", \"foo.txt\"]`.\n *\n * For `C:\\something\\somewhere.txt`, it'd be `[\"C:\", \"something\", \"somewhere.txt\"]`.\n */\n segments: Array<string>;\n\n /**\n * The path separator that should be used to turn this path into a string.\n *\n * Will be either `\"/\"` or `\"\\\"`.\n */\n separator: string;\n\n /**\n * Creates a new Path by resolving all non-leading `.` and `..` segments in\n * the target Path. In other words:\n *\n * - Segments containing `.` are removed\n * - Segments containing `..` are removed, along with the segment preceding\n * them.\n *\n * Note that any `.` or `..` segments at the beginning of the path (ie.\n * \"leading segments\") are not removed.\n */\n normalize(): Path;\n\n /**\n * Creates a new Path by appending additional path segments onto the end of\n * the target Path's segments.\n *\n * The returned Path will use the same separator as the target Path.\n */\n concat(...other: Array<string | Path | Array<string | Path>>): Path;\n\n /**\n * Returns a boolean indicating whether the target Path is absolute; that\n * is, whether it starts with either a slash (`/` or `\\`) or a drive letter\n * (ie `C:`).\n *\n * Note that Windows UNC Paths (eg. `\\\\MYSERVER\\share$\\`) are considered\n * absolute.\n */\n isAbsolute(): boolean;\n\n /**\n * Creates a new Path object containing the same segments and separator as\n * the target Path.\n *\n * Note that although it contains the same segments, the new Path does not use\n * the same Array instance for segments as the target Path is was cloned from.\n */\n clone(): this;\n\n /**\n * Creates a new Path which expresses the target Path relative to `dir`.\n *\n * @param dir - The directory to create a new path relative to.\n * @param options - Options that affect the resulting path (see {@link PathRelativeToOptions}).\n */\n relativeTo(dir: Path | string, options?: PathRelativeToOptions): Path;\n\n /**\n * Turns the target Path into a string by joining its segments using its\n * separator as the delimiter.\n */\n toString(): string;\n\n /**\n * Alias for `toString`. The presence of this method causes Path objects to be\n * serialized as strings when they (or an object referencing them) get(s) passed\n * into JSON.stringify.\n */\n toJSON(): string;\n\n /**\n * Returns the final segment of the target Path. If the target Path has no\n * segments, an empty string (`\"\"`) is returned.\n */\n basename(): string;\n\n /**\n * Returns the trailing file extension of this path.\n *\n * @param options - Works the same as the options parameter for the global {@link extname} (see {@link ExtnameOptions}).\n */\n extname(options?: ExtnameOptions): string;\n\n /**\n * Creates a new Path containing all of the segments in the target Path except\n * for the last one; ie. the path to the directory that contains the target Path.\n */\n dirname(): Path;\n\n /**\n * Returns a boolean indicating whether the target Path starts with the\n * provided value, by comparing one path segment at a time.\n *\n * The starting segments of the target Path must *exactly* match the segments in the\n * provided value.\n *\n * This means that, given two Paths A and B:\n *\n * ```\n * A: Path { /home/user/.config }\n * B: Path { /home/user/.config2 }\n * ```\n *\n * Path B does *not* start with Path A, because `\".config\" !== \".config2\"`.\n */\n startsWith(value: string | Path | Array<string | Path>): boolean;\n\n /**\n * Returns a boolean indicating whether the target Path ends with the provided\n * value, by comparing one path segment at a time.\n *\n * The ending segments of the target Path must *exactly* match the segments in the\n * provided value.\n *\n * This means that, given two Paths A and B:\n *\n * ```\n * A: Path { /home/1user/.config }\n * B: Path { user/.config }\n * ```\n *\n * Path A does *not* end with Path B, because `\"1user\" !== \"user\"`.\n */\n endsWith(value: string | Path | Array<string | Path>): boolean;\n\n /**\n * Returns the index at which `value` appears in the target Path's segments,\n * or `-1` if `value` doesn't appear in the target Path.\n *\n * @param value - The value to search for. If the value contains more than one path segment, the returned index will refer to the location of the value's first path segment.\n * @param fromIndex - The index into the target Path's segments to begin searching at. Defaults to `0`.\n */\n indexOf(\n value: string | Path | Array<string | Path>,\n fromIndex?: number | undefined\n ): number;\n\n /**\n * Returns a boolean indicating whether `value` appears in the target Path.\n *\n * @param value - The value to search for.\n * @param fromIndex - The index into the target Path's segments to begin searching at. Defaults to `0`.\n */\n includes(\n value: string | Path | Array<string | Path>,\n fromIndex?: number | undefined\n ): boolean;\n\n /**\n * Creates a new Path based on the target Path wherein the segments in `value`\n * have been replaced with the segments in `replacement`. If the segments in\n * `value` are not present in the target Path, a clone of the target Path is\n * returned.\n *\n * Note that only the first match is replaced. To replace more than one match,\n * use {@link Path.prototype.replaceAll}.\n *\n * @param value - What should be replaced\n * @param replacement - What it should be replaced with\n *\n * See also {@link Path.prototype.replaceLast}.\n */\n replace(\n value: string | Path | Array<string | Path>,\n replacement: string | Path | Array<string | Path>\n ): Path;\n\n /**\n * Creates a new Path based on the target Path wherein all occurrences of the\n * segments in `value` have been replaced with the segments in `replacement`.\n * If the segments in `value` are not present in the target Path, a clone of\n * the target Path is returned.\n *\n * Note that all matches are replaced. To replace only the first match,\n * use {@link Path.prototype.replace}.\n *\n * @param value - What should be replaced\n * @param replacement - What it should be replaced with\n *\n * See also {@link Path.prototype.replaceLast}.\n */\n replaceAll(\n value: string | Path | Array<string | Path>,\n replacement: string | Path | Array<string | Path>\n ): Path;\n\n /**\n * Creates a new Path based on the target Path but with the final segment\n * replaced with `replacement`.\n *\n * If the target Path has no segments, the newly created Path will be the same\n * as `new Path(replacement)`; ie. non-empty.\n *\n * @param replacement - The new final segment(s) for the returned Path\n */\n replaceLast(replacement: string | Path | Array<string | Path>): Path;\n\n /**\n * Return a boolean indicating whether this Path has the same separator and\n * segments as another Path.\n *\n * To check only segments and not separator, use {@link Path.prototype.hasEqualSegments}.\n */\n equals(other: string | Path | Array<string | Path>): boolean;\n\n /**\n * Return a boolean indicating whether this Path has the same segments as\n * another Path. **Separator is not checked; use {@link Path.prototype.equals} for that.**\n */\n hasEqualSegments(other: string | Path | Array<string | Path>): boolean;\n}\n\n/**\n * Options for {@link Path.prototype.relativeTo}.\n */\ndeclare interface PathRelativeToOptions {\n /**\n * Defaults to false. When true, a leading `./` will be omitted from the\n * path, if present. Note that a leading `../` will never be omitted.\n */\n noLeadingDot?: boolean;\n}\n\n/**\n * The absolute path to the currently-executing file (whether script or module).\n *\n * Behaves the same as in Node.js, except that it's also present within ES\n * modules.\n *\n * Example: `/home/suchipi/some-folder/some-file.js`\n */\ndeclare var __filename: string;\n\n/**\n * The absolute path to the directory containing the currently-executing file.\n *\n * Behaves the same as in Node.js, except that it's also present within ES\n * modules.\n *\n * Example: `/home/suchipi/some-folder`\n */\ndeclare var __dirname: string;\n\n/**\n * Return the last component of a path string.\n *\n * Provides the same functionality as the unix binary of the same name.\n *\n * > Example: `basename(\"/home/suchipi/something\")` returns `\"something\"`, the last part.\n */\ndeclare function basename(path: string | Path): string;\n\n/**\n * Reads the contents of one or more files from disk as either one UTF-8 string\n * or one ArrayBuffer.\n *\n * Provides the same functionality as the unix binary of the same name.\n *\n * > Example: If you have a file called `hi.txt` in the current working\n * > directory, and it contains the text \"hello\", running `cat(\"hi.txt\")`\n * > returns `\"hello\"`.\n */\ndeclare const cat: {\n /**\n * Read the contents of one or more files from disk, as one UTF-8 string.\n */\n (paths: string | Path | Array<string | Path>): string;\n\n /**\n * Read the contents of one or more files from disk, as one UTF-8 string.\n */\n (paths: string | Path | Array<string | Path>, options: {}): string;\n\n /**\n * Read the contents of one or more files from disk, as one UTF-8 string.\n */\n (\n paths: string | Path | Array<string | Path>,\n options: { binary: false }\n ): string;\n\n /**\n * Read the contents of one or more files from disk, as one ArrayBuffer.\n */\n (\n paths: string | Path | Array<string | Path>,\n options: { binary: true }\n ): ArrayBuffer;\n};\n\n/**\n * Changes the process's current working directory to the specified path. If no\n * path is specified, moves to the user's home directory.\n *\n * Provides the same functionality as the shell builtin of the same name.\n */\ndeclare function cd(path?: string | Path): void;\n\n/**\n * Set the permission bits for the specified file.\n *\n * Provides the same functionality as the unix binary of the same name.\n */\ndeclare const chmod: Chmod;\n\n/**\n * The interface for the global function `chmod`, which has two call signatures.\n */\ninterface Chmod {\n /**\n * Set the permission bits for the specified file.\n *\n * Provides the same functionality as the unix binary of the same name.\n *\n * @param permissions The permission bits to set. This can be a number, or a string containing an octal number.\n * @param path The path to the file.\n */\n (permissions: number | string, path: string | Path): void;\n\n /**\n * Apply a change to the permission bits for the specified file.\n *\n * Provides the same functionality as the unix binary of the same name.\n *\n * @param operation What to do to the bits; can be \"add\", \"set\", or \"remove\".\n * @param permissions An object describing the changes (see below).\n * @param path The path to the file.\n *\n * Each of the `permissions` object's own property keys must be one of these\n * strings:\n *\n * - `\"user\"`\n * - `\"group\"`\n * - `\"others\"`\n * - `\"all\"` (meaning \"user\", \"group\", and \"others\")\n * - `\"u\"` (alias for \"user\")\n * - `\"g\"` (alias for \"group\")\n * - `\"o\"` (alias for \"others\")\n * - `\"a\"` (alias for \"all\")\n * - `\"ug\"` (\"user\" plus \"group\")\n * - `\"go\"` (\"group\" plus \"others\")\n * - `\"uo\"` (\"user\" plus \"others\")\n *\n * and their values must be one of these strings:\n *\n * - `\"read\"` (permission to read the contents of the file)\n * - `\"write\"` (permission to write to the file's contents)\n * - `\"execute\"` (permission to run the file as an executable)\n * - `\"readwrite\"` (both \"read\" and \"write\")\n * - `\"none\"` (no permissions)\n * - `\"full\"` (\"read\", \"write\", and \"execute\")\n * - `\"r\"` (alias for \"read\")\n * - `\"w\"` (alias for \"write\")\n * - `\"x\"` (alias for \"execute\")\n * - `\"rw\"` (alias for \"readwrite\")\n * - `\"rx\"` (\"read\" and \"execute\")\n * - `\"wx\"` (\"write\" and \"execute\")\n * - `\"rwx\"` (alias for \"full\")\n *\n * Some example objects:\n *\n * ```json\n * { user: \"readwrite\", group: \"read\", others: \"none\" }\n * { ug: \"rw\", o: \"w\" }\n * { all: \"full\" }\n * ```\n */\n <Operation extends Chmod.Operation>(\n operation: Operation,\n permissions: Operation extends \"set\"\n ? Record<Chmod.Who, Chmod.Permission>\n : Partial<Record<Chmod.Who, Chmod.Permission>>,\n path: string | Path\n ): void;\n}\n\ndeclare namespace Chmod {\n /** A string representing who a permission applies to. */\n export type Who =\n | \"user\"\n | \"group\"\n | \"others\"\n | \"all\"\n | \"u\"\n | \"g\"\n | \"o\"\n | \"a\"\n | \"ug\"\n | \"go\"\n | \"uo\";\n\n /** A string representing how the permissions should be changed. */\n export type Operation = \"add\" | \"set\" | \"remove\";\n\n /** A string representing the access level for the given permission. */\n export type Permission =\n | \"read\"\n | \"write\"\n | \"execute\"\n | \"readwrite\"\n | \"none\"\n | \"full\"\n | \"r\"\n | \"w\"\n | \"x\"\n | \"rw\"\n | \"rx\"\n | \"wx\"\n | \"rwx\";\n}\n\n/**\n * Removes the final component from a path string.\n *\n * Provides the same functionality as the unix binary of the same name.\n *\n * > Example: `dirname(\"/home/suchipi/something\")` returns\n * > `\"/home/suchipi\"`, everything except the last part.\n */\ndeclare function dirname(path: string | Path): Path;\n\n/**\n * Print one or more values to stdout.\n *\n * Provides the same functionality as the shell builtin of the same name.\n *\n * > NOTE: This can print any value, not just strings.\n *\n * `echo` is functionally identical to `console.log`.\n */\ndeclare const echo: typeof console.log;\n\n/**\n * Exit the yavascript process.\n *\n * Provides the same functionality as the shell builtin of the same name.\n *\n * If exit is called with an argument, that argument is used as the exit code.\n * Otherwise, `exit.code` is used, which defaults to 0.\n *\n * `exit.code` will also be used as the exit status code for the yavascript\n * process if the process exits normally.\n *\n * > Attempting to call `exit` or set `exit.code` within a Worker will fail and\n * > throw an error.\n */\ndeclare const exit: {\n (code?: number): never;\n code: number;\n};\n\n/**\n * Returns the file extension of the file at a given path.\n *\n * If the file has no extension (eg `Makefile`, etc), then `''` will be\n * returned.\n *\n * @param pathOrFilename The input path\n * @param options Options which affect the return value. See {@link ExtnameOptions}.\n */\ndeclare function extname(\n pathOrFilename: string | Path,\n options?: ExtnameOptions\n): string;\n\n/**\n * Options for {@link extname} and {@link Path.prototype.extname}.\n */\ndeclare interface ExtnameOptions {\n /**\n * Whether to get compound extensions, like `.d.ts` or `.test.js`, instead of\n * just the final extension (`.ts` or `.js` in this example).\n */\n full?: boolean;\n}\n\n/**\n * Returns the contents of a directory, as absolute paths. `.` and `..` are\n * omitted.\n *\n * If `ls()` is called with no directory, the present working directory\n * (`pwd()`) is used.\n */\ndeclare function ls(dir?: string | Path): Array<Path>;\n\n/**\n * Create a directory (folder).\n *\n * Provides the same functionality as the unix binary of the same name.\n */\ndeclare function mkdir(\n path: string | Path,\n options?: {\n recursive?: boolean;\n mode?: number;\n logging?: {\n trace?: (...args: Array<any>) => void;\n info?: (...args: Array<any>) => void;\n };\n }\n): void;\n\n/**\n * Create a directory (folder) and all parents, recursively\n *\n * Alias for `mkdir(path, { recursive: true })`.\n *\n * Provides the same functionality as `mkdir -p`.\n */\ndeclare function mkdirp(\n path: string | Path,\n options?: {\n mode?: number;\n logging?: {\n trace?: (...args: Array<any>) => void;\n info?: (...args: Array<any>) => void;\n };\n }\n): void;\n\n/**\n * Print data to stdout using C-style format specifiers.\n *\n * The same formats as the [standard C library\n * printf](https://en.cppreference.com/w/c/io/fprintf) are supported. Integer\n * format types (e.g. `%d`) truncate the Numbers or BigInts to 32 bits. Use the\n * l modifier (e.g. `%ld`) to truncate to 64 bits.\n */\ndeclare function printf(format: string, ...args: Array<any>): void;\n\n/**\n * Returns the process's current working directory.\n *\n * Provides the same functionality as the shell builtin of the same name.\n */\ndeclare const pwd: {\n /**\n * Returns the process's current working directory.\n *\n * Provides the same functionality as the shell builtin of the same name.\n */\n (): Path;\n\n /**\n * A frozen, read-only `Path` object containing what `pwd()` was when\n * yavascript first started up.\n */\n readonly initial: Path;\n};\n\n/**\n * Reads a symlink.\n *\n * Returns the target of the symlink, which may be absolute or relative.\n *\n * Provides the same functionality as the unix binary of the same name.\n */\ndeclare function readlink(path: string | Path): Path;\n\n/**\n * Get the absolute path given a relative path. Symlinks are also resolved.\n *\n * The path's target file/directory must exist.\n *\n * Provides the same functionality as the unix binary of the same name.\n *\n * > If you want to convert a relative path to an absolute path, but the path's\n * > target might NOT exist, use {@link Path.normalize}.\n */\ndeclare function realpath(path: string | Path): Path;\n\n/**\n * `sleep` and `sleep.sync` block the current thread for at least the specified\n * number of milliseconds, but maybe a tiny bit longer.\n *\n * `sleep.async` returns a Promise which resolves in at least the specified\n * number of milliseconds, but maybe a tiny bit longer.\n *\n * `sleep` and `sleep.sync` block the current thread. `sleep.async` doesn't\n * block the current thread.\n *\n * \"Blocking the thread\" means no other JavaScript code can run while `sleep` or\n * `sleep.sync` is running. If this is not the behavior you want, use\n * `sleep.async` instead.\n */\ndeclare var sleep: {\n /**\n * Blocks the current thread for at least the specified number of\n * milliseconds, but maybe a tiny bit longer.\n *\n * alias for `sleep.sync`.\n *\n * @param milliseconds - The number of milliseconds to block for.\n *\n * No other JavaScript code can run while `sleep()` is running. If this is\n * not the behavior you want, use `sleep.async` instead.\n */\n (milliseconds: number): void;\n\n /**\n * Blocks the current thread for at least the specified number of\n * milliseconds, but maybe a tiny bit longer.\n *\n * @param milliseconds - The number of milliseconds to block for.\n *\n * No other JavaScript code can run while `sleep.sync` is running. If this is\n * not the behavior you want, use `sleep.async` instead.\n */\n sync(milliseconds: number): void;\n\n /**\n * Returns a Promise which resolves in at least the specified number of\n * milliseconds, maybe a little longer.\n *\n * @param milliseconds - The number of milliseconds to wait before the returned Promise should be resolved.\n *\n * `sleep.async` doesn't block the current thread, so other JavaScript code\n * (registered event handlers, async functions, timers, etc) can run while\n * `sleep.async`'s return Promise is waiting to resolve. If this is not the\n * behavior you want, use `sleep.sync` instead.\n *\n * The Promise returned by `sleep.async` will never get rejected. It will only\n * ever get resolved.\n */\n async(milliseconds: number): Promise<void>;\n};\n\n/**\n * If the file at `path` exists, update its creation/modification timestamps.\n *\n * Otherwise, create an empty file at that path.\n *\n * @param path The target path for the file.\n */\ndeclare function touch(path: string | Path): void;\n\n/**\n * Searches the system for the path to a program named `binaryName`.\n *\n * If the program can't be found, `null` is returned.\n *\n * @param binaryName The program to search for\n * @param options Options which affect how the search is performed\n * @param options.searchPaths A list of folders where programs may be found. Defaults to `env.PATH?.split(Path.OS_ENV_VAR_SEPARATOR) || []`.\n * @param options.suffixes A list of filename extension suffixes to include in the search, ie [\".exe\"]. Defaults to `Path.OS_PROGRAM_EXTENSIONS`.\n * @param options.trace A logging function that will be called at various times during the execution of `which`. Defaults to {@link logger.trace}.\n */\ndeclare function which(binaryName: string, options?: WhichOptions): Path | null;\n\ndeclare type WhichOptions = {\n /**\n * A list of folders where programs may be found. Defaults to\n * `env.PATH?.split(Path.OS_ENV_VAR_SEPARATOR) || []`.\n */\n searchPaths?: Array<Path | string>;\n\n /**\n * A list of filename extension suffixes to include in the search, ie\n * `[\".exe\"]`. Defaults to {@link Path.OS_PROGRAM_EXTENSIONS}.\n */\n suffixes?: Array<string>;\n\n /** Options which control logging. */\n logging?: {\n /**\n * If provided, this logging function will be called multiple times as\n * `which` runs, to help you understand what's going on and/or troubleshoot\n * things. In most cases, it makes sense to use a function from `console`\n * here, like so:\n *\n * ```js\n * which(\"bash\", {\n * logging: { trace: console.log }\n * });\n * ```\n *\n * Defaults to the current value of {@link logger.trace}. `logger.trace`\n * defaults to a no-op function.\n */\n trace?: (...args: Array<any>) => void;\n };\n};\n\n/** The type of the return value of {@link whoami}. */\ndeclare interface WhoAmIResult {\n name: string;\n uid: number;\n gid: number;\n}\n\n/**\n * Get info about the user the yavascript process is executing as.\n *\n * Provides functionality similar to the unix binaries `whoami` and `id`.\n *\n * NOTE: Doesn't work on Windows; throws an error.\n */\ndeclare function whoami(): WhoAmIResult;\n\n/**\n * Runs a child process and blocks until it exits. You can call it with either a\n * string or an array of strings.\n *\n * When calling `exec` with an array of strings, the first string in the array\n * is the program to run, and the rest of the strings in the array are arguments\n * to the program, eg:\n *\n * ```ts\n * exec([\"echo\", \"hi\", \"there\"]);\n * exec([\"printf\", \"something with spaces\\n\"]);\n * ```\n *\n * When calling with a string instead of an array, the string will be split into\n * separate arguments using the following rules:\n *\n * - The program and its arguments will be determined by splitting the input\n * string on whitespace, except:\n * - Stuff in single or double-quotes will be preserved as a single argument\n * - Double and single quotes can be \"glued\" together (eg `\"bla\"'bla'` becomes\n * `blabla`)\n * - The escape sequences `\\n`, `\\r`, `\\t`, `\\v`, `\\0`, and `\\\\` can be used\n * inside of quotes get replaced with newline, carriage return, tab,\n * vertical tab, nul, and `\\` characters, respectively\n *\n * For example:\n *\n * ```ts\n * exec(`echo hi there`);\n * exec(`printf \"something with spaces\\n\"`);\n * ```\n *\n * The intent is that it behaves similarly to what you would expect from a UNIX\n * shell, but only the \"safe\" features. \"Unsafe\" features like environment\n * variable expansion (`$VAR` or `${VAR}`), subshells (\\`echo hi\\` or `$(echo\n * hi)`), and redirection (`> /dev/null` or `2>&1 `) are not supported. To use\n * those features, shell out to `bash` or `sh` directly via eg `exec(['bash',\n * '-c', 'your command string'])`, but be aware of the security implications of\n * doing so.\n *\n * `exec` also supports a second argument, an options object which supports the\n * following keys (all are optional):\n *\n * | Property | Purpose |\n * | ------------------------------ | --------------------------------------------------- |\n * | cwd (string) | current working directory for the child process |\n * | env (object) | environment variables for the process |\n * | failOnNonZeroStatus (boolean) | whether to throw error on nonzero exit status |\n * | captureOutput (boolean/string) | controls how stdout/stderr is directed |\n * | logging (object) | controls how/whether info messages are logged |\n * | block (boolean) | whether to wait for child process exit now or later |\n *\n * The return value of `exec` varies depending on the options passed:\n *\n * - When `captureOutput` is true or \"utf-8\", an object will be returned with\n * `stdout` and `stderr` properties, both strings.\n * - When `captureOutput` is \"arraybuffer\", an object will be returned with\n * `stdout` and `stderr` properties, both `ArrayBuffer`s.\n * - When `failOnNonZeroStatus` is false, an object will be returned with\n * `status` (the exit code; number or undefined) and `signal` (the signal that\n * killed the process; number or undefined).\n * - When `captureOutput` is non-false and `failOnNonZeroStatus` is false, an\n * object will be returned with four properties (the two associated with\n * `failOnNonZeroStatus`, and the two associated with `captureOutput`).\n * - When `captureOutput` is false or unspecified, and `failOnNonZeroStatus` is\n * true or unspecified, undefined will be returned.\n * - If `block` is false, an object with a \"wait\" method is returned instead,\n * which blocks the calling thread until the process exits, and then returns\n * one of the values described above.\n */\ndeclare const exec: Exec;\n\ndeclare type BaseExecOptions = {\n /** Sets the current working directory for the child process. */\n cwd?: string | Path;\n\n /** Sets environment variables within the process. */\n env?: { [key: string | number]: string | number | boolean };\n\n /** Options which control logging. */\n logging?: {\n /**\n * If provided, this logging function will be called multiple times as\n * `exec` runs, to help you understand what's going on and/or troubleshoot\n * things. In most cases, it makes sense to use a function from `console`\n * here, like so:\n *\n * ```js\n * exec([\"echo\", \"hi\"], {\n * logging: { trace: console.log },\n * });\n * ```\n *\n * Defaults to the current value of {@link logger.trace}. `logger.trace`\n * defaults to a no-op function.\n */\n trace?: (...args: Array<any>) => void;\n\n /**\n * An optional, user-provided logging function to be used for informational\n * messages. Less verbose than `logging.trace`.\n *\n * Defaults to the current value of {@link logger.info}. `logger.info`\n * defaults to a function which logs to stderr.\n */\n info?: (...args: Array<any>) => void;\n };\n\n /**\n * Whether an Error should be thrown when the process exits with a nonzero\n * status code.\n *\n * Defaults to true.\n */\n failOnNonZeroStatus?: boolean;\n\n /**\n * If true, stdout and stderr will be collected into strings or array buffers\n * and returned instead of being printed to the screen.\n *\n * Defaults to false. true is an alias for \"utf8\".\n */\n captureOutput?: boolean | \"utf8\" | \"arraybuffer\";\n\n /**\n * If true, exec doesn't return until the process is done running. If false,\n * exec returns an object with a \"wait\" method which can be used to wait for\n * the process to be done running.\n *\n * Defaults to true.\n */\n block?: boolean;\n};\n\ndeclare interface Exec {\n /**\n * Runs a child process using the provided arguments.\n *\n * When `args` is an Array, the first value in the Array is the program to\n * run.\n *\n * @param args - The command to run.\n * @param options - Options; see {@link BaseExecOptions}\n */\n <\n ExecOptions extends BaseExecOptions = {\n failOnNonZeroStatus: true;\n captureOutput: false;\n block: true;\n }\n >(\n args: Array<string | Path | number> | string | Path,\n options?: ExecOptions\n ): ExecOptions[\"block\"] extends false\n ? { wait(): ExecWaitResult<ExecOptions> }\n : ExecWaitResult<ExecOptions>;\n\n /**\n * Parse the provided value into an array of command-line argument strings,\n * using the same logic that {@link exec} and {@link ChildProcess} use.\n */\n toArgv(args: Array<string | Path | number> | string | Path): Array<string>;\n}\n\n/**\n * `$(...)` is an alias for `exec(..., { captureOutput: true, failOnNonZeroStatus: true })`.\n *\n * It's often used to capture the output of a program:\n *\n * ```ts\n * const result = $(`echo hi`).stdout;\n * // result is 'hi\\n'\n * ```\n *\n * For more info, see {@link exec}.\n */\ndeclare function $(args: Array<string | Path | number> | string | Path): {\n stdout: string;\n stderr: string;\n};\n\ntype ExecWaitResult<ExecOptions extends BaseExecOptions> = ExecOptions extends\n | { captureOutput: true | \"utf8\" | \"arraybuffer\" }\n | { failOnNonZeroStatus: false }\n ? (ExecOptions[\"captureOutput\"] extends true | \"utf8\"\n ? { stdout: string; stderr: string }\n : {}) &\n (ExecOptions[\"captureOutput\"] extends \"arraybuffer\"\n ? { stdout: ArrayBuffer; stderr: ArrayBuffer }\n : {}) &\n (ExecOptions[\"failOnNonZeroStatus\"] extends false\n ?\n | { status: number; signal: undefined }\n | { status: undefined; signal: number }\n : {})\n : void;\n\n/**\n * A class which represents a child process. The process may or may not be\n * running.\n *\n * This class is the API used internally by the {@link exec} function to spawn child\n * processes.\n *\n * Generally, you should not need to use the `ChildProcess` class directly, and\n * should use {@link exec} or {@link $} instead. However, you may need to use it in some\n * special cases, like when specifying custom stdio for a process, or spawning a\n * non-blocking long-running process.\n */\ndeclare interface ChildProcess {\n /**\n * The argv for the process. The first entry in this array is the program to\n * run.\n */\n args: Array<string>;\n\n /** The current working directory for the process. */\n cwd: Path;\n\n /** The environment variables for the process. */\n env: { [key: string]: string };\n\n /**\n * The standard I/O streams for the process. Generally these are the same as\n * `std.in`, `std.out`, and `std.err`, but they can be customized to write\n * output elsewhere.\n */\n stdio: {\n /** Where the process reads stdin from */\n in: FILE;\n /** Where the process writes stdout to */\n out: FILE;\n /** Where the process writes stderr to */\n err: FILE;\n };\n\n get state(): ChildProcessState;\n get pid(): number | null;\n\n /** Spawns the process and returns its pid (process id). */\n start(): number;\n\n /** Blocks the calling thread until the process exits or is killed. */\n waitUntilComplete():\n | { status: number; signal: undefined }\n | { status: undefined; signal: number };\n}\n\ndeclare type ChildProcessState =\n | {\n id: \"UNSTARTED\";\n }\n | {\n id: \"STARTED\";\n pid: number;\n }\n | {\n id: \"STOPPED\";\n pid: number;\n }\n | {\n id: \"CONTINUED\";\n pid: number;\n }\n | {\n id: \"EXITED\";\n oldPid: number;\n status: number;\n }\n | {\n id: \"SIGNALED\";\n oldPid: number;\n signal: number;\n };\n\n/**\n * Options to be passed to the ChildProcess constructor. Their purposes and\n * types match the same-named properties found on the resulting ChildProcess.\n */\ndeclare type ChildProcessOptions = {\n /** The current working directory for the process. */\n cwd?: string | Path;\n\n /** The environment variables for the process. */\n env?: { [key: string]: string };\n\n /**\n * The standard I/O streams for the process. Generally these are the same as\n * `std.in`, `std.out`, and `std.err`, but they can be customized to write\n * output elsewhere.\n */\n stdio?: {\n /** Where the process reads stdin from */\n in?: FILE;\n /** Where the process writes stdout to */\n out?: FILE;\n /** Where the process writes stderr to */\n err?: FILE;\n };\n\n /** Options which control logging */\n logging?: {\n /**\n * Optional trace function which, if present, will be called at various\n * times to provide information about the lifecycle of the process.\n *\n * Defaults to the current value of {@link logger.trace}. `logger.trace`\n * defaults to a function which writes to stderr.\n */\n trace?: (...args: Array<any>) => void;\n };\n};\n\ndeclare interface ChildProcessConstructor {\n /**\n * Construct a new ChildProcess.\n *\n * @param args - The argv for the process. The first entry in this array is the program to run.\n * @param options - Options for the process (cwd, env, stdio, etc)\n */\n new (\n args: string | Path | Array<string | number | Path>,\n options?: ChildProcessOptions\n ): ChildProcess;\n\n readonly prototype: ChildProcess;\n}\n\ndeclare var ChildProcess: ChildProcessConstructor;\n\n/**\n * Searches the filesystem in order to resolve [UNIX-style glob\n * strings](https://man7.org/linux/man-pages/man7/glob.7.html) into an array of\n * matching filesystem paths.\n *\n * Glob strings assist in succinctly finding and describing a set of files on\n * disk. For instance, to find the path of every `.js` file in the `src` folder,\n * one might write `src/*.js`.\n *\n * The function `glob` can be used to turn one or more of these \"glob strings\" into an array of\n * `Path` objects.\n *\n * `glob` uses [minimatch](https://www.npmjs.com/package/minimatch) with its\n * default options, which means it supports features like brace expanstion,\n * \"globstar\" (**) matching, and other features you would expect from a modern\n * globbing solution.\n *\n * > When specifying more than one pattern string, paths must match ALL of the\n * > patterns to be included in the returned Array. In other words, it uses\n * > \"logical AND\" behavior when you give it more than one pattern.\n */\ndeclare function glob(\n patterns: string | Array<string>,\n options?: GlobOptions\n): Array<Path>;\n\n/**\n * Options for {@link glob}.\n */\ndeclare type GlobOptions = {\n /**\n * Whether to treat symlinks to directories as if they themselves were\n * directories, traversing into them.\n *\n * Defaults to false.\n */\n followSymlinks?: boolean;\n\n /** Options which control logging. */\n logging?: {\n /**\n * If provided, this function will be called multiple times as `glob`\n * traverses the filesystem, to help you understand what's going on and/or\n * troubleshoot things. In most cases, it makes sense to use a logging\n * function here, like so:\n *\n * ```js\n * glob([\"./*.js\"], {\n * logging: { trace: console.log }\n * });\n * ```\n *\n * Defaults to the current value of {@link logger.trace}. `logger.trace`\n * defaults to a no-op function.\n */\n trace?: (...args: Array<any>) => void;\n\n /**\n * An optional, user-provided logging function to be used for informational\n * messages. Less verbose than `logging.trace`.\n *\n * Defaults to the current value of {@link logger.info}. `logger.info`\n * defaults to a function which writes to stderr.\n */\n info?: (...args: Array<any>) => void;\n };\n\n /**\n * Directory to interpret glob patterns relative to. Defaults to `pwd()`.\n */\n dir?: string | Path;\n};\n\n/**\n * Prints special ANSI escape characters to stdout which instruct your terminal\n * emulator to clear the screen and clear your terminal scrollback.\n *\n * Identical to {@link console.clear}.\n */\ndeclare function clear(): void;\n\ninterface Console {\n /**\n * Logs its arguments to stdout, with a newline appended.\n *\n * Any value can be logged, not just strings. Non-string values will be\n * formatted using {@link inspect}.\n *\n * Functionally identical to {@link console.info}, {@link echo}, and\n * {@link print}. Contrast with {@link console.error}, which prints to stderr\n * instead of stdout.\n */\n log(message?: any, ...optionalParams: any[]): void;\n\n /**\n * Logs its arguments to stdout, with a newline appended.\n *\n * Any value can be logged, not just strings. Non-string values will be\n * formatted using {@link inspect}.\n *\n * Functionally identical to {@link console.log}, {@link echo}, and\n * {@link print}. Contrast with {@link console.error}, which prints to stderr\n * instead of stdout.\n */\n info(message?: any, ...optionalParams: any[]): void;\n\n /**\n * Logs its arguments to stderr, with a newline appended.\n *\n * Any value can be logged, not just strings. Non-string values will be\n * formatted using {@link inspect}.\n *\n * Functionally identical to {@link console.error}. Contrast with\n * {@link console.log}, which prints to stdout instead of stderr.\n */\n warn(message?: any, ...optionalParams: any[]): void;\n\n /**\n * Logs its arguments to stderr, with a newline appended.\n *\n * Any value can be logged, not just strings. Non-string values will be\n * formatted using {@link inspect}.\n *\n * Functionally identical to {@link console.warn}. Contrast with\n * {@link console.log}, which prints to stdout instead of stderr.\n */\n error(message?: any, ...optionalParams: any[]): void;\n\n /**\n * Prints special ANSI escape characters to stdout which instruct your terminal\n * emulator to clear the screen and clear your terminal scrollback.\n *\n * Identical to {@link clear}.\n */\n clear(): void;\n}\n\ndeclare var console: Console;\n\n/**\n * `print` is an alias for {@link console.log}, which prints values to stdout.\n *\n * Any value can be logged, not just strings. Non-string values will be\n * formatted using {@link inspect}.\n */\ndeclare function print(...args: any): void;\n\n/**\n * Removes ANSI control characters from a string.\n */\ndeclare function stripAnsi(input: string | number | Path): string;\n\n/**\n * Wraps a string in double quotes, and escapes any double-quotes inside using `\\\"`.\n */\ndeclare function quote(input: string | number | Path): string;\n\n// Colors\n\n/** Wraps a string with the ANSI control characters that will make it print as black text. */\ndeclare function black(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it print as red text. */\ndeclare function red(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it print as green text. */\ndeclare function green(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it print as yellow text. */\ndeclare function yellow(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it print as blue text. */\ndeclare function blue(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it print as magenta text. */\ndeclare function magenta(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it print as cyan text. */\ndeclare function cyan(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it print as white text. */\ndeclare function white(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it print as gray text. (Alias for {@link grey}.) */\ndeclare function gray(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it print as grey text. (Alias for {@link gray}.) */\ndeclare function grey(input: string | number | Path): string;\n\n// Background Colors\n\n/** Wraps a string with the ANSI control characters that will make it have a black background when printed. */\ndeclare function bgBlack(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it have a red background when printed. */\ndeclare function bgRed(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it have a green background when printed. */\ndeclare function bgGreen(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it have a yellow background when printed. */\ndeclare function bgYellow(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it have a blue background when printed. */\ndeclare function bgBlue(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it have a magenta background when printed. */\ndeclare function bgMagenta(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it have a cyan background when printed. */\ndeclare function bgCyan(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it have a white background when printed. */\ndeclare function bgWhite(input: string | number | Path): string;\n\n// Modifiers\n\n/** Prefixes a string with the ANSI control character that resets all styling. */\ndeclare function reset(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it print with a bold style. */\ndeclare function bold(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it print with a dimmed style. */\ndeclare function dim(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it print italicized. */\ndeclare function italic(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it print underlined. */\ndeclare function underline(input: string | number | Path): string;\n/** Wraps a string with ANSI control characters that will make it print with its foreground (text) and background colors swapped. */\ndeclare function inverse(input: string | number | Path): string;\n/** Wraps a string with ANSI control characters that will make it print as hidden. */\ndeclare function hidden(input: string | number | Path): string;\n/** Wraps a string with the ANSI control characters that will make it print with a horizontal line through its center. */\ndeclare function strikethrough(input: string | number | Path): string;\n\n/**\n * Splits the string passed into it on `\\n` and then returns the lines matching\n * the specified pattern, as an array of strings or detail objects.\n *\n * @param str - The string to search through.\n * @param pattern - The pattern to find. Can be a string or a RegExp.\n * @param options - Options which control matching behavior.\n *\n * See also {@link grepFile} and {@link String.prototype.grep}.\n */\ndeclare const grepString: {\n (\n str: string,\n pattern: string | RegExp,\n options: GrepOptions & { details: true }\n ): Array<GrepMatchDetail>;\n\n (str: string, pattern: string | RegExp, options?: GrepOptions): Array<string>;\n};\n\n/**\n * Reads the file content at `path`, splits it on `\\n`, and then returns the\n * lines matching the specified pattern, as an array of strings or detail objects.\n *\n * @param str - The string to search through.\n * @param pattern - The pattern to find. Can be a string or a RegExp.\n * @param options - Options which control matching behavior.\n *\n * See also {@link grepString} and {@link String.prototype.grep}.\n */\ndeclare const grepFile: {\n (\n path: string | Path,\n pattern: string | RegExp,\n options: GrepOptions & { details: true }\n ): Array<GrepMatchDetail>;\n\n (\n path: string | Path,\n pattern: string | RegExp,\n options?: GrepOptions\n ): Array<string>;\n};\n\ninterface String {\n // Same as grepString but without the first argument.\n /**\n * Splits the target string on `\\n` and then returns the lines matching the\n * specified pattern, as an array of strings or detail objects.\n *\n * @param str - The string to search through.\n * @param pattern - The pattern to find. Can be a string or a RegExp.\n * @param options - Options which control matching behavior.\n *\n * See also {@link grepString} and {@link grepFile}.\n */\n grep: {\n (\n pattern: string | RegExp,\n options: GrepOptions & { details: true }\n ): Array<GrepMatchDetail>;\n\n (pattern: string | RegExp, options?: GrepOptions): Array<string>;\n };\n}\n\ndeclare interface GrepOptions {\n /**\n * When `inverse` is true, the grep function returns those lines which DON'T\n * match the pattern, instead of those which do. Defaults to `false`.\n */\n inverse?: boolean;\n\n /**\n * When `details` is true, the grep function returns an array of\n * {@link GrepMatchDetail} objects instead of an array of strings. Defaults to\n * `false`.\n */\n details?: boolean;\n}\n\n/**\n * When `grepString`, `grepFile`, or `String.prototype.grep` are called with the\n * `{ details: true }` option set, an Array of `GrepMatchDetail` objects is\n * returned.\n */\ndeclare interface GrepMatchDetail {\n lineNumber: number;\n lineContent: string;\n matches: RegExpMatchArray;\n}\n\n/**\n * The `types` namespace object contains various functions which can be used to\n * identify the type of a value at runtime. It is based on\n * [pheno](https://github.com/suchipi/pheno), with some yavascript-specific\n * extensions.\n *\n * ## Usage\n *\n * To check that a value is of a type, use `is`. To assert that a value is of a\n * type, use `assert.type`:\n *\n * ```ts\n * is(\"hi\", types.string); // true\n * is(\"hi\", types.number); // false\n * is({ blah: 42 }, types.objectWithProperties({ blah: types.number })); // true\n *\n * assert.type(\"hi\", types.string);\n * assert.type(\"hi\", types.number); // throws\n * assert.type({ blah: 42 }, types.objectWithProperties({ blah: types.number }));\n * ```\n *\n * In many cases, you can use a \"normal\" JavaScript value for the type instead\n * of something from the `types` namespace. For instance, the following code\n * block is equivalent to the previous one:\n *\n * ```ts\n * is(\"hi\", String); // true\n * is(\"hi\", Number); // false\n * is({ blah: 42 }, { blah: Number }); // true\n *\n * assert.type(\"hi\", String);\n * assert.type(\"hi\", Number); // throws\n * assert.type({ blah: 42 }, { blah: Number });\n * ```\n *\n * For more info about using \"normal\" values, see the \"Coercion\" heading below.\n *\n * ## Explanation\n *\n * There are two kinds of function properties found on the `types` namespace:\n * those which return a boolean, and those which return a function. Functions\n * which return a boolean are called \"type validators\", and can be used to check\n * the type of a value. For example, `types.number` is a type validator:\n *\n * ```ts\n * is(42, types.number); // returns true\n * ```\n *\n * The other kind of function is a function which returns a function. These are\n * called \"type validator constructors\", because the function they return is a\n * type validator. They are used to construct complex type validators. For\n * example, `types.exactString` is a type validator constructor:\n *\n * ```ts\n * const myType = types.exactString(\"potato\");\n * // myType is a function which returns true or false\n *\n * is(\"eggplant\", myType); // returns false\n * is(\"potato\", myType); // returns true\n * ```\n *\n * ## List of Functions\n *\n * ### Type Validators\n *\n * Here is a list of all the type validators:\n *\n * - `any`\n * - `anyArray`\n * - `anyFunction`\n * - `anyMap`\n * - `anyObject`\n * - `anySet`\n * - `anyTypeValidator`\n * - `array` (alias of `arrayOfUnknown`)\n * - `arrayOfAny`\n * - `arrayOfUnknown`\n * - `Array` (alias of `arrayOfUnknown`)\n * - `bigint`\n * - `BigInt` (alias of `bigint`)\n * - `boolean`\n * - `Boolean` (alias of `boolean`)\n * - `Date`\n * - `Error`\n * - `false`\n * - `falsy`\n * - `Function` (alias of `unknownFunction`)\n * - `Infinity`\n * - `integer`\n * - `map` (alias of `unknownMap`)\n * - `Map` (alias of `unknownMap`)\n * - `NaN`\n * - `NegativeInfinity`\n * - `never`\n * - `nonNullOrUndefined`\n * - `null`\n * - `nullish`\n * - `void` (alias of `nullish`)\n * - `number` (doesn't include NaN, Infinity, or -Infinity)\n * - `Number` (alias of `number`)\n * - `numberIncludingNanAndInfinities`\n * - `object` (alias of `unknownObject`)\n * - `Object` (alias of `unknownObject`)\n * - `objectOrNull`\n * - `RegExp`\n * - `set` (alias of `unknownSet`)\n * - `Set` (alias of `unknownSet`)\n * - `string`\n * - `String` (alias of `string`)\n * - `Symbol`\n * - `symbol` (alias of `Symbol`)\n * - `true`\n * - `truthy`\n * - `undefined`\n * - `unknown`\n * - `unknownFunction`\n * - `unknownMap`\n * - `unknownObject`\n * - `unknownSet`\n * - `unknownTypeValidator`\n * - `ArrayBuffer`\n * - `SharedArrayBuffer`\n * - `DataView`\n * - `TypedArray`\n * - `Int8Array`\n * - `Uint8Array`\n * - `Uint8ClampedArray`\n * - `Int16Array`\n * - `Uint16Array`\n * - `Int32Array`\n * - `Uint32Array`\n * - `Float32Array`\n * - `Float64Array`\n * - `FILE`\n * - `Path`\n * - `JSX.Element` (alias of `JSX.unknownElement`)\n * - `JSX.unknownElement`\n * - `JSX.anyElement`\n * - `JSX.Fragment`\n *\n * ### Type Validator Constructors\n *\n * And all the type validator constructors:\n *\n * - `and`\n * - `arrayOf`\n * - `exactBigInt`\n * - `exactNumber`\n * - `exactString`\n * - `exactSymbol`\n * - `hasClassName`\n * - `hasToStringTag`\n * - `instanceOf`\n * - `intersection`\n * - `mapOf`\n * - `mappingObjectOf`\n * - `maybe`\n * - `objectWithOnlyTheseProperties`\n * - `objectWithProperties`\n * - `or`\n * - `optional`\n * - `partialObjectWithProperties`\n * - `record`\n * - `setOf`\n * - `stringMatching`\n * - `symbolFor`\n * - `union`\n *\n * ## Coercion\n *\n * There is also a function, `types.coerce`, which returns an appropriate type\n * validator value for a given input value, using the following logic:\n *\n * | Input value | Output validator |\n * | ----------------------------- | ---------------------------------- |\n * | `String` or `string` global | `types.string` |\n * | `Number` or `number` global | `types.number` |\n * | `Boolean` or `boolean` global | `types.boolean` |\n * | `BigInt` or `bigint` global | `types.bigint` |\n * | `Symbol` global | `types.Symbol` |\n * | `RegExp` global | `types.RegExp` |\n * | `Array` global | `types.arrayOfUnknown` |\n * | `Set` global | `types.unknownSet` |\n * | `Map` global | `types.unknownMap` |\n * | `Object` global | `types.unknownObject` |\n * | `Date` global | `types.Date` |\n * | `Function` global | `types.unknownFunction` |\n * | `ArrayBuffer` global | `types.ArrayBuffer` |\n * | `SharedArrayBuffer` global | `types.SharedArrayBuffer` |\n * | `DataView` global | `types.DataView` |\n * | `Int8Array` global | `types.Int8Array` |\n * | `Uint8Array` global | `types.Uint8Array` |\n * | `Uint8ClampedArray` global | `types.Uint8ClampedArray` |\n * | `Int16Array` global | `types.Int16Array` |\n * | `Uint16Array` global | `types.Uint16Array` |\n * | `Int32Array` global | `types.Int32Array` |\n * | `Uint32Array` global | `types.Uint32Array` |\n * | `Float32Array` global | `types.Float32Array` |\n * | `Float64Array` global | `types.Float64Array` |\n * | `Path` global | `types.Path` |\n * | Any RegExp value | Validator for matching strings |\n * | Empty array | Validator for empty arrays |\n * | Array with one item | Validator for array of that item |\n * | Array with multiple items | Validator for tuple of those types |\n * | Class constructor function | Validator for instances of it |\n * | Any Object value | Validator for same-shaped object |\n * | null | `types.null` |\n * | undefined | `types.undefined` |\n * | true | `types.true` |\n * | false | `types.false` |\n * | NaN | `types.NaN` |\n * | Infinity | `types.Infinity` |\n * | `-Infinity` | `types.NegativeInfinity` |\n * | Any string value | `types.exactString(<the value>)` |\n * | Any 'normal' number value | `types.exactNumber(<the value>)` |\n * | Any Symbol value | `types.exactSymbol(<the value>)` |\n * | Any BigInt value | `types.exactBigInt(<the value>)` |\n *\n * > All type constructors, as well as `is` and `assert.type`, do coercion\n * > automatically! This means that in many cases, you do not need to access\n * > properties from the `types` namespace.\n */\ndeclare const types: {\n // basic types\n any: TypeValidator<any>;\n unknown: TypeValidator<unknown>;\n anyObject: TypeValidator<{\n [key: string | number | symbol]: any;\n }>;\n unknownObject: TypeValidator<{}>;\n object: TypeValidator<{}>;\n Object: TypeValidator<{}>;\n arrayOfAny: TypeValidator<Array<any>>;\n arrayOfUnknown: TypeValidator<Array<unknown>>;\n array: TypeValidator<Array<unknown>>;\n Array: TypeValidator<unknown[]>;\n anyArray: TypeValidator<Array<any>>;\n boolean: TypeValidator<boolean>;\n Boolean: TypeValidator<boolean>;\n string: TypeValidator<string>;\n String: TypeValidator<string>;\n null: TypeValidator<null>;\n undefined: TypeValidator<undefined>;\n nullish: TypeValidator<null | undefined>;\n void: TypeValidator<null | undefined>;\n numberIncludingNanAndInfinities: TypeValidator<number>;\n number: TypeValidator<number>;\n Number: TypeValidator<number>;\n NaN: TypeValidator<number>;\n Infinity: TypeValidator<number>;\n NegativeInfinity: TypeValidator<number>;\n integer: TypeValidator<number>;\n bigint: TypeValidator<bigint>;\n BigInt: TypeValidator<bigint>;\n never: TypeValidator<never>;\n anyFunction: TypeValidator<(...args: any) => any>;\n unknownFunction: TypeValidator<(...args: Array<unknown>) => unknown>;\n Function: TypeValidator<(...args: Array<unknown>) => unknown>;\n false: TypeValidator<false>;\n true: TypeValidator<true>;\n falsy: TypeValidator<false | null | undefined | \"\" | 0>;\n truthy: <T>(target: false | \"\" | 0 | T | null | undefined) => target is T;\n nonNullOrUndefined: <T>(target: T | null | undefined) => target is T;\n Error: TypeValidator<Error>;\n Symbol: TypeValidator<symbol>;\n symbol: TypeValidator<symbol>;\n RegExp: TypeValidator<RegExp>;\n Date: TypeValidator<Date>;\n anyMap: TypeValidator<Map<any, any>>;\n unknownMap: TypeValidator<Map<unknown, unknown>>;\n map: TypeValidator<Map<unknown, unknown>>;\n Map: TypeValidator<Map<unknown, unknown>>;\n anySet: TypeValidator<Set<any>>;\n unknownSet: TypeValidator<Set<unknown>>;\n set: TypeValidator<Set<unknown>>;\n Set: TypeValidator<Set<unknown>>;\n ArrayBuffer: TypeValidator<ArrayBuffer>;\n SharedArrayBuffer: TypeValidator<SharedArrayBuffer>;\n DataView: TypeValidator<DataView>;\n TypedArray: TypeValidator<\n | Int8Array\n | Uint8Array\n | Uint8ClampedArray\n | Int16Array\n | Uint16Array\n | Int32Array\n | Uint32Array\n | Float32Array\n | Float64Array\n >;\n Int8Array: TypeValidator<Int8Array>;\n Uint8Array: TypeValidator<Uint8Array>;\n Uint8ClampedArray: TypeValidator<Uint8ClampedArray>;\n Int16Array: TypeValidator<Int16Array>;\n Uint16Array: TypeValidator<Uint16Array>;\n Int32Array: TypeValidator<Int32Array>;\n Uint32Array: TypeValidator<Uint32Array>;\n Float32Array: TypeValidator<Float32Array>;\n Float64Array: TypeValidator<Float64Array>;\n\n // type constructors\n exactString<T extends string>(str: T): TypeValidator<T>;\n exactNumber<T extends number>(num: T): TypeValidator<T>;\n exactBigInt<T extends bigint>(num: T): TypeValidator<T>;\n exactSymbol<T extends symbol>(sym: T): TypeValidator<T>;\n hasClassName<Name extends string>(\n name: Name\n ): TypeValidator<{ constructor: Function & { name: Name } }>;\n hasToStringTag(name: string): TypeValidator<any>;\n instanceOf<Klass extends Function & { prototype: any }>(\n klass: Klass\n ): TypeValidator<Klass[\"prototype\"]>;\n stringMatching(regexp: RegExp): TypeValidator<string>;\n symbolFor(key: string): TypeValidator<symbol>;\n arrayOf<T extends TypeValidator<any> | CoerceableToTypeValidator | unknown>(\n typeValidator: T\n ): TypeValidator<Array<UnwrapTypeFromCoerceableOrValidator<T>>>;\n intersection: {\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second\n ): TypeValidator<\n UnwrapTypeFromCoerceableOrValidator<First> &\n UnwrapTypeFromCoerceableOrValidator<Second>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third\n ): TypeValidator<\n UnwrapTypeFromCoerceableOrValidator<First> &\n UnwrapTypeFromCoerceableOrValidator<Second> &\n UnwrapTypeFromCoerceableOrValidator<Third>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth\n ): TypeValidator<\n UnwrapTypeFromCoerceableOrValidator<First> &\n UnwrapTypeFromCoerceableOrValidator<Second> &\n UnwrapTypeFromCoerceableOrValidator<Third> &\n UnwrapTypeFromCoerceableOrValidator<Fourth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth\n ): TypeValidator<\n UnwrapTypeFromCoerceableOrValidator<First> &\n UnwrapTypeFromCoerceableOrValidator<Second> &\n UnwrapTypeFromCoerceableOrValidator<Third> &\n UnwrapTypeFromCoerceableOrValidator<Fourth> &\n UnwrapTypeFromCoerceableOrValidator<Fifth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth\n ): TypeValidator<\n UnwrapTypeFromCoerceableOrValidator<First> &\n UnwrapTypeFromCoerceableOrValidator<Second> &\n UnwrapTypeFromCoerceableOrValidator<Third> &\n UnwrapTypeFromCoerceableOrValidator<Fourth> &\n UnwrapTypeFromCoerceableOrValidator<Fifth> &\n UnwrapTypeFromCoerceableOrValidator<Sixth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh\n ): TypeValidator<\n UnwrapTypeFromCoerceableOrValidator<First> &\n UnwrapTypeFromCoerceableOrValidator<Second> &\n UnwrapTypeFromCoerceableOrValidator<Third> &\n UnwrapTypeFromCoerceableOrValidator<Fourth> &\n UnwrapTypeFromCoerceableOrValidator<Fifth> &\n UnwrapTypeFromCoerceableOrValidator<Sixth> &\n UnwrapTypeFromCoerceableOrValidator<Seventh>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh,\n eighth: Eighth\n ): TypeValidator<\n UnwrapTypeFromCoerceableOrValidator<First> &\n UnwrapTypeFromCoerceableOrValidator<Second> &\n UnwrapTypeFromCoerceableOrValidator<Third> &\n UnwrapTypeFromCoerceableOrValidator<Fourth> &\n UnwrapTypeFromCoerceableOrValidator<Fifth> &\n UnwrapTypeFromCoerceableOrValidator<Sixth> &\n UnwrapTypeFromCoerceableOrValidator<Seventh> &\n UnwrapTypeFromCoerceableOrValidator<Eighth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Ninth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh,\n eighth: Eighth,\n ninth: Ninth\n ): TypeValidator<\n UnwrapTypeFromCoerceableOrValidator<First> &\n UnwrapTypeFromCoerceableOrValidator<Second> &\n UnwrapTypeFromCoerceableOrValidator<Third> &\n UnwrapTypeFromCoerceableOrValidator<Fourth> &\n UnwrapTypeFromCoerceableOrValidator<Fifth> &\n UnwrapTypeFromCoerceableOrValidator<Sixth> &\n UnwrapTypeFromCoerceableOrValidator<Seventh> &\n UnwrapTypeFromCoerceableOrValidator<Eighth> &\n UnwrapTypeFromCoerceableOrValidator<Ninth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Ninth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Tenth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh,\n eighth: Eighth,\n ninth: Ninth,\n tenth: Tenth\n ): TypeValidator<\n UnwrapTypeFromCoerceableOrValidator<First> &\n UnwrapTypeFromCoerceableOrValidator<Second> &\n UnwrapTypeFromCoerceableOrValidator<Third> &\n UnwrapTypeFromCoerceableOrValidator<Fourth> &\n UnwrapTypeFromCoerceableOrValidator<Fifth> &\n UnwrapTypeFromCoerceableOrValidator<Sixth> &\n UnwrapTypeFromCoerceableOrValidator<Seventh> &\n UnwrapTypeFromCoerceableOrValidator<Eighth> &\n UnwrapTypeFromCoerceableOrValidator<Ninth> &\n UnwrapTypeFromCoerceableOrValidator<Tenth>\n >;\n };\n and: {\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second\n ): TypeValidator<\n UnwrapTypeFromCoerceableOrValidator<First> &\n UnwrapTypeFromCoerceableOrValidator<Second>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third\n ): TypeValidator<\n UnwrapTypeFromCoerceableOrValidator<First> &\n UnwrapTypeFromCoerceableOrValidator<Second> &\n UnwrapTypeFromCoerceableOrValidator<Third>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth\n ): TypeValidator<\n UnwrapTypeFromCoerceableOrValidator<First> &\n UnwrapTypeFromCoerceableOrValidator<Second> &\n UnwrapTypeFromCoerceableOrValidator<Third> &\n UnwrapTypeFromCoerceableOrValidator<Fourth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth\n ): TypeValidator<\n UnwrapTypeFromCoerceableOrValidator<First> &\n UnwrapTypeFromCoerceableOrValidator<Second> &\n UnwrapTypeFromCoerceableOrValidator<Third> &\n UnwrapTypeFromCoerceableOrValidator<Fourth> &\n UnwrapTypeFromCoerceableOrValidator<Fifth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth\n ): TypeValidator<\n UnwrapTypeFromCoerceableOrValidator<First> &\n UnwrapTypeFromCoerceableOrValidator<Second> &\n UnwrapTypeFromCoerceableOrValidator<Third> &\n UnwrapTypeFromCoerceableOrValidator<Fourth> &\n UnwrapTypeFromCoerceableOrValidator<Fifth> &\n UnwrapTypeFromCoerceableOrValidator<Sixth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh\n ): TypeValidator<\n UnwrapTypeFromCoerceableOrValidator<First> &\n UnwrapTypeFromCoerceableOrValidator<Second> &\n UnwrapTypeFromCoerceableOrValidator<Third> &\n UnwrapTypeFromCoerceableOrValidator<Fourth> &\n UnwrapTypeFromCoerceableOrValidator<Fifth> &\n UnwrapTypeFromCoerceableOrValidator<Sixth> &\n UnwrapTypeFromCoerceableOrValidator<Seventh>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh,\n eighth: Eighth\n ): TypeValidator<\n UnwrapTypeFromCoerceableOrValidator<First> &\n UnwrapTypeFromCoerceableOrValidator<Second> &\n UnwrapTypeFromCoerceableOrValidator<Third> &\n UnwrapTypeFromCoerceableOrValidator<Fourth> &\n UnwrapTypeFromCoerceableOrValidator<Fifth> &\n UnwrapTypeFromCoerceableOrValidator<Sixth> &\n UnwrapTypeFromCoerceableOrValidator<Seventh> &\n UnwrapTypeFromCoerceableOrValidator<Eighth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Ninth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh,\n eighth: Eighth,\n ninth: Ninth\n ): TypeValidator<\n UnwrapTypeFromCoerceableOrValidator<First> &\n UnwrapTypeFromCoerceableOrValidator<Second> &\n UnwrapTypeFromCoerceableOrValidator<Third> &\n UnwrapTypeFromCoerceableOrValidator<Fourth> &\n UnwrapTypeFromCoerceableOrValidator<Fifth> &\n UnwrapTypeFromCoerceableOrValidator<Sixth> &\n UnwrapTypeFromCoerceableOrValidator<Seventh> &\n UnwrapTypeFromCoerceableOrValidator<Eighth> &\n UnwrapTypeFromCoerceableOrValidator<Ninth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Ninth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Tenth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh,\n eighth: Eighth,\n ninth: Ninth,\n tenth: Tenth\n ): TypeValidator<\n UnwrapTypeFromCoerceableOrValidator<First> &\n UnwrapTypeFromCoerceableOrValidator<Second> &\n UnwrapTypeFromCoerceableOrValidator<Third> &\n UnwrapTypeFromCoerceableOrValidator<Fourth> &\n UnwrapTypeFromCoerceableOrValidator<Fifth> &\n UnwrapTypeFromCoerceableOrValidator<Sixth> &\n UnwrapTypeFromCoerceableOrValidator<Seventh> &\n UnwrapTypeFromCoerceableOrValidator<Eighth> &\n UnwrapTypeFromCoerceableOrValidator<Ninth> &\n UnwrapTypeFromCoerceableOrValidator<Tenth>\n >;\n };\n union: {\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second\n ): TypeValidator<\n | UnwrapTypeFromCoerceableOrValidator<First>\n | UnwrapTypeFromCoerceableOrValidator<Second>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third\n ): TypeValidator<\n | UnwrapTypeFromCoerceableOrValidator<First>\n | UnwrapTypeFromCoerceableOrValidator<Second>\n | UnwrapTypeFromCoerceableOrValidator<Third>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth\n ): TypeValidator<\n | UnwrapTypeFromCoerceableOrValidator<First>\n | UnwrapTypeFromCoerceableOrValidator<Second>\n | UnwrapTypeFromCoerceableOrValidator<Third>\n | UnwrapTypeFromCoerceableOrValidator<Fourth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth\n ): TypeValidator<\n | UnwrapTypeFromCoerceableOrValidator<First>\n | UnwrapTypeFromCoerceableOrValidator<Second>\n | UnwrapTypeFromCoerceableOrValidator<Third>\n | UnwrapTypeFromCoerceableOrValidator<Fourth>\n | UnwrapTypeFromCoerceableOrValidator<Fifth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth\n ): TypeValidator<\n | UnwrapTypeFromCoerceableOrValidator<First>\n | UnwrapTypeFromCoerceableOrValidator<Second>\n | UnwrapTypeFromCoerceableOrValidator<Third>\n | UnwrapTypeFromCoerceableOrValidator<Fourth>\n | UnwrapTypeFromCoerceableOrValidator<Fifth>\n | UnwrapTypeFromCoerceableOrValidator<Sixth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh\n ): TypeValidator<\n | UnwrapTypeFromCoerceableOrValidator<First>\n | UnwrapTypeFromCoerceableOrValidator<Second>\n | UnwrapTypeFromCoerceableOrValidator<Third>\n | UnwrapTypeFromCoerceableOrValidator<Fourth>\n | UnwrapTypeFromCoerceableOrValidator<Fifth>\n | UnwrapTypeFromCoerceableOrValidator<Sixth>\n | UnwrapTypeFromCoerceableOrValidator<Seventh>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh,\n eighth: Eighth\n ): TypeValidator<\n | UnwrapTypeFromCoerceableOrValidator<First>\n | UnwrapTypeFromCoerceableOrValidator<Second>\n | UnwrapTypeFromCoerceableOrValidator<Third>\n | UnwrapTypeFromCoerceableOrValidator<Fourth>\n | UnwrapTypeFromCoerceableOrValidator<Fifth>\n | UnwrapTypeFromCoerceableOrValidator<Sixth>\n | UnwrapTypeFromCoerceableOrValidator<Seventh>\n | UnwrapTypeFromCoerceableOrValidator<Eighth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Ninth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh,\n eighth: Eighth,\n ninth: Ninth\n ): TypeValidator<\n | UnwrapTypeFromCoerceableOrValidator<First>\n | UnwrapTypeFromCoerceableOrValidator<Second>\n | UnwrapTypeFromCoerceableOrValidator<Third>\n | UnwrapTypeFromCoerceableOrValidator<Fourth>\n | UnwrapTypeFromCoerceableOrValidator<Fifth>\n | UnwrapTypeFromCoerceableOrValidator<Sixth>\n | UnwrapTypeFromCoerceableOrValidator<Seventh>\n | UnwrapTypeFromCoerceableOrValidator<Eighth>\n | UnwrapTypeFromCoerceableOrValidator<Ninth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Ninth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Tenth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh,\n eighth: Eighth,\n ninth: Ninth,\n tenth: Tenth\n ): TypeValidator<\n | UnwrapTypeFromCoerceableOrValidator<First>\n | UnwrapTypeFromCoerceableOrValidator<Second>\n | UnwrapTypeFromCoerceableOrValidator<Third>\n | UnwrapTypeFromCoerceableOrValidator<Fourth>\n | UnwrapTypeFromCoerceableOrValidator<Fifth>\n | UnwrapTypeFromCoerceableOrValidator<Sixth>\n | UnwrapTypeFromCoerceableOrValidator<Seventh>\n | UnwrapTypeFromCoerceableOrValidator<Eighth>\n | UnwrapTypeFromCoerceableOrValidator<Ninth>\n | UnwrapTypeFromCoerceableOrValidator<Tenth>\n >;\n };\n or: {\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second\n ): TypeValidator<\n | UnwrapTypeFromCoerceableOrValidator<First>\n | UnwrapTypeFromCoerceableOrValidator<Second>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third\n ): TypeValidator<\n | UnwrapTypeFromCoerceableOrValidator<First>\n | UnwrapTypeFromCoerceableOrValidator<Second>\n | UnwrapTypeFromCoerceableOrValidator<Third>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth\n ): TypeValidator<\n | UnwrapTypeFromCoerceableOrValidator<First>\n | UnwrapTypeFromCoerceableOrValidator<Second>\n | UnwrapTypeFromCoerceableOrValidator<Third>\n | UnwrapTypeFromCoerceableOrValidator<Fourth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth\n ): TypeValidator<\n | UnwrapTypeFromCoerceableOrValidator<First>\n | UnwrapTypeFromCoerceableOrValidator<Second>\n | UnwrapTypeFromCoerceableOrValidator<Third>\n | UnwrapTypeFromCoerceableOrValidator<Fourth>\n | UnwrapTypeFromCoerceableOrValidator<Fifth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth\n ): TypeValidator<\n | UnwrapTypeFromCoerceableOrValidator<First>\n | UnwrapTypeFromCoerceableOrValidator<Second>\n | UnwrapTypeFromCoerceableOrValidator<Third>\n | UnwrapTypeFromCoerceableOrValidator<Fourth>\n | UnwrapTypeFromCoerceableOrValidator<Fifth>\n | UnwrapTypeFromCoerceableOrValidator<Sixth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh\n ): TypeValidator<\n | UnwrapTypeFromCoerceableOrValidator<First>\n | UnwrapTypeFromCoerceableOrValidator<Second>\n | UnwrapTypeFromCoerceableOrValidator<Third>\n | UnwrapTypeFromCoerceableOrValidator<Fourth>\n | UnwrapTypeFromCoerceableOrValidator<Fifth>\n | UnwrapTypeFromCoerceableOrValidator<Sixth>\n | UnwrapTypeFromCoerceableOrValidator<Seventh>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh,\n eighth: Eighth\n ): TypeValidator<\n | UnwrapTypeFromCoerceableOrValidator<First>\n | UnwrapTypeFromCoerceableOrValidator<Second>\n | UnwrapTypeFromCoerceableOrValidator<Third>\n | UnwrapTypeFromCoerceableOrValidator<Fourth>\n | UnwrapTypeFromCoerceableOrValidator<Fifth>\n | UnwrapTypeFromCoerceableOrValidator<Sixth>\n | UnwrapTypeFromCoerceableOrValidator<Seventh>\n | UnwrapTypeFromCoerceableOrValidator<Eighth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Ninth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh,\n eighth: Eighth,\n ninth: Ninth\n ): TypeValidator<\n | UnwrapTypeFromCoerceableOrValidator<First>\n | UnwrapTypeFromCoerceableOrValidator<Second>\n | UnwrapTypeFromCoerceableOrValidator<Third>\n | UnwrapTypeFromCoerceableOrValidator<Fourth>\n | UnwrapTypeFromCoerceableOrValidator<Fifth>\n | UnwrapTypeFromCoerceableOrValidator<Sixth>\n | UnwrapTypeFromCoerceableOrValidator<Seventh>\n | UnwrapTypeFromCoerceableOrValidator<Eighth>\n | UnwrapTypeFromCoerceableOrValidator<Ninth>\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Ninth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Tenth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh,\n eighth: Eighth,\n ninth: Ninth,\n tenth: Tenth\n ): TypeValidator<\n | UnwrapTypeFromCoerceableOrValidator<First>\n | UnwrapTypeFromCoerceableOrValidator<Second>\n | UnwrapTypeFromCoerceableOrValidator<Third>\n | UnwrapTypeFromCoerceableOrValidator<Fourth>\n | UnwrapTypeFromCoerceableOrValidator<Fifth>\n | UnwrapTypeFromCoerceableOrValidator<Sixth>\n | UnwrapTypeFromCoerceableOrValidator<Seventh>\n | UnwrapTypeFromCoerceableOrValidator<Eighth>\n | UnwrapTypeFromCoerceableOrValidator<Ninth>\n | UnwrapTypeFromCoerceableOrValidator<Tenth>\n >;\n };\n mapOf<\n K extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n V extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n keyType: K,\n valueType: V\n ): TypeValidator<\n Map<\n UnwrapTypeFromCoerceableOrValidator<K>,\n UnwrapTypeFromCoerceableOrValidator<V>\n >\n >;\n setOf<T extends TypeValidator<any> | CoerceableToTypeValidator | unknown>(\n itemType: T\n ): TypeValidator<Set<UnwrapTypeFromCoerceableOrValidator<T>>>;\n maybe<T extends TypeValidator<any> | CoerceableToTypeValidator | unknown>(\n itemType: T\n ): TypeValidator<UnwrapTypeFromCoerceableOrValidator<T> | undefined | null>;\n objectWithProperties<\n T extends {\n [key: string | number | symbol]:\n | TypeValidator<any>\n | CoerceableToTypeValidator\n | unknown;\n }\n >(\n properties: T\n ): TypeValidator<{\n [key in keyof T]: UnwrapTypeFromCoerceableOrValidator<T[key]>;\n }>;\n objectWithOnlyTheseProperties<\n T extends {\n [key: string | number | symbol]:\n | TypeValidator<any>\n | CoerceableToTypeValidator\n | unknown;\n }\n >(\n properties: T\n ): TypeValidator<{\n [key in keyof T]: UnwrapTypeFromCoerceableOrValidator<T[key]>;\n }>;\n\n mappingObjectOf<\n Values extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Keys extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n keyType: Keys,\n valueType: Values\n ): TypeValidator<\n Record<\n UnwrapTypeFromCoerceableOrValidator<Keys> extends string | number | symbol\n ? UnwrapTypeFromCoerceableOrValidator<Keys>\n : never,\n UnwrapTypeFromCoerceableOrValidator<Values>\n >\n >;\n record<\n Values extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Keys extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n keyType: Keys,\n valueType: Values\n ): TypeValidator<\n Record<\n UnwrapTypeFromCoerceableOrValidator<Keys> extends string | number | symbol\n ? UnwrapTypeFromCoerceableOrValidator<Keys>\n : never,\n UnwrapTypeFromCoerceableOrValidator<Values>\n >\n >;\n partialObjectWithProperties<\n T extends {\n [key: string | number | symbol]:\n | TypeValidator<any>\n | CoerceableToTypeValidator\n | unknown;\n }\n >(\n properties: T\n ): TypeValidator<{\n [key in keyof T]:\n | UnwrapTypeFromCoerceableOrValidator<T[key]>\n | null\n | undefined;\n }>;\n tuple: {\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second\n ): TypeValidator<\n [\n UnwrapTypeFromCoerceableOrValidator<First>,\n UnwrapTypeFromCoerceableOrValidator<Second>\n ]\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third\n ): TypeValidator<\n [\n UnwrapTypeFromCoerceableOrValidator<First>,\n UnwrapTypeFromCoerceableOrValidator<Second>,\n UnwrapTypeFromCoerceableOrValidator<Third>\n ]\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth\n ): TypeValidator<\n [\n UnwrapTypeFromCoerceableOrValidator<First>,\n UnwrapTypeFromCoerceableOrValidator<Second>,\n UnwrapTypeFromCoerceableOrValidator<Third>,\n UnwrapTypeFromCoerceableOrValidator<Fourth>\n ]\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth\n ): TypeValidator<\n [\n UnwrapTypeFromCoerceableOrValidator<First>,\n UnwrapTypeFromCoerceableOrValidator<Second>,\n UnwrapTypeFromCoerceableOrValidator<Third>,\n UnwrapTypeFromCoerceableOrValidator<Fourth>,\n UnwrapTypeFromCoerceableOrValidator<Fifth>\n ]\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth\n ): TypeValidator<\n [\n UnwrapTypeFromCoerceableOrValidator<First>,\n UnwrapTypeFromCoerceableOrValidator<Second>,\n UnwrapTypeFromCoerceableOrValidator<Third>,\n UnwrapTypeFromCoerceableOrValidator<Fourth>,\n UnwrapTypeFromCoerceableOrValidator<Fifth>,\n UnwrapTypeFromCoerceableOrValidator<Sixth>\n ]\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh\n ): TypeValidator<\n [\n UnwrapTypeFromCoerceableOrValidator<First>,\n UnwrapTypeFromCoerceableOrValidator<Second>,\n UnwrapTypeFromCoerceableOrValidator<Third>,\n UnwrapTypeFromCoerceableOrValidator<Fourth>,\n UnwrapTypeFromCoerceableOrValidator<Fifth>,\n UnwrapTypeFromCoerceableOrValidator<Sixth>,\n UnwrapTypeFromCoerceableOrValidator<Seventh>\n ]\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh,\n eighth: Eighth\n ): TypeValidator<\n [\n UnwrapTypeFromCoerceableOrValidator<First>,\n UnwrapTypeFromCoerceableOrValidator<Second>,\n UnwrapTypeFromCoerceableOrValidator<Third>,\n UnwrapTypeFromCoerceableOrValidator<Fourth>,\n UnwrapTypeFromCoerceableOrValidator<Fifth>,\n UnwrapTypeFromCoerceableOrValidator<Sixth>,\n UnwrapTypeFromCoerceableOrValidator<Seventh>,\n UnwrapTypeFromCoerceableOrValidator<Eighth>\n ]\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Ninth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh,\n eighth: Eighth,\n ninth: Ninth\n ): TypeValidator<\n [\n UnwrapTypeFromCoerceableOrValidator<First>,\n UnwrapTypeFromCoerceableOrValidator<Second>,\n UnwrapTypeFromCoerceableOrValidator<Third>,\n UnwrapTypeFromCoerceableOrValidator<Fourth>,\n UnwrapTypeFromCoerceableOrValidator<Fifth>,\n UnwrapTypeFromCoerceableOrValidator<Sixth>,\n UnwrapTypeFromCoerceableOrValidator<Seventh>,\n UnwrapTypeFromCoerceableOrValidator<Eighth>,\n UnwrapTypeFromCoerceableOrValidator<Ninth>\n ]\n >;\n <\n First extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Second extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Third extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fourth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Fifth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Sixth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Seventh extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Eighth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Ninth extends TypeValidator<any> | CoerceableToTypeValidator | unknown,\n Tenth extends TypeValidator<any> | CoerceableToTypeValidator | unknown\n >(\n first: First,\n second: Second,\n third: Third,\n fourth: Fourth,\n fifth: Fifth,\n sixth: Sixth,\n seventh: Seventh,\n eighth: Eighth,\n ninth: Ninth,\n tenth: Tenth\n ): TypeValidator<\n [\n UnwrapTypeFromCoerceableOrValidator<First>,\n UnwrapTypeFromCoerceableOrValidator<Second>,\n UnwrapTypeFromCoerceableOrValidator<Third>,\n UnwrapTypeFromCoerceableOrValidator<Fourth>,\n UnwrapTypeFromCoerceableOrValidator<Fifth>,\n UnwrapTypeFromCoerceableOrValidator<Sixth>,\n UnwrapTypeFromCoerceableOrValidator<Seventh>,\n UnwrapTypeFromCoerceableOrValidator<Eighth>,\n UnwrapTypeFromCoerceableOrValidator<Ninth>,\n UnwrapTypeFromCoerceableOrValidator<Tenth>\n ]\n >;\n };\n\n coerce: <V extends CoerceableToTypeValidator | TypeValidator<any> | unknown>(\n value: V\n ) => TypeValidator<UnwrapTypeFromCoerceableOrValidator<V>>;\n\n FILE: TypeValidator<FILE>;\n Path: TypeValidator<Path>;\n JSX: {\n unknownElement: TypeValidator<\n JSX.Element<{ [key: string | symbol | number]: unknown }, unknown>\n >;\n anyElement: TypeValidator<JSX.Element<any, any>>;\n Element: TypeValidator<\n JSX.Element<{ [key: string | symbol | number]: unknown }, unknown>\n >;\n Fragment: TypeValidator<JSX.Fragment>;\n };\n};\n\ndeclare type TypeValidator<T> = (value: any) => value is T;\n\ndeclare type CoerceToTypeValidator<V extends CoerceableToTypeValidator> =\n V extends StringConstructor\n ? TypeValidator<string>\n : V extends NumberConstructor\n ? TypeValidator<number>\n : V extends BooleanConstructor\n ? TypeValidator<boolean>\n : V extends BigIntConstructor\n ? TypeValidator<BigInt>\n : V extends SymbolConstructor\n ? TypeValidator<Symbol>\n : V extends RegExpConstructor\n ? TypeValidator<RegExp>\n : V extends ArrayConstructor\n ? TypeValidator<Array<unknown>>\n : V extends SetConstructor\n ? TypeValidator<Set<unknown>>\n : V extends MapConstructor\n ? TypeValidator<Map<unknown, unknown>>\n : V extends ObjectConstructor\n ? TypeValidator<{\n [key: string | number | symbol]: unknown;\n }>\n : V extends DateConstructor\n ? TypeValidator<Date>\n : V extends FunctionConstructor\n ? TypeValidator<Function>\n : V extends ArrayBufferConstructor\n ? TypeValidator<ArrayBuffer>\n : V extends SharedArrayBufferConstructor\n ? TypeValidator<SharedArrayBuffer>\n : V extends DataViewConstructor\n ? TypeValidator<DataView>\n : V extends Int8ArrayConstructor\n ? TypeValidator<Int8Array>\n : V extends Uint8ArrayConstructor\n ? TypeValidator<Uint8Array>\n : V extends Uint8ClampedArrayConstructor\n ? TypeValidator<Uint8ClampedArray>\n : V extends Int16ArrayConstructor\n ? TypeValidator<Int16Array>\n : V extends Uint16ArrayConstructor\n ? TypeValidator<Uint16Array>\n : V extends Int32ArrayConstructor\n ? TypeValidator<Int32Array>\n : V extends Uint32ArrayConstructor\n ? TypeValidator<Uint32Array>\n : V extends Float32ArrayConstructor\n ? TypeValidator<Float32Array>\n : V extends Float64ArrayConstructor\n ? TypeValidator<Float64Array>\n : V extends RegExp\n ? TypeValidator<string>\n : V extends {}\n ? TypeValidator<{\n [key in keyof V]: CoerceToTypeValidator<V[key]>;\n }>\n : V extends []\n ? TypeValidator<[]>\n : V extends [any]\n ? TypeValidator<Array<CoerceToTypeValidator<V[0]>>>\n : V extends Array<any>\n ? TypeValidator<Array<unknown>>\n : V extends {\n new (...args: any): any;\n }\n ? TypeValidator<InstanceType<V>>\n : TypeValidator<V>;\n\ndeclare type CoerceableToTypeValidator =\n | boolean\n | number\n | string\n | bigint\n | undefined\n | null\n | RegExp\n | StringConstructor\n | NumberConstructor\n | BooleanConstructor\n | BigIntConstructor\n | SymbolConstructor\n | RegExpConstructor\n | ArrayConstructor\n | SetConstructor\n | MapConstructor\n | ObjectConstructor\n | DateConstructor\n | FunctionConstructor\n | ArrayBufferConstructor\n | SharedArrayBufferConstructor\n | DataViewConstructor\n | Int8ArrayConstructor\n | Uint8ArrayConstructor\n | Uint8ClampedArrayConstructor\n | Int16ArrayConstructor\n | Uint16ArrayConstructor\n | Int32ArrayConstructor\n | Uint32ArrayConstructor\n | Float32ArrayConstructor\n | Float64ArrayConstructor\n | {}\n | []\n | [any]\n | Array<any>\n | {\n new (...args: any): any;\n };\n\ndeclare type UnwrapTypeFromCoerceableOrValidator<\n V extends CoerceableToTypeValidator | TypeValidator<any> | unknown\n> = V extends TypeValidator<infer T>\n ? T\n : V extends CoerceableToTypeValidator\n ? CoerceToTypeValidator<V> extends TypeValidator<infer T>\n ? T\n : never\n : unknown;\n\n/**\n * Returns whether `value` is of type `type`. Useful for validating that values\n * have the correct type at runtime, in library functions or etc.\n *\n * The `type` parameter can be any of the following:\n *\n * - a TypeValidator function from the `types` namespace\n * - a global constructor like `String`, `Number`, `Boolean`, `Set`,\n * `Int8Array`, etc\n * - a user-defined class\n * - a primitive value like `true`, `false`, `null`, or `42`\n * - a Regular Expression (to match strings that match the regexp)\n * - an object or array containing any combination of the above\n *\n * Note that yavascript has the following global aliases defined, which are also\n * valid types:\n *\n * ```ts\n * const bigint = BigInt;\n * const boolean = Boolean;\n * const number = Number;\n * const string = String;\n * const symbol = Symbol;\n * ```\n *\n * ## Example\n *\n * ```ts\n * is(42, Number); // true\n * is(42, number); // true\n * is(42, types.number); // true\n *\n * is(42, String); // false\n * is(42, Set); // false\n * is(42, Array); // false\n *\n * is(42, 42); // true\n * is(42, 45); // false\n *\n * is({ kind: \"success\", data: 99 }, { kind: \"success\" }); // true\n * ```\n *\n * ```ts\n * // Defined in yavascript/src/api/is\n * declare function is(value: any, type: TypeValidator<any>): boolean;\n * ```\n *\n * See also {@link types} (which contains {@link TypeValidator}s that can be\n * used by `is`) and {@link assert.type} (which throws an error instead of\n * returning a boolean).\n */\ndeclare const is: <T extends TypeValidator<any> | CoerceableToTypeValidator>(\n value: any,\n type: T\n) => value is UnwrapTypeFromCoerceableOrValidator<T>;\n\n/**\n * Alias to {@link is}, for when using the Civet language, because `is` is a\n * reserved keyword in Civet.\n */\ndeclare const _is: typeof is;\n\ndeclare const assert: {\n /**\n * Throws an error if `value` is not truthy.\n *\n * @param value - The value to test for truthiness\n * @param message - An optional error message to use. If unspecified, \"Assertion failed\" will be used.\n */\n <ValueType>(\n value: ValueType,\n message?: string\n ): asserts value is ValueType extends null | undefined | false | 0 | \"\"\n ? never\n : ValueType;\n\n /**\n * Throws an error if its argument isn't the correct type.\n *\n * @param value - The value to test the type of\n * @param type - The type that `value` should be, as either a `TypeValidator` (from the `types.*` namespace) or a value which can be coerced into a `TypeValidator` via the `types.coerce` function, like `String`, `Boolean`, etc.\n * @param message - An optional error message to use. If unspecified, a generic-but-descriptive message will be used.\n */\n type: <T extends TypeValidator<any> | CoerceableToTypeValidator>(\n value: any,\n type: T,\n optionalMessage?: string\n ) => asserts value is UnwrapTypeFromCoerceableOrValidator<T>;\n};\n\n/**\n * This API is a work-in-progress and is subject to change at any time.\n */\ninterface InteractivePrompt {\n prompt?: () => string;\n printInput?: (input: string) => void;\n historyFileName?: string;\n getCompletions?: (\n line: string,\n pos: number\n ) => {\n // TODO refactor these to have better key names\n tab: Array<string>;\n pos: number;\n ctx: { [key: string | number | symbol]: any };\n };\n\n handleInput: (input: string) => void;\n start(): void;\n}\n\n/**\n * This API is a work-in-progress and is subject to change at any time.\n */\ninterface InteractivePromptConstructor {\n new (\n handleInput: (input: string) => void,\n options?: {\n prompt?: () => string;\n printInput?: (input: string) => void;\n historyFileName?: string;\n getCompletions?: (\n line: string,\n pos: number\n ) => {\n // TODO refactor these to have better key names\n tab: Array<string>;\n pos: number;\n ctx: { [key: string | number | symbol]: any };\n };\n }\n ): InteractivePrompt;\n\n prototype: InteractivePrompt;\n}\n\n/**\n * This API is a work-in-progress and is subject to change at any time.\n */\ndeclare var InteractivePrompt: InteractivePromptConstructor;\n\n/**\n * Launch the Yavascript REPL (read-eval-print-loop).\n *\n * @param context Variables to make available as globals within the repl.\n * @param lang The language to use in the repl. Defaults to \"javascript\".\n */\ndeclare const startRepl: {\n (\n context?: { [key: string]: any },\n lang?:\n | \"js\"\n | \"javascript\"\n | \"ts\"\n | \"typescript\"\n | \"jsx\"\n | \"tsx\"\n | \"coffee\"\n | \"coffeescript\"\n | \"civet\"\n ): void;\n\n /**\n * A special value; when expressions result in this value, the repl will\n * print nothing instead of printing this value.\n */\n NOTHING: symbol;\n};\n\n/**\n * An object that points to a git repository on disk and provides utility\n * methods for getting information from that repo.\n *\n * To use it, construct a GitRepo object, passing in the path to the repo:\n *\n * ```ts\n * // The path here is just an example\n * const repo = new GitRepo(\"/home/suchipi/Code/yavascript\");\n * ```\n *\n * Then, you can use methods/properties on the `repo` object:\n *\n * ```ts\n * console.log(repo.branchName() || repo.commitSHA());\n * ```\n */\ndeclare class GitRepo {\n /**\n * Given a path to a file or folder on disk, searches upwards through the\n * directory ancestry to find a `.git` folder, then returns the Path that\n * contains that `.git` folder. If no `.git` folder is found, an error will be\n * thrown.\n *\n * For example, if you have a git repo at `/home/suchipi/Code/my-project`,\n * such that `/home/suchipi/Code/my-project/.git` exists, calling\n * `GitRepo.findRoot(\"/home/suchipi/Code/my-project/src/index.js\")` will\n * return a `Path` object pointing to `/home/suchipi/Code/my-project`.\n *\n * This function can be useful in order to set the current working directory\n * of a script relative to the root of the git repo the script appears in. By\n * doing so, the script can be invoked from any directory.\n *\n * For instance, consider this theoretical filesystem layout:\n *\n * ```\n * my-project\n * - src\n * - my-script.js\n * - README.md\n * ```\n *\n * If `my-script.js` contained the following content:\n *\n * ```ts\n * #!/usr/bin/env yavascript\n *\n * cat(\"README.md\");\n * ```\n *\n * Then running `src/my-script.js` would print the contents of the README as\n * expected.\n *\n * However, suppose someone ran the script from a different folder:\n *\n * ```sh\n * $ cd src\n * $ ./my-script.js\n * ```\n *\n * Now an error occurs!\n *\n * To make the script resilient against this, you can use `cd` at the top of\n * the script:\n *\n * ```ts\n * #!/usr/bin/env yavascript\n *\n * // __dirname is a special variable that refers to the folder the current script is in.\n * cd(__dirname);\n * cd(\"..\");\n *\n * cat(\"README.md\");\n * ```\n *\n * However, if the location of `my-script.js` later changes, you will have to\n * remember to update the script. For instance, if `src/my-script.js` got\n * moved to `src/tools/my-script.js`, you would need to update the script like\n * so:\n *\n * ```ts\n * #!/usr/bin/env yavascript\n *\n * cd(__dirname);\n * cd(\"../..\"); // Changed this line\n *\n * cat(\"README.md\");\n * ```\n *\n * Since `README.md` will always be in the repository root, using\n * `GitRepo.findRoot` would make the `cd` resilient against file moves:\n *\n * ```ts\n * #!/usr/bin/env yavascript\n *\n * cd(GitRepo.findRoot(__dirname));\n *\n * cat(\"README.md\");\n * ```\n *\n * Depending on how you anticipate your codebase changing over time, and how\n * you expect others to use your scripts, it might make sense to use\n * `cd(__dirname)`, `cd(GitRepo.findRoot(__dirname))`, or no `cd` at all. Pick what\n * makes the most sense for your situation.\n *\n */\n static findRoot(fromPath: string | Path): Path;\n\n /**\n * Creates a new `GitRepo` object for the given repo on disk.\n */\n constructor(repoDir: string | Path);\n\n /**\n * The root folder of the git repo that this `GitRepo` object represents (the\n * folder that contains the '.git' folder).\n */\n repoDir: Path;\n\n /**\n * Returns the full SHA-1 hash string associated with the repo's current\n * commit.\n *\n * For example:\n *\n * ```ts\n * const repo = new GitRepo(\".\");\n * const sha = repo.commitSHA();\n * console.log(sha);\n * // \"2a0a15f9872406faebcac694562efeae3447a4ba\"\n * ```\n *\n * To obtain this information, the command `git rev-parse HEAD` gets run\n * within the repo's directory.\n *\n * > If the repo has unstaged or uncommitted changes, that state will NOT be\n * > reflected in the SHA-1 hash. As such, it may be desirable to use this\n * > method in conjunction with `GitRepo.prototype.isWorkingTreeDirty`.\n */\n commitSHA(): string;\n\n /**\n * If the commit SHA the git repo is currently pointed at is the tip of a\n * named branch, returns the branch name. Otherwise, returns `null`.\n *\n * This is done by running `git rev-parse --abbrev-ref HEAD` within the repo\n * directory.\n *\n * Example:\n *\n * ```ts\n * const repo = new GitRepo(\".\");\n * const branch = repo.branchName();\n * console.log(branch);\n * // \"main\"\n * ```\n *\n * > The most common situation where there is no current branch is when the\n * > repository is in \"detached HEAD\" state.\n */\n branchName(): string | null;\n\n /**\n * Returns a boolean indicating whether there are uncommited changes in the\n * git repo. `true` means there are changes, `false` means there are no\n * changes (ie. the repo is clean).\n *\n * This is done by running `git status --quiet` within the repo directory.\n */\n isWorkingTreeDirty(): boolean;\n\n /**\n * Returns a boolean indicating whether the provided path is ignored by one or\n * more `.gitignore` files in the repository.\n *\n * Example:\n *\n * ```ts\n * const repo = new GitRepo(\".\");\n * const ignoreStatus = repo.isIgnored(\"README.md\");\n * console.log(ignoreStatus);\n * // false\n * ```\n *\n * To obtain this information, the command `git check-ignore <the-path>` gets\n * run within the repo's directory.\n *\n * An error will be thrown if the provided path is not within the repository's\n * directory tree. For instance, calling `gitRepo.isIgnored(\"/tmp\")` on a\n * `gitRepo` pointed at `/home/suchipi/my-project` would throw an error,\n * because `/tmp` is not a child of `/home/suchipi/my-project`.\n *\n * > NOTE: When passing relative paths to `isIgnored`, they will be resolved\n * > relative to the repo root, NOT relative to `pwd()`. It's best practice to\n * > always pass around absolute paths in your program instead of relative\n * > ones so that this type of ambiguity is avoided.\n */\n isIgnored(path: string | Path): boolean;\n}\n\n/**\n * The logger used internally by yavascript API functions such as {@link which},\n * {@link exec}, {@link copy}, {@link glob}, and more.\n *\n * You can modify the properties on this object in order to configure the\n * amount and style of log output from yavascript API functions.\n *\n * This object behaves similarly to the shell builtin `set -x`.\n */\ndeclare const logger: {\n /**\n * This property is used as the default value for `trace` in yavascript API\n * functions which receive `logging.trace` as an option, like {@link which},\n * {@link exec}, {@link copy} and {@link glob}.\n *\n * The default value of `logger.trace` is a no-op function.\n */\n trace: (...args: Array<any>) => void;\n\n /**\n * This property is used as the default value for `info` in yavascript API\n * functions which receive `logging.info` as an option, like {@link exec},\n * {@link copy}, and {@link glob}.\n *\n * The default value of `logger.info` writes dimmed text to stdout.\n */\n info: (...args: Array<any>) => void;\n};\n\n/**\n * The properties of the `JSX` global can be modified to change how JSX syntax\n * gets compiled by yavascript. Those properties are:\n *\n * - `pragma` (string): The JavaScript expression that should be called to\n * create JSX elements. Defaults to \"JSX.createElement\".\n * - `pragmaFrag` (string): The JavaScript expression that should be used when\n * creating JSX fragments. Defaults to \"JSX.Fragment\".\n * - `createElement` (function): The function used to create JSX elements,\n * unless `JSX.pragma` has been changed.\n * - `Element` (symbol): used by the default `JSX.createElement` function to\n * identify JSX elements.\n * - `Fragment` (symbol): used by the default `JSX.createElement` function to\n * identify JSX fragments. Referenced by the default value for\n * `JSX.pragmaFrag`.\n *\n * Modifying these properties will change how JSX syntax gets compiled.\n *\n * For instance, to use React for JSX, you could either replace\n * `JSX.createElement` and `JSX.Fragment` with React's versions:\n *\n * ```ts\n * import * as React from \"npm:react\";\n *\n * JSX.createElement = React.createElement;\n * JSX.Fragment = React.Fragment;\n * ```\n *\n * Or, you could change `JSX.pragma` and `JSX.pragmaFrag` to reference React\n * directly:\n *\n * ```ts\n * JSX.pragma = \"React.createElement\";\n * JSX.pragmaFrag = \"React.Fragment\";\n * ```\n *\n * Note however, that changes to `pragma` and `pragmaFrag` will only affect JSX\n * appearing in files which are loaded _after_ the change, but changing\n * `createElement` and `Fragment` will affect all JSX syntax appearing after the\n * change, even within the same file.\n *\n * Whichever approach you take, you should also update `types.JSX.Element` and\n * `types.JSX.Fragment` such that the expression `types.JSX.Element(<a />) &&\n * types.JSX.Fragment(<></>)` is always `true`. To do that for React, you would\n * do:\n *\n * ```ts\n * types.JSX.Element = React.isValidElement;\n * types.JSX.Fragment = (value) => {\n * return React.isValidElement(value) && value.type === React.Fragment;\n * };\n * ```\n */\ndeclare namespace JSX {\n /**\n *\n * A string containing the expression that should be called to create JSX\n * elements. yavascript's internals use this string to transpile JSX syntax.\n *\n * The default value is \"JSX.createElement\".\n *\n * If changed, any JSX code loaded afterwards will use a different expression.\n *\n * Note that if you change this, you need to verify that the following\n * expression always evaluates to `true` (by changing `types.JSX.Element` and\n * `types.JSX.Fragment`):\n *\n * ```jsx\n * types.JSX.Element(<a />) && types.JSX.Fragment(<></>);\n * ```\n *\n * Failure to uphold this guarantee indicates a bug.\n *\n * For more info, including info on how to change how JSX is compiled, see\n * {@link JSX}.\n */\n export let pragma: string;\n\n /**\n * A string containing the expression that should be used as the first\n * parameter when creating JSX fragment elements. yavascript's internals use\n * this string to transpile JSX syntax.\n *\n * Defaults to \"JSX.Fragment\".\n *\n * If changed, any JSX code loaded afterwards will use a different expression.\n *\n * Note that if you change this, you need to verify that the following\n * expression always evaluates to `true` (by changing `types.JSX.Element` and\n * `types.JSX.Fragment`):\n *\n * ```jsx\n * types.JSX.Element(<a />) && types.JSX.Fragment(<></>);\n * ```\n *\n * Failure to uphold this guarantee indicates a bug.\n *\n * For more info, including info on how to change how JSX is compiled, see\n * {@link JSX}.\n */\n export let pragmaFrag: string;\n\n /**\n * `JSX.Element` is a Symbol. The default implementation of\n * `JSX.createElement` creates objects whose `$$typeof` property is set to\n * `JSX.Element`, and type validator functions under the `types.JSX.*`\n * namespace look for this property in order to determine whether an object is\n * a JSX element, as created via `JSX.createElement` or JSX syntax.\n *\n * ```jsx\n * // This gets compiled internally by yavascript into:\n * // const a = JSX.createElement('a', null);\n * const a = <a />;\n *\n * console.log(a);\n * // {\n * // $$typeof: Symbol(JSX.Element)\n * // type: \"a\"\n * // props: null\n * // key: null\n * // }\n *\n * console.log(a.$$typeof === JSX.Element);\n * // true\n * ```\n *\n * There is also a TypeScript type called `JSX.Element` which is a type for\n * the JSX element objects as created by `JSX.createElement` or JSX syntax.\n *\n * If you modify properties on the JSX global such that the default\n * implementation of `JSX.createElement` is no longer used (eg. by replacing\n * it with `React.createElement`), this value may no longer be relevant.\n * However, the default JSX element object shape is designed to match\n * React/Preact/etc.\n *\n * For more info, including info on how to change how JSX is compiled, see\n * {@link JSX}.\n *\n */\n export const Element: unique symbol;\n\n /**\n * The TypeScript type for JSX Element objects created by the default\n * implementation of `JSX.createElement`.\n */\n export interface Element<\n Props = { [key: string | symbol | number]: any },\n Type = any\n > {\n $$typeof: typeof Element;\n type: Type;\n props: Props;\n key: string | number | null;\n }\n\n /**\n *\n * `JSX.Fragment` is a Symbol which is used to indicate whether a JSX element\n * is a JSX fragment.\n *\n * ```jsx\n * // This gets compiled internally by yavascript into:\n * // const a = JSX.createElement(JSX.Fragment, null);\n * const frag = <></>;\n *\n * console.log(frag);\n * // {\n * // $$typeof: Symbol(JSX.Element)\n * // type: Symbol(JSX.Fragment)\n * // props: null\n * // key: null\n * // }\n *\n * console.log(a.type === JSX.Fragment);\n * // true\n * ```\n *\n * There is also a TypeScript type called `JSX.Fragment` which is a type for\n * the JSX fragment element objects as created by `JSX.createElement` or JSX\n * syntax.\n *\n * If you modify properties on the JSX global such that `JSX.Fragment` is no\n * longer used (eg. by replacing it with `React.Fragment`), this value may no\n * longer be relevant.\n *\n * For more info, including info on how to change how JSX is compiled, see\n * {@link JSX}.\n */\n export const Fragment: unique symbol;\n\n /**\n * The TypeScript type for JSX Element objects whose type is `JSX.Fragment`,\n * which is what yavascript creates internally when JSX fragment syntax\n * (`<></>`) is used.\n *\n * If you modify properties on the JSX global such that `JSX.Fragment` is no\n * longer used (eg. by replacing it with `React.Fragment`), this type may no\n * longer be relevant.\n */\n export type Fragment = Element<{}, typeof Fragment>;\n\n /**\n * The JSX element builder function, which gets invoked internally by\n * yavascript whenever JSX syntax is used (unless `JSX.pragma` gets changed by\n * the user).\n *\n * Note that if you change this, you need to verify that the following\n * expression always evaluates to `true` (by changing `types.JSX.Element` and\n * `types.JSX.Fragment`):\n *\n * ```jsx\n * types.JSX.Element(<a />) && types.JSX.Fragment(<></>);\n * ```\n *\n * Failure to uphold this guarantee indicates a bug.\n *\n * For more info, including info on how to change how JSX is compiled, see\n * {@link JSX}.\n *\n */\n export let createElement: {\n <Type extends string | typeof Fragment | ((...args: any) => any)>(\n type: Type\n ): Element<{}, Type>;\n <\n Type extends string | typeof Fragment | ((...args: any) => any),\n Props extends { [key: string | number | symbol]: any }\n >(\n type: Type,\n props: Props\n ): Element<Props, Type>;\n\n <\n Type extends string | typeof Fragment | ((...args: any) => any),\n Props extends { [key: string | number | symbol]: any },\n Children extends Array<any>\n >(\n type: Type,\n props: Props,\n ...children: Children\n ): Element<Props & { children: Children }, Type>;\n\n <\n Type extends string | typeof Fragment | ((...args: any) => any),\n Children extends Array<any>\n >(\n type: Type,\n ...children: Children\n ): Element<{ children: Children }, Type>;\n };\n}\n\n/**\n * The `YAML` namespace contains functions which can serialize and deserialize\n * YAML documents, following the same pattern as JavaScript's `JSON` builtin.\n */\ndeclare const YAML: {\n /**\n * Converts a YAML document string into a JavaScript value. It works the same\n * way that `JSON.parse` does, but for YAML.\n */\n parse(\n input: string,\n reviver?: (this: any, key: string, value: any) => any\n ): any;\n\n /**\n * Converts a JavaScript value into a YAML document string. It works the same\n * way that `JSON.stringify` does, but for YAML.\n */\n stringify(\n input: any,\n replacer?:\n | ((this: any, key: string, value: any) => any)\n | (number | string)[]\n | null,\n indent?: number\n ): string;\n};\n\n/**\n * Serializes or deserializes CSV data.\n *\n * The `CSV` object contains a `parse` function and a `stringify` function which\n * can be used to parse strings of CSV (comma-separated values) data into\n * arrays-of-arrays-of-strings and serialize arrays-of-arrays-of-strings into\n * strings of CSV data.\n *\n * Its interface is similar to `JSON.parse` and `JSON.stringify`, but CSV does\n * not support the spacing/replacer/reviver options that `JSON.parse` and\n * `JSON.stringify` have.\n */\ndeclare const CSV: {\n /**\n * Parse a CSV string into an Array of Arrays of strings.\n *\n * The outer array holds the rows, and the inner arrays hold the items in\n * each row.\n */\n parse(input: string): Array<Array<string>>;\n\n /**\n * Convert an Array of Arrays of strings into a CSV string.\n *\n * The outer array holds the rows, and the inner arrays hold the items in\n * each row.\n */\n stringify(input: Array<Array<string>>): string;\n};\n\n/**\n * An object with a `parse` function and a `stringify` function which can be\n * used to parse TOML document strings into objects and serialize objects into\n * TOML document strings.\n *\n * Its interface is similar to `JSON.parse` and `JSON.stringify`, but\n * `TOML.parse` and `TOML.stringify` do not support the spacing/replacer/reviver\n * options that `JSON.parse` and `JSON.stringify` do.\n */\ndeclare var TOML: {\n /**\n * Parse a TOML document string (`data`) into an object.\n */\n parse(data: string): { [key: string]: any };\n /**\n * Convert an object into a TOML document.\n */\n stringify(data: { [key: string]: any }): string;\n};\n\ninterface RegExpConstructor {\n /**\n * The function `RegExp.escape` accepts an input string and prefixes with `\\`\n * those characters in that string which have a special meaning when appearing\n * in a regular expression.\n *\n * The implementation is based on the stage 2 ECMAScript proposal of the same\n * name: https://github.com/tc39/proposal-regex-escaping\n */\n escape(str: any): string;\n}\n\ninterface StringConstructor {\n /**\n * The function `String.dedent` can be used to remove leading indentation from\n * a string. It is commonly used as a tagged template function, but you can\n * also call it and pass in a string.\n *\n * Note that the first line of the string must be empty.\n *\n * `String.dedent` is the default export from the npm package `string-dedent`.\n * See its readme on npm for more info:\n * https://www.npmjs.com/package/string-dedent\n */\n dedent: {\n /**\n * Removes leading minimum indentation from the string `input`.\n * The first line of `input` MUST be empty.\n *\n * For more info, see: https://www.npmjs.com/package/string-dedent#usage\n */\n (input: string): string;\n\n /**\n * Removes leading minimum indentation from the tagged template literal.\n * The first line of the template literal MUST be empty.\n *\n * For more info, see: https://www.npmjs.com/package/string-dedent#usage\n */\n (\n strings: readonly string[] | ArrayLike<string>,\n ...substitutions: unknown[]\n ): string;\n\n /**\n * Wrap another template tag function such that tagged literals\n * become dedented before being passed to the wrapped function.\n *\n * For more info, see: https://www.npmjs.com/package/string-dedent#usage\n */\n <\n Func extends (\n strings: readonly string[] | ArrayLike<string>,\n ...substitutions: any[]\n ) => string\n >(\n input: Func\n ): Func;\n };\n}\n\n/**\n * Opens the resource at the given path or URL using the operating system's\n * default application or handler.\n *\n * Examples:\n *\n * ```ts\n * openUrl(\"/home/me/stuff/code.txt\"); // opens code.txt in your default text editor\n * openUrl(\"code.txt\"); // same as above, using relative path\n * openUrl(\"file:///home/me/stuff/code.txt\"); // same as above, using file:// url\n *\n * openUrl(\"IMG_001.jpg\"); // opens IMG_001.jpg in your default image viewer\n *\n * openUrl(\"https://example.com/\") // opens example.com in your default web browser\n * ```\n */\ndeclare function openUrl(urlOrFilePath: string | Path): void;\n\n// prettier-ignore\n/** Any integer in the range [0, 255]. */\ndeclare type byte =\n| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 \n| 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 \n| 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 \n| 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 \n| 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 \n| 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 \n| 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 \n| 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 \n| 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 \n| 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 \n| 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 \n| 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 \n| 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 \n| 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 \n| 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 \n| 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255;\n\n// Convenience aliases to provide parity with TypeScript types.\ndeclare var number: NumberConstructor;\ndeclare var string: StringConstructor;\ndeclare var boolean: BooleanConstructor;\ndeclare var bigint: BigIntConstructor;\ndeclare var symbol: SymbolConstructor;\n\ndeclare type TypedArray =\n | Int8Array\n | Uint8Array\n | Uint8ClampedArray\n | Int16Array\n | Uint16Array\n | Int32Array\n | Uint32Array\n | Float32Array\n | Float64Array;\ndeclare type TypedArrayConstructor =\n | Int8ArrayConstructor\n | Uint8ArrayConstructor\n | Uint8ClampedArrayConstructor\n | Int16ArrayConstructor\n | Uint16ArrayConstructor\n | Int32ArrayConstructor\n | Uint32ArrayConstructor\n | Float32ArrayConstructor\n | Float64ArrayConstructor;\n\ninterface ErrorOptions {\n [key: string]: any;\n}\n\n/**\n * For compatibility with Node.js scripts, the global object is accessible via\n * the global variable named \"global\".\n */\ndeclare var global: typeof globalThis;\n\n/**\n * A `process` global is provided for rudimentary compatibility with Node.js\n * scripts. It contains a subset of the properties found on the Node.js\n * `process` global, which each forward to their corresponding yavascript API.\n *\n * For instance, `process.env` is a getter that returns {@link env}, and\n * `process.argv` is a getter that returns {@link scriptArgs}.\n *\n * If you are writing yavascript-specific code, you should use yavascript's APIs\n * instead of `process`.\n */\ndeclare var process: {\n version: string;\n versions: {\n node: string;\n yavascript: string;\n unicode: string;\n };\n arch: string;\n /** Same as the global {@link env}. */\n readonly env: { [key: string]: string | undefined };\n /** Same as the global {@link scriptArgs}. */\n readonly argv: Array<string>;\n /** Same as `scriptArgs[0]`. */\n readonly argv0: string;\n /**\n * Shortcut for `os.realpath(os.execPath())`, using the QuickJS {@link os}\n * module.\n */\n readonly execPath: string;\n /**\n * Uses `std.getExitCode()` and `std.setExitCode()` from the QuickJS\n * {@link std} module.\n */\n exitCode: number;\n /**\n * Uses `std.exit()` from the QuickJS {@link std} module.\n */\n exit(code?: number | null | undefined): void;\n};\n\n// ==========================================\n// ------------------------------------------\n// QuickJS APIs, which YavaScript builds upon\n// ------------------------------------------\n// ==========================================\ninterface ObjectConstructor {\n /**\n * Convert the specified value to a primitive value.\n *\n * The provided hint indicates a preferred return type, which may or may not\n * be respected by the engine.\n *\n * See the abstract operation \"ToPrimitive\" in the ECMAScript standard for\n * more info.\n */\n toPrimitive(\n input: any,\n hint: \"string\" | \"number\" | \"default\"\n ): string | number | bigint | boolean | undefined | symbol | null;\n\n /**\n * Returns a boolean indicating whether the specified value is a primitive value.\n */\n isPrimitive(input: any): boolean;\n}\n\ninterface StringConstructor {\n /**\n * A no-op template literal tag.\n *\n * https://github.com/tc39/proposal-string-cooked\n */\n cooked(\n strings: readonly string[] | ArrayLike<string>,\n ...substitutions: any[]\n ): string;\n}\n\ninterface SymbolConstructor {\n /**\n * A method that changes the result of using the `typeof` operator on the\n * object. Called by the semantics of the typeof operator.\n *\n * Note that the following semantics will come into play when use of the\n * `typeof` operator causes the engine to call a `Symbol.typeofValue` method\n * on an object:\n *\n * - If the method returns any value other than one of the string values\n * which are normally the result of using the `typeof` operator, the engine\n * behaves as if no `Symbol.typeofValue` method was present on the object.\n * - If an error is thrown from this method, or an error is thrown while\n * accessing this property, the error will be silently ignored, and the\n * engine will behave as if no `Symbol.typeofValue` method was present on\n * the object.\n * - If this property is present on an object, but the value of that property\n * is not a function, the engine will not consider that value when\n * determining the result of the `typeof` operation (it'll ignore it).\n */\n readonly typeofValue: unique symbol;\n\n /**\n * To override operators (+, -, ==, etc) for an object, set its\n * `Symbol.operatorSet` property to an `OperatorSet` object, which can be\n * created via `Operators.create`.\n */\n readonly operatorSet: unique symbol;\n}\n\n/**\n * An object that, if placed on another object's `Symbol.operatorSet` property,\n * will overload its operators to behave as defined by the functions this\n * OperatorSet was constructed with.\n *\n * You can create an OperatorSet via `Operators(...)` or\n * `Operators.create(...)`.\n */\ndeclare type OperatorSet = {\n /**\n * This property is not here at runtime; we just use it to make this type\n * differ from an empty object.\n */\n __is__: \"OperatorSet\";\n};\n\ninterface OperatorFunctions<Left, Right> {\n \"+\": (left: Left, right: Right) => any;\n \"-\": (left: Left, right: Right) => any;\n \"*\": (left: Left, right: Right) => any;\n \"/\": (left: Left, right: Right) => any;\n \"%\": (left: Left, right: Right) => any;\n \"**\": (left: Left, right: Right) => any;\n \"|\": (left: Left, right: Right) => any;\n \"&\": (left: Left, right: Right) => any;\n \"^\": (left: Left, right: Right) => any;\n \"<<\": (left: Left, right: Right) => any;\n \">>\": (left: Left, right: Right) => any;\n \">>>\": (left: Left, right: Right) => any;\n \"==\": (left: Left, right: Right) => any;\n \"<\": (left: Left, right: Right) => any;\n pos: (left: Left, right: Right) => any;\n neg: (left: Left, right: Right) => any;\n \"++\": (left: Left, right: Right) => any;\n \"--\": (left: Left, right: Right) => any;\n \"~\": (left: Left, right: Right) => any;\n}\n\ninterface SelfOperators<T> extends Partial<OperatorFunctions<T, T>> {\n left?: undefined;\n right?: undefined;\n}\n\ninterface LeftOperators<T, Left> extends Partial<OperatorFunctions<Left, T>> {\n left: {};\n right?: undefined;\n}\n\ninterface RightOperators<T, Right>\n extends Partial<OperatorFunctions<T, Right>> {\n left?: undefined;\n right: {};\n}\n\ninterface OperatorsConstructor {\n /**\n * Creates a new OperatorSet object, which should be placed on an object's\n * Symbol.operatorSet property.\n */\n <T>(\n selfOperators?: SelfOperators<T>,\n ...otherOperators: Array<LeftOperators<T, any> | RightOperators<T, any>>\n ): OperatorSet;\n\n /**\n * Creates a new OperatorSet object, which should be placed on an object's\n * Symbol.operatorSet property.\n */\n create: <T>(\n selfOperators?: SelfOperators<T>,\n ...otherOperators: Array<LeftOperators<T, any> | RightOperators<T, any>>\n ) => OperatorSet;\n\n /**\n * In math mode, the BigInt division and power operators can be overloaded by\n * using this function.\n */\n updateBigIntOperators(\n ops: Pick<OperatorFunctions<BigInt, BigInt>, \"/\" | \"**\">\n ): void;\n}\n\ndeclare var Operators: OperatorsConstructor;\n\ninterface Number {\n [Symbol.operatorSet]: OperatorSet;\n}\n\ninterface Boolean {\n [Symbol.operatorSet]: OperatorSet;\n}\n\ninterface String {\n [Symbol.operatorSet]: OperatorSet;\n}\n\ninterface BigInt {\n [Symbol.operatorSet]: OperatorSet;\n}\n\ninterface BigIntConstructor {\n /**\n * Return trunc(a/b).\n *\n * b = 0 raises a RangeError exception.\n */\n tdiv(a: bigint, b: bigint): bigint;\n\n /**\n * Return \\lfloor a/b \\rfloor.\n *\n * b = 0 raises a RangeError exception.\n */\n fdiv(a: bigint, b: bigint): bigint;\n\n /**\n * Return \\lceil a/b \\rceil.\n *\n * b = 0 raises a RangeError exception.\n */\n cdiv(a: bigint, b: bigint): bigint;\n\n /**\n * Return sgn(b) \\lfloor a/{|b|} \\rfloor (Euclidian division).\n *\n * b = 0 raises a RangeError exception.\n */\n ediv(a: bigint, b: bigint): bigint;\n\n /**\n * Perform trunc(a/b) and return an array of two elements. The first element\n * is the quotient, the second is the remainder.\n *\n * b = 0 raises a RangeError exception.\n */\n tdivrem(a: bigint, b: bigint): [bigint, bigint];\n\n /**\n * Perform \\lfloor a/b \\rfloor and return an array of two elements. The first\n * element is the quotient, the second is the remainder.\n *\n * b = 0 raises a RangeError exception.\n */\n fdivrem(a: bigint, b: bigint): [bigint, bigint];\n\n /**\n * Perform \\lceil a/b \\rceil and return an array of two elements. The first\n * element is the quotient, the second is the remainder.\n *\n * b = 0 raises a RangeError exception.\n */\n cdivrem(a: bigint, b: bigint): [bigint, bigint];\n\n /**\n * Perform sgn(b) \\lfloor a/{|b|} \\rfloor (Euclidian division) and return an\n * array of two elements. The first element is the quotient, the second is\n * the remainder.\n *\n * b = 0 raises a RangeError exception.\n */\n edivrem(a: bigint, b: bigint): [bigint, bigint];\n\n /**\n * Return \\lfloor \\sqrt(a) \\rfloor.\n *\n * A RangeError exception is raised if a < 0.\n */\n sqrt(a: bigint): bigint;\n\n /**\n * Return an array of two elements. The first element is\n * \\lfloor \\sqrt{a} \\rfloor. The second element is\n * a-\\lfloor \\sqrt{a} \\rfloor^2.\n *\n * A RangeError exception is raised if a < 0.\n */\n sqrtrem(a: bigint): [bigint, bigint];\n\n /**\n * Return -1 if a \\leq 0 otherwise return \\lfloor \\log2(a) \\rfloor.\n */\n floorLog2(a: bigint): bigint;\n\n /**\n * Return the number of trailing zeros in the two’s complement binary representation of a.\n *\n * Return -1 if a=0.\n */\n ctz(a: bigint): bigint;\n}\n\ndeclare type BigFloatRoundingMode = number & {\n /**\n * This property is not here at runtime; we just use it to make this type\n * differ from a normal number\n */\n __is__: \"BigFloatRoundingMode\";\n};\n\ninterface BigFloatEnvConstructor {\n /**\n * Creates a new floating point environment. Its status flags are reset.\n *\n * - If unspecified, `precision` defaults to the precision from the global floating point environment.\n * - If unspecified, `roundingMode` defaults to RNDN.\n */\n new (precision?: number, roundingMode?: BigFloatRoundingMode): BigFloatEnv;\n\n /**\n * The mantissa precision in bits of the global floating point environment.\n *\n * The initial value is 113.\n */\n get prec(): number;\n\n /**\n * The exponent size in bits of the global floating point environment,\n * assuming an IEEE 754 representation.\n *\n * The initial value is 15.\n */\n get expBits(): number;\n\n /**\n * Sets the mantissa precision of the global floating point environment to\n * `prec` and the exponent size to `expBits`, then calls the function `func`.\n * Then the precision and exponent size are reset to their previous values\n * and the return value of `func` is returned (or an exception is raised if\n * `func` raised an exception).\n *\n * If expBits is undefined, it is set to {@link BigFloatEnv.expBitsMax}.\n *\n * @param func The function to call within the modified environment\n * @param prec The mantissa precision (in bits) to use in the modified environment\n * @param expBits The exponent size (in bits) to use in the modified environment. Defaults to {@link BigFloatEnv.expBitsMax}.\n */\n setPrec<Ret>(func: () => Ret, prec: number, expBits?: number): Ret;\n\n /**\n * Integer; the minimum allowed precision. Must be at least 2.\n */\n readonly precMin: number;\n\n /**\n * Integer; the maximum allowed precision. Must be at least 113.\n */\n readonly precMax: number;\n\n /**\n * Integer; the minimum allowed exponent size in bits. Must be at least 3.\n */\n readonly expBitsMin: number;\n\n /**\n * Integer; the maximum allowed exponent size in bits. Must be at least 15.\n */\n readonly expBitsMax: number;\n\n /**\n * Round to nearest, with ties to even rounding mode.\n */\n readonly RNDN: BigFloatRoundingMode;\n\n /**\n * Round to zero rounding mode.\n */\n readonly RNDZ: BigFloatRoundingMode;\n\n /**\n * Round to -Infinity rounding mode.\n */\n readonly RNDD: BigFloatRoundingMode;\n\n /**\n * Round to +Infinity rounding mode.\n */\n readonly RNDU: BigFloatRoundingMode;\n\n /**\n * Round to nearest, with ties away from zero rounding mode.\n */\n readonly RNDNA: BigFloatRoundingMode;\n\n /**\n * Round away from zero rounding mode.\n */\n readonly RNDA: BigFloatRoundingMode;\n\n /**\n * Faithful rounding mode. The result is non-deterministically rounded to\n * -Infinity or +Infinity.\n *\n * This rounding mode usually gives a faster and deterministic running time\n * for the floating point operations.\n */\n readonly RNDF: BigFloatRoundingMode;\n\n prototype: BigFloatEnv;\n}\n\ndeclare var BigFloatEnv: BigFloatEnvConstructor;\n\n/**\n * A BigFloatEnv contains:\n *\n * - the mantissa precision in bits\n * - the exponent size in bits assuming an IEEE 754 representation;\n * - the subnormal flag (if true, subnormal floating point numbers can be generated by the floating point operations).\n * - the rounding mode\n * - the floating point status. The status flags can only be set by the floating point operations. They can be reset with BigFloatEnv.prototype.clearStatus() or with the various status flag setters.\n */\ninterface BigFloatEnv {\n /**\n * The mantissa precision, in bits.\n *\n * If precision was not specified as an argument to the BigFloatEnv\n * constructor, defaults to the precision value of the global floating-point\n * environment ({@link BigFloatEnv.prec}).\n */\n get prec(): number;\n set prec(newValue: number);\n\n /**\n * The exponent size in bits assuming an IEEE 754 representation.\n *\n * Defaults to the exponent size of the global floating-point environment\n * ({@link BigFloatEnv.expBits}).\n */\n get expBits(): number;\n set expBits(newValue: number);\n\n /**\n * The rounding mode.\n *\n * If the rounding mode was not specified as an argument to the BigFloatEnv\n * constructor, defaults to {@link BigFloatEnv.RNDN}.\n */\n get rndMode(): BigFloatRoundingMode;\n set rndMode(newMode: BigFloatRoundingMode);\n\n /** subnormal flag. It is false when expBits = expBitsMax. Defaults to false. */\n get subnormal(): boolean;\n set subnormal(newValue: boolean);\n\n /** Status flag; cleared by `clearStatus`. */\n get invalidOperation(): boolean;\n set invalidOperation(newValue: boolean);\n\n /** Status flag; cleared by `clearStatus`. */\n get divideByZero(): boolean;\n set divideByZero(newValue: boolean);\n\n /** Status flag; cleared by `clearStatus`. */\n get overflow(): boolean;\n set overflow(newValue: boolean);\n\n /** Status flag; cleared by `clearStatus`. */\n get underflow(): boolean;\n set underflow(newValue: boolean);\n\n /** Status flag; cleared by `clearStatus`. */\n get inexact(): boolean;\n set inexact(newValue: boolean);\n\n /**\n * Clear the status flags (invalidOperation, divideByZero, overflow,\n * underflow, and inexact).\n */\n clearStatus(): void;\n}\n\ninterface BigFloatConstructor {\n /**\n * If `value` is a numeric type, it is converted to BigFloat without rounding.\n *\n * If `value`` is a string, it is converted to BigFloat using the precision of the global floating point environment ({@link BigFloatEnv.prec}).\n */\n (value: number | string | BigInt | BigFloat): BigFloat;\n\n prototype: BigFloat;\n\n /**\n * The value of {@link Math.LN2} rounded to nearest, ties to even with the\n * current global precision.\n *\n * The constant values are cached for small precisions.\n */\n get LN2(): BigFloat;\n\n /**\n * The value of {@link Math.PI} rounded to nearest, ties to even with\n * the current global precision.\n *\n * The constant values are cached for small precisions.\n */\n get PI(): BigFloat;\n\n /**\n * The value of {@link Number.MIN_VALUE} as a BigFloat.\n */\n get MIN_VALUE(): BigFloat;\n\n /**\n * The value of {@link Number.MAX_VALUE} as a BigFloat.\n */\n get MAX_VALUE(): BigFloat;\n\n /**\n * The value of {@link Number.EPSILON} as a BigFloat.\n */\n get EPSILON(): BigFloat;\n\n /**\n * Rounds the floating point number `a` according to the floating point\n * environment `e` or the global environment if `e` is undefined.\n */\n fpRound(a: BigFloat, e?: BigFloatEnv): BigFloat;\n\n /**\n * Parses the string `a` as a floating point number in radix `radix`.\n *\n * The radix is 0 (default) or from 2 to 36. The radix 0 means radix 10\n * unless there is a hexadecimal or binary prefix.\n *\n * The result is rounded according to the floating point environment `e` or\n * the global environment if `e` is undefined.\n */\n parseFloat(a: string, radix?: number, e?: BigFloatEnv): BigFloat;\n\n /**\n * Returns true if `a` is a finite bigfloat. Returns false otherwise.\n */\n isFinite(a: BigFloat): boolean;\n\n /**\n * Returns true if a is a NaN bigfloat. Returns false otherwise.\n */\n isNaN(a: BigFloat): boolean;\n\n /**\n * Adds `a` and `b` together and rounds the resulting floating point number\n * according to the floating point environment `e`, or the global environment\n * if e is undefined.\n *\n * If `e` is specified, the floating point status flags on `e` are updated.\n */\n add(a: BigFloat, b: BigFloat, e?: BigFloatEnv): BigFloat;\n\n /**\n * Subtracts `b` from `a` and rounds the resulting floating point number\n * according to the floating point environment `e`, or the global environment\n * if e is undefined.\n *\n * If `e` is specified, the floating point status flags on `e` are updated.\n */\n sub(a: BigFloat, b: BigFloat, e?: BigFloatEnv): BigFloat;\n\n /**\n * Multiplies `a` and `b` together and rounds the resulting floating point\n * number according to the floating point environment `e`, or the global\n * environment if e is undefined.\n *\n * If `e` is specified, the floating point status flags on `e` are updated.\n */\n mul(a: BigFloat, b: BigFloat, e?: BigFloatEnv): BigFloat;\n\n /**\n * Divides `a` by `b` and rounds the resulting floating point number\n * according to the floating point environment `e`, or the global environment\n * if e is undefined.\n *\n * If `e` is specified, the floating point status flags on `e` are updated.\n */\n div(a: BigFloat, b: BigFloat, e?: BigFloatEnv): BigFloat;\n\n /**\n * Rounds `x` down to the nearest integer.\n *\n * No additional rounding (ie. BigFloatEnv-related rounding) is performed.\n */\n floor(x: BigFloat): BigFloat;\n\n /**\n * Rounds `x` up to the nearest integer.\n *\n * No additional rounding (ie. BigFloatEnv-related rounding) is performed.\n */\n ceil(x: BigFloat): BigFloat;\n\n /**\n * Rounds `x` to the nearest integer.\n *\n * No additional rounding (ie. BigFloatEnv-related rounding) is performed.\n */\n round(x: BigFloat): BigFloat;\n\n /**\n * Truncates the fractional part of `x`, resulting in an integer.\n *\n * No additional rounding (ie. BigFloatEnv-related rounding) is performed.\n */\n trunc(x: BigFloat): BigFloat;\n\n /**\n * Returns the absolute value of `x`.\n *\n * No additional rounding (ie. BigFloatEnv-related rounding) is performed.\n */\n abs(x: BigFloat): BigFloat;\n\n /**\n * Floating point remainder. The quotient is truncated to zero.\n *\n * `e` is an optional floating point environment.\n */\n fmod(x: BigFloat, y: BigFloat, e?: BigFloatEnv): BigFloat;\n\n /**\n * Floating point remainder. The quotient is rounded to the nearest integer\n * with ties to even.\n *\n * `e` is an optional floating point environment.\n */\n remainder(x: BigFloat, y: BigFloat, e?: BigFloatEnv): BigFloat;\n\n /**\n * Square root. Returns a rounded floating point number.\n *\n * e is an optional floating point environment.\n */\n sqrt(x: BigFloat, e?: BigFloatEnv): BigFloat;\n\n /**\n * Returns a rounded floating point number.\n *\n * `e` is an optional floating point environment.\n */\n sin(x: BigFloat, e?: BigFloatEnv): BigFloat;\n\n /**\n * Returns a rounded floating point number.\n *\n * `e` is an optional floating point environment.\n */\n cos(x: BigFloat, e?: BigFloatEnv): BigFloat;\n\n /**\n * Returns a rounded floating point number.\n *\n * `e` is an optional floating point environment.\n */\n tan(x: BigFloat, e?: BigFloatEnv): BigFloat;\n\n /**\n * Returns a rounded floating point number.\n *\n * `e` is an optional floating point environment.\n */\n asin(x: BigFloat, e?: BigFloatEnv): BigFloat;\n\n /**\n * Returns a rounded floating point number.\n *\n * `e` is an optional floating point environment.\n */\n acos(x: BigFloat, e?: BigFloatEnv): BigFloat;\n\n /**\n * Returns a rounded floating point number.\n *\n * `e` is an optional floating point environment.\n */\n atan(x: BigFloat, e?: BigFloatEnv): BigFloat;\n\n /**\n * Returns a rounded floating point number.\n *\n * `e` is an optional floating point environment.\n */\n atan2(x: BigFloat, y: BigFloat, e?: BigFloatEnv): BigFloat;\n\n /**\n * Returns a rounded floating point number.\n *\n * `e` is an optional floating point environment.\n */\n exp(x: BigFloat, e?: BigFloatEnv): BigFloat;\n\n /**\n * Returns a rounded floating point number.\n *\n * `e` is an optional floating point environment.\n */\n log(x: BigFloat, e?: BigFloatEnv): BigFloat;\n\n /**\n * Returns a rounded floating point number.\n *\n * `e` is an optional floating point environment.\n */\n pow(x: BigFloat, y: BigFloat, e?: BigFloatEnv): BigFloat;\n}\n\ndeclare var BigFloat: BigFloatConstructor;\n\n/**\n * The BigFloat type represents floating point numbers in base 2 with the IEEE 754 semantics.\n *\n * A floating point number is represented as a sign, mantissa and exponent.\n *\n * The special values NaN, +/-Infinity, +0 and -0 are supported.\n *\n * The mantissa and exponent can have any bit length with an implementation specific minimum and maximum.\n */\ninterface BigFloat {\n valueOf(): BigFloat;\n\n /** radix must be between 2 and 36 */\n toString(radix?: number): string;\n\n /**\n * Returns a string containing a number represented either in exponential or\n * fixed-point notation with a specified number of digits.\n *\n * @param precision Number of significant digits. There is no range limit on this number.\n * @param roundingMode The rounding mode to use when representing the value. Defaults to {@link BigFloatEnv.RNDNA}.\n * @param radix The base to use when representing the value. Must be an integer between 2 and 36. Defaults to 10.\n */\n toPrecision(\n precision: number,\n roundingMode?: BigFloatRoundingMode,\n radix?: number\n ): string;\n\n /**\n * Returns a string representing a number in fixed-point notation.\n *\n * @param fractionDigits Number of digits after the decimal point. There is no range limit on this number.\n * @param roundingMode The rounding mode to use when representing the value. Defaults to {@link BigFloatEnv.RNDNA}.\n * @param radix The base to use when representing the value. Must be an integer between 2 and 36. Defaults to 10.\n */\n toFixed(\n fractionDigits: number,\n roundingMode?: BigFloatRoundingMode,\n radix?: number\n ): string;\n\n /**\n * Returns a string containing a number represented in exponential notation.\n *\n * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.\n * @param roundingMode The rounding mode to use when representing the value. Defaults to {@link BigFloatEnv.RNDNA}.\n * @param radix The base to use when representing the value. Must be an integer between 2 and 36. Defaults to 10.\n */\n toExponential(\n fractionDigits: number,\n roundingMode?: BigFloatRoundingMode,\n radix?: number\n ): string;\n\n [Symbol.typeofValue]: () => \"bigfloat\";\n}\n\ndeclare type BigDecimalRoundingMode =\n | \"floor\"\n | \"ceiling\"\n | \"down\"\n | \"up\"\n | \"half-even\"\n | \"half-up\";\n\ndeclare type BigDecimalRoundingObject =\n | {\n /** must be >= 1 */\n maximumSignificantDigits: number;\n roundingMode: BigDecimalRoundingMode;\n }\n | {\n /** must be >= 0 */\n maximumFractionDigits: number;\n roundingMode: BigDecimalRoundingMode;\n };\n\ninterface BigDecimalConstructor {\n (): BigDecimal;\n (value: number | string | BigInt | BigFloat): BigDecimal;\n\n /**\n * Adds together `a` and `b` and rounds the result according to the rounding\n * object `e`. If the rounding object is not present, the operation is\n * executed with infinite precision; in other words, no rounding occurs when\n * the rounding object is not present.\n */\n add(a: BigDecimal, b: BigDecimal, e?: BigDecimalRoundingObject): BigDecimal;\n\n /**\n * Subtracts `b` from `a` and rounds the result according to the rounding\n * object `e`. If the rounding object is not present, the operation is\n * executed with infinite precision; in other words, no rounding occurs when\n * the rounding object is not present.\n */\n sub(a: BigDecimal, b: BigDecimal, e?: BigDecimalRoundingObject): BigDecimal;\n\n /**\n * Multiplies together `a` and `b` and rounds the result according to the\n * rounding object `e`. If the rounding object is not present, the operation\n * is executed with infinite precision; in other words, no rounding occurs\n * when the rounding object is not present.\n */\n mul(a: BigDecimal, b: BigDecimal, e?: BigDecimalRoundingObject): BigDecimal;\n\n /**\n * Divides `a` by `b` and rounds the result according to the rounding object\n * `e`.\n *\n * If the rounding object is not present, an attempt is made to perform the\n * operation with infinite precision. However, not all quotients can be\n * represented with infinite precision. If the quotient cannot be represented\n * with infinite precision, a RangeError is thrown.\n *\n * A RangeError is thrown when dividing by zero.\n */\n div(a: BigDecimal, b: BigDecimal, e?: BigDecimalRoundingObject): BigDecimal;\n\n /**\n * Perform the modulo operation of `a` by `b` and round the result according\n * to the rounding object `e`. If the rounding object is not present, the\n * operation is executed with infinite precision; in other words, no rounding\n * occurs when the rounding object is not present.\n */\n mod(a: BigDecimal, b: BigDecimal, e?: BigDecimalRoundingObject): BigDecimal;\n\n /**\n * Obtain the square root of `a`, rounding the result according to the\n * rounding object `e`.\n *\n * If `a` is less than zero, a RangeError will be thrown.\n *\n * Note that the rounding object is *required*.\n */\n sqrt(a: BigDecimal, e: BigDecimalRoundingObject): BigDecimal;\n\n /**\n * Rounds `a` using the rounding object `e`.\n */\n round(a: BigDecimal, e: BigDecimalRoundingObject): BigDecimal;\n\n prototype: BigDecimal;\n}\n\ndeclare var BigDecimal: BigDecimalConstructor;\n\n/**\n * The BigDecimal type represents floating point numbers in base 10.\n *\n * It is inspired from the proposal available at https://github.com/littledan/proposal-bigdecimal.\n *\n * The BigDecimal floating point numbers are always normalized and finite.\n * There is no concept of -0, Infinity or NaN. By default, all the computations\n * are done with infinite precision.\n */\ninterface BigDecimal {\n /**\n * Returns the bigdecimal primitive value corresponding to this BigDecimal.\n */\n valueOf(): BigDecimal;\n\n /**\n * Converts this BigDecimal to a string with infinite precision in base 10.\n */\n toString(): string;\n\n /**\n * Returns a string containing a number represented either in exponential or\n * fixed-point notation with a specified number of digits.\n *\n * @param precision Number of significant digits. There is no range limit on this number.\n * @param roundingMode The rounding mode to use when representing the value. Defaults to \"half-up\".\n */\n toPrecision(precision: number, roundingMode?: BigDecimalRoundingMode): string;\n\n /**\n * Returns a string representing a number in fixed-point notation.\n *\n * @param fractionDigits Number of digits after the decimal point. There is no range limit on this number.\n * @param roundingMode The rounding mode to use when representing the value. Defaults to \"half-up\".\n */\n toFixed(\n fractionDigits: number,\n roundingMode?: BigDecimalRoundingMode\n ): string;\n\n /**\n * Returns a string containing a number represented in exponential notation.\n *\n * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.\n * @param roundingMode The rounding mode to use when representing the value. Defaults to \"half-up\".\n */\n toExponential(\n fractionDigits: number,\n roundingMode?: BigDecimalRoundingMode\n ): string;\n}\n\n// Note that BigFloat and BigDecimal have custom operator overloads defined in\n// QuickJS, but TypeScript does not support operator overloading. As such,\n// TypeScript will not understand or handle unary/binary operators for BigFloat\n// and BigDecimal properly.\n\n/** npm: @suchipi/print@2.5.0. License: ISC */\n/* (with some QuickJS-specific modifications) */\n\n/*\nCopyright (c) 2016-2022, John Gardner\nCopyright (c) 2022 Lily Skye\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\nANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\nACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\nOR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n/**\n * Options for {@link inspect}.\n */\ndeclare interface InspectOptions {\n /** Whether to display non-enumerable properties. Defaults to false. */\n all?: boolean;\n\n /** Whether to invoke getter functions. Defaults to false. */\n followGetters?: boolean;\n\n /** Whether to display the indexes of iterable entries. Defaults to false. */\n indexes?: boolean;\n\n /** Hide object details after 𝑁 recursions. Defaults to Infinity. */\n maxDepth?: number;\n\n /** If true, don't identify well-known symbols as `@@…`. Defaults to false. */\n noAmp?: boolean;\n\n /** If true, don't format byte-arrays as hexadecimal. Defaults to false. */\n noHex?: boolean;\n\n /** If true, don't display function source code. Defaults to false. */\n noSource?: boolean;\n\n /** Whether to show `__proto__` properties if possible. Defaults to false. */\n proto?: boolean;\n\n /** Whether to sort properties alphabetically. When false, properties are sorted by creation order. Defaults to false. */\n sort?: boolean;\n\n /** Options that control whether and how ANSI terminal escape sequences for colours should be added to the output. Defaults to false, meaning no colours. */\n colours?: boolean | 256 | 8 | InspectColours;\n\n /** Prefix string to use for indentation. Defaults to '\\t'. */\n indent?: string;\n}\n\ndeclare interface InspectColours {\n off?: string | number;\n red?: string | number;\n grey?: string | number;\n green?: string | number;\n darkGreen?: string | number;\n punct?: string | number;\n keys?: string | number;\n keyEscape?: string | number;\n typeColour?: string | number;\n primitive?: string | number;\n escape?: string | number;\n date?: string | number;\n hexBorder?: string | number;\n hexValue?: string | number;\n hexOffset?: string | number;\n reference?: string | number;\n srcBorder?: string | number;\n srcRowNum?: string | number;\n srcRowText?: string | number;\n nul?: string | number;\n nulProt?: string | number;\n undef?: string | number;\n noExts?: string | number;\n frozen?: string | number;\n sealed?: string | number;\n regex?: string | number;\n string?: string | number;\n symbol?: string | number;\n symbolFade?: string | number;\n braces?: string | number;\n quotes?: string | number;\n empty?: string | number;\n dot?: string | number;\n}\n\ndeclare interface InspectFunction {\n /**\n * Generate a human-readable representation of a value.\n *\n * @param value - Value to inspect\n * @param options - Additional settings for refining output\n * @returns A string representation of `value`.\n */\n (value: any, options?: InspectOptions): string;\n\n /**\n * Generate a human-readable representation of a value.\n *\n * @param value - Value to inspect\n * @param key - The value's corresponding member name\n * @param options - Additional settings for refining output\n * @returns A string representation of `value`.\n */\n (value: any, key?: string | symbol, options?: InspectOptions): string;\n\n /**\n * A symbol which can be used to customize how an object gets printed.\n */\n custom: symbol;\n}\n\n/**\n * Generate a human-readable representation of a value.\n *\n * @param value - Value to inspect\n * @param key - The value's corresponding member name\n * @param options - Additional settings for refining output\n * @returns A string representation of `value`.\n */\ndeclare var inspect: InspectFunction;\n\ndeclare interface InspectCustomInputs {\n key: string | symbol;\n type: string;\n brackets: [string, string];\n oneLine: boolean;\n linesBefore: Array<string>;\n linesAfter: Array<string>;\n propLines: Array<string>;\n readonly tooDeep: boolean;\n indent: string;\n typeSuffix: string;\n opts: InspectOptions;\n colours: { [Key in keyof Required<InspectColours>]: string };\n}\n\ndeclare type Interval = { [Symbol.toStringTag]: \"Interval\" };\n\ndeclare function setInterval(func: (...args: any) => any, ms: number): Interval;\ndeclare function clearInterval(interval: Interval): void;\n\n// Definitions of the globals and modules added by quickjs-libc\n\n/**\n * Provides the command line arguments. The first argument is the script name.\n */\ndeclare var scriptArgs: Array<string>;\n\n/** An object representing a file handle. */\ndeclare interface FILE {\n /**\n * Human-readable description of where this FILE points.\n *\n * If `target` is a number, the FILE was opened with fdopen, and `target` is\n * the fd. Otherwise, `target` will be an arbitrary string that describes the\n * file; it may be the absolute path to the file, the relative path to the\n * file at time of its opening, or some other string like \"stdin\" or\n * \"tmpfile\".\n *\n * You should *not* use this property for anything other than logging and\n * debugging. It is *only* provided for debugging and/or troubleshooting\n * purposes. The value of this property could change at any time when\n * upgrading yavascript, even if upgrading by a minor or patch release.\n */\n target: string | number;\n\n /**\n * Close the file handle. Note that for files other than stdin/stdout/stderr,\n * the file will be closed automatically when the `FILE` object is\n * garbage-collected.\n */\n close(): void;\n\n /** Outputs the string with the UTF-8 encoding. */\n puts(...strings: Array<string>): void;\n\n /**\n * Formatted printf.\n *\n * The same formats as the standard C library `printf` are supported. Integer format types (e.g. `%d`) truncate the Numbers or BigInts to 32 bits. Use the `l` modifier (e.g. `%ld`) to truncate to 64 bits.\n */\n printf(fmt: string, ...args: Array<any>): void;\n\n /** Flush the buffered file. Wrapper for C `fflush`. */\n flush(): void;\n\n /** Sync the buffered file to disk. Wrapper for C `fsync`. */\n sync(): void;\n\n /**\n * Seek to a given file position (whence is `std.SEEK_*`).\n *\n * `offset` can be a number or a bigint.\n */\n seek(offset: number, whence: number): void;\n\n /** Return the current file position. */\n tell(): number;\n\n /** Return the current file position as a bigint. */\n tello(): BigInt;\n\n /** Return true if end of file. */\n eof(): boolean;\n\n /** Return the associated OS handle. */\n fileno(): number;\n\n /** Read `length` bytes from the file to the ArrayBuffer `buffer` at byte position `position` (wrapper to the libc `fread`). Returns the number of bytes read, or `0` if the end of the file has been reached. */\n read(buffer: ArrayBuffer, position: number, length: number): number;\n\n /** Write `length` bytes from the ArrayBuffer `buffer` at byte position `position` into the file (wrapper to the libc `fwrite`). Returns the number of bytes written. */\n write(buffer: ArrayBuffer, position: number, length: number): number;\n\n /**\n * Write this file into `target`, using a memory buffer of size `bufferSize`.\n *\n * If `limit` is specified, only that amount of bytes will be read and\n * written. Otherwise, data is read and written until this file reaches EOF.\n *\n * A `limit` of 0 is treated the same as not specifying a limit.\n *\n * Internally, this function uses libc `fread` and `fwrite` in a loop.\n *\n * Returns the number of bytes read and written.\n */\n writeTo(target: FILE, bufferSize: number, limit?: number): number;\n\n /**\n * Return the next line from the file, assuming UTF-8 encoding, excluding the trailing line feed or EOF.\n *\n * If the end of the file has been reached, then `null` will be returned instead of a string.\n *\n * Note: Although the trailing line feed has been removed, a carriage return (`\\r`) may still be present.\n */\n getline(): string | null;\n\n /** Read `maxSize` bytes from the file and return them as a string assuming UTF-8 encoding. If `maxSize` is not present, the file is read up its end. */\n readAsString(maxSize?: number): string;\n\n /** Return the next byte from the file. Return -1 if the end of file is reached. */\n getByte(): number;\n\n /** Write one byte to the file. */\n putByte(value: number): void;\n\n /**\n * Set the buffering mode and buffer size for the file stream (wrapper to the libc `setvbuf()`).\n *\n * Note that unlike the libc setvbuf, the \"buffer\" argument is not supported, and therefore is not present.\n *\n * @param mode The buffering mode to use. It can be one of the following values: `std._IOFBF` for full buffering, `std._IOLBF` for line buffering, or `std._IONBF` for no buffering.\n * @param size The size to resize the internal in-memory buffer for this file to.\n */\n setvbuf(mode: number, size: number): void;\n}\n\ndeclare module \"quickjs:std\" {\n /**\n * Set the exit code that the process should exit with in the future, if it\n * exits normally.\n *\n * Can only be called from the main thread.\n *\n * This exit code will only be used if the process exits \"normally\", ie, when\n * there are no more pending JS tasks/listeners. If an unhandled exception is\n * thrown, the process will always exit with status `1`, regardless of the\n * status code passed to `setExitCode`. If someone calls {@link exit} and\n * passes in a status code, that status code will take precedence over the\n * status code passed to `setExitCode`.\n *\n * @param statusCode The future exit code; 0 for success, nonzero for failure.\n */\n export function setExitCode(statusCode: number): void;\n\n /**\n * Return the exit code that was previously set by {@link setExitCode}, or 0 if\n * it hasn't yet been set.\n *\n * Can only be called from the main thread.\n */\n export function getExitCode(): number;\n\n /**\n * Exit the process with the provided status code.\n *\n * Can only be called from the main thread.\n *\n * If `statusCode` is not provided, a value previously passed into\n * {@link setExitCode} will be used. If no value was previously passed into\n * setExitCode, `0` will be used.\n *\n * @param statusCode The exit code; 0 for success, nonzero for failure.\n */\n export function exit(statusCode?: number): never;\n\n /**\n * Load the file `filename` and return it as a string assuming UTF-8 encoding.\n *\n * @param filename - The relative or absolute path to the file to load. Relative paths are resolved relative to the process's current working directory.\n */\n export function loadFile(filename: string): string;\n\n /**\n * Return a boolean indicating whether the provided value is a FILE object.\n *\n * @param value - The value to check.\n * @returns Whether the value was a `FILE` or not.\n */\n export function isFILE(value: any): boolean;\n\n /**\n * Open a file (wrapper to the libc `fopen()`).\n * Return the FILE object.\n *\n * @param filename - The relative or absolute path to the file to open. Relative paths are resolved relative to the process's current working directory.\n * @param flags - A string containing any combination of the characters 'r', 'w', 'a', '+', and/or 'b'.\n * @returns The opened FILE object.\n */\n export function open(filename: string, flags: string): FILE;\n\n /**\n * Open a process by creating a pipe (wrapper to the libc `popen()`).\n * Return the FILE object.\n *\n * @param command - The command line to execute. Gets passed via `/bin/sh -c`.\n * @param flags - A string containing any combination of the characters 'r', 'w', 'a', '+', and/or 'b'.\n * @returns The opened FILE object.\n */\n export function popen(command: string, flags: string): FILE;\n\n /**\n * Open a file from a file handle (wrapper to the libc `fdopen()`).\n * Return the FILE object.\n *\n * @param fd - The file handle to open.\n * @param flags - A string containing any combination of the characters 'r', 'w', 'a', '+', and/or 'b'.\n * @returns The opened FILE object.\n */\n export function fdopen(fd: number, flags: string): FILE;\n\n /**\n * Open a temporary file.\n * Return the FILE object.\n *\n * @returns The opened FILE object.\n */\n export function tmpfile(): FILE;\n\n /** Equivalent to `std.out.puts(str)`. */\n export function puts(...strings: Array<string>): void;\n\n /** Equivalent to `std.out.printf(fmt, ...args)` */\n export function printf(fmt: string, ...args: Array<any>): void;\n\n /** Equivalent to the libc sprintf(). */\n export function sprintf(fmt: string, ...args: Array<any>): void;\n\n /** Wrapper to the libc file stdin. */\n var in_: FILE;\n\n export { in_ as in };\n\n /** Wrapper to the libc file stdout. */\n export var out: FILE;\n\n /** Wrapper to the libc file stderr. */\n export var err: FILE;\n\n /** Constant for {@link FILE.seek}. Declares that pointer offset should be relative to the beginning of the file. See also libc `fseek()`. */\n export var SEEK_SET: number;\n\n /** Constant for {@link FILE.seek}. Declares that the offset should be relative to the current position of the FILE handle. See also libc `fseek()`. */\n export var SEEK_CUR: number;\n\n /** Constant for {@link FILE.seek}. Declares that the offset should be relative to the end of the file. See also libc `fseek()`. */\n export var SEEK_END: number;\n\n /** Constant for {@link FILE.setvbuf}. Declares that the buffer mode should be 'full buffering'. */\n export var _IOFBF: number;\n\n /** Constant for {@link FILE.setvbuf}. Declares that the buffer mode should be 'line buffering'. */\n export var _IOLBF: number;\n\n /** Constant for {@link FILE.setvbuf}. Declares that the buffer mode should be 'no buffering'. */\n export var _IONBF: number;\n\n /** Return the value of the environment variable `name` or `undefined` if it is not defined. */\n export function getenv(name: string): string | undefined;\n\n /** Set the value of the environment variable `name` to the string `value`. */\n export function setenv(name: string, value: string): void;\n\n /** Delete the environment variable `name`. */\n export function unsetenv(name: string): void;\n\n /** Return an object containing the environment variables as key-value pairs. */\n export function getenviron(): { [key: string]: string | undefined };\n\n /**\n * Return the real user ID of the calling process.\n *\n * This function throws an error on windows, because windows doesn't support\n * the same uid/gid paradigm as Unix-like operating systems.\n */\n export function getuid(): number;\n\n /**\n * Return the effective user ID of the calling process.\n *\n * This function throws an error on windows, because windows doesn't support\n * the same uid/gid paradigm as Unix-like operating systems.\n */\n export function geteuid(): number;\n\n /**\n * Return the real group ID of the calling process.\n *\n * This function throws an error on windows, because windows doesn't support\n * the same uid/gid paradigm as Unix-like operating systems.\n */\n export function getgid(): number;\n\n /**\n * Return the effective group ID of the calling process.\n *\n * This function throws an error on windows, because windows doesn't support\n * the same uid/gid paradigm as Unix-like operating systems.\n */\n export function getegid(): number;\n\n /** The type of the object returned by {@link getpwuid}. */\n export interface PasswdEntry {\n name: string;\n passwd: string;\n uid: number;\n gid: number;\n gecos: string;\n dir: string;\n shell: string;\n }\n\n /**\n * Get information from the passwd file entry for the specified user id.\n *\n * See https://linux.die.net/man/3/getpwuid.\n *\n * This function throws an error on windows, because windows doesn't support\n * the same uid/gid paradigm as Unix-like operating systems.\n */\n export function getpwuid(id: number): PasswdEntry;\n\n interface UrlGet {\n /**\n * Download `url` using the `curl` command line utility. Returns string\n * when the http status code is between 200 and 299, and throws otherwise.\n *\n * Pass an object with { full: true } as the second argument to get\n * response headers and status code.\n */\n (url: string): string;\n\n /**\n * Download `url` using the `curl` command line utility. Returns string\n * when the http status code is between 200 and 299, and throws otherwise.\n *\n * Pass an object with { full: true } as the second argument to get\n * response headers and status code.\n */\n (url: string, options: { binary: false }): string;\n\n /**\n * Download `url` using the `curl` command line utility. Returns string\n * when the http status code is between 200 and 299, and throws otherwise.\n *\n * Pass an object with { full: true } as the second argument to get\n * response headers and status code.\n */\n (url: string, options: { full: false }): string;\n\n /**\n * Download `url` using the `curl` command line utility. Returns string\n * when the http status code is between 200 and 299, and throws otherwise.\n *\n * Pass an object with { full: true } as the second argument to get\n * response headers and status code.\n */\n (url: string, options: { binary: false; full: false }): string;\n\n /**\n * Download `url` using the `curl` command line utility. Returns\n * ArrayBuffer when the http status code is between 200 and 299, and throws\n * otherwise.\n *\n * Pass an object with { full: true } as the second argument to get\n * response headers and status code.\n */\n (url: string, options: { binary: true }): ArrayBuffer;\n\n /**\n * Download `url` using the `curl` command line utility. Returns\n * ArrayBuffer when the http status code is between 200 and 299, and throws\n * otherwise.\n *\n * Pass an object with { full: true } as the second argument to get\n * response headers and status code.\n */\n (url: string, options: { binary: true; full: false }): ArrayBuffer;\n\n /**\n * Download `url` using the `curl` command line utility.\n *\n * Returns an object with three properties:\n *\n * - `response`: response body content (string)\n * - `responseHeaders`: headers separated by CRLF (string)\n * - `status`: status code (number)\n */\n (url: string, options: { full: true }): {\n status: number;\n response: string;\n responseHeaders: string;\n };\n\n /**\n * Download `url` using the `curl` command line utility.\n *\n * Returns an object with three properties:\n *\n * - `response`: response body content (string)\n * - `responseHeaders`: headers separated by CRLF (string)\n * - `status`: status code (number)\n */\n (url: string, options: { full: true; binary: false }): {\n status: number;\n response: string;\n responseHeaders: string;\n };\n\n /**\n * Download `url` using the `curl` command line utility.\n *\n * Returns an object with three properties:\n *\n * - `response`: response body content (ArrayBuffer)\n * - `responseHeaders`: headers separated by CRLF (string)\n * - `status`: status code (number)\n */\n (url: string, options: { full: true; binary: true }): {\n status: number;\n response: ArrayBuffer;\n responseHeaders: string;\n };\n }\n\n export var urlGet: UrlGet;\n\n /**\n * Parse `str` using a superset of JSON.parse. The following extensions are accepted:\n *\n * - Single line and multiline comments\n * - unquoted properties (ASCII-only Javascript identifiers)\n * - trailing comma in array and object definitions\n * - single quoted strings\n * - `\\f` and `\\v` are accepted as space characters\n * - leading plus in numbers\n * - octal (0o prefix) and hexadecimal (0x prefix) numbers\n */\n export function parseExtJSON(str: string): any;\n\n /**\n * A wrapper around the standard C [strftime](https://en.cppreference.com/w/c/chrono/strftime).\n * Formats a time/date into a format as specified by the user.\n *\n * @param maxBytes - The number of bytes to allocate for the string that will be returned\n * @param format - Format string, using `%`-prefixed sequences as found in [this table](https://en.cppreference.com/w/c/chrono/strftime#Format_string).\n * @param time - The Date object (or unix timestamp, in ms) to render.\n */\n export function strftime(\n maxBytes: number,\n format: string,\n time: Date | number\n ): string;\n}\n\ndeclare module \"quickjs:os\" {\n /**\n * Open a file handle. Returns a number; the file descriptor.\n *\n * @param filename - The path to the file to open.\n * @param flags - Numeric flags that set the mode to use when opening the file. See `os.O_*`\n * @param mode - Octal access mask. Defaults to 0o666.\n */\n export function open(filename: string, flags: number, mode?: number): number;\n\n /** POSIX open flag, used in {@link open}. */\n export var O_RDONLY: number;\n\n /** POSIX open flag, used in {@link open}. */\n export var O_WRONLY: number;\n\n /** POSIX open flag, used in {@link open}. */\n export var O_RDWR: number;\n\n /** POSIX open flag, used in {@link open}. */\n export var O_APPEND: number;\n\n /** POSIX open flag, used in {@link open}. */\n export var O_CREAT: number;\n\n /** POSIX open flag, used in {@link open}. */\n export var O_EXCL: number;\n\n /** POSIX open flag, used in {@link open}. */\n export var O_TRUNC: number;\n\n /**\n * Windows-specific open flag: open the file in binary mode (which is the default). Used in {@link open}.\n *\n * NOTE: this property is only present on windows\n */\n export var O_BINARY: number | undefined;\n\n /**\n * Windows-specific open flag: open the file in text mode. The default is binary mode. Used in {@link open}.\n *\n * NOTE: this property is only present on windows\n */\n export var O_TEXT: number | undefined;\n\n /** Close the file with descriptor `fd`. */\n export function close(fd: number): void;\n\n interface OsSeek {\n /** Seek in the file. Use `std.SEEK_*` for `whence`. `offset` is either a number or a bigint. If `offset` is a bigint, a bigint is returned too. */\n (fd: number, offset: number, whence: number): number;\n\n /** Seek in the file. Use `std.SEEK_*` for `whence`. `offset` is either a number or a bigint. If `offset` is a bigint, a bigint is returned too. */\n (fd: number, offset: BigInt, whence: number): BigInt;\n }\n\n /** Seek in the file. Use `std.SEEK_*` for `whence`. `offset` is either a number or a bigint. If `offset` is a bigint, a bigint is returned too. */\n export var seek: OsSeek;\n\n /** Read `length` bytes from the file with descriptor `fd` to the ArrayBuffer `buffer` at byte position `offset`. Return the number of read bytes. */\n export function read(\n fd: number,\n buffer: ArrayBuffer,\n offset: number,\n length: number\n ): number;\n\n /** Write `length` bytes to the file with descriptor `fd` from the ArrayBuffer `buffer` at byte position `offset`. Return the number of written bytes. */\n export function write(\n fd: number,\n buffer: ArrayBuffer,\n offset: number,\n length: number\n ): number;\n\n /** Return `true` if the file opened with descriptor `fd` is a TTY (terminal). */\n export function isatty(fd: number): boolean;\n\n /** Return the TTY size as `[width, height]` or `null` if not available. */\n export function ttyGetWinSize(fd: number): null | [number, number];\n\n /** Set the TTY in raw mode. */\n export function ttySetRaw(fd: number): void;\n\n /** Remove a file. */\n export function remove(filename: string): void;\n\n /** Rename a file. */\n export function rename(oldname: string, newname: string): void;\n\n /** Return the canonicalized absolute pathname of `path`. */\n export function realpath(path: string): string;\n\n /** Return the current working directory. */\n export function getcwd(): string;\n\n /** Change the current directory. */\n export function chdir(path: string): void;\n\n /** Create a directory at `path`. */\n export function mkdir(path: string, mode?: number): void;\n\n export type Stats = {\n dev: number;\n ino: number;\n mode: number;\n nlink: number;\n uid: number;\n gid: number;\n rdev: number;\n size: number;\n blocks: number;\n atime: number;\n mtime: number;\n ctime: number;\n };\n\n /**\n * Return a stats object with the following fields:\n *\n * - `dev`\n * - `ino`\n * - `mode`\n * - `nlink`\n * - `uid`\n * - `gid`\n * - `rdev`\n * - `size`\n * - `blocks`\n * - `atime`\n * - `mtime`\n * - `ctime`\n *\n * The times are specified in milliseconds since 1970. `lstat()` is the same as `stat()` except that it returns information about the link itself.\n */\n export function stat(path: string): Stats;\n\n /**\n * Return a stats object with the following fields:\n *\n * - `dev`\n * - `ino`\n * - `mode`\n * - `nlink`\n * - `uid`\n * - `gid`\n * - `rdev`\n * - `size`\n * - `blocks`\n * - `atime`\n * - `mtime`\n * - `ctime`\n *\n * The times are specified in milliseconds since 1970. `lstat()` is the same as `stat()` except that it returns information about the link itself.\n */\n export function lstat(path: string): Stats;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * Mask for getting type of file from mode.\n */\n export var S_IFMT: number;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * File type: named pipe (fifo)\n */\n export var S_IFIFO: number;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * File type: character special\n */\n export var S_IFCHR: number;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * File type: directory\n */\n export var S_IFDIR: number;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * File type: block special\n */\n export var S_IFBLK: number;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * File type: regular\n */\n export var S_IFREG: number;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * File type: socket\n *\n * NOTE: this property is not present on windows\n */\n export var S_IFSOCK: number | undefined;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * File type: symbolic link\n *\n * NOTE: this property is not present on windows\n */\n export var S_IFLNK: number | undefined;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * Flag: set group id on execution\n *\n * NOTE: this property is not present on windows\n */\n export var S_ISGID: number | undefined;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * Flag: set user id on execution\n *\n * NOTE: this property is not present on windows\n */\n export var S_ISUID: number | undefined;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * Mask for getting RWX permissions for owner\n */\n export var S_IRWXU: number;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * Permission: read for owner\n */\n export var S_IRUSR: number;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * Permission: write for owner\n */\n export var S_IWUSR: number;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * Permission: execute for owner\n */\n export var S_IXUSR: number;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * Mask for getting RWX permissions for group\n */\n export var S_IRWXG: number;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * Permission: read for group\n */\n export var S_IRGRP: number;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * Permission: write for group\n */\n export var S_IWGRP: number;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * Permission: execute for group\n */\n export var S_IXGRP: number;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * Mask for getting RWX permissions for others\n */\n export var S_IRWXO: number;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * Permission: read for others\n */\n export var S_IROTH: number;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * Permission: write for others\n */\n export var S_IWOTH: number;\n\n /**\n * Constant to interpret the `mode` property returned by `stat()`. Has the same value as in the C system header `sys/stat.h`.\n *\n * Permission: execute for others\n */\n export var S_IXOTH: number;\n\n /**\n * Change the access and modification times of the file path.\n *\n * The times are specified in milliseconds since 1970.\n */\n export function utimes(path: string, atime: number, mtime: number): void;\n\n /** Create a link at `linkpath` containing the string `target`. */\n export function symlink(target: string, linkpath: string): void;\n\n /** Return the link target. */\n export function readlink(path: string): string;\n\n /** Return an array of strings containing the filenames of the directory `path`. */\n export function readdir(path: string): Array<string>;\n\n /** Add a read handler to the file with descriptor `fd`. `func` is called each time there is data pending for `fd`. A single read handler per file handle is supported. Use `func = null` to remove the handler. */\n export function setReadHandler(fd: number, func: null | (() => void)): void;\n\n /** Add a write handler to the file with descriptor `fd`. `func` is called each time data can be written to `fd`. A single write handler per file handle is supported. Use `func = null` to remove the handler. */\n export function setWriteHandler(fd: number, func: null | (() => void)): void;\n\n /** Call the function `func` when the signal `signal` happens. Only a single handler per signal number is supported. Use `null` to set the default handler or `undefined` to ignore the signal. Signal handlers can only be defined in the main thread. */\n export function signal(\n signal: number,\n func: null | undefined | (() => void)\n ): void;\n\n /** POSIX signal number. */\n export var SIGINT: number;\n\n /** POSIX signal number. */\n export var SIGABRT: number;\n\n /** POSIX signal number. */\n export var SIGFPE: number;\n\n /** POSIX signal number. */\n export var SIGILL: number;\n\n /** POSIX signal number. */\n export var SIGSEGV: number;\n\n /** POSIX signal number. */\n export var SIGTERM: number;\n\n /** POSIX signal number. NOTE: this signal is not present on windows. */\n export var SIGQUIT: number | undefined;\n\n /** POSIX signal number. NOTE: this signal is not present on windows. */\n export var SIGPIPE: number | undefined;\n\n /** POSIX signal number. NOTE: this signal is not present on windows. */\n export var SIGALRM: number | undefined;\n\n /** POSIX signal number. NOTE: this signal is not present on windows. */\n export var SIGUSR1: number | undefined;\n\n /** POSIX signal number. NOTE: this signal is not present on windows. */\n export var SIGUSR2: number | undefined;\n\n /** POSIX signal number. NOTE: this signal is not present on windows. */\n export var SIGCHLD: number | undefined;\n\n /** POSIX signal number. NOTE: this signal is not present on windows. */\n export var SIGCONT: number | undefined;\n\n /** POSIX signal number. NOTE: this signal is not present on windows. */\n export var SIGSTOP: number | undefined;\n\n /** POSIX signal number. NOTE: this signal is not present on windows. */\n export var SIGTSTP: number | undefined;\n\n /** POSIX signal number. NOTE: this signal is not present on windows. */\n export var SIGTTIN: number | undefined;\n\n /** POSIX signal number. NOTE: this signal is not present on windows. */\n export var SIGTTOU: number | undefined;\n\n /** Send the signal `sig` to the process `pid`. Use `os.SIG*` constants. */\n export function kill(pid: number, sig: number): void;\n\n export type ExecOptions = {\n /** Boolean (default = true). If true, wait until the process is terminated. In this case, `exec` returns the exit code if positive or the negated signal number if the process was interrupted by a signal. If false, do not block and return the process id of the child. */\n block?: boolean;\n\n /** Boolean (default = true). If true, the file is searched in the `PATH` environment variable. */\n usePath?: boolean;\n\n /** String (default = `args[0]`). Set the file to be executed. */\n file?: string;\n\n /** String. If present, set the working directory of the new process. */\n cwd?: string;\n\n /** If present, set the file descriptor in the child for stdin. */\n stdin?: number;\n\n /** If present, set the file descriptor in the child for stdout. */\n stdout?: number;\n\n /** If present, set the file descriptor in the child for stderr. */\n stderr?: number;\n\n /** Object. If present, set the process environment from the object key-value pairs. Otherwise use the same environment as the current process. To get the current process's environment variables as on object, use `std.getenviron()`. */\n env?: { [key: string | number]: string | number | boolean };\n\n /** Integer. If present, the process uid with `setuid`. */\n uid?: number;\n\n /** Integer. If present, the process gid with `setgid`. */\n gid?: number;\n };\n\n /** Execute a process with the arguments args, and the provided options (if any). */\n export function exec(args: Array<string>, options?: ExecOptions): number;\n\n /**\n * `waitpid` Unix system call. Returns the array [ret, status].\n *\n * From man waitpid(2):\n *\n * waitpid(): on success, returns the process ID of the child whose state has changed; if WNOHANG was specified and one or more child(ren) specified by pid exist, but have not yet changed state, then 0 is returned.\n */\n export function waitpid(pid: number, options?: number): [number, number];\n\n /** Constant for the `options` argument of `waitpid`. */\n export var WNOHANG: number;\n /** Constant for the `options` argument of `waitpid`. */\n export var WUNTRACED: number;\n\n /** Function to be used to interpret the 'status' return value of `waitpid`. */\n export function WEXITSTATUS(status: number): number;\n /** Function to be used to interpret the 'status' return value of `waitpid`. */\n export function WTERMSIG(status: number): number;\n /** Function to be used to interpret the 'status' return value of `waitpid`. */\n export function WSTOPSIG(status: number): number;\n\n /** Function to be used to interpret the 'status' return value of `waitpid`. */\n export function WIFEXITED(status: number): boolean;\n /** Function to be used to interpret the 'status' return value of `waitpid`. */\n export function WIFSIGNALED(status: number): boolean;\n /** Function to be used to interpret the 'status' return value of `waitpid`. */\n export function WIFSTOPPED(status: number): boolean;\n /** Function to be used to interpret the 'status' return value of `waitpid`. */\n export function WIFCONTINUED(status: number): boolean;\n\n /** `dup` Unix system call. */\n export function dup(fd: number): number;\n\n /** `dup2` Unix system call. */\n export function dup2(oldfd: number, newfd: number): number;\n\n /** `pipe` Unix system call. Return two handles as `[read_fd, write_fd]`. */\n export function pipe(): [number, number];\n\n /** Sleep for `delay_ms` milliseconds. */\n export function sleep(delay_ms: number): void;\n\n export type OSTimer = { [Symbol.toStringTag]: \"OSTimer\" };\n\n /** Call the function func after delay ms. Return a handle to the timer. */\n export function setTimeout(\n func: (...args: any) => any,\n delay: number\n ): OSTimer;\n\n /** Cancel a timer. */\n export function clearTimeout(handle: OSTimer): void;\n\n /** Return a string representing the platform: \"linux\", \"darwin\", \"win32\", \"freebsd\", or \"js\" (emscripten). */\n export var platform: \"linux\" | \"darwin\" | \"win32\" | \"freebsd\" | \"js\";\n\n /**\n * Things that can be put into Worker.postMessage.\n *\n * NOTE: This is effectively the same stuff as supported by the structured\n * clone algorithm, but without support for Map/Set (not supported in\n * QuickJS yet).\n */\n export type StructuredClonable =\n | string\n | number\n | boolean\n | null\n | undefined\n | Boolean\n | String\n | Date\n | RegExp\n | ArrayBuffer\n | Int8Array\n | Uint8Array\n | Uint8ClampedArray\n | Int16Array\n | Uint16Array\n | Int32Array\n | Uint32Array\n | Float32Array\n | Float64Array\n | BigInt64Array\n | BigUint64Array\n | DataView\n | Array<StructuredClonable>\n | SharedArrayBuffer\n // Map and Set not yet supported\n // | Map<StructuredClonable, StructuredClonable>\n // | Set<StructuredClonable>\n | { [key: string | number]: StructuredClonable };\n\n export class Worker {\n /**\n * Constructor to create a new thread (worker) with an API close to the\n * `WebWorkers`. `moduleFilename` is a string specifying the module\n * filename which is executed in the newly created thread. As for\n * dynamically imported module, it is relative to the current script or\n * module path. Threads normally don’t share any data and communicate\n * between each other with messages. Nested workers are not supported.\n */\n constructor(moduleFilename: string);\n\n /**\n * In the created worker, Worker.parent represents the parent worker and is\n * used to send or receive messages.\n */\n static parent: Worker;\n\n /**\n * Send a message to the corresponding worker. msg is cloned in the\n * destination worker using an algorithm similar to the HTML structured\n * clone algorithm. SharedArrayBuffer are shared between workers.\n *\n * Current limitations: Map and Set are not supported yet.\n */\n postMessage(msg: StructuredClonable): void;\n\n /**\n * Set a function which is called each time a message is received. The\n * function is called with a single argument. It is an object with a data\n * property containing the received message. The thread is not terminated\n * if there is at least one non null onmessage handler.\n */\n onmessage: null | ((event: { data: StructuredClonable }) => void);\n }\n\n /** constant for {@link access}(); test for read permission. */\n export var R_OK: number;\n\n /** constant for {@link access}(); test for write permission. */\n export var W_OK: number;\n\n /** constant for {@link access}(); test for execute (search) permission. */\n export var X_OK: number;\n\n /** constant for {@link access}(); test for existence of file. */\n export var F_OK: number;\n\n /** `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. */\n export function access(path: string, accessMode: number): void;\n\n /** gets the path to the executable which is executing this JS code. might be a relative path or symlink. */\n export function execPath(): string;\n\n /** changes the access permission bits of the file at `path` using the octal number `mode`. */\n export function chmod(path: string, mode: number): void;\n}\n\ndeclare var setTimeout: typeof import(\"quickjs:os\").setTimeout;\ndeclare var clearTimeout: typeof import(\"quickjs:os\").clearTimeout;\n\n/**\n * An object which lets you configure the module loader (import/export/require).\n * You can change these properties to add support for importing new filetypes.\n */\ninterface ModuleDelegate {\n /**\n * A list of filetype extensions that may be omitted from an import specifier\n * string.\n *\n * Defaults to `[\".js\"]`. You can add more strings to this array to\n * make the engine search for additional files when resolving a\n * require/import.\n *\n * See the doc comment on {@link require} for more information.\n *\n * NOTE: If you add a new extension to this array, you will likely also want\n * to add to {@link compilers}.\n */\n searchExtensions: Array<string>;\n\n /**\n * User-defined functions which will handle getting the JavaScript code\n * associated with a module.\n *\n * The key for each property in this object should be a file extension\n * string with a leading dot, eg `\".jsx\"`. The value for each property should\n * be a function which receives (1) the filepath to a module, and (2) that\n * file's content as a UTF-8 string, and the function should return a string\n * containing JavaScript code that corresponds to that module. In most cases,\n * these functions will compile the contents of the file from one format into JavaScript.\n *\n * The function does not have to use the second 'content' argument it\n * receives (ie. when loading binary files).\n *\n * By adding to this object, you can make it possible to import non-js\n * filetypes; compile-to-JS languages like JSX, TypeScript, and CoffeeScript\n * can be compiled at import time, and asset files like .txt files or .png\n * files can be converted into an appropriate data structure at import time.\n *\n * As an example, to make it possible to import .txt files, you might do:\n * ```js\n * import * as std from \"std\";\n *\n * ModuleDelegate.compilers[\".txt\"] = (filename, content) => {\n * return `export default ${JSON.stringify(content)}`;\n * }\n * ```\n * (leveraging `JSON.stringify`'s ability to escape quotes).\n *\n * Then, later in your code, you can do:\n * ```js\n * import names from \"./names.txt\";\n * ```\n *\n * And `names` will be a string containing the contents of names.txt.\n *\n * NOTE: When adding to this object, you may also wish to add to\n * {@link searchExtensions}.\n */\n compilers: {\n [extensionWithDot: string]: (filename: string, content: string) => string;\n };\n\n /**\n * An Array containing the names of all the built-in modules, such as\n * \"quickjs:std\", \"quickjs:bytecode\", etc.\n *\n * `quickjs:engine`'s `defineBuiltinModule` function adds to the end of this\n * array.\n */\n builtinModuleNames: Array<string>;\n\n /**\n * Resolves a require/import request from `fromFile` into a canonicalized\n * path.\n *\n * To change native module resolution behavior, replace this function with\n * your own implementation. Note that you must handle\n * `ModuleDelegate.searchExtensions` yourself in your replacement\n * implementation.\n */\n resolve(name: string, fromFile: string): string;\n\n /**\n * Reads the contents of the given resolved module name into a string.\n *\n * To change native module loading behavior, replace this function with your\n * own implementation. Note that you must handle `ModuleDelegate.compilers`\n * yourself in your replacement implementation.\n */\n read(modulePath: string): string;\n}\n\ninterface RequireFunction {\n /**\n * Synchronously import a module.\n *\n * `source` will be resolved relative to the calling file.\n *\n * If `source` does not have a file extension, and a file without an extension\n * cannot be found, the engine will check for files with the extensions in\n * {@link ModuleDelegate.searchExtensions}, and use one of those if present.\n * This behavior also happens when using normal `import` statements.\n *\n * For example, if you write:\n *\n * ```js\n * import something from \"./somewhere\";\n * ```\n *\n * but there's no file named `somewhere` in the same directory as the file\n * where that import appears, and `ModuleDelegate.searchExtensions` is the\n * default value:\n *\n * ```js\n * [\".js\"]\n * ```\n *\n * then the engine will look for `somewhere.js`. If that doesn't exist, the\n * engine will look for `somewhere/index.js`. If *that* doesn't exist, an\n * error will be thrown.\n *\n * If you add more extensions to `ModuleDelegate.searchExtensions`, then the\n * engine will use those, too. It will search in the same order as the strings\n * appear in the `ModuleDelegate.searchExtensions` array.\n */\n (source: string): any;\n\n /**\n * Resolves the normalized path to a modules, relative to the calling file.\n */\n resolve: (source: string) => string;\n}\n\n// global added by QJMS_InitContext\ndeclare var require: RequireFunction;\n\n// gets set per-module by QJMS_SetModuleImportMeta\ninterface ImportMeta {\n /**\n * A URL representing the current module.\n *\n * Usually starts with `file://`.\n */\n url: string;\n\n /**\n * Whether the current module is the \"main\" module, meaning that it is the\n * entrypoint file that's been loaded, or, in other terms, the first\n * user-authored module that's been loaded.\n */\n main: boolean;\n\n /**\n * Equivalent to `globalThis.require`. Provided for compatibility with tools\n * that can leverage a CommonJS require function via `import.meta.require`.\n */\n require: RequireFunction;\n\n /**\n * Resolves a module specifier based on the current module's path.\n *\n * Equivalent to `globalThis.require.resolve`.\n *\n * Behaves similarly to [the browser\n * import.meta.resolve](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import.meta/resolve),\n * but it does not ensure that the returned string is a valid URL, because it\n * delegates directly to {@link ModuleDelegate.resolve} to resolve the name.\n * If you want this to return URL strings, change `ModuleDelegate.resolve` and\n * `ModuleDelegate.read` to work with URL strings.\n */\n resolve: RequireFunction[\"resolve\"];\n}\n\ndeclare module \"quickjs:engine\" {\n /**\n * Return whether the provided resolved module path is set as the main module.\n *\n * In other words, return what the value of `import.meta.main` would be within\n * the module.\n *\n * The main module can be set via {@link setMainModule}.\n */\n export function isMainModule(resolvedFilepath: string): boolean;\n\n /**\n * Set the main module to the module with the provided resolved path.\n *\n * This will affect the value of `import.meta.main` for modules loaded in the\n * future, but it will NOT retroactively change the value of\n * `import.meta.main` in existing already-loaded modules.\n */\n export function setMainModule(resolvedFilepath: string): void;\n\n /**\n * Evaluate the string `code` as a script (global eval).\n *\n * @param code - The code to evaluate.\n * @param options - An optional object containing the following optional properties:\n * @property backtraceBarrier - Boolean (default = false). If true, error backtraces do not list the stack frames below the evalScript.\n * @property filename - String (default = \"<evalScript>\"). The filename to associate with the code being executed.\n * @returns The result of the evaluation.\n */\n export function evalScript(\n code: string,\n options?: { backtraceBarrier?: boolean; filename?: string }\n ): any;\n\n /**\n * Evaluate the file `filename` as a script (global eval).\n *\n * @param filename - The relative or absolute path to the file to load. Relative paths are resolved relative to the process's current working directory.\n * @returns The result of the evaluation.\n */\n export function runScript(filename: string): any;\n\n /**\n * Evaluate the file `filename` as a module. Effectively a synchronous dynamic `import()`.\n *\n * @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.\n * @param basename - If present and `filename` is a relative path, `filename` will be resolved relative to this basename.\n * @returns The result of the evaluation (module namespace object).\n */\n export function importModule(\n filename: string,\n basename?: string\n ): { [key: string]: any };\n\n /**\n * Return the resolved path to a module.\n *\n * @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.\n * @param basename - If present and `filename` is a relative path, `filename` will be resolved relative to this basename.\n * @returns The resolved module path.\n */\n export function resolveModule(filename: string, basename?: string): string;\n\n /**\n * Read the script of module filename from an active stack frame, then return it as a string.\n *\n * If there isn't a valid filename for the specified stack frame, an error will be thrown.\n *\n * @param stackLevels - How many levels up the stack to search for a filename. Defaults to 0, which uses the current stack frame.\n */\n export function getFileNameFromStack(stackLevels?: number): string;\n\n /**\n * Returns true if `target` is a module namespace object.\n */\n export function isModuleNamespace(target: any): boolean;\n\n /**\n * Create a virtual built-in module whose exports consist of the own\n * enumerable properties of `obj`.\n */\n export function defineBuiltinModule(\n name: string,\n obj: { [key: string]: any }\n ): void;\n\n /**\n * An object which lets you configure the module loader (import/export/require).\n * You can change these properties to add support for importing new filetypes.\n */\n export const ModuleDelegate: ModuleDelegate;\n\n /**\n * Manually invoke the cycle removal algorithm (garbage collector).\n *\n * The cycle removal algorithm is automatically started when needed, so this\n * function is useful in case of specific memory constraints or for testing.\n */\n export function gc(): void;\n}\n\ndeclare module \"quickjs:bytecode\" {\n /**\n * Convert the module or script in the specified file into bytecode.\n *\n * When converted back to a value, it will be a function.\n */\n export function fromFile(\n path: string,\n options?: {\n byteSwap?: boolean;\n sourceType?: \"module\" | \"script\";\n encodedFileName?: string;\n }\n ): ArrayBuffer;\n\n /**\n * Convert the provided value into bytecode. Doesn't work with all values.\n */\n export function fromValue(\n value: any,\n options?: { byteSwap?: boolean }\n ): ArrayBuffer;\n\n /**\n * Convert the provided bytecode into a value.\n */\n export function toValue(bytecode: ArrayBuffer): any;\n}\n\ndeclare module \"quickjs:context\" {\n /**\n * A separate global context (or 'realm') within which code can be executed.\n */\n export class Context {\n /**\n * Create a new global context (or 'realm') within code can be executed.\n *\n * @param options Options for what globals/modules/etc to make available within the context.\n *\n * The following globals are always present, regardless of options:\n *\n * - Object\n * - Function\n * - Error\n * - EvalError\n * - RangeError\n * - ReferenceError\n * - SyntaxError\n * - TypeError\n * - URIError\n * - InternalError\n * - AggregateError\n * - Array\n * - parseInt\n * - parseFloat\n * - isNaN\n * - isFinite\n * - decodeURI\n * - decodeURIComponent\n * - encodeURI\n * - encodeURIComponent\n * - escape\n * - unescape\n * - Infinity\n * - NaN\n * - undefined\n * - __date_clock\n * - Number\n * - Boolean\n * - String\n * - Math\n * - Reflect\n * - Symbol\n * - eval (but it doesn't work unless the `eval` option is enabled)\n * - globalThis\n *\n * Note that new contexts don't have a `scriptArgs` global. If you need one\n * to be present in the new context, you can add one onto the Context's\n * `globalThis` property.\n */\n constructor(options?: {\n /** Enables `Date`. Defaults to `true` */\n date?: boolean;\n\n /** Enables `eval`. Defaults to `true` */\n eval?: boolean;\n\n /** Enables `String.prototype.normalize`. Defaults to `true`. */\n stringNormalize?: boolean;\n\n /** Enables `RegExp`. Defaults to `true`. */\n regExp?: boolean;\n\n /** Enables `JSON`. Defaults to `true`. */\n json?: boolean;\n\n /** Enables `Proxy`. Defaults to `true`. */\n proxy?: boolean;\n\n /** Enables `Map` and `Set`. Defaults to `true`. */\n mapSet?: boolean;\n\n /**\n * Enables:\n *\n * - ArrayBuffer\n * - SharedArrayBuffer\n * - Uint8ClampedArray\n * - Int8Array\n * - Uint8Array\n * - Int16Array\n * - Uint16Array\n * - Int32Array\n * - Uint32Array\n * - BigInt64Array\n * - BigUint64Array\n * - Float32Array\n * - Float64Array\n * - DataView\n *\n * Defaults to `true`.\n */\n typedArrays?: boolean;\n\n /**\n * Enables:\n *\n * - Promise\n * - async functions\n * - async iterators\n * - async generators\n *\n * Defaults to `true`.\n */\n promise?: boolean;\n\n /** Enables `BigInt`. Defaults to `true`. */\n bigint?: boolean;\n\n /** Enables `BigFloat`. Defaults to `true`. */\n bigfloat?: boolean;\n\n /** Enables `BigDecimal`. Defaults to `true`. */\n bigdecimal?: boolean;\n\n /**\n * Enables:\n *\n * - Operators\n * - OperatorSet creation\n * - operator overloading\n *\n * Defaults to `true`.\n */\n operators?: boolean;\n\n /** Enables `\"use math\"`. Defaults to `true`. */\n useMath?: boolean;\n\n /** Enables `inspect`. Defaults to `true`. */\n inspect?: boolean;\n /** Enables `console`. Defaults to `true`. */\n console?: boolean;\n /** Enables `print`. Defaults to `true`. */\n print?: boolean;\n /** Enables `require`. Defaults to `true`. */\n moduleGlobals?: boolean;\n /**\n * Enables `setTimeout`, `clearTimeout`, `setInterval`, and\n * `clearInterval`. Defaults to `true`.\n */\n timers?: boolean;\n\n /** Enable builtin modules. */\n modules?: {\n /** Enables the \"quickjs:std\" module. Defaults to `true`. */\n \"quickjs:std\"?: boolean;\n /** Enables the \"quickjs:os\" module. Defaults to `true`. */\n \"quickjs:os\"?: boolean;\n /** Enables the \"quickjs:bytecode\" module. Defaults to `true`. */\n \"quickjs:bytecode\"?: boolean;\n /** Enables the \"quickjs:context\" module. Defaults to `true`. */\n \"quickjs:context\"?: boolean;\n /** Enables the \"quickjs:engine\" module. Defaults to `true`. */\n \"quickjs:engine\"?: boolean;\n /** Enables the \"quickjs:encoding\" module. Defaults to `true`. */\n \"quickjs:encoding\"?: boolean;\n };\n });\n\n /**\n * The `globalThis` object used by this context.\n *\n * You can add to or remove from it to change what is visible to the context.\n */\n globalThis: typeof globalThis;\n\n /**\n * Runs code within the context and returns the result.\n *\n * @param code The code to run.\n */\n eval(code: string): any;\n }\n}\n\n// WHATWG encoding spec at https://encoding.spec.whatwg.org/ would be better,\n// but this is better than nothing\ndeclare module \"quickjs:encoding\" {\n export function toUtf8(input: ArrayBuffer): string;\n export function fromUtf8(input: string): ArrayBuffer;\n}\n\ndeclare const std: typeof import(\"quickjs:std\");\ndeclare const os: typeof import(\"quickjs:os\");\n\n// undocumented from quickjs, but it's there\n/** Get the current unix timestamp with microsecond precision. */\ndeclare function __date_clock(): number;\n";
1990
1990
  }),
1991
1991
  /* --- src/api/repl/modified-qjs-repl.js --- */
1992
1992
  "src/api/repl/modified-qjs-repl.js": (function (exports, _kame_require_, module, __filename, __dirname, _kame_dynamic_import_) {
@@ -2362,11 +2362,13 @@ function startRepl(lang) {
2362
2362
  history_add(cmd);
2363
2363
  return -1;
2364
2364
  }
2365
+ let last_history_line = null;
2365
2366
  function history_add(str) {
2366
- if (str) {
2367
+ if (str && str !== last_history_line) {
2367
2368
  history.push(str);
2368
2369
  historyFile.append(str);
2369
2370
  }
2371
+ last_history_line = str;
2370
2372
  history_index = history.length;
2371
2373
  }
2372
2374
  function previous_history() {
@@ -3777,6 +3779,9 @@ _export(exports, {
3777
3779
  ChildProcessOptions: function () {
3778
3780
  return _ChildProcess.ChildProcessOptions;
3779
3781
  },
3782
+ ChildProcessState: function () {
3783
+ return _ChildProcess.ChildProcessState;
3784
+ },
3780
3785
  exec: function () {
3781
3786
  return _exec.exec;
3782
3787
  }
@@ -26260,17 +26265,23 @@ class Path {
26260
26265
  return this.replaceLast([]);
26261
26266
  }
26262
26267
  startsWith(value) {
26263
- value = new Path(value);
26268
+ if (!(0, _is.is)(value, _types.types.Path)) {
26269
+ value = new Path(value);
26270
+ }
26264
26271
  return value.segments.every((segment, index) => this.segments[index] === segment);
26265
26272
  }
26266
26273
  endsWith(value) {
26267
- value = new Path(value);
26274
+ if (!(0, _is.is)(value, _types.types.Path)) {
26275
+ value = new Path(value);
26276
+ }
26268
26277
  const valueSegmentsReversed = [...value.segments].reverse();
26269
26278
  const ownSegmentsReversed = [...this.segments].reverse();
26270
26279
  return valueSegmentsReversed.every((segment, index) => ownSegmentsReversed[index] === segment);
26271
26280
  }
26272
26281
  indexOf(value, fromIndex = 0) {
26273
- value = new Path(value);
26282
+ if (!(0, _is.is)(value, _types.types.Path)) {
26283
+ value = new Path(value);
26284
+ }
26274
26285
  const ownSegmentsLength = this.segments.length;
26275
26286
  for (let i = fromIndex; i < ownSegmentsLength; i++) {
26276
26287
  if (value.segments.every((valueSegment, valueIndex) => {
@@ -26285,8 +26296,12 @@ class Path {
26285
26296
  return this.indexOf(value, fromIndex) !== -1;
26286
26297
  }
26287
26298
  replace(value, replacement) {
26288
- value = new Path(value);
26289
- replacement = new Path(replacement);
26299
+ if (!(0, _is.is)(value, _types.types.Path)) {
26300
+ value = new Path(value);
26301
+ }
26302
+ if (!(0, _is.is)(replacement, _types.types.Path)) {
26303
+ replacement = new Path(replacement);
26304
+ }
26290
26305
  const matchIndex = this.indexOf(value);
26291
26306
  if (matchIndex === -1) {
26292
26307
  return this.clone();
@@ -26296,7 +26311,9 @@ class Path {
26296
26311
  }
26297
26312
  }
26298
26313
  replaceAll(value, replacement) {
26299
- replacement = new Path(replacement);
26314
+ if (!(0, _is.is)(replacement, _types.types.Path)) {
26315
+ replacement = new Path(replacement);
26316
+ }
26300
26317
  let searchIndex = 0;
26301
26318
  let currentPath = this;
26302
26319
  const ownLength = this.segments.length;
@@ -26312,12 +26329,28 @@ class Path {
26312
26329
  return currentPath;
26313
26330
  }
26314
26331
  replaceLast(replacement) {
26315
- replacement = new Path(replacement);
26332
+ if (!(0, _is.is)(replacement, _types.types.Path)) {
26333
+ replacement = new Path(replacement);
26334
+ }
26316
26335
  const segments = [...this.segments];
26317
26336
  segments.pop();
26318
26337
  segments.push(...replacement.segments);
26319
26338
  return Path.fromRaw(segments, this.separator);
26320
26339
  }
26340
+ equals(other) {
26341
+ if (!(0, _is.is)(other, _types.types.Path)) {
26342
+ other = new Path(other);
26343
+ }
26344
+ return other.separator === this.separator && this.hasEqualSegments(other);
26345
+ }
26346
+ hasEqualSegments(other) {
26347
+ if (!(0, _is.is)(other, _types.types.Path)) {
26348
+ other = new Path(other);
26349
+ }
26350
+ return this.segments.length === other.segments.length && this.segments.every((segment, index) => {
26351
+ return segment === other.segments[index];
26352
+ });
26353
+ }
26321
26354
  [_inspect_custom](inputs) {
26322
26355
  if (typeof this.segments === "undefined" || typeof this.separator === "undefined") {
26323
26356
  // inspecting Path.prototype, or a Path someone messed up
@@ -26442,7 +26475,7 @@ function realpath(path) {
26442
26475
  /* --- src/hardcoded/compile-time.js?evalAtBuildTime --- */
26443
26476
  "src/hardcoded/compile-time.js?evalAtBuildTime": (function (exports, _kame_require_, module, __filename, __dirname, _kame_dynamic_import_) {
26444
26477
  module.exports = {
26445
- "version": "v0.0.13",
26478
+ "version": "v0.0.14",
26446
26479
  "arch": "arm64"
26447
26480
  };
26448
26481
  }),
@@ -27279,9 +27312,18 @@ const _types = _kame_require_("src/api/types/index.ts");
27279
27312
  const _assert = _kame_require_("src/api/assert/index.ts");
27280
27313
  const _path = _kame_require_("src/api/path/index.ts");
27281
27314
  class ChildProcess {
27282
- /** returns pid */start() {
27315
+ get state() {
27316
+ this._updateState();
27317
+ return this._state;
27318
+ }
27319
+ get pid() {
27320
+ this._updateState();
27321
+ return this._getPidRaw();
27322
+ }
27323
+ /** returns pid */
27324
+ start() {
27283
27325
  this._logging.trace.call(null, "ChildProcess.start:", this.args);
27284
- this.pid = _quickjsos.exec(this.args, {
27326
+ const pid = _quickjsos.exec(this.args, {
27285
27327
  block: false,
27286
27328
  cwd: this.cwd.toString(),
27287
27329
  env: this.env,
@@ -27289,33 +27331,123 @@ class ChildProcess {
27289
27331
  stdout: this.stdio.out.fileno(),
27290
27332
  stderr: this.stdio.err.fileno()
27291
27333
  });
27292
- return this.pid;
27334
+ this._state = {
27335
+ id: "STARTED",
27336
+ pid
27337
+ };
27338
+ return pid;
27293
27339
  }
27294
- waitUntilComplete() {
27295
- const pid = this.pid;
27296
- if (pid == null) {
27297
- throw new Error("Cannot wait for a child process that hasn't yet been started");
27340
+ _getPidRaw() {
27341
+ const state = this._state;
27342
+ switch (state.id) {
27343
+ case "UNSTARTED":
27344
+ return null;
27345
+ case "STARTED":
27346
+ case "STOPPED":
27347
+ case "CONTINUED":
27348
+ return state.pid;
27349
+ case "EXITED":
27350
+ case "SIGNALED":
27351
+ return state.oldPid;
27352
+ default:
27353
+ {
27354
+ const here = state;
27355
+ throw new Error(`Unhandled ChildProcessStateKind: ${state.id}`);
27356
+ }
27298
27357
  }
27299
- while (true) {
27300
- const [ret, status] = _quickjsos.waitpid(pid);
27301
- if (ret == pid) {
27302
- if (_quickjsos.WIFEXITED(status)) {
27303
- const ret = {
27304
- status: _quickjsos.WEXITSTATUS(status),
27305
- signal: undefined
27306
- };
27307
- this._logging.trace.call(null, "ChildProcess result:", this.args, "->", ret);
27308
- return ret;
27309
- } else if (_quickjsos.WIFSIGNALED(status)) {
27310
- const ret = {
27311
- status: undefined,
27312
- signal: _quickjsos.WTERMSIG(status)
27313
- };
27314
- this._logging.trace.call(null, "ChildProcess result:", this.args, "->");
27315
- return ret;
27358
+ }
27359
+ _updateState() {
27360
+ switch (this._state.id) {
27361
+ case "UNSTARTED":
27362
+ case "EXITED":
27363
+ case "SIGNALED":
27364
+ return;
27365
+ case "STARTED":
27366
+ case "STOPPED":
27367
+ case "CONTINUED":
27368
+ this._waitpid(false);
27369
+ break;
27370
+ default:
27371
+ {
27372
+ const here = this._state;
27373
+ throw new Error(`Unhandled ChildProcessStateKind: ${this._state.id}`);
27316
27374
  }
27375
+ }
27376
+ }
27377
+ _waitpid(block) {
27378
+ const pid = this._getPidRaw();
27379
+ if (!pid) {
27380
+ return;
27381
+ }
27382
+ const flags = block ? 0 : _quickjsos.WNOHANG;
27383
+ const [ret, status] = _quickjsos.waitpid(pid, flags);
27384
+ if (ret === pid) {
27385
+ if (_quickjsos.WIFEXITED(status)) {
27386
+ this._state = {
27387
+ id: "EXITED",
27388
+ oldPid: pid,
27389
+ status: _quickjsos.WEXITSTATUS(status)
27390
+ };
27391
+ this._logging.trace.call(null, "ChildProcess result:", this.args, "->", this._state);
27392
+ } else if (_quickjsos.WIFSIGNALED(status)) {
27393
+ this._state = {
27394
+ id: "SIGNALED",
27395
+ oldPid: pid,
27396
+ signal: _quickjsos.WTERMSIG(status)
27397
+ };
27398
+ this._logging.trace.call(null, "ChildProcess result:", this.args, "->", this._state);
27399
+ } else if (_quickjsos.WIFSTOPPED(status)) {
27400
+ this._state = {
27401
+ id: "STOPPED",
27402
+ pid
27403
+ };
27404
+ this._logging.trace.call(null, "ChildProcess stopped:", this.args);
27405
+ } else if (_quickjsos.WIFCONTINUED(status)) {
27406
+ this._state = {
27407
+ id: "CONTINUED",
27408
+ pid
27409
+ };
27410
+ this._logging.trace.call(null, "ChildProcess continued:", this.args);
27317
27411
  }
27318
27412
  }
27413
+ return false;
27414
+ }
27415
+ waitUntilComplete() {
27416
+ do {
27417
+ const rawState = this._state;
27418
+ idSwitch: switch (rawState.id) {
27419
+ case "UNSTARTED":
27420
+ {
27421
+ throw new Error("The ChildProcess hasn't yet started. Call ChildProcess's start() method before calling waitUntilComplete().");
27422
+ }
27423
+ case "EXITED":
27424
+ {
27425
+ return {
27426
+ status: rawState.status,
27427
+ signal: undefined
27428
+ };
27429
+ }
27430
+ case "SIGNALED":
27431
+ {
27432
+ return {
27433
+ status: undefined,
27434
+ signal: rawState.signal
27435
+ };
27436
+ }
27437
+ case "STARTED":
27438
+ case "CONTINUED":
27439
+ case "STOPPED":
27440
+ {
27441
+ this._waitpid(true);
27442
+ break idSwitch;
27443
+ }
27444
+ default:
27445
+ {
27446
+ const here = rawState;
27447
+ throw new Error(`Unhandled ChildProcessStateKind: ${rawState.id}`);
27448
+ }
27449
+ }
27450
+ } while (true);
27319
27451
  }
27320
27452
  constructor(args, options = {}) {
27321
27453
  _define_property._(this, "args", void 0);
@@ -27323,7 +27455,9 @@ class ChildProcess {
27323
27455
  _define_property._(this, "env", void 0);
27324
27456
  _define_property._(this, "stdio", void 0);
27325
27457
  _define_property._(this, "_logging", void 0);
27326
- _define_property._(this, "pid", null);
27458
+ _define_property._(this, "_state", {
27459
+ id: "UNSTARTED"
27460
+ });
27327
27461
  // type of `args` gets checked in `toArgv`
27328
27462
  this.args = (0, _toargv.toArgv)(args);
27329
27463
  const cwd = options.cwd;
@@ -36752,13 +36886,15 @@ function startRepl(handle_cmd, {
36752
36886
  history_add(cmd);
36753
36887
  return -1;
36754
36888
  }
36889
+ let last_history_line = null;
36755
36890
  function history_add(str) {
36756
- if (str) {
36891
+ if (str && str !== last_history_line) {
36757
36892
  history.push(str);
36758
36893
  if (history_file) {
36759
36894
  history_file.append(str);
36760
36895
  }
36761
36896
  }
36897
+ last_history_line = str;
36762
36898
  history_index = history.length;
36763
36899
  }
36764
36900
  function previous_history() {
@@ -73819,7 +73955,7 @@ function expand(str, isTop) {
73819
73955
  var isOptions = m.body.indexOf(',') >= 0;
73820
73956
  if (!isSequence && !isOptions) {
73821
73957
  // {a},b}
73822
- if (m.post.match(/,.*\}/)) {
73958
+ if (m.post.match(/,(?!,).*\}/)) {
73823
73959
  str = m.pre + '{' + m.body + escClose + m.post;
73824
73960
  return expand(str);
73825
73961
  }
@@ -93417,7 +93553,7 @@ var __kame__ = {
93417
93553
  },
93418
93554
 
93419
93555
  chunkUrls: {
93420
- "external:node:fs": "6270d80e8d3ad7c8bb1f2e1ac342e450.js"
93556
+ "external:node:fs": "23f4558a5bd338c1df999a85b5fc0986.js"
93421
93557
  },
93422
93558
  loadChunk: function loadChunk(id) {
93423
93559
  var resolve, reject;
@@ -93465,7 +93601,7 @@ var __kame__ = {
93465
93601
  modules: modules,
93466
93602
  };
93467
93603
 
93468
- global.__kame_instances__ = global.__kame_instances__ || {}; global.__kame_instances__["5074d1e494d1749108041994"] = __kame__;
93604
+ global.__kame_instances__ = global.__kame_instances__ || {}; global.__kame_instances__["a3a0a14413c1754074304831"] = __kame__;
93469
93605
 
93470
93606
  return __kame__.runModule("src/index.ts", true);
93471
93607
  }