diff --git a/node_modules/.bin/stencil b/node_modules/.bin/stencil new file mode 120000 index 00000000..febdaf0a --- /dev/null +++ b/node_modules/.bin/stencil @@ -0,0 +1 @@ +../@stencil/core/bin/stencil \ No newline at end of file diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json new file mode 100644 index 00000000..699d1fda --- /dev/null +++ b/node_modules/.package-lock.json @@ -0,0 +1,27 @@ +{ + "name": "www", + "lockfileVersion": 3, + "requires": true, + "packages": { + "node_modules/@stencil/core": { + "version": "4.22.2", + "resolved": "https://registry.npmjs.org/@stencil/core/-/core-4.22.2.tgz", + "integrity": "sha512-eq2pYrrnzcLyBRANk0X/VVOfCtD0nCxWnEZ0AVdscuqfDkOjxa6SSZOfEhR9FAvrmESHp8y5jRCVPnf4n5CC4A==", + "bin": { + "stencil": "bin/stencil" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.10.0" + } + }, + "node_modules/ionicons": { + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/ionicons/-/ionicons-7.4.0.tgz", + "integrity": "sha512-ZK94MMqgzMCPPMhmk8Ouu6goyVHFIlw/ACP6oe3FrikcI0N7CX0xcwVaEbUc0G/v3W0shI93vo+9ve/KpvcNhQ==", + "dependencies": { + "@stencil/core": "^4.0.3" + } + } + } +} diff --git a/node_modules/@stencil/core/LICENSE.md b/node_modules/@stencil/core/LICENSE.md new file mode 100644 index 00000000..a3032612 --- /dev/null +++ b/node_modules/@stencil/core/LICENSE.md @@ -0,0 +1,27 @@ +The MIT License (MIT) + +Copyright (c) 2019-present Drifty Co. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +----------------------------------------- +Third-party components, software, and/or libraries (collectively, "components") +are included under the licenses specified by their authors. For information +about these third-party licenses, refer to the separate legal notices governing +such components at NOTICE file at the top level of the package. diff --git a/node_modules/@stencil/core/bin/stencil b/node_modules/@stencil/core/bin/stencil new file mode 100755 index 00000000..5370db38 --- /dev/null +++ b/node_modules/@stencil/core/bin/stencil @@ -0,0 +1,57 @@ +#!/usr/bin/env node +'use strict'; + +var minimumVersion = '16.0'; +var futureDeprecationMinVersion = '16.0'; +var recommendedVersion = '18.16'; +var currentVersion = process.versions.node; + +function isNodeLT(v) { + var check = v.split('.').map(Number); + var node = currentVersion.split('.').map(Number); + return node[0] < check[0] || (node[0] === check[0] && node[1] < check[1]); +} + +if (isNodeLT(minimumVersion)) { + console.error( + '\nYour current version of Node is v' + + currentVersion + + ', however Stencil requires v' + + minimumVersion + + '.0 or greater. It is recommended to use an Active LTS version of Node (https://nodejs.org/en/about/releases/).\n', + ); + process.exit(1); +} + +if (isNodeLT(futureDeprecationMinVersion)) { + console.warn( + '\nIn an upcoming major release of Stencil, Node v' + recommendedVersion + '.0 or higher will be required.\n', + ); +} else if (isNodeLT(recommendedVersion)) { + console.warn( + '\nYour current version of Node is v' + + currentVersion + + ", however Stencil's recommendation is v" + + recommendedVersion + + '.0 or greater. Note that future versions of Stencil will eventually remove support for older Node versions and an Active LTS version is recommended (https://nodejs.org/en/about/releases/).\n', + ); +} + +var cli = require('../cli/index.cjs'); +var nodeApi = require('../sys/node/index.js'); +var nodeLogger = nodeApi.createNodeLogger(); +var nodeSys = nodeApi.createNodeSys({ process: process, logger: nodeLogger }); + +nodeApi.setupNodeProcess({ process: process, logger: nodeLogger }); + +cli + .run({ + args: process.argv.slice(2), + logger: nodeLogger, + sys: nodeSys, + checkVersion: nodeApi.checkVersion, + }) + .catch(function (err) { + console.error('uncaught error', err); + process.exit(1); + }); diff --git a/node_modules/@stencil/core/cli/config-flags.d.ts b/node_modules/@stencil/core/cli/config-flags.d.ts new file mode 100644 index 00000000..5e02bd2e --- /dev/null +++ b/node_modules/@stencil/core/cli/config-flags.d.ts @@ -0,0 +1,132 @@ +import type { LogLevel, TaskCommand } from '../internal/index'; +/** + * All the Boolean options supported by the Stencil CLI + */ +export declare const BOOLEAN_CLI_FLAGS: readonly ["build", "cache", "checkVersion", "ci", "compare", "debug", "dev", "devtools", "docs", "e2e", "es5", "esm", "help", "log", "open", "prerender", "prerenderExternal", "prod", "profile", "serviceWorker", "screenshot", "serve", "skipNodeCheck", "spec", "ssr", "stats", "updateScreenshot", "verbose", "version", "watch", "all", "automock", "bail", "changedFilesWithAncestor", "clearCache", "clearMocks", "collectCoverage", "color", "colors", "coverage", "detectLeaks", "detectOpenHandles", "errorOnDeprecated", "expand", "findRelatedTests", "forceExit", "init", "injectGlobals", "json", "lastCommit", "listTests", "logHeapUsage", "noStackTrace", "notify", "onlyChanged", "onlyFailures", "passWithNoTests", "resetMocks", "resetModules", "restoreMocks", "runInBand", "runTestsByPath", "showConfig", "silent", "skipFilter", "testLocationInResults", "updateSnapshot", "useStderr", "watchAll", "watchman"]; +/** + * All the Number options supported by the Stencil CLI + */ +export declare const NUMBER_CLI_FLAGS: readonly ["port", "maxConcurrency", "testTimeout"]; +/** + * All the String options supported by the Stencil CLI + */ +export declare const STRING_CLI_FLAGS: readonly ["address", "config", "docsApi", "docsJson", "emulate", "root", "screenshotConnector", "cacheDirectory", "changedSince", "collectCoverageFrom", "coverageDirectory", "coverageThreshold", "env", "filter", "globalSetup", "globalTeardown", "globals", "haste", "moduleNameMapper", "notifyMode", "outputFile", "preset", "prettierPath", "resolver", "rootDir", "runner", "testEnvironment", "testEnvironmentOptions", "testFailureExitCode", "testNamePattern", "testResultsProcessor", "testRunner", "testSequencer", "testURL", "timers", "transform"]; +export declare const STRING_ARRAY_CLI_FLAGS: readonly ["collectCoverageOnlyFrom", "coveragePathIgnorePatterns", "coverageReporters", "moduleDirectories", "moduleFileExtensions", "modulePathIgnorePatterns", "modulePaths", "projects", "reporters", "roots", "selectProjects", "setupFiles", "setupFilesAfterEnv", "snapshotSerializers", "testMatch", "testPathIgnorePatterns", "testPathPattern", "testRegex", "transformIgnorePatterns", "unmockedModulePathPatterns", "watchPathIgnorePatterns"]; +/** + * All the CLI arguments which may have string or number values + * + * `maxWorkers` is an argument which is used both by Stencil _and_ by Jest, + * which means that we need to support parsing both string and number values. + */ +export declare const STRING_NUMBER_CLI_FLAGS: readonly ["maxWorkers"]; +/** + * All the CLI arguments which may have boolean or string values. + */ +export declare const BOOLEAN_STRING_CLI_FLAGS: readonly ["headless"]; +/** + * All the LogLevel-type options supported by the Stencil CLI + * + * This is a bit silly since there's only one such argument atm, + * but this approach lets us make sure that we're handling all + * our arguments in a type-safe way. + */ +export declare const LOG_LEVEL_CLI_FLAGS: readonly ["logLevel"]; +/** + * A type which gives the members of a `ReadonlyArray` as + * an enum-like type which can be used for e.g. keys in a `Record` + * (as in the `AliasMap` type below) + */ +type ArrayValuesAsUnion> = T[number]; +export type BooleanCLIFlag = ArrayValuesAsUnion; +export type StringCLIFlag = ArrayValuesAsUnion; +export type StringArrayCLIFlag = ArrayValuesAsUnion; +export type NumberCLIFlag = ArrayValuesAsUnion; +export type StringNumberCLIFlag = ArrayValuesAsUnion; +export type BooleanStringCLIFlag = ArrayValuesAsUnion; +export type LogCLIFlag = ArrayValuesAsUnion; +export type KnownCLIFlag = BooleanCLIFlag | StringCLIFlag | StringArrayCLIFlag | NumberCLIFlag | StringNumberCLIFlag | BooleanStringCLIFlag | LogCLIFlag; +type AliasMap = Partial>; +/** + * For a small subset of CLI options we support a short alias e.g. `'h'` for `'help'` + */ +export declare const CLI_FLAG_ALIASES: AliasMap; +/** + * A regular expression which can be used to match a CLI flag for one of our + * short aliases. + */ +export declare const CLI_FLAG_REGEX: RegExp; +/** + * Given two types `K` and `T` where `K` extends `ReadonlyArray`, + * construct a type which maps the strings in `K` as keys to values of type `T`. + * + * Because we use types derived this way to construct an interface (`ConfigFlags`) + * for which we want optional keys, we make all the properties optional (w/ `'?'`) + * and possibly null. + */ +type ObjectFromKeys, T> = { + [key in K[number]]?: T | null; +}; +/** + * Type containing the possible Boolean configuration flags, to be included + * in ConfigFlags, below + */ +type BooleanConfigFlags = ObjectFromKeys; +/** + * Type containing the possible String configuration flags, to be included + * in ConfigFlags, below + */ +type StringConfigFlags = ObjectFromKeys; +/** + * Type containing the possible String Array configuration flags. This is + * one of the 'constituent types' for `ConfigFlags`. + */ +type StringArrayConfigFlags = ObjectFromKeys; +/** + * Type containing the possible numeric configuration flags, to be included + * in ConfigFlags, below + */ +type NumberConfigFlags = ObjectFromKeys; +/** + * Type containing the configuration flags which may be set to either string + * or number values. + */ +type StringNumberConfigFlags = ObjectFromKeys; +/** + * Type containing the configuration flags which may be set to either string + * or boolean values. + */ +type BooleanStringConfigFlags = ObjectFromKeys; +/** + * Type containing the possible LogLevel configuration flags, to be included + * in ConfigFlags, below + */ +type LogLevelFlags = ObjectFromKeys; +/** + * The configuration flags which can be set by the user on the command line. + * This interface captures both known arguments (which are enumerated and then + * parsed according to their types) and unknown arguments which the user may + * pass at the CLI. + * + * Note that this interface is constructed by extending `BooleanConfigFlags`, + * `StringConfigFlags`, etc. These types are in turn constructed from types + * extending `ReadonlyArray` which we declare in another module. This + * allows us to record our known CLI arguments in one place, using a + * `ReadonlyArray` to get both a type-level representation of what CLI + * options we support and a runtime list of strings which can be used to match + * on actual flags passed by the user. + */ +export interface ConfigFlags extends BooleanConfigFlags, StringConfigFlags, StringArrayConfigFlags, NumberConfigFlags, StringNumberConfigFlags, BooleanStringConfigFlags, LogLevelFlags { + task: TaskCommand | null; + args: string[]; + knownArgs: string[]; + unknownArgs: string[]; +} +/** + * Helper function for initializing a `ConfigFlags` object. Provide any overrides + * for default values and off you go! + * + * @param init an object with any overrides for default values + * @returns a complete CLI flag object + */ +export declare const createConfigFlags: (init?: Partial) => ConfigFlags; +export {}; diff --git a/node_modules/@stencil/core/cli/index.cjs b/node_modules/@stencil/core/cli/index.cjs new file mode 100644 index 00000000..19905fce --- /dev/null +++ b/node_modules/@stencil/core/cli/index.cjs @@ -0,0 +1,4086 @@ +/*! + Stencil CLI (CommonJS) v4.22.2 | MIT Licensed | https://stenciljs.com + */ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// node_modules/kleur/index.js +var require_kleur = __commonJS({ + "node_modules/kleur/index.js"(exports2, module2) { + "use strict"; + var { FORCE_COLOR, NODE_DISABLE_COLORS, TERM } = process.env; + var $ = { + enabled: !NODE_DISABLE_COLORS && TERM !== "dumb" && FORCE_COLOR !== "0", + // modifiers + reset: init(0, 0), + bold: init(1, 22), + dim: init(2, 22), + italic: init(3, 23), + underline: init(4, 24), + inverse: init(7, 27), + hidden: init(8, 28), + strikethrough: init(9, 29), + // colors + black: init(30, 39), + red: init(31, 39), + green: init(32, 39), + yellow: init(33, 39), + blue: init(34, 39), + magenta: init(35, 39), + cyan: init(36, 39), + white: init(37, 39), + gray: init(90, 39), + grey: init(90, 39), + // background colors + bgBlack: init(40, 49), + bgRed: init(41, 49), + bgGreen: init(42, 49), + bgYellow: init(43, 49), + bgBlue: init(44, 49), + bgMagenta: init(45, 49), + bgCyan: init(46, 49), + bgWhite: init(47, 49) + }; + function run2(arr, str) { + let i = 0, tmp, beg = "", end = ""; + for (; i < arr.length; i++) { + tmp = arr[i]; + beg += tmp.open; + end += tmp.close; + if (str.includes(tmp.close)) { + str = str.replace(tmp.rgx, tmp.close + tmp.open); + } + } + return beg + str + end; + } + function chain(has, keys) { + let ctx = { has, keys }; + ctx.reset = $.reset.bind(ctx); + ctx.bold = $.bold.bind(ctx); + ctx.dim = $.dim.bind(ctx); + ctx.italic = $.italic.bind(ctx); + ctx.underline = $.underline.bind(ctx); + ctx.inverse = $.inverse.bind(ctx); + ctx.hidden = $.hidden.bind(ctx); + ctx.strikethrough = $.strikethrough.bind(ctx); + ctx.black = $.black.bind(ctx); + ctx.red = $.red.bind(ctx); + ctx.green = $.green.bind(ctx); + ctx.yellow = $.yellow.bind(ctx); + ctx.blue = $.blue.bind(ctx); + ctx.magenta = $.magenta.bind(ctx); + ctx.cyan = $.cyan.bind(ctx); + ctx.white = $.white.bind(ctx); + ctx.gray = $.gray.bind(ctx); + ctx.grey = $.grey.bind(ctx); + ctx.bgBlack = $.bgBlack.bind(ctx); + ctx.bgRed = $.bgRed.bind(ctx); + ctx.bgGreen = $.bgGreen.bind(ctx); + ctx.bgYellow = $.bgYellow.bind(ctx); + ctx.bgBlue = $.bgBlue.bind(ctx); + ctx.bgMagenta = $.bgMagenta.bind(ctx); + ctx.bgCyan = $.bgCyan.bind(ctx); + ctx.bgWhite = $.bgWhite.bind(ctx); + return ctx; + } + function init(open, close) { + let blk = { + open: `\x1B[${open}m`, + close: `\x1B[${close}m`, + rgx: new RegExp(`\\x1b\\[${close}m`, "g") + }; + return function(txt) { + if (this !== void 0 && this.has !== void 0) { + this.has.includes(open) || (this.has.push(open), this.keys.push(blk)); + return txt === void 0 ? this : $.enabled ? run2(this.keys, txt + "") : txt + ""; + } + return txt === void 0 ? chain([open], [blk]) : $.enabled ? run2([blk], txt + "") : txt + ""; + }; + } + module2.exports = $; + } +}); + +// node_modules/prompts/lib/util/action.js +var require_action = __commonJS({ + "node_modules/prompts/lib/util/action.js"(exports2, module2) { + "use strict"; + module2.exports = (key, isSelect) => { + if (key.meta && key.name !== "escape") return; + if (key.ctrl) { + if (key.name === "a") return "first"; + if (key.name === "c") return "abort"; + if (key.name === "d") return "abort"; + if (key.name === "e") return "last"; + if (key.name === "g") return "reset"; + } + if (isSelect) { + if (key.name === "j") return "down"; + if (key.name === "k") return "up"; + } + if (key.name === "return") return "submit"; + if (key.name === "enter") return "submit"; + if (key.name === "backspace") return "delete"; + if (key.name === "delete") return "deleteForward"; + if (key.name === "abort") return "abort"; + if (key.name === "escape") return "exit"; + if (key.name === "tab") return "next"; + if (key.name === "pagedown") return "nextPage"; + if (key.name === "pageup") return "prevPage"; + if (key.name === "home") return "home"; + if (key.name === "end") return "end"; + if (key.name === "up") return "up"; + if (key.name === "down") return "down"; + if (key.name === "right") return "right"; + if (key.name === "left") return "left"; + return false; + }; + } +}); + +// node_modules/prompts/lib/util/strip.js +var require_strip = __commonJS({ + "node_modules/prompts/lib/util/strip.js"(exports2, module2) { + "use strict"; + module2.exports = (str) => { + const pattern = [ + "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", + "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))" + ].join("|"); + const RGX = new RegExp(pattern, "g"); + return typeof str === "string" ? str.replace(RGX, "") : str; + }; + } +}); + +// node_modules/sisteransi/src/index.js +var require_src = __commonJS({ + "node_modules/sisteransi/src/index.js"(exports2, module2) { + "use strict"; + var ESC = "\x1B"; + var CSI = `${ESC}[`; + var beep = "\x07"; + var cursor = { + to(x, y) { + if (!y) return `${CSI}${x + 1}G`; + return `${CSI}${y + 1};${x + 1}H`; + }, + move(x, y) { + let ret = ""; + if (x < 0) ret += `${CSI}${-x}D`; + else if (x > 0) ret += `${CSI}${x}C`; + if (y < 0) ret += `${CSI}${-y}A`; + else if (y > 0) ret += `${CSI}${y}B`; + return ret; + }, + up: (count = 1) => `${CSI}${count}A`, + down: (count = 1) => `${CSI}${count}B`, + forward: (count = 1) => `${CSI}${count}C`, + backward: (count = 1) => `${CSI}${count}D`, + nextLine: (count = 1) => `${CSI}E`.repeat(count), + prevLine: (count = 1) => `${CSI}F`.repeat(count), + left: `${CSI}G`, + hide: `${CSI}?25l`, + show: `${CSI}?25h`, + save: `${ESC}7`, + restore: `${ESC}8` + }; + var scroll = { + up: (count = 1) => `${CSI}S`.repeat(count), + down: (count = 1) => `${CSI}T`.repeat(count) + }; + var erase = { + screen: `${CSI}2J`, + up: (count = 1) => `${CSI}1J`.repeat(count), + down: (count = 1) => `${CSI}J`.repeat(count), + line: `${CSI}2K`, + lineEnd: `${CSI}K`, + lineStart: `${CSI}1K`, + lines(count) { + let clear = ""; + for (let i = 0; i < count; i++) + clear += this.line + (i < count - 1 ? cursor.up() : ""); + if (count) + clear += cursor.left; + return clear; + } + }; + module2.exports = { cursor, scroll, erase, beep }; + } +}); + +// node_modules/prompts/lib/util/clear.js +var require_clear = __commonJS({ + "node_modules/prompts/lib/util/clear.js"(exports2, module2) { + "use strict"; + var strip = require_strip(); + var { erase, cursor } = require_src(); + var width = (str) => [...strip(str)].length; + module2.exports = function(prompt, perLine) { + if (!perLine) return erase.line + cursor.to(0); + let rows = 0; + const lines = prompt.split(/\r?\n/); + for (let line of lines) { + rows += 1 + Math.floor(Math.max(width(line) - 1, 0) / perLine); + } + return erase.lines(rows); + }; + } +}); + +// node_modules/prompts/lib/util/figures.js +var require_figures = __commonJS({ + "node_modules/prompts/lib/util/figures.js"(exports2, module2) { + "use strict"; + var main = { + arrowUp: "\u2191", + arrowDown: "\u2193", + arrowLeft: "\u2190", + arrowRight: "\u2192", + radioOn: "\u25C9", + radioOff: "\u25EF", + tick: "\u2714", + cross: "\u2716", + ellipsis: "\u2026", + pointerSmall: "\u203A", + line: "\u2500", + pointer: "\u276F" + }; + var win = { + arrowUp: main.arrowUp, + arrowDown: main.arrowDown, + arrowLeft: main.arrowLeft, + arrowRight: main.arrowRight, + radioOn: "(*)", + radioOff: "( )", + tick: "\u221A", + cross: "\xD7", + ellipsis: "...", + pointerSmall: "\xBB", + line: "\u2500", + pointer: ">" + }; + var figures = process.platform === "win32" ? win : main; + module2.exports = figures; + } +}); + +// node_modules/prompts/lib/util/style.js +var require_style = __commonJS({ + "node_modules/prompts/lib/util/style.js"(exports2, module2) { + "use strict"; + var c = require_kleur(); + var figures = require_figures(); + var styles = Object.freeze({ + password: { scale: 1, render: (input) => "*".repeat(input.length) }, + emoji: { scale: 2, render: (input) => "\u{1F603}".repeat(input.length) }, + invisible: { scale: 0, render: (input) => "" }, + default: { scale: 1, render: (input) => `${input}` } + }); + var render = (type) => styles[type] || styles.default; + var symbols = Object.freeze({ + aborted: c.red(figures.cross), + done: c.green(figures.tick), + exited: c.yellow(figures.cross), + default: c.cyan("?") + }); + var symbol = (done, aborted, exited) => aborted ? symbols.aborted : exited ? symbols.exited : done ? symbols.done : symbols.default; + var delimiter = (completing) => c.gray(completing ? figures.ellipsis : figures.pointerSmall); + var item = (expandable, expanded) => c.gray(expandable ? expanded ? figures.pointerSmall : "+" : figures.line); + module2.exports = { + styles, + render, + symbols, + symbol, + delimiter, + item + }; + } +}); + +// node_modules/prompts/lib/util/lines.js +var require_lines = __commonJS({ + "node_modules/prompts/lib/util/lines.js"(exports2, module2) { + "use strict"; + var strip = require_strip(); + module2.exports = function(msg, perLine) { + let lines = String(strip(msg) || "").split(/\r?\n/); + if (!perLine) return lines.length; + return lines.map((l) => Math.ceil(l.length / perLine)).reduce((a, b) => a + b); + }; + } +}); + +// node_modules/prompts/lib/util/wrap.js +var require_wrap = __commonJS({ + "node_modules/prompts/lib/util/wrap.js"(exports2, module2) { + "use strict"; + module2.exports = (msg, opts = {}) => { + const tab = Number.isSafeInteger(parseInt(opts.margin)) ? new Array(parseInt(opts.margin)).fill(" ").join("") : opts.margin || ""; + const width = opts.width; + return (msg || "").split(/\r?\n/g).map((line) => line.split(/\s+/g).reduce((arr, w) => { + if (w.length + tab.length >= width || arr[arr.length - 1].length + w.length + 1 < width) + arr[arr.length - 1] += ` ${w}`; + else arr.push(`${tab}${w}`); + return arr; + }, [tab]).join("\n")).join("\n"); + }; + } +}); + +// node_modules/prompts/lib/util/entriesToDisplay.js +var require_entriesToDisplay = __commonJS({ + "node_modules/prompts/lib/util/entriesToDisplay.js"(exports2, module2) { + "use strict"; + module2.exports = (cursor, total, maxVisible) => { + maxVisible = maxVisible || total; + let startIndex = Math.min(total - maxVisible, cursor - Math.floor(maxVisible / 2)); + if (startIndex < 0) startIndex = 0; + let endIndex = Math.min(startIndex + maxVisible, total); + return { startIndex, endIndex }; + }; + } +}); + +// node_modules/prompts/lib/util/index.js +var require_util = __commonJS({ + "node_modules/prompts/lib/util/index.js"(exports2, module2) { + "use strict"; + module2.exports = { + action: require_action(), + clear: require_clear(), + style: require_style(), + strip: require_strip(), + figures: require_figures(), + lines: require_lines(), + wrap: require_wrap(), + entriesToDisplay: require_entriesToDisplay() + }; + } +}); + +// node_modules/prompts/lib/elements/prompt.js +var require_prompt = __commonJS({ + "node_modules/prompts/lib/elements/prompt.js"(exports2, module2) { + "use strict"; + var readline = require("readline"); + var { action } = require_util(); + var EventEmitter = require("events"); + var { beep, cursor } = require_src(); + var color = require_kleur(); + var Prompt = class extends EventEmitter { + constructor(opts = {}) { + super(); + this.firstRender = true; + this.in = opts.stdin || process.stdin; + this.out = opts.stdout || process.stdout; + this.onRender = (opts.onRender || (() => void 0)).bind(this); + const rl = readline.createInterface({ input: this.in, escapeCodeTimeout: 50 }); + readline.emitKeypressEvents(this.in, rl); + if (this.in.isTTY) this.in.setRawMode(true); + const isSelect = ["SelectPrompt", "MultiselectPrompt"].indexOf(this.constructor.name) > -1; + const keypress = (str, key) => { + let a = action(key, isSelect); + if (a === false) { + this._ && this._(str, key); + } else if (typeof this[a] === "function") { + this[a](key); + } else { + this.bell(); + } + }; + this.close = () => { + this.out.write(cursor.show); + this.in.removeListener("keypress", keypress); + if (this.in.isTTY) this.in.setRawMode(false); + rl.close(); + this.emit(this.aborted ? "abort" : this.exited ? "exit" : "submit", this.value); + this.closed = true; + }; + this.in.on("keypress", keypress); + } + fire() { + this.emit("state", { + value: this.value, + aborted: !!this.aborted, + exited: !!this.exited + }); + } + bell() { + this.out.write(beep); + } + render() { + this.onRender(color); + if (this.firstRender) this.firstRender = false; + } + }; + module2.exports = Prompt; + } +}); + +// node_modules/prompts/lib/elements/text.js +var require_text = __commonJS({ + "node_modules/prompts/lib/elements/text.js"(exports2, module2) { + var color = require_kleur(); + var Prompt = require_prompt(); + var { erase, cursor } = require_src(); + var { style, clear, lines, figures } = require_util(); + var TextPrompt = class extends Prompt { + constructor(opts = {}) { + super(opts); + this.transform = style.render(opts.style); + this.scale = this.transform.scale; + this.msg = opts.message; + this.initial = opts.initial || ``; + this.validator = opts.validate || (() => true); + this.value = ``; + this.errorMsg = opts.error || `Please Enter A Valid Value`; + this.cursor = Number(!!this.initial); + this.cursorOffset = 0; + this.clear = clear(``, this.out.columns); + this.render(); + } + set value(v) { + if (!v && this.initial) { + this.placeholder = true; + this.rendered = color.gray(this.transform.render(this.initial)); + } else { + this.placeholder = false; + this.rendered = this.transform.render(v); + } + this._value = v; + this.fire(); + } + get value() { + return this._value; + } + reset() { + this.value = ``; + this.cursor = Number(!!this.initial); + this.cursorOffset = 0; + this.fire(); + this.render(); + } + exit() { + this.abort(); + } + abort() { + this.value = this.value || this.initial; + this.done = this.aborted = true; + this.error = false; + this.red = false; + this.fire(); + this.render(); + this.out.write("\n"); + this.close(); + } + async validate() { + let valid = await this.validator(this.value); + if (typeof valid === `string`) { + this.errorMsg = valid; + valid = false; + } + this.error = !valid; + } + async submit() { + this.value = this.value || this.initial; + this.cursorOffset = 0; + this.cursor = this.rendered.length; + await this.validate(); + if (this.error) { + this.red = true; + this.fire(); + this.render(); + return; + } + this.done = true; + this.aborted = false; + this.fire(); + this.render(); + this.out.write("\n"); + this.close(); + } + next() { + if (!this.placeholder) return this.bell(); + this.value = this.initial; + this.cursor = this.rendered.length; + this.fire(); + this.render(); + } + moveCursor(n) { + if (this.placeholder) return; + this.cursor = this.cursor + n; + this.cursorOffset += n; + } + _(c, key) { + let s1 = this.value.slice(0, this.cursor); + let s2 = this.value.slice(this.cursor); + this.value = `${s1}${c}${s2}`; + this.red = false; + this.cursor = this.placeholder ? 0 : s1.length + 1; + this.render(); + } + delete() { + if (this.isCursorAtStart()) return this.bell(); + let s1 = this.value.slice(0, this.cursor - 1); + let s2 = this.value.slice(this.cursor); + this.value = `${s1}${s2}`; + this.red = false; + if (this.isCursorAtStart()) { + this.cursorOffset = 0; + } else { + this.cursorOffset++; + this.moveCursor(-1); + } + this.render(); + } + deleteForward() { + if (this.cursor * this.scale >= this.rendered.length || this.placeholder) return this.bell(); + let s1 = this.value.slice(0, this.cursor); + let s2 = this.value.slice(this.cursor + 1); + this.value = `${s1}${s2}`; + this.red = false; + if (this.isCursorAtEnd()) { + this.cursorOffset = 0; + } else { + this.cursorOffset++; + } + this.render(); + } + first() { + this.cursor = 0; + this.render(); + } + last() { + this.cursor = this.value.length; + this.render(); + } + left() { + if (this.cursor <= 0 || this.placeholder) return this.bell(); + this.moveCursor(-1); + this.render(); + } + right() { + if (this.cursor * this.scale >= this.rendered.length || this.placeholder) return this.bell(); + this.moveCursor(1); + this.render(); + } + isCursorAtStart() { + return this.cursor === 0 || this.placeholder && this.cursor === 1; + } + isCursorAtEnd() { + return this.cursor === this.rendered.length || this.placeholder && this.cursor === this.rendered.length + 1; + } + render() { + if (this.closed) return; + if (!this.firstRender) { + if (this.outputError) + this.out.write(cursor.down(lines(this.outputError, this.out.columns) - 1) + clear(this.outputError, this.out.columns)); + this.out.write(clear(this.outputText, this.out.columns)); + } + super.render(); + this.outputError = ""; + this.outputText = [ + style.symbol(this.done, this.aborted), + color.bold(this.msg), + style.delimiter(this.done), + this.red ? color.red(this.rendered) : this.rendered + ].join(` `); + if (this.error) { + this.outputError += this.errorMsg.split(` +`).reduce((a, l, i) => a + ` +${i ? " " : figures.pointerSmall} ${color.red().italic(l)}`, ``); + } + this.out.write(erase.line + cursor.to(0) + this.outputText + cursor.save + this.outputError + cursor.restore + cursor.move(this.cursorOffset, 0)); + } + }; + module2.exports = TextPrompt; + } +}); + +// node_modules/prompts/lib/elements/select.js +var require_select = __commonJS({ + "node_modules/prompts/lib/elements/select.js"(exports2, module2) { + "use strict"; + var color = require_kleur(); + var Prompt = require_prompt(); + var { style, clear, figures, wrap, entriesToDisplay } = require_util(); + var { cursor } = require_src(); + var SelectPrompt = class extends Prompt { + constructor(opts = {}) { + super(opts); + this.msg = opts.message; + this.hint = opts.hint || "- Use arrow-keys. Return to submit."; + this.warn = opts.warn || "- This option is disabled"; + this.cursor = opts.initial || 0; + this.choices = opts.choices.map((ch, idx) => { + if (typeof ch === "string") + ch = { title: ch, value: idx }; + return { + title: ch && (ch.title || ch.value || ch), + value: ch && (ch.value === void 0 ? idx : ch.value), + description: ch && ch.description, + selected: ch && ch.selected, + disabled: ch && ch.disabled + }; + }); + this.optionsPerPage = opts.optionsPerPage || 10; + this.value = (this.choices[this.cursor] || {}).value; + this.clear = clear("", this.out.columns); + this.render(); + } + moveCursor(n) { + this.cursor = n; + this.value = this.choices[n].value; + this.fire(); + } + reset() { + this.moveCursor(0); + this.fire(); + this.render(); + } + exit() { + this.abort(); + } + abort() { + this.done = this.aborted = true; + this.fire(); + this.render(); + this.out.write("\n"); + this.close(); + } + submit() { + if (!this.selection.disabled) { + this.done = true; + this.aborted = false; + this.fire(); + this.render(); + this.out.write("\n"); + this.close(); + } else + this.bell(); + } + first() { + this.moveCursor(0); + this.render(); + } + last() { + this.moveCursor(this.choices.length - 1); + this.render(); + } + up() { + if (this.cursor === 0) { + this.moveCursor(this.choices.length - 1); + } else { + this.moveCursor(this.cursor - 1); + } + this.render(); + } + down() { + if (this.cursor === this.choices.length - 1) { + this.moveCursor(0); + } else { + this.moveCursor(this.cursor + 1); + } + this.render(); + } + next() { + this.moveCursor((this.cursor + 1) % this.choices.length); + this.render(); + } + _(c, key) { + if (c === " ") return this.submit(); + } + get selection() { + return this.choices[this.cursor]; + } + render() { + if (this.closed) return; + if (this.firstRender) this.out.write(cursor.hide); + else this.out.write(clear(this.outputText, this.out.columns)); + super.render(); + let { startIndex, endIndex } = entriesToDisplay(this.cursor, this.choices.length, this.optionsPerPage); + this.outputText = [ + style.symbol(this.done, this.aborted), + color.bold(this.msg), + style.delimiter(false), + this.done ? this.selection.title : this.selection.disabled ? color.yellow(this.warn) : color.gray(this.hint) + ].join(" "); + if (!this.done) { + this.outputText += "\n"; + for (let i = startIndex; i < endIndex; i++) { + let title, prefix, desc = "", v = this.choices[i]; + if (i === startIndex && startIndex > 0) { + prefix = figures.arrowUp; + } else if (i === endIndex - 1 && endIndex < this.choices.length) { + prefix = figures.arrowDown; + } else { + prefix = " "; + } + if (v.disabled) { + title = this.cursor === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title); + prefix = (this.cursor === i ? color.bold().gray(figures.pointer) + " " : " ") + prefix; + } else { + title = this.cursor === i ? color.cyan().underline(v.title) : v.title; + prefix = (this.cursor === i ? color.cyan(figures.pointer) + " " : " ") + prefix; + if (v.description && this.cursor === i) { + desc = ` - ${v.description}`; + if (prefix.length + title.length + desc.length >= this.out.columns || v.description.split(/\r?\n/).length > 1) { + desc = "\n" + wrap(v.description, { margin: 3, width: this.out.columns }); + } + } + } + this.outputText += `${prefix} ${title}${color.gray(desc)} +`; + } + } + this.out.write(this.outputText); + } + }; + module2.exports = SelectPrompt; + } +}); + +// node_modules/prompts/lib/elements/toggle.js +var require_toggle = __commonJS({ + "node_modules/prompts/lib/elements/toggle.js"(exports2, module2) { + var color = require_kleur(); + var Prompt = require_prompt(); + var { style, clear } = require_util(); + var { cursor, erase } = require_src(); + var TogglePrompt = class extends Prompt { + constructor(opts = {}) { + super(opts); + this.msg = opts.message; + this.value = !!opts.initial; + this.active = opts.active || "on"; + this.inactive = opts.inactive || "off"; + this.initialValue = this.value; + this.render(); + } + reset() { + this.value = this.initialValue; + this.fire(); + this.render(); + } + exit() { + this.abort(); + } + abort() { + this.done = this.aborted = true; + this.fire(); + this.render(); + this.out.write("\n"); + this.close(); + } + submit() { + this.done = true; + this.aborted = false; + this.fire(); + this.render(); + this.out.write("\n"); + this.close(); + } + deactivate() { + if (this.value === false) return this.bell(); + this.value = false; + this.render(); + } + activate() { + if (this.value === true) return this.bell(); + this.value = true; + this.render(); + } + delete() { + this.deactivate(); + } + left() { + this.deactivate(); + } + right() { + this.activate(); + } + down() { + this.deactivate(); + } + up() { + this.activate(); + } + next() { + this.value = !this.value; + this.fire(); + this.render(); + } + _(c, key) { + if (c === " ") { + this.value = !this.value; + } else if (c === "1") { + this.value = true; + } else if (c === "0") { + this.value = false; + } else return this.bell(); + this.render(); + } + render() { + if (this.closed) return; + if (this.firstRender) this.out.write(cursor.hide); + else this.out.write(clear(this.outputText, this.out.columns)); + super.render(); + this.outputText = [ + style.symbol(this.done, this.aborted), + color.bold(this.msg), + style.delimiter(this.done), + this.value ? this.inactive : color.cyan().underline(this.inactive), + color.gray("/"), + this.value ? color.cyan().underline(this.active) : this.active + ].join(" "); + this.out.write(erase.line + cursor.to(0) + this.outputText); + } + }; + module2.exports = TogglePrompt; + } +}); + +// node_modules/prompts/lib/dateparts/datepart.js +var require_datepart = __commonJS({ + "node_modules/prompts/lib/dateparts/datepart.js"(exports2, module2) { + "use strict"; + var DatePart = class _DatePart { + constructor({ token, date, parts, locales }) { + this.token = token; + this.date = date || /* @__PURE__ */ new Date(); + this.parts = parts || [this]; + this.locales = locales || {}; + } + up() { + } + down() { + } + next() { + const currentIdx = this.parts.indexOf(this); + return this.parts.find((part, idx) => idx > currentIdx && part instanceof _DatePart); + } + setTo(val) { + } + prev() { + let parts = [].concat(this.parts).reverse(); + const currentIdx = parts.indexOf(this); + return parts.find((part, idx) => idx > currentIdx && part instanceof _DatePart); + } + toString() { + return String(this.date); + } + }; + module2.exports = DatePart; + } +}); + +// node_modules/prompts/lib/dateparts/meridiem.js +var require_meridiem = __commonJS({ + "node_modules/prompts/lib/dateparts/meridiem.js"(exports2, module2) { + "use strict"; + var DatePart = require_datepart(); + var Meridiem = class extends DatePart { + constructor(opts = {}) { + super(opts); + } + up() { + this.date.setHours((this.date.getHours() + 12) % 24); + } + down() { + this.up(); + } + toString() { + let meridiem = this.date.getHours() > 12 ? "pm" : "am"; + return /\A/.test(this.token) ? meridiem.toUpperCase() : meridiem; + } + }; + module2.exports = Meridiem; + } +}); + +// node_modules/prompts/lib/dateparts/day.js +var require_day = __commonJS({ + "node_modules/prompts/lib/dateparts/day.js"(exports2, module2) { + "use strict"; + var DatePart = require_datepart(); + var pos = (n) => { + n = n % 10; + return n === 1 ? "st" : n === 2 ? "nd" : n === 3 ? "rd" : "th"; + }; + var Day = class extends DatePart { + constructor(opts = {}) { + super(opts); + } + up() { + this.date.setDate(this.date.getDate() + 1); + } + down() { + this.date.setDate(this.date.getDate() - 1); + } + setTo(val) { + this.date.setDate(parseInt(val.substr(-2))); + } + toString() { + let date = this.date.getDate(); + let day = this.date.getDay(); + return this.token === "DD" ? String(date).padStart(2, "0") : this.token === "Do" ? date + pos(date) : this.token === "d" ? day + 1 : this.token === "ddd" ? this.locales.weekdaysShort[day] : this.token === "dddd" ? this.locales.weekdays[day] : date; + } + }; + module2.exports = Day; + } +}); + +// node_modules/prompts/lib/dateparts/hours.js +var require_hours = __commonJS({ + "node_modules/prompts/lib/dateparts/hours.js"(exports2, module2) { + "use strict"; + var DatePart = require_datepart(); + var Hours = class extends DatePart { + constructor(opts = {}) { + super(opts); + } + up() { + this.date.setHours(this.date.getHours() + 1); + } + down() { + this.date.setHours(this.date.getHours() - 1); + } + setTo(val) { + this.date.setHours(parseInt(val.substr(-2))); + } + toString() { + let hours = this.date.getHours(); + if (/h/.test(this.token)) + hours = hours % 12 || 12; + return this.token.length > 1 ? String(hours).padStart(2, "0") : hours; + } + }; + module2.exports = Hours; + } +}); + +// node_modules/prompts/lib/dateparts/milliseconds.js +var require_milliseconds = __commonJS({ + "node_modules/prompts/lib/dateparts/milliseconds.js"(exports2, module2) { + "use strict"; + var DatePart = require_datepart(); + var Milliseconds = class extends DatePart { + constructor(opts = {}) { + super(opts); + } + up() { + this.date.setMilliseconds(this.date.getMilliseconds() + 1); + } + down() { + this.date.setMilliseconds(this.date.getMilliseconds() - 1); + } + setTo(val) { + this.date.setMilliseconds(parseInt(val.substr(-this.token.length))); + } + toString() { + return String(this.date.getMilliseconds()).padStart(4, "0").substr(0, this.token.length); + } + }; + module2.exports = Milliseconds; + } +}); + +// node_modules/prompts/lib/dateparts/minutes.js +var require_minutes = __commonJS({ + "node_modules/prompts/lib/dateparts/minutes.js"(exports2, module2) { + "use strict"; + var DatePart = require_datepart(); + var Minutes = class extends DatePart { + constructor(opts = {}) { + super(opts); + } + up() { + this.date.setMinutes(this.date.getMinutes() + 1); + } + down() { + this.date.setMinutes(this.date.getMinutes() - 1); + } + setTo(val) { + this.date.setMinutes(parseInt(val.substr(-2))); + } + toString() { + let m = this.date.getMinutes(); + return this.token.length > 1 ? String(m).padStart(2, "0") : m; + } + }; + module2.exports = Minutes; + } +}); + +// node_modules/prompts/lib/dateparts/month.js +var require_month = __commonJS({ + "node_modules/prompts/lib/dateparts/month.js"(exports2, module2) { + "use strict"; + var DatePart = require_datepart(); + var Month = class extends DatePart { + constructor(opts = {}) { + super(opts); + } + up() { + this.date.setMonth(this.date.getMonth() + 1); + } + down() { + this.date.setMonth(this.date.getMonth() - 1); + } + setTo(val) { + val = parseInt(val.substr(-2)) - 1; + this.date.setMonth(val < 0 ? 0 : val); + } + toString() { + let month = this.date.getMonth(); + let tl = this.token.length; + return tl === 2 ? String(month + 1).padStart(2, "0") : tl === 3 ? this.locales.monthsShort[month] : tl === 4 ? this.locales.months[month] : String(month + 1); + } + }; + module2.exports = Month; + } +}); + +// node_modules/prompts/lib/dateparts/seconds.js +var require_seconds = __commonJS({ + "node_modules/prompts/lib/dateparts/seconds.js"(exports2, module2) { + "use strict"; + var DatePart = require_datepart(); + var Seconds = class extends DatePart { + constructor(opts = {}) { + super(opts); + } + up() { + this.date.setSeconds(this.date.getSeconds() + 1); + } + down() { + this.date.setSeconds(this.date.getSeconds() - 1); + } + setTo(val) { + this.date.setSeconds(parseInt(val.substr(-2))); + } + toString() { + let s = this.date.getSeconds(); + return this.token.length > 1 ? String(s).padStart(2, "0") : s; + } + }; + module2.exports = Seconds; + } +}); + +// node_modules/prompts/lib/dateparts/year.js +var require_year = __commonJS({ + "node_modules/prompts/lib/dateparts/year.js"(exports2, module2) { + "use strict"; + var DatePart = require_datepart(); + var Year = class extends DatePart { + constructor(opts = {}) { + super(opts); + } + up() { + this.date.setFullYear(this.date.getFullYear() + 1); + } + down() { + this.date.setFullYear(this.date.getFullYear() - 1); + } + setTo(val) { + this.date.setFullYear(val.substr(-4)); + } + toString() { + let year = String(this.date.getFullYear()).padStart(4, "0"); + return this.token.length === 2 ? year.substr(-2) : year; + } + }; + module2.exports = Year; + } +}); + +// node_modules/prompts/lib/dateparts/index.js +var require_dateparts = __commonJS({ + "node_modules/prompts/lib/dateparts/index.js"(exports2, module2) { + "use strict"; + module2.exports = { + DatePart: require_datepart(), + Meridiem: require_meridiem(), + Day: require_day(), + Hours: require_hours(), + Milliseconds: require_milliseconds(), + Minutes: require_minutes(), + Month: require_month(), + Seconds: require_seconds(), + Year: require_year() + }; + } +}); + +// node_modules/prompts/lib/elements/date.js +var require_date = __commonJS({ + "node_modules/prompts/lib/elements/date.js"(exports2, module2) { + "use strict"; + var color = require_kleur(); + var Prompt = require_prompt(); + var { style, clear, figures } = require_util(); + var { erase, cursor } = require_src(); + var { DatePart, Meridiem, Day, Hours, Milliseconds, Minutes, Month, Seconds, Year } = require_dateparts(); + var regex = /\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g; + var regexGroups = { + 1: ({ token }) => token.replace(/\\(.)/g, "$1"), + 2: (opts) => new Day(opts), + // Day // TODO + 3: (opts) => new Month(opts), + // Month + 4: (opts) => new Year(opts), + // Year + 5: (opts) => new Meridiem(opts), + // AM/PM // TODO (special) + 6: (opts) => new Hours(opts), + // Hours + 7: (opts) => new Minutes(opts), + // Minutes + 8: (opts) => new Seconds(opts), + // Seconds + 9: (opts) => new Milliseconds(opts) + // Fractional seconds + }; + var dfltLocales = { + months: "January,February,March,April,May,June,July,August,September,October,November,December".split(","), + monthsShort: "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","), + weekdays: "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","), + weekdaysShort: "Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",") + }; + var DatePrompt = class extends Prompt { + constructor(opts = {}) { + super(opts); + this.msg = opts.message; + this.cursor = 0; + this.typed = ""; + this.locales = Object.assign(dfltLocales, opts.locales); + this._date = opts.initial || /* @__PURE__ */ new Date(); + this.errorMsg = opts.error || "Please Enter A Valid Value"; + this.validator = opts.validate || (() => true); + this.mask = opts.mask || "YYYY-MM-DD HH:mm:ss"; + this.clear = clear("", this.out.columns); + this.render(); + } + get value() { + return this.date; + } + get date() { + return this._date; + } + set date(date) { + if (date) this._date.setTime(date.getTime()); + } + set mask(mask) { + let result; + this.parts = []; + while (result = regex.exec(mask)) { + let match = result.shift(); + let idx = result.findIndex((gr) => gr != null); + this.parts.push(idx in regexGroups ? regexGroups[idx]({ token: result[idx] || match, date: this.date, parts: this.parts, locales: this.locales }) : result[idx] || match); + } + let parts = this.parts.reduce((arr, i) => { + if (typeof i === "string" && typeof arr[arr.length - 1] === "string") + arr[arr.length - 1] += i; + else arr.push(i); + return arr; + }, []); + this.parts.splice(0); + this.parts.push(...parts); + this.reset(); + } + moveCursor(n) { + this.typed = ""; + this.cursor = n; + this.fire(); + } + reset() { + this.moveCursor(this.parts.findIndex((p) => p instanceof DatePart)); + this.fire(); + this.render(); + } + exit() { + this.abort(); + } + abort() { + this.done = this.aborted = true; + this.error = false; + this.fire(); + this.render(); + this.out.write("\n"); + this.close(); + } + async validate() { + let valid = await this.validator(this.value); + if (typeof valid === "string") { + this.errorMsg = valid; + valid = false; + } + this.error = !valid; + } + async submit() { + await this.validate(); + if (this.error) { + this.color = "red"; + this.fire(); + this.render(); + return; + } + this.done = true; + this.aborted = false; + this.fire(); + this.render(); + this.out.write("\n"); + this.close(); + } + up() { + this.typed = ""; + this.parts[this.cursor].up(); + this.render(); + } + down() { + this.typed = ""; + this.parts[this.cursor].down(); + this.render(); + } + left() { + let prev = this.parts[this.cursor].prev(); + if (prev == null) return this.bell(); + this.moveCursor(this.parts.indexOf(prev)); + this.render(); + } + right() { + let next = this.parts[this.cursor].next(); + if (next == null) return this.bell(); + this.moveCursor(this.parts.indexOf(next)); + this.render(); + } + next() { + let next = this.parts[this.cursor].next(); + this.moveCursor(next ? this.parts.indexOf(next) : this.parts.findIndex((part) => part instanceof DatePart)); + this.render(); + } + _(c) { + if (/\d/.test(c)) { + this.typed += c; + this.parts[this.cursor].setTo(this.typed); + this.render(); + } + } + render() { + if (this.closed) return; + if (this.firstRender) this.out.write(cursor.hide); + else this.out.write(clear(this.outputText, this.out.columns)); + super.render(); + this.outputText = [ + style.symbol(this.done, this.aborted), + color.bold(this.msg), + style.delimiter(false), + this.parts.reduce((arr, p, idx) => arr.concat(idx === this.cursor && !this.done ? color.cyan().underline(p.toString()) : p), []).join("") + ].join(" "); + if (this.error) { + this.outputText += this.errorMsg.split("\n").reduce( + (a, l, i) => a + ` +${i ? ` ` : figures.pointerSmall} ${color.red().italic(l)}`, + `` + ); + } + this.out.write(erase.line + cursor.to(0) + this.outputText); + } + }; + module2.exports = DatePrompt; + } +}); + +// node_modules/prompts/lib/elements/number.js +var require_number = __commonJS({ + "node_modules/prompts/lib/elements/number.js"(exports2, module2) { + var color = require_kleur(); + var Prompt = require_prompt(); + var { cursor, erase } = require_src(); + var { style, figures, clear, lines } = require_util(); + var isNumber = /[0-9]/; + var isDef = (any) => any !== void 0; + var round = (number, precision) => { + let factor = Math.pow(10, precision); + return Math.round(number * factor) / factor; + }; + var NumberPrompt = class extends Prompt { + constructor(opts = {}) { + super(opts); + this.transform = style.render(opts.style); + this.msg = opts.message; + this.initial = isDef(opts.initial) ? opts.initial : ""; + this.float = !!opts.float; + this.round = opts.round || 2; + this.inc = opts.increment || 1; + this.min = isDef(opts.min) ? opts.min : -Infinity; + this.max = isDef(opts.max) ? opts.max : Infinity; + this.errorMsg = opts.error || `Please Enter A Valid Value`; + this.validator = opts.validate || (() => true); + this.color = `cyan`; + this.value = ``; + this.typed = ``; + this.lastHit = 0; + this.render(); + } + set value(v) { + if (!v && v !== 0) { + this.placeholder = true; + this.rendered = color.gray(this.transform.render(`${this.initial}`)); + this._value = ``; + } else { + this.placeholder = false; + this.rendered = this.transform.render(`${round(v, this.round)}`); + this._value = round(v, this.round); + } + this.fire(); + } + get value() { + return this._value; + } + parse(x) { + return this.float ? parseFloat(x) : parseInt(x); + } + valid(c) { + return c === `-` || c === `.` && this.float || isNumber.test(c); + } + reset() { + this.typed = ``; + this.value = ``; + this.fire(); + this.render(); + } + exit() { + this.abort(); + } + abort() { + let x = this.value; + this.value = x !== `` ? x : this.initial; + this.done = this.aborted = true; + this.error = false; + this.fire(); + this.render(); + this.out.write(` +`); + this.close(); + } + async validate() { + let valid = await this.validator(this.value); + if (typeof valid === `string`) { + this.errorMsg = valid; + valid = false; + } + this.error = !valid; + } + async submit() { + await this.validate(); + if (this.error) { + this.color = `red`; + this.fire(); + this.render(); + return; + } + let x = this.value; + this.value = x !== `` ? x : this.initial; + this.done = true; + this.aborted = false; + this.error = false; + this.fire(); + this.render(); + this.out.write(` +`); + this.close(); + } + up() { + this.typed = ``; + if (this.value === "") { + this.value = this.min - this.inc; + } + if (this.value >= this.max) return this.bell(); + this.value += this.inc; + this.color = `cyan`; + this.fire(); + this.render(); + } + down() { + this.typed = ``; + if (this.value === "") { + this.value = this.min + this.inc; + } + if (this.value <= this.min) return this.bell(); + this.value -= this.inc; + this.color = `cyan`; + this.fire(); + this.render(); + } + delete() { + let val = this.value.toString(); + if (val.length === 0) return this.bell(); + this.value = this.parse(val = val.slice(0, -1)) || ``; + if (this.value !== "" && this.value < this.min) { + this.value = this.min; + } + this.color = `cyan`; + this.fire(); + this.render(); + } + next() { + this.value = this.initial; + this.fire(); + this.render(); + } + _(c, key) { + if (!this.valid(c)) return this.bell(); + const now = Date.now(); + if (now - this.lastHit > 1e3) this.typed = ``; + this.typed += c; + this.lastHit = now; + this.color = `cyan`; + if (c === `.`) return this.fire(); + this.value = Math.min(this.parse(this.typed), this.max); + if (this.value > this.max) this.value = this.max; + if (this.value < this.min) this.value = this.min; + this.fire(); + this.render(); + } + render() { + if (this.closed) return; + if (!this.firstRender) { + if (this.outputError) + this.out.write(cursor.down(lines(this.outputError, this.out.columns) - 1) + clear(this.outputError, this.out.columns)); + this.out.write(clear(this.outputText, this.out.columns)); + } + super.render(); + this.outputError = ""; + this.outputText = [ + style.symbol(this.done, this.aborted), + color.bold(this.msg), + style.delimiter(this.done), + !this.done || !this.done && !this.placeholder ? color[this.color]().underline(this.rendered) : this.rendered + ].join(` `); + if (this.error) { + this.outputError += this.errorMsg.split(` +`).reduce((a, l, i) => a + ` +${i ? ` ` : figures.pointerSmall} ${color.red().italic(l)}`, ``); + } + this.out.write(erase.line + cursor.to(0) + this.outputText + cursor.save + this.outputError + cursor.restore); + } + }; + module2.exports = NumberPrompt; + } +}); + +// node_modules/prompts/lib/elements/multiselect.js +var require_multiselect = __commonJS({ + "node_modules/prompts/lib/elements/multiselect.js"(exports2, module2) { + "use strict"; + var color = require_kleur(); + var { cursor } = require_src(); + var Prompt = require_prompt(); + var { clear, figures, style, wrap, entriesToDisplay } = require_util(); + var MultiselectPrompt = class extends Prompt { + constructor(opts = {}) { + super(opts); + this.msg = opts.message; + this.cursor = opts.cursor || 0; + this.scrollIndex = opts.cursor || 0; + this.hint = opts.hint || ""; + this.warn = opts.warn || "- This option is disabled -"; + this.minSelected = opts.min; + this.showMinError = false; + this.maxChoices = opts.max; + this.instructions = opts.instructions; + this.optionsPerPage = opts.optionsPerPage || 10; + this.value = opts.choices.map((ch, idx) => { + if (typeof ch === "string") + ch = { title: ch, value: idx }; + return { + title: ch && (ch.title || ch.value || ch), + description: ch && ch.description, + value: ch && (ch.value === void 0 ? idx : ch.value), + selected: ch && ch.selected, + disabled: ch && ch.disabled + }; + }); + this.clear = clear("", this.out.columns); + if (!opts.overrideRender) { + this.render(); + } + } + reset() { + this.value.map((v) => !v.selected); + this.cursor = 0; + this.fire(); + this.render(); + } + selected() { + return this.value.filter((v) => v.selected); + } + exit() { + this.abort(); + } + abort() { + this.done = this.aborted = true; + this.fire(); + this.render(); + this.out.write("\n"); + this.close(); + } + submit() { + const selected = this.value.filter((e) => e.selected); + if (this.minSelected && selected.length < this.minSelected) { + this.showMinError = true; + this.render(); + } else { + this.done = true; + this.aborted = false; + this.fire(); + this.render(); + this.out.write("\n"); + this.close(); + } + } + first() { + this.cursor = 0; + this.render(); + } + last() { + this.cursor = this.value.length - 1; + this.render(); + } + next() { + this.cursor = (this.cursor + 1) % this.value.length; + this.render(); + } + up() { + if (this.cursor === 0) { + this.cursor = this.value.length - 1; + } else { + this.cursor--; + } + this.render(); + } + down() { + if (this.cursor === this.value.length - 1) { + this.cursor = 0; + } else { + this.cursor++; + } + this.render(); + } + left() { + this.value[this.cursor].selected = false; + this.render(); + } + right() { + if (this.value.filter((e) => e.selected).length >= this.maxChoices) return this.bell(); + this.value[this.cursor].selected = true; + this.render(); + } + handleSpaceToggle() { + const v = this.value[this.cursor]; + if (v.selected) { + v.selected = false; + this.render(); + } else if (v.disabled || this.value.filter((e) => e.selected).length >= this.maxChoices) { + return this.bell(); + } else { + v.selected = true; + this.render(); + } + } + toggleAll() { + if (this.maxChoices !== void 0 || this.value[this.cursor].disabled) { + return this.bell(); + } + const newSelected = !this.value[this.cursor].selected; + this.value.filter((v) => !v.disabled).forEach((v) => v.selected = newSelected); + this.render(); + } + _(c, key) { + if (c === " ") { + this.handleSpaceToggle(); + } else if (c === "a") { + this.toggleAll(); + } else { + return this.bell(); + } + } + renderInstructions() { + if (this.instructions === void 0 || this.instructions) { + if (typeof this.instructions === "string") { + return this.instructions; + } + return ` +Instructions: + ${figures.arrowUp}/${figures.arrowDown}: Highlight option + ${figures.arrowLeft}/${figures.arrowRight}/[space]: Toggle selection +` + (this.maxChoices === void 0 ? ` a: Toggle all +` : "") + ` enter/return: Complete answer`; + } + return ""; + } + renderOption(cursor2, v, i, arrowIndicator) { + const prefix = (v.selected ? color.green(figures.radioOn) : figures.radioOff) + " " + arrowIndicator + " "; + let title, desc; + if (v.disabled) { + title = cursor2 === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title); + } else { + title = cursor2 === i ? color.cyan().underline(v.title) : v.title; + if (cursor2 === i && v.description) { + desc = ` - ${v.description}`; + if (prefix.length + title.length + desc.length >= this.out.columns || v.description.split(/\r?\n/).length > 1) { + desc = "\n" + wrap(v.description, { margin: prefix.length, width: this.out.columns }); + } + } + } + return prefix + title + color.gray(desc || ""); + } + // shared with autocompleteMultiselect + paginateOptions(options) { + if (options.length === 0) { + return color.red("No matches for this query."); + } + let { startIndex, endIndex } = entriesToDisplay(this.cursor, options.length, this.optionsPerPage); + let prefix, styledOptions = []; + for (let i = startIndex; i < endIndex; i++) { + if (i === startIndex && startIndex > 0) { + prefix = figures.arrowUp; + } else if (i === endIndex - 1 && endIndex < options.length) { + prefix = figures.arrowDown; + } else { + prefix = " "; + } + styledOptions.push(this.renderOption(this.cursor, options[i], i, prefix)); + } + return "\n" + styledOptions.join("\n"); + } + // shared with autocomleteMultiselect + renderOptions(options) { + if (!this.done) { + return this.paginateOptions(options); + } + return ""; + } + renderDoneOrInstructions() { + if (this.done) { + return this.value.filter((e) => e.selected).map((v) => v.title).join(", "); + } + const output = [color.gray(this.hint), this.renderInstructions()]; + if (this.value[this.cursor].disabled) { + output.push(color.yellow(this.warn)); + } + return output.join(" "); + } + render() { + if (this.closed) return; + if (this.firstRender) this.out.write(cursor.hide); + super.render(); + let prompt = [ + style.symbol(this.done, this.aborted), + color.bold(this.msg), + style.delimiter(false), + this.renderDoneOrInstructions() + ].join(" "); + if (this.showMinError) { + prompt += color.red(`You must select a minimum of ${this.minSelected} choices.`); + this.showMinError = false; + } + prompt += this.renderOptions(this.value); + this.out.write(this.clear + prompt); + this.clear = clear(prompt, this.out.columns); + } + }; + module2.exports = MultiselectPrompt; + } +}); + +// node_modules/prompts/lib/elements/autocomplete.js +var require_autocomplete = __commonJS({ + "node_modules/prompts/lib/elements/autocomplete.js"(exports2, module2) { + "use strict"; + var color = require_kleur(); + var Prompt = require_prompt(); + var { erase, cursor } = require_src(); + var { style, clear, figures, wrap, entriesToDisplay } = require_util(); + var getVal = (arr, i) => arr[i] && (arr[i].value || arr[i].title || arr[i]); + var getTitle = (arr, i) => arr[i] && (arr[i].title || arr[i].value || arr[i]); + var getIndex = (arr, valOrTitle) => { + const index = arr.findIndex((el) => el.value === valOrTitle || el.title === valOrTitle); + return index > -1 ? index : void 0; + }; + var AutocompletePrompt = class extends Prompt { + constructor(opts = {}) { + super(opts); + this.msg = opts.message; + this.suggest = opts.suggest; + this.choices = opts.choices; + this.initial = typeof opts.initial === "number" ? opts.initial : getIndex(opts.choices, opts.initial); + this.select = this.initial || opts.cursor || 0; + this.i18n = { noMatches: opts.noMatches || "no matches found" }; + this.fallback = opts.fallback || this.initial; + this.clearFirst = opts.clearFirst || false; + this.suggestions = []; + this.input = ""; + this.limit = opts.limit || 10; + this.cursor = 0; + this.transform = style.render(opts.style); + this.scale = this.transform.scale; + this.render = this.render.bind(this); + this.complete = this.complete.bind(this); + this.clear = clear("", this.out.columns); + this.complete(this.render); + this.render(); + } + set fallback(fb) { + this._fb = Number.isSafeInteger(parseInt(fb)) ? parseInt(fb) : fb; + } + get fallback() { + let choice; + if (typeof this._fb === "number") + choice = this.choices[this._fb]; + else if (typeof this._fb === "string") + choice = { title: this._fb }; + return choice || this._fb || { title: this.i18n.noMatches }; + } + moveSelect(i) { + this.select = i; + if (this.suggestions.length > 0) + this.value = getVal(this.suggestions, i); + else this.value = this.fallback.value; + this.fire(); + } + async complete(cb) { + const p = this.completing = this.suggest(this.input, this.choices); + const suggestions = await p; + if (this.completing !== p) return; + this.suggestions = suggestions.map((s, i, arr) => ({ title: getTitle(arr, i), value: getVal(arr, i), description: s.description })); + this.completing = false; + const l = Math.max(suggestions.length - 1, 0); + this.moveSelect(Math.min(l, this.select)); + cb && cb(); + } + reset() { + this.input = ""; + this.complete(() => { + this.moveSelect(this.initial !== void 0 ? this.initial : 0); + this.render(); + }); + this.render(); + } + exit() { + if (this.clearFirst && this.input.length > 0) { + this.reset(); + } else { + this.done = this.exited = true; + this.aborted = false; + this.fire(); + this.render(); + this.out.write("\n"); + this.close(); + } + } + abort() { + this.done = this.aborted = true; + this.exited = false; + this.fire(); + this.render(); + this.out.write("\n"); + this.close(); + } + submit() { + this.done = true; + this.aborted = this.exited = false; + this.fire(); + this.render(); + this.out.write("\n"); + this.close(); + } + _(c, key) { + let s1 = this.input.slice(0, this.cursor); + let s2 = this.input.slice(this.cursor); + this.input = `${s1}${c}${s2}`; + this.cursor = s1.length + 1; + this.complete(this.render); + this.render(); + } + delete() { + if (this.cursor === 0) return this.bell(); + let s1 = this.input.slice(0, this.cursor - 1); + let s2 = this.input.slice(this.cursor); + this.input = `${s1}${s2}`; + this.complete(this.render); + this.cursor = this.cursor - 1; + this.render(); + } + deleteForward() { + if (this.cursor * this.scale >= this.rendered.length) return this.bell(); + let s1 = this.input.slice(0, this.cursor); + let s2 = this.input.slice(this.cursor + 1); + this.input = `${s1}${s2}`; + this.complete(this.render); + this.render(); + } + first() { + this.moveSelect(0); + this.render(); + } + last() { + this.moveSelect(this.suggestions.length - 1); + this.render(); + } + up() { + if (this.select === 0) { + this.moveSelect(this.suggestions.length - 1); + } else { + this.moveSelect(this.select - 1); + } + this.render(); + } + down() { + if (this.select === this.suggestions.length - 1) { + this.moveSelect(0); + } else { + this.moveSelect(this.select + 1); + } + this.render(); + } + next() { + if (this.select === this.suggestions.length - 1) { + this.moveSelect(0); + } else this.moveSelect(this.select + 1); + this.render(); + } + nextPage() { + this.moveSelect(Math.min(this.select + this.limit, this.suggestions.length - 1)); + this.render(); + } + prevPage() { + this.moveSelect(Math.max(this.select - this.limit, 0)); + this.render(); + } + left() { + if (this.cursor <= 0) return this.bell(); + this.cursor = this.cursor - 1; + this.render(); + } + right() { + if (this.cursor * this.scale >= this.rendered.length) return this.bell(); + this.cursor = this.cursor + 1; + this.render(); + } + renderOption(v, hovered, isStart, isEnd) { + let desc; + let prefix = isStart ? figures.arrowUp : isEnd ? figures.arrowDown : " "; + let title = hovered ? color.cyan().underline(v.title) : v.title; + prefix = (hovered ? color.cyan(figures.pointer) + " " : " ") + prefix; + if (v.description) { + desc = ` - ${v.description}`; + if (prefix.length + title.length + desc.length >= this.out.columns || v.description.split(/\r?\n/).length > 1) { + desc = "\n" + wrap(v.description, { margin: 3, width: this.out.columns }); + } + } + return prefix + " " + title + color.gray(desc || ""); + } + render() { + if (this.closed) return; + if (this.firstRender) this.out.write(cursor.hide); + else this.out.write(clear(this.outputText, this.out.columns)); + super.render(); + let { startIndex, endIndex } = entriesToDisplay(this.select, this.choices.length, this.limit); + this.outputText = [ + style.symbol(this.done, this.aborted, this.exited), + color.bold(this.msg), + style.delimiter(this.completing), + this.done && this.suggestions[this.select] ? this.suggestions[this.select].title : this.rendered = this.transform.render(this.input) + ].join(" "); + if (!this.done) { + const suggestions = this.suggestions.slice(startIndex, endIndex).map((item, i) => this.renderOption( + item, + this.select === i + startIndex, + i === 0 && startIndex > 0, + i + startIndex === endIndex - 1 && endIndex < this.choices.length + )).join("\n"); + this.outputText += ` +` + (suggestions || color.gray(this.fallback.title)); + } + this.out.write(erase.line + cursor.to(0) + this.outputText); + } + }; + module2.exports = AutocompletePrompt; + } +}); + +// node_modules/prompts/lib/elements/autocompleteMultiselect.js +var require_autocompleteMultiselect = __commonJS({ + "node_modules/prompts/lib/elements/autocompleteMultiselect.js"(exports2, module2) { + "use strict"; + var color = require_kleur(); + var { cursor } = require_src(); + var MultiselectPrompt = require_multiselect(); + var { clear, style, figures } = require_util(); + var AutocompleteMultiselectPrompt = class extends MultiselectPrompt { + constructor(opts = {}) { + opts.overrideRender = true; + super(opts); + this.inputValue = ""; + this.clear = clear("", this.out.columns); + this.filteredOptions = this.value; + this.render(); + } + last() { + this.cursor = this.filteredOptions.length - 1; + this.render(); + } + next() { + this.cursor = (this.cursor + 1) % this.filteredOptions.length; + this.render(); + } + up() { + if (this.cursor === 0) { + this.cursor = this.filteredOptions.length - 1; + } else { + this.cursor--; + } + this.render(); + } + down() { + if (this.cursor === this.filteredOptions.length - 1) { + this.cursor = 0; + } else { + this.cursor++; + } + this.render(); + } + left() { + this.filteredOptions[this.cursor].selected = false; + this.render(); + } + right() { + if (this.value.filter((e) => e.selected).length >= this.maxChoices) return this.bell(); + this.filteredOptions[this.cursor].selected = true; + this.render(); + } + delete() { + if (this.inputValue.length) { + this.inputValue = this.inputValue.substr(0, this.inputValue.length - 1); + this.updateFilteredOptions(); + } + } + updateFilteredOptions() { + const currentHighlight = this.filteredOptions[this.cursor]; + this.filteredOptions = this.value.filter((v) => { + if (this.inputValue) { + if (typeof v.title === "string") { + if (v.title.toLowerCase().includes(this.inputValue.toLowerCase())) { + return true; + } + } + if (typeof v.value === "string") { + if (v.value.toLowerCase().includes(this.inputValue.toLowerCase())) { + return true; + } + } + return false; + } + return true; + }); + const newHighlightIndex = this.filteredOptions.findIndex((v) => v === currentHighlight); + this.cursor = newHighlightIndex < 0 ? 0 : newHighlightIndex; + this.render(); + } + handleSpaceToggle() { + const v = this.filteredOptions[this.cursor]; + if (v.selected) { + v.selected = false; + this.render(); + } else if (v.disabled || this.value.filter((e) => e.selected).length >= this.maxChoices) { + return this.bell(); + } else { + v.selected = true; + this.render(); + } + } + handleInputChange(c) { + this.inputValue = this.inputValue + c; + this.updateFilteredOptions(); + } + _(c, key) { + if (c === " ") { + this.handleSpaceToggle(); + } else { + this.handleInputChange(c); + } + } + renderInstructions() { + if (this.instructions === void 0 || this.instructions) { + if (typeof this.instructions === "string") { + return this.instructions; + } + return ` +Instructions: + ${figures.arrowUp}/${figures.arrowDown}: Highlight option + ${figures.arrowLeft}/${figures.arrowRight}/[space]: Toggle selection + [a,b,c]/delete: Filter choices + enter/return: Complete answer +`; + } + return ""; + } + renderCurrentInput() { + return ` +Filtered results for: ${this.inputValue ? this.inputValue : color.gray("Enter something to filter")} +`; + } + renderOption(cursor2, v, i) { + let title; + if (v.disabled) title = cursor2 === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title); + else title = cursor2 === i ? color.cyan().underline(v.title) : v.title; + return (v.selected ? color.green(figures.radioOn) : figures.radioOff) + " " + title; + } + renderDoneOrInstructions() { + if (this.done) { + return this.value.filter((e) => e.selected).map((v) => v.title).join(", "); + } + const output = [color.gray(this.hint), this.renderInstructions(), this.renderCurrentInput()]; + if (this.filteredOptions.length && this.filteredOptions[this.cursor].disabled) { + output.push(color.yellow(this.warn)); + } + return output.join(" "); + } + render() { + if (this.closed) return; + if (this.firstRender) this.out.write(cursor.hide); + super.render(); + let prompt = [ + style.symbol(this.done, this.aborted), + color.bold(this.msg), + style.delimiter(false), + this.renderDoneOrInstructions() + ].join(" "); + if (this.showMinError) { + prompt += color.red(`You must select a minimum of ${this.minSelected} choices.`); + this.showMinError = false; + } + prompt += this.renderOptions(this.filteredOptions); + this.out.write(this.clear + prompt); + this.clear = clear(prompt, this.out.columns); + } + }; + module2.exports = AutocompleteMultiselectPrompt; + } +}); + +// node_modules/prompts/lib/elements/confirm.js +var require_confirm = __commonJS({ + "node_modules/prompts/lib/elements/confirm.js"(exports2, module2) { + var color = require_kleur(); + var Prompt = require_prompt(); + var { style, clear } = require_util(); + var { erase, cursor } = require_src(); + var ConfirmPrompt = class extends Prompt { + constructor(opts = {}) { + super(opts); + this.msg = opts.message; + this.value = opts.initial; + this.initialValue = !!opts.initial; + this.yesMsg = opts.yes || "yes"; + this.yesOption = opts.yesOption || "(Y/n)"; + this.noMsg = opts.no || "no"; + this.noOption = opts.noOption || "(y/N)"; + this.render(); + } + reset() { + this.value = this.initialValue; + this.fire(); + this.render(); + } + exit() { + this.abort(); + } + abort() { + this.done = this.aborted = true; + this.fire(); + this.render(); + this.out.write("\n"); + this.close(); + } + submit() { + this.value = this.value || false; + this.done = true; + this.aborted = false; + this.fire(); + this.render(); + this.out.write("\n"); + this.close(); + } + _(c, key) { + if (c.toLowerCase() === "y") { + this.value = true; + return this.submit(); + } + if (c.toLowerCase() === "n") { + this.value = false; + return this.submit(); + } + return this.bell(); + } + render() { + if (this.closed) return; + if (this.firstRender) this.out.write(cursor.hide); + else this.out.write(clear(this.outputText, this.out.columns)); + super.render(); + this.outputText = [ + style.symbol(this.done, this.aborted), + color.bold(this.msg), + style.delimiter(this.done), + this.done ? this.value ? this.yesMsg : this.noMsg : color.gray(this.initialValue ? this.yesOption : this.noOption) + ].join(" "); + this.out.write(erase.line + cursor.to(0) + this.outputText); + } + }; + module2.exports = ConfirmPrompt; + } +}); + +// node_modules/prompts/lib/elements/index.js +var require_elements = __commonJS({ + "node_modules/prompts/lib/elements/index.js"(exports2, module2) { + "use strict"; + module2.exports = { + TextPrompt: require_text(), + SelectPrompt: require_select(), + TogglePrompt: require_toggle(), + DatePrompt: require_date(), + NumberPrompt: require_number(), + MultiselectPrompt: require_multiselect(), + AutocompletePrompt: require_autocomplete(), + AutocompleteMultiselectPrompt: require_autocompleteMultiselect(), + ConfirmPrompt: require_confirm() + }; + } +}); + +// node_modules/prompts/lib/prompts.js +var require_prompts = __commonJS({ + "node_modules/prompts/lib/prompts.js"(exports2) { + "use strict"; + var $ = exports2; + var el = require_elements(); + var noop = (v) => v; + function toPrompt(type, args, opts = {}) { + return new Promise((res, rej) => { + const p = new el[type](args); + const onAbort = opts.onAbort || noop; + const onSubmit = opts.onSubmit || noop; + const onExit = opts.onExit || noop; + p.on("state", args.onState || noop); + p.on("submit", (x) => res(onSubmit(x))); + p.on("exit", (x) => res(onExit(x))); + p.on("abort", (x) => rej(onAbort(x))); + }); + } + $.text = (args) => toPrompt("TextPrompt", args); + $.password = (args) => { + args.style = "password"; + return $.text(args); + }; + $.invisible = (args) => { + args.style = "invisible"; + return $.text(args); + }; + $.number = (args) => toPrompt("NumberPrompt", args); + $.date = (args) => toPrompt("DatePrompt", args); + $.confirm = (args) => toPrompt("ConfirmPrompt", args); + $.list = (args) => { + const sep = args.separator || ","; + return toPrompt("TextPrompt", args, { + onSubmit: (str) => str.split(sep).map((s) => s.trim()) + }); + }; + $.toggle = (args) => toPrompt("TogglePrompt", args); + $.select = (args) => toPrompt("SelectPrompt", args); + $.multiselect = (args) => { + args.choices = [].concat(args.choices || []); + const toSelected = (items) => items.filter((item) => item.selected).map((item) => item.value); + return toPrompt("MultiselectPrompt", args, { + onAbort: toSelected, + onSubmit: toSelected + }); + }; + $.autocompleteMultiselect = (args) => { + args.choices = [].concat(args.choices || []); + const toSelected = (items) => items.filter((item) => item.selected).map((item) => item.value); + return toPrompt("AutocompleteMultiselectPrompt", args, { + onAbort: toSelected, + onSubmit: toSelected + }); + }; + var byTitle = (input, choices) => Promise.resolve( + choices.filter((item) => item.title.slice(0, input.length).toLowerCase() === input.toLowerCase()) + ); + $.autocomplete = (args) => { + args.suggest = args.suggest || byTitle; + args.choices = [].concat(args.choices || []); + return toPrompt("AutocompletePrompt", args); + }; + } +}); + +// node_modules/prompts/lib/index.js +var require_lib = __commonJS({ + "node_modules/prompts/lib/index.js"(exports2, module2) { + "use strict"; + var prompts = require_prompts(); + var passOn = ["suggest", "format", "onState", "validate", "onRender", "type"]; + var noop = () => { + }; + async function prompt(questions = [], { onSubmit = noop, onCancel = noop } = {}) { + const answers = {}; + const override2 = prompt._override || {}; + questions = [].concat(questions); + let answer, question, quit, name, type, lastPrompt; + const getFormattedAnswer = async (question2, answer2, skipValidation = false) => { + if (!skipValidation && question2.validate && question2.validate(answer2) !== true) { + return; + } + return question2.format ? await question2.format(answer2, answers) : answer2; + }; + for (question of questions) { + ({ name, type } = question); + if (typeof type === "function") { + type = await type(answer, { ...answers }, question); + question["type"] = type; + } + if (!type) continue; + for (let key in question) { + if (passOn.includes(key)) continue; + let value = question[key]; + question[key] = typeof value === "function" ? await value(answer, { ...answers }, lastPrompt) : value; + } + lastPrompt = question; + if (typeof question.message !== "string") { + throw new Error("prompt message is required"); + } + ({ name, type } = question); + if (prompts[type] === void 0) { + throw new Error(`prompt type (${type}) is not defined`); + } + if (override2[question.name] !== void 0) { + answer = await getFormattedAnswer(question, override2[question.name]); + if (answer !== void 0) { + answers[name] = answer; + continue; + } + } + try { + answer = prompt._injected ? getInjectedAnswer(prompt._injected, question.initial) : await prompts[type](question); + answers[name] = answer = await getFormattedAnswer(question, answer, true); + quit = await onSubmit(question, answer, answers); + } catch (err2) { + quit = !await onCancel(question, answers); + } + if (quit) return answers; + } + return answers; + } + function getInjectedAnswer(injected, deafultValue) { + const answer = injected.shift(); + if (answer instanceof Error) { + throw answer; + } + return answer === void 0 ? deafultValue : answer; + } + function inject(answers) { + prompt._injected = (prompt._injected || []).concat(answers); + } + function override(answers) { + prompt._override = Object.assign({}, answers); + } + module2.exports = Object.assign(prompt, { prompt, prompts, inject, override }); + } +}); + +// src/cli/index.ts +var cli_exports = {}; +__export(cli_exports, { + BOOLEAN_CLI_FLAGS: () => BOOLEAN_CLI_FLAGS, + parseFlags: () => parseFlags, + run: () => run, + runTask: () => runTask +}); +module.exports = __toCommonJS(cli_exports); + +// src/cli/config-flags.ts +var BOOLEAN_CLI_FLAGS = [ + "build", + "cache", + "checkVersion", + "ci", + "compare", + "debug", + "dev", + "devtools", + "docs", + "e2e", + "es5", + "esm", + "help", + "log", + "open", + "prerender", + "prerenderExternal", + "prod", + "profile", + "serviceWorker", + "screenshot", + "serve", + "skipNodeCheck", + "spec", + "ssr", + "stats", + "updateScreenshot", + "verbose", + "version", + "watch", + // JEST CLI OPTIONS + "all", + "automock", + "bail", + // 'cache', Stencil already supports this argument + "changedFilesWithAncestor", + // 'ci', Stencil already supports this argument + "clearCache", + "clearMocks", + "collectCoverage", + "color", + "colors", + "coverage", + // 'debug', Stencil already supports this argument + "detectLeaks", + "detectOpenHandles", + "errorOnDeprecated", + "expand", + "findRelatedTests", + "forceExit", + "init", + "injectGlobals", + "json", + "lastCommit", + "listTests", + "logHeapUsage", + "noStackTrace", + "notify", + "onlyChanged", + "onlyFailures", + "passWithNoTests", + "resetMocks", + "resetModules", + "restoreMocks", + "runInBand", + "runTestsByPath", + "showConfig", + "silent", + "skipFilter", + "testLocationInResults", + "updateSnapshot", + "useStderr", + // 'verbose', Stencil already supports this argument + // 'version', Stencil already supports this argument + // 'watch', Stencil already supports this argument + "watchAll", + "watchman" +]; +var NUMBER_CLI_FLAGS = [ + "port", + // JEST CLI ARGS + "maxConcurrency", + "testTimeout" +]; +var STRING_CLI_FLAGS = [ + "address", + "config", + "docsApi", + "docsJson", + "emulate", + "root", + "screenshotConnector", + // JEST CLI ARGS + "cacheDirectory", + "changedSince", + "collectCoverageFrom", + // 'config', Stencil already supports this argument + "coverageDirectory", + "coverageThreshold", + "env", + "filter", + "globalSetup", + "globalTeardown", + "globals", + "haste", + "moduleNameMapper", + "notifyMode", + "outputFile", + "preset", + "prettierPath", + "resolver", + "rootDir", + "runner", + "testEnvironment", + "testEnvironmentOptions", + "testFailureExitCode", + "testNamePattern", + "testResultsProcessor", + "testRunner", + "testSequencer", + "testURL", + "timers", + "transform" +]; +var STRING_ARRAY_CLI_FLAGS = [ + "collectCoverageOnlyFrom", + "coveragePathIgnorePatterns", + "coverageReporters", + "moduleDirectories", + "moduleFileExtensions", + "modulePathIgnorePatterns", + "modulePaths", + "projects", + "reporters", + "roots", + "selectProjects", + "setupFiles", + "setupFilesAfterEnv", + "snapshotSerializers", + "testMatch", + "testPathIgnorePatterns", + "testPathPattern", + "testRegex", + "transformIgnorePatterns", + "unmockedModulePathPatterns", + "watchPathIgnorePatterns" +]; +var STRING_NUMBER_CLI_FLAGS = ["maxWorkers"]; +var BOOLEAN_STRING_CLI_FLAGS = [ + /** + * `headless` is an argument passed through to Puppeteer (which is passed to Chrome) for end-to-end testing. + * Prior to Chrome v112, `headless` was treated like a boolean flag. Starting with Chrome v112, 'new' is an accepted + * option to support Chrome's new headless mode. In order to support this option in Stencil, both the boolean and + * string versions of the flag must be accepted. + * + * {@see https://developer.chrome.com/articles/new-headless/} + */ + "headless" +]; +var LOG_LEVEL_CLI_FLAGS = ["logLevel"]; +var CLI_FLAG_ALIASES = { + c: "config", + h: "help", + p: "port", + v: "version", + // JEST SPECIFIC CLI FLAGS + // these are defined in + // https://github.com/facebook/jest/blob/4156f86/packages/jest-cli/src/args.ts + b: "bail", + e: "expand", + f: "onlyFailures", + i: "runInBand", + o: "onlyChanged", + t: "testNamePattern", + u: "updateSnapshot", + w: "maxWorkers" +}; +var CLI_FLAG_REGEX = new RegExp(`^-[chpvbewofitu]{1}$`); +var createConfigFlags = (init = {}) => { + const flags = { + task: null, + args: [], + knownArgs: [], + unknownArgs: [], + ...init + }; + return flags; +}; + +// src/utils/constants.ts +var DIST_HYDRATE_SCRIPT = "dist-hydrate-script"; +var DOCS_CUSTOM = "docs-custom"; +var DOCS_JSON = "docs-json"; +var DOCS_README = "docs-readme"; +var DOCS_VSCODE = "docs-vscode"; +var WWW = "www"; + +// src/utils/helpers.ts +var dashToPascalCase = (str) => str.toLowerCase().split("-").map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1)).join(""); +var toCamelCase = (str) => { + const pascalCase = dashToPascalCase(str); + return pascalCase.charAt(0).toLowerCase() + pascalCase.slice(1); +}; +var isFunction = (v) => typeof v === "function"; +var isString = (v) => typeof v === "string"; + +// src/utils/message-utils.ts +var buildError = (diagnostics) => { + const diagnostic = { + level: "error", + type: "build", + header: "Build Error", + messageText: "build error", + relFilePath: void 0, + absFilePath: void 0, + lines: [] + }; + if (diagnostics) { + diagnostics.push(diagnostic); + } + return diagnostic; +}; +var catchError = (diagnostics, err2, msg) => { + const diagnostic = { + level: "error", + type: "build", + header: "Build Error", + messageText: "build error", + lines: [] + }; + if (isString(msg)) { + diagnostic.messageText = msg.length ? msg : "UNKNOWN ERROR"; + } else if (err2 != null) { + if (err2.stack != null) { + diagnostic.messageText = err2.stack.toString(); + } else { + if (err2.message != null) { + diagnostic.messageText = err2.message.length ? err2.message : "UNKNOWN ERROR"; + } else { + diagnostic.messageText = err2.toString(); + } + } + } + if (diagnostics != null && !shouldIgnoreError(diagnostic.messageText)) { + diagnostics.push(diagnostic); + } + return diagnostic; +}; +var hasError = (diagnostics) => { + if (diagnostics == null || diagnostics.length === 0) { + return false; + } + return diagnostics.some((d) => d.level === "error" && d.type !== "runtime"); +}; +var shouldIgnoreError = (msg) => { + return msg === TASK_CANCELED_MSG; +}; +var TASK_CANCELED_MSG = `task canceled`; + +// src/utils/path.ts +var normalizePath = (path, relativize = true) => { + if (typeof path !== "string") { + throw new Error(`invalid path to normalize`); + } + path = normalizeSlashes(path.trim()); + const components = pathComponents(path, getRootLength(path)); + const reducedComponents = reducePathComponents(components); + const rootPart = reducedComponents[0]; + const secondPart = reducedComponents[1]; + const normalized = rootPart + reducedComponents.slice(1).join("/"); + if (normalized === "") { + return "."; + } + if (rootPart === "" && secondPart && path.includes("/") && !secondPart.startsWith(".") && !secondPart.startsWith("@") && relativize) { + return "./" + normalized; + } + return normalized; +}; +var normalizeSlashes = (path) => path.replace(backslashRegExp, "/"); +var altDirectorySeparator = "\\"; +var urlSchemeSeparator = "://"; +var backslashRegExp = /\\/g; +var reducePathComponents = (components) => { + if (!Array.isArray(components) || components.length === 0) { + return []; + } + const reduced = [components[0]]; + for (let i = 1; i < components.length; i++) { + const component = components[i]; + if (!component) continue; + if (component === ".") continue; + if (component === "..") { + if (reduced.length > 1) { + if (reduced[reduced.length - 1] !== "..") { + reduced.pop(); + continue; + } + } else if (reduced[0]) continue; + } + reduced.push(component); + } + return reduced; +}; +var getRootLength = (path) => { + const rootLength = getEncodedRootLength(path); + return rootLength < 0 ? ~rootLength : rootLength; +}; +var getEncodedRootLength = (path) => { + if (!path) return 0; + const ch0 = path.charCodeAt(0); + if (ch0 === 47 /* slash */ || ch0 === 92 /* backslash */) { + if (path.charCodeAt(1) !== ch0) return 1; + const p1 = path.indexOf(ch0 === 47 /* slash */ ? "/" : altDirectorySeparator, 2); + if (p1 < 0) return path.length; + return p1 + 1; + } + if (isVolumeCharacter(ch0) && path.charCodeAt(1) === 58 /* colon */) { + const ch2 = path.charCodeAt(2); + if (ch2 === 47 /* slash */ || ch2 === 92 /* backslash */) return 3; + if (path.length === 2) return 2; + } + const schemeEnd = path.indexOf(urlSchemeSeparator); + if (schemeEnd !== -1) { + const authorityStart = schemeEnd + urlSchemeSeparator.length; + const authorityEnd = path.indexOf("/", authorityStart); + if (authorityEnd !== -1) { + const scheme = path.slice(0, schemeEnd); + const authority = path.slice(authorityStart, authorityEnd); + if (scheme === "file" && (authority === "" || authority === "localhost") && isVolumeCharacter(path.charCodeAt(authorityEnd + 1))) { + const volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path, authorityEnd + 2); + if (volumeSeparatorEnd !== -1) { + if (path.charCodeAt(volumeSeparatorEnd) === 47 /* slash */) { + return ~(volumeSeparatorEnd + 1); + } + if (volumeSeparatorEnd === path.length) { + return ~volumeSeparatorEnd; + } + } + } + return ~(authorityEnd + 1); + } + return ~path.length; + } + return 0; +}; +var isVolumeCharacter = (charCode) => charCode >= 97 /* a */ && charCode <= 122 /* z */ || charCode >= 65 /* A */ && charCode <= 90 /* Z */; +var getFileUrlVolumeSeparatorEnd = (url, start) => { + const ch0 = url.charCodeAt(start); + if (ch0 === 58 /* colon */) return start + 1; + if (ch0 === 37 /* percent */ && url.charCodeAt(start + 1) === 51 /* _3 */) { + const ch2 = url.charCodeAt(start + 2); + if (ch2 === 97 /* a */ || ch2 === 65 /* A */) return start + 3; + } + return -1; +}; +var pathComponents = (path, rootLength) => { + const root = path.substring(0, rootLength); + const rest = path.substring(rootLength).split("/"); + const restLen = rest.length; + if (restLen > 0 && !rest[restLen - 1]) { + rest.pop(); + } + return [root, ...rest]; +}; + +// src/utils/output-target.ts +var isOutputTargetHydrate = (o) => o.type === DIST_HYDRATE_SCRIPT; +var isOutputTargetDocs = (o) => o.type === DOCS_README || o.type === DOCS_JSON || o.type === DOCS_CUSTOM || o.type === DOCS_VSCODE; + +// src/utils/result.ts +var result_exports = {}; +__export(result_exports, { + err: () => err, + map: () => map, + ok: () => ok, + unwrap: () => unwrap, + unwrapErr: () => unwrapErr +}); +var ok = (value) => ({ + isOk: true, + isErr: false, + value +}); +var err = (value) => ({ + isOk: false, + isErr: true, + value +}); +function map(result, fn) { + if (result.isOk) { + const val = fn(result.value); + if (val instanceof Promise) { + return val.then((newVal) => ok(newVal)); + } else { + return ok(val); + } + } + if (result.isErr) { + const value = result.value; + return err(value); + } + throw "should never get here"; +} +var unwrap = (result) => { + if (result.isOk) { + return result.value; + } else { + throw result.value; + } +}; +var unwrapErr = (result) => { + if (result.isErr) { + return result.value; + } else { + throw result.value; + } +}; + +// src/utils/util.ts +var readOnlyArrayHasStringMember = (readOnlyArray, maybeMember) => readOnlyArray.includes(maybeMember); + +// src/utils/validation.ts +var validateComponentTag = (tag) => { + if (typeof tag !== "string") { + return `Tag "${tag}" must be a string type`; + } + if (tag !== tag.trim()) { + return `Tag can not contain white spaces`; + } + if (tag !== tag.toLowerCase()) { + return `Tag can not contain upper case characters`; + } + if (tag.length === 0) { + return `Received empty tag value`; + } + if (tag.indexOf(" ") > -1) { + return `"${tag}" tag cannot contain a space`; + } + if (tag.indexOf(",") > -1) { + return `"${tag}" tag cannot be used for multiple tags`; + } + const invalidChars = tag.replace(/\w|-/g, ""); + if (invalidChars !== "") { + return `"${tag}" tag contains invalid characters: ${invalidChars}`; + } + if (tag.indexOf("-") === -1) { + return `"${tag}" tag must contain a dash (-) to work as a valid web component`; + } + if (tag.indexOf("--") > -1) { + return `"${tag}" tag cannot contain multiple dashes (--) next to each other`; + } + if (tag.indexOf("-") === 0) { + return `"${tag}" tag cannot start with a dash (-)`; + } + if (tag.lastIndexOf("-") === tag.length - 1) { + return `"${tag}" tag cannot end with a dash (-)`; + } + return void 0; +}; + +// src/declarations/stencil-public-compiler.ts +var LOG_LEVELS = ["debug", "info", "warn", "error"]; + +// src/cli/parse-flags.ts +var parseFlags = (args) => { + const flags = createConfigFlags(); + flags.args = Array.isArray(args) ? args.slice() : []; + if (flags.args.length > 0 && flags.args[0] && !flags.args[0].startsWith("-")) { + flags.task = flags.args[0]; + parseArgs(flags, args.slice(1)); + } else { + parseArgs(flags, flags.args); + } + if (flags.task != null) { + const i = flags.args.indexOf(flags.task); + if (i > -1) { + flags.args.splice(i, 1); + } + } + return flags; +}; +var parseArgs = (flags, args) => { + const argsCopy = args.concat(); + while (argsCopy.length > 0) { + parseCLITerm(flags, argsCopy); + } +}; +var parseCLITerm = (flags, args) => { + const arg = args.shift(); + if (arg === void 0) return; + const isNegatedBoolean = !readOnlyArrayHasStringMember(BOOLEAN_CLI_FLAGS, normalizeFlagName(arg)) && readOnlyArrayHasStringMember(BOOLEAN_CLI_FLAGS, normalizeNegativeFlagName(arg)); + const isNegatedBooleanOrString = !readOnlyArrayHasStringMember(BOOLEAN_STRING_CLI_FLAGS, normalizeFlagName(arg)) && readOnlyArrayHasStringMember(BOOLEAN_STRING_CLI_FLAGS, normalizeNegativeFlagName(arg)); + if (arg.startsWith("--") && arg.includes("=")) { + const [originalArg, value] = parseEqualsArg(arg); + setCLIArg(flags, arg.split("=")[0], normalizeFlagName(originalArg), value); + } else if (arg.startsWith("-") && arg.includes("=")) { + const [originalArg, value] = parseEqualsArg(arg); + setCLIArg(flags, desugarRawAlias(originalArg), normalizeFlagName(originalArg), value); + } else if (CLI_FLAG_REGEX.test(arg)) { + setCLIArg(flags, desugarRawAlias(arg), normalizeFlagName(arg), parseCLIValue(args)); + } else if (arg.startsWith("--no-") && arg.length > "--no-".length) { + const normalized = normalizeNegativeFlagName(arg); + setCLIArg(flags, arg, normalized, ""); + } else if (arg.startsWith("--no") && (isNegatedBoolean || isNegatedBooleanOrString)) { + setCLIArg(flags, arg, normalizeNegativeFlagName(arg), ""); + } else if (arg.startsWith("--") && arg.length > "--".length) { + setCLIArg(flags, arg, normalizeFlagName(arg), parseCLIValue(args)); + } else { + flags.unknownArgs.push(arg); + } +}; +var normalizeNegativeFlagName = (flagName) => { + const trimmed = flagName.replace(/^--no[-]?/, ""); + return normalizeFlagName(trimmed.charAt(0).toLowerCase() + trimmed.slice(1)); +}; +var normalizeFlagName = (flagName) => { + const trimmed = flagName.replace(/^-+/, ""); + return trimmed.includes("-") ? toCamelCase(trimmed) : trimmed; +}; +var setCLIArg = (flags, rawArg, normalizedArg, value) => { + normalizedArg = desugarAlias(normalizedArg); + if (readOnlyArrayHasStringMember(BOOLEAN_CLI_FLAGS, normalizedArg)) { + const parsed = typeof value === "string" ? ( + // check if the value is `'true'` + value === "true" + ) : ( + // no value was supplied, default to true + true + ); + flags[normalizedArg] = parsed; + flags.knownArgs.push(rawArg); + if (typeof value === "string" && value !== "") { + flags.knownArgs.push(value); + } + } else if (readOnlyArrayHasStringMember(STRING_CLI_FLAGS, normalizedArg)) { + if (typeof value === "string") { + flags[normalizedArg] = value; + flags.knownArgs.push(rawArg); + flags.knownArgs.push(value); + } else { + throwCLIParsingError(rawArg, "expected a string argument but received nothing"); + } + } else if (readOnlyArrayHasStringMember(STRING_ARRAY_CLI_FLAGS, normalizedArg)) { + if (typeof value === "string") { + if (!Array.isArray(flags[normalizedArg])) { + flags[normalizedArg] = []; + } + const targetArray = flags[normalizedArg]; + if (Array.isArray(targetArray)) { + targetArray.push(value); + flags.knownArgs.push(rawArg); + flags.knownArgs.push(value); + } + } else { + throwCLIParsingError(rawArg, "expected a string argument but received nothing"); + } + } else if (readOnlyArrayHasStringMember(NUMBER_CLI_FLAGS, normalizedArg)) { + if (typeof value === "string") { + const parsed = parseInt(value, 10); + if (isNaN(parsed)) { + throwNumberParsingError(rawArg, value); + } else { + flags[normalizedArg] = parsed; + flags.knownArgs.push(rawArg); + flags.knownArgs.push(value); + } + } else { + throwCLIParsingError(rawArg, "expected a number argument but received nothing"); + } + } else if (readOnlyArrayHasStringMember(STRING_NUMBER_CLI_FLAGS, normalizedArg)) { + if (typeof value === "string") { + if (CLI_ARG_STRING_REGEX.test(value)) { + flags[normalizedArg] = value; + } else { + const parsed = Number(value); + if (isNaN(parsed)) { + throwNumberParsingError(rawArg, value); + } else { + flags[normalizedArg] = parsed; + } + } + flags.knownArgs.push(rawArg); + flags.knownArgs.push(value); + } else { + throwCLIParsingError(rawArg, "expected a string or a number but received nothing"); + } + } else if (readOnlyArrayHasStringMember(BOOLEAN_STRING_CLI_FLAGS, normalizedArg)) { + const derivedValue = typeof value === "string" ? value ? value : false : true; + flags[normalizedArg] = derivedValue; + flags.knownArgs.push(rawArg); + if (typeof derivedValue === "string" && derivedValue) { + flags.knownArgs.push(derivedValue); + } + } else if (readOnlyArrayHasStringMember(LOG_LEVEL_CLI_FLAGS, normalizedArg)) { + if (typeof value === "string") { + if (isLogLevel(value)) { + flags[normalizedArg] = value; + flags.knownArgs.push(rawArg); + flags.knownArgs.push(value); + } else { + throwCLIParsingError(rawArg, `expected to receive a valid log level but received "${String(value)}"`); + } + } else { + throwCLIParsingError(rawArg, "expected to receive a valid log level but received nothing"); + } + } else { + flags.unknownArgs.push(rawArg); + if (typeof value === "string") { + flags.unknownArgs.push(value); + } + } +}; +var CLI_ARG_STRING_REGEX = /[^\d\.Ee\+\-]+/g; +var Empty = Symbol("Empty"); +var parseCLIValue = (args) => { + if (args[0] === void 0) { + return Empty; + } + if (!args[0].startsWith("-")) { + const value = args.shift(); + if (typeof value === "string") { + return value; + } + } + return Empty; +}; +var parseEqualsArg = (arg) => { + const [originalArg, ...splitSections] = arg.split("="); + const value = splitSections.join("="); + return [originalArg, value === "" ? Empty : value]; +}; +var isLogLevel = (maybeLogLevel) => readOnlyArrayHasStringMember(LOG_LEVELS, maybeLogLevel); +var throwCLIParsingError = (flag, message) => { + throw new Error(`when parsing CLI flag "${flag}": ${message}`); +}; +var throwNumberParsingError = (flag, value) => { + throwCLIParsingError(flag, `expected a number but received "${value}"`); +}; +var desugarAlias = (maybeAlias) => { + const possiblyDesugared = CLI_FLAG_ALIASES[maybeAlias]; + if (typeof possiblyDesugared === "string") { + return possiblyDesugared; + } + return maybeAlias; +}; +var desugarRawAlias = (rawAlias) => "--" + desugarAlias(normalizeFlagName(rawAlias)); + +// src/cli/find-config.ts +var findConfig = async (opts) => { + const sys = opts.sys; + const cwd = sys.getCurrentDirectory(); + const rootDir = normalizePath(cwd); + let configPath = opts.configPath; + if (isString(configPath)) { + if (!sys.platformPath.isAbsolute(configPath)) { + configPath = normalizePath(sys.platformPath.join(cwd, configPath)); + } else { + configPath = normalizePath(configPath); + } + } else { + configPath = rootDir; + } + const results = { + configPath, + rootDir: normalizePath(cwd) + }; + const stat = await sys.stat(configPath); + if (stat.error) { + const diagnostics = []; + const diagnostic = buildError(diagnostics); + diagnostic.absFilePath = configPath; + diagnostic.header = `Invalid config path`; + diagnostic.messageText = `Config path "${configPath}" not found`; + return result_exports.err(diagnostics); + } + if (stat.isFile) { + results.configPath = configPath; + results.rootDir = sys.platformPath.dirname(configPath); + } else if (stat.isDirectory) { + for (const configName of ["stencil.config.ts", "stencil.config.js"]) { + const testConfigFilePath = sys.platformPath.join(configPath, configName); + const stat2 = await sys.stat(testConfigFilePath); + if (stat2.isFile) { + results.configPath = testConfigFilePath; + results.rootDir = sys.platformPath.dirname(testConfigFilePath); + break; + } + } + } + return result_exports.ok(results); +}; + +// src/cli/load-compiler.ts +var loadCoreCompiler = async (sys) => { + return await sys.dynamicImport(sys.getCompilerExecutingPath()); +}; + +// src/cli/logs.ts +var startupLog = (logger, task) => { + if (task === "info" || task === "serve" || task === "version") { + return; + } + logger.info(logger.cyan(`@stencil/core`)); +}; +var startupLogVersion = (logger, task, coreCompiler) => { + if (task === "info" || task === "serve" || task === "version") { + return; + } + const isDevBuild = coreCompiler.version.includes("-dev."); + let startupMsg; + if (isDevBuild) { + startupMsg = logger.yellow(`[LOCAL DEV] v${coreCompiler.version}`); + } else { + startupMsg = logger.cyan(`v${coreCompiler.version}`); + } + startupMsg += logger.emoji(" " + coreCompiler.vermoji); + logger.info(startupMsg); +}; +var loadedCompilerLog = (sys, logger, flags, coreCompiler) => { + const sysDetails = sys.details; + const runtimeInfo = `${sys.name} ${sys.version}`; + const platformInfo = sysDetails ? `${sysDetails.platform}, ${sysDetails.cpuModel}` : `Unknown Platform, Unknown CPU Model`; + const statsInfo = sysDetails ? `cpus: ${sys.hardwareConcurrency}, freemem: ${Math.round( + sysDetails.freemem() / 1e6 + )}MB, totalmem: ${Math.round(sysDetails.totalmem / 1e6)}MB` : "Unknown CPU Core Count, Unknown Memory"; + if (logger.getLevel() === "debug") { + logger.debug(runtimeInfo); + logger.debug(platformInfo); + logger.debug(statsInfo); + logger.debug(`compiler: ${sys.getCompilerExecutingPath()}`); + logger.debug(`build: ${coreCompiler.buildId}`); + } else if (flags.ci) { + logger.info(runtimeInfo); + logger.info(platformInfo); + logger.info(statsInfo); + } +}; +var startupCompilerLog = (coreCompiler, config) => { + if (config.suppressLogs === true) { + return; + } + const { logger } = config; + const isDebug = logger.getLevel() === "debug"; + const isPrerelease = coreCompiler.version.includes("-"); + const isDevBuild = coreCompiler.version.includes("-dev."); + if (isPrerelease && !isDevBuild) { + logger.warn( + logger.yellow( + `This is a prerelease build, undocumented changes might happen at any time. Technical support is not available for prereleases, but any assistance testing is appreciated.` + ) + ); + } + if (config.devMode && !isDebug) { + if (config.buildEs5) { + logger.warn( + `Generating ES5 during development is a very task expensive, initial and incremental builds will be much slower. Drop the '--es5' flag and use a modern browser for development.` + ); + } + if (!config.enableCache) { + logger.warn(`Disabling cache during development will slow down incremental builds.`); + } + } +}; + +// src/cli/check-version.ts +var startCheckVersion = async (config, currentVersion) => { + if (config.devMode && !config.flags.ci && !currentVersion.includes("-dev.") && isFunction(config.sys.checkVersion)) { + return config.sys.checkVersion(config.logger, currentVersion); + } + return null; +}; +var printCheckVersionResults = async (versionChecker) => { + if (versionChecker) { + const checkVersionResults = await versionChecker; + if (isFunction(checkVersionResults)) { + checkVersionResults(); + } + } +}; + +// src/cli/task-prerender.ts +var taskPrerender = async (coreCompiler, config) => { + startupCompilerLog(coreCompiler, config); + const hydrateAppFilePath = config.flags.unknownArgs[0]; + if (typeof hydrateAppFilePath !== "string") { + config.logger.error(`Missing hydrate app script path`); + return config.sys.exit(1); + } + const srcIndexHtmlPath = config.srcIndexHtml; + const diagnostics = await runPrerenderTask(coreCompiler, config, hydrateAppFilePath, void 0, srcIndexHtmlPath); + config.logger.printDiagnostics(diagnostics); + if (diagnostics.some((d) => d.level === "error")) { + return config.sys.exit(1); + } +}; +var runPrerenderTask = async (coreCompiler, config, hydrateAppFilePath, componentGraph, srcIndexHtmlPath) => { + const diagnostics = []; + try { + const prerenderer = await coreCompiler.createPrerenderer(config); + const results = await prerenderer.start({ + hydrateAppFilePath, + componentGraph, + srcIndexHtmlPath + }); + diagnostics.push(...results.diagnostics); + } catch (e) { + catchError(diagnostics, e); + } + return diagnostics; +}; + +// src/cli/task-watch.ts +var taskWatch = async (coreCompiler, config) => { + let devServer = null; + let exitCode = 0; + try { + startupCompilerLog(coreCompiler, config); + const versionChecker = startCheckVersion(config, coreCompiler.version); + const compiler = await coreCompiler.createCompiler(config); + const watcher = await compiler.createWatcher(); + if (!config.sys.getDevServerExecutingPath || !config.sys.dynamicImport || !config.sys.onProcessInterrupt) { + throw new Error( + `Environment doesn't provide required functions: getDevServerExecutingPath, dynamicImport, onProcessInterrupt` + ); + } + if (config.flags.serve) { + const devServerPath = config.sys.getDevServerExecutingPath(); + const { start } = await config.sys.dynamicImport(devServerPath); + devServer = await start(config.devServer, config.logger, watcher); + } + config.sys.onProcessInterrupt(() => { + config.logger.debug(`close watch`); + compiler && compiler.destroy(); + }); + const rmVersionCheckerLog = watcher.on("buildFinish", async () => { + rmVersionCheckerLog(); + printCheckVersionResults(versionChecker); + }); + if (devServer) { + const rmDevServerLog = watcher.on("buildFinish", () => { + var _a; + rmDevServerLog(); + const url = (_a = devServer == null ? void 0 : devServer.browserUrl) != null ? _a : "UNKNOWN URL"; + config.logger.info(`${config.logger.cyan(url)} +`); + }); + } + const closeResults = await watcher.start(); + if (closeResults.exitCode > 0) { + exitCode = closeResults.exitCode; + } + } catch (e) { + exitCode = 1; + config.logger.error(e); + } + if (devServer) { + await devServer.close(); + } + if (exitCode > 0) { + return config.sys.exit(exitCode); + } +}; + +// src/cli/telemetry/helpers.ts +var tryFn = async (fn, ...args) => { + try { + return await fn(...args); + } catch { + } + return null; +}; +var isInteractive = (sys, flags, object) => { + const terminalInfo = object || Object.freeze({ + tty: sys.isTTY() ? true : false, + ci: ["CI", "BUILD_ID", "BUILD_NUMBER", "BITBUCKET_COMMIT", "CODEBUILD_BUILD_ARN"].filter( + (v) => { + var _a; + return !!((_a = sys.getEnvironmentVar) == null ? void 0 : _a.call(sys, v)); + } + ).length > 0 || !!flags.ci + }); + return terminalInfo.tty && !terminalInfo.ci; +}; +var UUID_REGEX = new RegExp(/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i); +function uuidv4() { + return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => { + const r = Math.random() * 16 | 0; + const v = c == "x" ? r : r & 3 | 8; + return v.toString(16); + }); +} +async function readJson(sys, path) { + const file = await sys.readFile(path); + return !!file && JSON.parse(file); +} +function hasDebug(flags) { + return !!flags.debug; +} +function hasVerbose(flags) { + return !!flags.verbose && hasDebug(flags); +} + +// src/cli/ionic-config.ts +var isTest = () => process.env.JEST_WORKER_ID !== void 0; +var defaultConfig = (sys) => sys.resolvePath(`${sys.homeDir()}/.ionic/${isTest() ? "tmp-config.json" : "config.json"}`); +var defaultConfigDirectory = (sys) => sys.resolvePath(`${sys.homeDir()}/.ionic`); +async function readConfig(sys) { + let config = await readJson(sys, defaultConfig(sys)); + if (!config) { + config = { + "tokens.telemetry": uuidv4(), + "telemetry.stencil": true + }; + await writeConfig(sys, config); + } else if (!config["tokens.telemetry"] || !UUID_REGEX.test(config["tokens.telemetry"])) { + const newUuid = uuidv4(); + await writeConfig(sys, { ...config, "tokens.telemetry": newUuid }); + config["tokens.telemetry"] = newUuid; + } + return config; +} +async function writeConfig(sys, config) { + let result = false; + try { + await sys.createDir(defaultConfigDirectory(sys), { recursive: true }); + await sys.writeFile(defaultConfig(sys), JSON.stringify(config, null, 2)); + result = true; + } catch (error) { + console.error(`Stencil Telemetry: couldn't write configuration file to ${defaultConfig(sys)} - ${error}.`); + } + return result; +} +async function updateConfig(sys, newOptions) { + const config = await readConfig(sys); + return await writeConfig(sys, Object.assign(config, newOptions)); +} + +// src/cli/telemetry/shouldTrack.ts +async function shouldTrack(config, sys, ci) { + return !ci && isInteractive(sys, config.flags) && await checkTelemetry(sys); +} + +// src/cli/telemetry/telemetry.ts +async function telemetryBuildFinishedAction(sys, config, coreCompiler, result) { + const tracking = await shouldTrack(config, sys, !!config.flags.ci); + if (!tracking) { + return; + } + const component_count = result.componentGraph ? Object.keys(result.componentGraph).length : void 0; + const data = await prepareData(coreCompiler, config, sys, result.duration, component_count); + await sendMetric(sys, config, "stencil_cli_command", data); + config.logger.debug(`${config.logger.blue("Telemetry")}: ${config.logger.gray(JSON.stringify(data))}`); +} +async function telemetryAction(sys, config, coreCompiler, action) { + const tracking = await shouldTrack(config, sys, !!config.flags.ci); + let duration = void 0; + let error; + if (action) { + const start = /* @__PURE__ */ new Date(); + try { + await action(); + } catch (e) { + error = e; + } + const end = /* @__PURE__ */ new Date(); + duration = end.getTime() - start.getTime(); + } + if (!tracking || config.flags.task == "build" && !config.flags.args.includes("--watch")) { + return; + } + const data = await prepareData(coreCompiler, config, sys, duration); + await sendMetric(sys, config, "stencil_cli_command", data); + config.logger.debug(`${config.logger.blue("Telemetry")}: ${config.logger.gray(JSON.stringify(data))}`); + if (error) { + throw error; + } +} +function hasAppTarget(config) { + return config.outputTargets.some( + (target) => target.type === WWW && (!!target.serviceWorker || !!target.baseUrl && target.baseUrl !== "/") + ); +} +function isUsingYarn(sys) { + var _a, _b; + return ((_b = (_a = sys.getEnvironmentVar) == null ? void 0 : _a.call(sys, "npm_execpath")) == null ? void 0 : _b.includes("yarn")) || false; +} +function getActiveTargets(config) { + const result = config.outputTargets.map((t) => t.type); + return Array.from(new Set(result)); +} +var prepareData = async (coreCompiler, config, sys, duration_ms, component_count = void 0) => { + var _a, _b, _c; + const { typescript, rollup } = coreCompiler.versions || { typescript: "unknown", rollup: "unknown" }; + const { packages, packagesNoVersions } = await getInstalledPackages(sys, config); + const targets = getActiveTargets(config); + const yarn = isUsingYarn(sys); + const stencil = coreCompiler.version || "unknown"; + const system = `${sys.name} ${sys.version}`; + const os_name = (_a = sys.details) == null ? void 0 : _a.platform; + const os_version = (_b = sys.details) == null ? void 0 : _b.release; + const cpu_model = (_c = sys.details) == null ? void 0 : _c.cpuModel; + const build = coreCompiler.buildId || "unknown"; + const has_app_pwa_config = hasAppTarget(config); + const anonymizedConfig = anonymizeConfigForTelemetry(config); + return { + arguments: config.flags.args, + build, + component_count, + config: anonymizedConfig, + cpu_model, + duration_ms, + has_app_pwa_config, + os_name, + os_version, + packages, + packages_no_versions: packagesNoVersions, + rollup, + stencil, + system, + system_major: getMajorVersion(system), + targets, + task: config.flags.task, + typescript, + yarn + }; +}; +var OUTPUT_TARGET_KEYS_TO_KEEP = ["type"]; +var CONFIG_PROPS_TO_ANONYMIZE = [ + "rootDir", + "fsNamespace", + "packageJsonFilePath", + "namespace", + "srcDir", + "srcIndexHtml", + "buildLogFilePath", + "cacheDir", + "configPath", + "tsconfig" +]; +var CONFIG_PROPS_TO_DELETE = [ + "commonjs", + "devServer", + "env", + "logger", + "rollupConfig", + "sys", + "testing", + "tsCompilerOptions" +]; +var anonymizeConfigForTelemetry = (config) => { + const anonymizedConfig = { ...config }; + for (const prop of CONFIG_PROPS_TO_ANONYMIZE) { + if (anonymizedConfig[prop] !== void 0) { + anonymizedConfig[prop] = "omitted"; + } + } + anonymizedConfig.outputTargets = config.outputTargets.map((target) => { + const anonymizedOT = JSON.parse( + JSON.stringify(target, (key, value) => { + if (!(typeof value === "string")) { + return value; + } + if (OUTPUT_TARGET_KEYS_TO_KEEP.includes(key)) { + return value; + } + return "omitted"; + }) + ); + if (isOutputTargetHydrate(target) && target.external) { + anonymizedOT["external"] = target.external.concat(); + } + return anonymizedOT; + }); + for (const prop of CONFIG_PROPS_TO_DELETE) { + delete anonymizedConfig[prop]; + } + return anonymizedConfig; +}; +async function getInstalledPackages(sys, config) { + let packages = []; + let packagesNoVersions = []; + const yarn = isUsingYarn(sys); + try { + const appRootDir = sys.getCurrentDirectory(); + const packageJson = await tryFn( + readJson, + sys, + sys.resolvePath(appRootDir + "/package.json") + ); + if (!packageJson) { + return { packages, packagesNoVersions }; + } + const rawPackages = Object.entries({ + ...packageJson.devDependencies, + ...packageJson.dependencies + }); + const ionicPackages = rawPackages.filter( + ([k]) => k.startsWith("@stencil/") || k.startsWith("@ionic/") || k.startsWith("@capacitor/") + ); + try { + packages = yarn ? await yarnPackages(sys, ionicPackages) : await npmPackages(sys, ionicPackages); + } catch (e) { + packages = ionicPackages.map(([k, v]) => `${k}@${v.replace("^", "")}`); + } + packagesNoVersions = ionicPackages.map(([k]) => `${k}`); + return { packages, packagesNoVersions }; + } catch (err2) { + hasDebug(config.flags) && console.error(err2); + return { packages, packagesNoVersions }; + } +} +async function npmPackages(sys, ionicPackages) { + const appRootDir = sys.getCurrentDirectory(); + const packageLockJson = await tryFn(readJson, sys, sys.resolvePath(appRootDir + "/package-lock.json")); + return ionicPackages.map(([k, v]) => { + var _a, _b, _c, _d; + let version = (_d = (_c = (_a = packageLockJson == null ? void 0 : packageLockJson.dependencies[k]) == null ? void 0 : _a.version) != null ? _c : (_b = packageLockJson == null ? void 0 : packageLockJson.devDependencies[k]) == null ? void 0 : _b.version) != null ? _d : v; + version = version.includes("file:") ? sanitizeDeclaredVersion(v) : version; + return `${k}@${version}`; + }); +} +async function yarnPackages(sys, ionicPackages) { + var _a; + const appRootDir = sys.getCurrentDirectory(); + const yarnLock = sys.readFileSync(sys.resolvePath(appRootDir + "/yarn.lock")); + const yarnLockYml = (_a = sys.parseYarnLockFile) == null ? void 0 : _a.call(sys, yarnLock); + return ionicPackages.map(([k, v]) => { + var _a2; + const identifiedVersion = `${k}@${v}`; + let version = (_a2 = yarnLockYml == null ? void 0 : yarnLockYml.object[identifiedVersion]) == null ? void 0 : _a2.version; + version = version && version.includes("undefined") ? sanitizeDeclaredVersion(identifiedVersion) : version; + return `${k}@${version}`; + }); +} +function sanitizeDeclaredVersion(version) { + return version.replace(/[*^~]/g, ""); +} +async function sendMetric(sys, config, name, value) { + const session_id = await getTelemetryToken(sys); + const message = { + name, + timestamp: (/* @__PURE__ */ new Date()).toISOString(), + source: "stencil_cli", + value, + session_id + }; + await sendTelemetry(sys, config, message); +} +async function getTelemetryToken(sys) { + const config = await readConfig(sys); + if (config["tokens.telemetry"] === void 0) { + config["tokens.telemetry"] = uuidv4(); + await writeConfig(sys, config); + } + return config["tokens.telemetry"]; +} +async function sendTelemetry(sys, config, data) { + try { + const now = (/* @__PURE__ */ new Date()).toISOString(); + const body = { + metrics: [data], + sent_at: now + }; + if (!sys.fetch) { + throw new Error("No fetch implementation available"); + } + const response = await sys.fetch("https://api.ionicjs.com/events/metrics", { + method: "POST", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(body) + }); + hasVerbose(config.flags) && console.debug("\nSent %O metric to events service (status: %O)", data.name, response.status, "\n"); + if (response.status !== 204) { + hasVerbose(config.flags) && console.debug("\nBad response from events service. Request body: %O", response.body.toString(), "\n"); + } + } catch (e) { + hasVerbose(config.flags) && console.debug("Telemetry request failed:", e); + } +} +async function checkTelemetry(sys) { + const config = await readConfig(sys); + if (config["telemetry.stencil"] === void 0) { + config["telemetry.stencil"] = true; + await writeConfig(sys, config); + } + return config["telemetry.stencil"]; +} +async function enableTelemetry(sys) { + return await updateConfig(sys, { "telemetry.stencil": true }); +} +async function disableTelemetry(sys) { + return await updateConfig(sys, { "telemetry.stencil": false }); +} +function getMajorVersion(version) { + const parts = version.split("."); + return parts[0]; +} + +// src/cli/task-build.ts +var taskBuild = async (coreCompiler, config) => { + if (config.flags.watch) { + await taskWatch(coreCompiler, config); + return; + } + let exitCode = 0; + try { + startupCompilerLog(coreCompiler, config); + const versionChecker = startCheckVersion(config, coreCompiler.version); + const compiler = await coreCompiler.createCompiler(config); + const results = await compiler.build(); + await telemetryBuildFinishedAction(config.sys, config, coreCompiler, results); + await compiler.destroy(); + if (results.hasError) { + exitCode = 1; + } else if (config.flags.prerender) { + const prerenderDiagnostics = await runPrerenderTask( + coreCompiler, + config, + results.hydrateAppFilePath, + results.componentGraph, + void 0 + ); + config.logger.printDiagnostics(prerenderDiagnostics); + if (prerenderDiagnostics.some((d) => d.level === "error")) { + exitCode = 1; + } + } + await printCheckVersionResults(versionChecker); + } catch (e) { + exitCode = 1; + config.logger.error(e); + } + if (exitCode > 0) { + return config.sys.exit(exitCode); + } +}; + +// src/cli/task-docs.ts +var taskDocs = async (coreCompiler, config) => { + config.devServer = {}; + config.outputTargets = config.outputTargets.filter(isOutputTargetDocs); + config.devMode = true; + startupCompilerLog(coreCompiler, config); + const compiler = await coreCompiler.createCompiler(config); + await compiler.build(); + await compiler.destroy(); +}; + +// src/cli/task-generate.ts +var import_path2 = require("path"); +var taskGenerate = async (config) => { + if (!config.configPath) { + config.logger.error("Please run this command in your root directory (i. e. the one containing stencil.config.ts)."); + return config.sys.exit(1); + } + const absoluteSrcDir = config.srcDir; + if (!absoluteSrcDir) { + config.logger.error(`Stencil's srcDir was not specified.`); + return config.sys.exit(1); + } + const { prompt } = await Promise.resolve().then(() => __toESM(require_lib())); + const input = config.flags.unknownArgs.find((arg) => !arg.startsWith("-")) || (await prompt({ name: "tagName", type: "text", message: "Component tag name (dash-case):" })).tagName; + if (void 0 === input) { + return; + } + const { dir, base: componentName } = (0, import_path2.parse)(input); + const tagError = validateComponentTag(componentName); + if (tagError) { + config.logger.error(tagError); + return config.sys.exit(1); + } + let cssExtension = "css"; + if (!!config.plugins.find((plugin) => plugin.name === "sass")) { + cssExtension = await chooseSassExtension(); + } else if (!!config.plugins.find((plugin) => plugin.name === "less")) { + cssExtension = "less"; + } + const filesToGenerateExt = await chooseFilesToGenerate(cssExtension); + if (!filesToGenerateExt) { + return; + } + const extensionsToGenerate = ["tsx", ...filesToGenerateExt]; + const testFolder = extensionsToGenerate.some(isTest2) ? "test" : ""; + const outDir = (0, import_path2.join)(absoluteSrcDir, "components", dir, componentName); + await config.sys.createDir(normalizePath((0, import_path2.join)(outDir, testFolder)), { recursive: true }); + const filesToGenerate = extensionsToGenerate.map((extension) => ({ + extension, + path: getFilepathForFile(outDir, componentName, extension) + })); + await checkForOverwrite(filesToGenerate, config); + const writtenFiles = await Promise.all( + filesToGenerate.map( + (file) => getBoilerplateAndWriteFile( + config, + componentName, + extensionsToGenerate.includes("css") || extensionsToGenerate.includes("sass") || extensionsToGenerate.includes("scss") || extensionsToGenerate.includes("less"), + file, + cssExtension + ) + ) + ).catch((error) => config.logger.error(error)); + if (!writtenFiles) { + return config.sys.exit(1); + } + console.log(); + console.log(`${config.logger.gray("$")} stencil generate ${input}`); + console.log(); + console.log(config.logger.bold("The following files have been generated:")); + const absoluteRootDir = config.rootDir; + writtenFiles.map((file) => console.log(` - ${(0, import_path2.relative)(absoluteRootDir, file)}`)); +}; +var chooseFilesToGenerate = async (cssExtension) => { + const { prompt } = await Promise.resolve().then(() => __toESM(require_lib())); + return (await prompt({ + name: "filesToGenerate", + type: "multiselect", + message: "Which additional files do you want to generate?", + choices: [ + { value: cssExtension, title: `Stylesheet (.${cssExtension})`, selected: true }, + { value: "spec.tsx", title: "Spec Test (.spec.tsx)", selected: true }, + { value: "e2e.ts", title: "E2E Test (.e2e.ts)", selected: true } + ] + })).filesToGenerate; +}; +var chooseSassExtension = async () => { + const { prompt } = await Promise.resolve().then(() => __toESM(require_lib())); + return (await prompt({ + name: "sassFormat", + type: "select", + message: "Which Sass format would you like to use? (More info: https://sass-lang.com/documentation/syntax/#the-indented-syntax)", + choices: [ + { value: "sass", title: `*.sass Format`, selected: true }, + { value: "scss", title: "*.scss Format" } + ] + })).sassFormat; +}; +var getFilepathForFile = (filePath, componentName, extension) => isTest2(extension) ? normalizePath((0, import_path2.join)(filePath, "test", `${componentName}.${extension}`)) : normalizePath((0, import_path2.join)(filePath, `${componentName}.${extension}`)); +var getBoilerplateAndWriteFile = async (config, componentName, withCss, file, styleExtension) => { + const boilerplate = getBoilerplateByExtension(componentName, file.extension, withCss, styleExtension); + await config.sys.writeFile(normalizePath(file.path), boilerplate); + return file.path; +}; +var checkForOverwrite = async (files, config) => { + const alreadyPresent = []; + await Promise.all( + files.map(async ({ path }) => { + if (await config.sys.readFile(path) !== void 0) { + alreadyPresent.push(path); + } + }) + ); + if (alreadyPresent.length > 0) { + config.logger.error( + "Generating code would overwrite the following files:", + ...alreadyPresent.map((path) => " " + normalizePath(path)) + ); + await config.sys.exit(1); + } +}; +var isTest2 = (extension) => { + return extension === "e2e.ts" || extension === "spec.tsx"; +}; +var getBoilerplateByExtension = (tagName, extension, withCss, styleExtension) => { + switch (extension) { + case "tsx": + return getComponentBoilerplate(tagName, withCss, styleExtension); + case "css": + case "less": + case "sass": + case "scss": + return getStyleUrlBoilerplate(styleExtension); + case "spec.tsx": + return getSpecTestBoilerplate(tagName); + case "e2e.ts": + return getE2eTestBoilerplate(tagName); + default: + throw new Error(`Unkown extension "${extension}".`); + } +}; +var getComponentBoilerplate = (tagName, hasStyle, styleExtension) => { + const decorator = [`{`]; + decorator.push(` tag: '${tagName}',`); + if (hasStyle) { + decorator.push(` styleUrl: '${tagName}.${styleExtension}',`); + } + decorator.push(` shadow: true,`); + decorator.push(`}`); + return `import { Component, Host, h } from '@stencil/core'; + +@Component(${decorator.join("\n")}) +export class ${toPascalCase(tagName)} { + render() { + return ( + + + + ); + } +} +`; +}; +var getStyleUrlBoilerplate = (ext) => ext === "sass" ? `:host + display: block +` : `:host { + display: block; +} +`; +var getSpecTestBoilerplate = (tagName) => `import { newSpecPage } from '@stencil/core/testing'; +import { ${toPascalCase(tagName)} } from '../${tagName}'; + +describe('${tagName}', () => { + it('renders', async () => { + const page = await newSpecPage({ + components: [${toPascalCase(tagName)}], + html: \`<${tagName}>\`, + }); + expect(page.root).toEqualHtml(\` + <${tagName}> + + + + + \`); + }); +}); +`; +var getE2eTestBoilerplate = (tagName) => `import { newE2EPage } from '@stencil/core/testing'; + +describe('${tagName}', () => { + it('renders', async () => { + const page = await newE2EPage(); + await page.setContent('<${tagName}>'); + + const element = await page.find('${tagName}'); + expect(element).toHaveClass('hydrated'); + }); +}); +`; +var toPascalCase = (str) => str.split("-").reduce((res, part) => res + part[0].toUpperCase() + part.slice(1), ""); + +// src/cli/task-telemetry.ts +var taskTelemetry = async (flags, sys, logger) => { + var _a; + const prompt = logger.dim(((_a = sys.details) == null ? void 0 : _a.platform) === "windows" ? ">" : "$"); + const isEnabling = flags.args.includes("on"); + const isDisabling = flags.args.includes("off"); + const INFORMATION = `Opt in or out of telemetry. Information about the data we collect is available on our website: ${logger.bold( + "https://stenciljs.com/telemetry" + )}`; + const THANK_YOU = `Thank you for helping to make Stencil better! \u{1F496}`; + const ENABLED_MESSAGE = `${logger.green("Enabled")}. ${THANK_YOU} + +`; + const DISABLED_MESSAGE = `${logger.red("Disabled")} + +`; + const hasTelemetry = await checkTelemetry(sys); + if (isEnabling) { + const result = await enableTelemetry(sys); + result ? console.log(` + ${logger.bold("Telemetry is now ") + ENABLED_MESSAGE}`) : console.log(`Something went wrong when enabling Telemetry.`); + return; + } + if (isDisabling) { + const result = await disableTelemetry(sys); + result ? console.log(` + ${logger.bold("Telemetry is now ") + DISABLED_MESSAGE}`) : console.log(`Something went wrong when disabling Telemetry.`); + return; + } + console.log(` ${logger.bold("Telemetry:")} ${logger.dim(INFORMATION)}`); + console.log(` + ${logger.bold("Status")}: ${hasTelemetry ? ENABLED_MESSAGE : DISABLED_MESSAGE}`); + console.log(` ${prompt} ${logger.green("stencil telemetry [off|on]")} + + ${logger.cyan("off")} ${logger.dim(".............")} Disable sharing anonymous usage data + ${logger.cyan("on")} ${logger.dim("..............")} Enable sharing anonymous usage data + `); +}; + +// src/cli/task-help.ts +var taskHelp = async (flags, logger, sys) => { + var _a; + const prompt = logger.dim(((_a = sys.details) == null ? void 0 : _a.platform) === "windows" ? ">" : "$"); + console.log(` + ${logger.bold("Build:")} ${logger.dim("Build components for development or production.")} + + ${prompt} ${logger.green("stencil build [--dev] [--watch] [--prerender] [--debug]")} + + ${logger.cyan("--dev")} ${logger.dim(".............")} Development build + ${logger.cyan("--watch")} ${logger.dim("...........")} Rebuild when files update + ${logger.cyan("--serve")} ${logger.dim("...........")} Start the dev-server + ${logger.cyan("--prerender")} ${logger.dim(".......")} Prerender the application + ${logger.cyan("--docs")} ${logger.dim("............")} Generate component readme.md docs + ${logger.cyan("--config")} ${logger.dim("..........")} Set stencil config file + ${logger.cyan("--stats")} ${logger.dim("...........")} Write stencil-stats.json file + ${logger.cyan("--log")} ${logger.dim(".............")} Write stencil-build.log file + ${logger.cyan("--debug")} ${logger.dim("...........")} Set the log level to debug + + + ${logger.bold("Test:")} ${logger.dim("Run unit and end-to-end tests.")} + + ${prompt} ${logger.green("stencil test [--spec] [--e2e]")} + + ${logger.cyan("--spec")} ${logger.dim("............")} Run unit tests with Jest + ${logger.cyan("--e2e")} ${logger.dim(".............")} Run e2e tests with Puppeteer + + + ${logger.bold("Generate:")} ${logger.dim("Bootstrap components.")} + + ${prompt} ${logger.green("stencil generate")} or ${logger.green("stencil g")} + +`); + await taskTelemetry(flags, sys, logger); + console.log(` + ${logger.bold("Examples:")} + + ${prompt} ${logger.green("stencil build --dev --watch --serve")} + ${prompt} ${logger.green("stencil build --prerender")} + ${prompt} ${logger.green("stencil test --spec --e2e")} + ${prompt} ${logger.green("stencil telemetry on")} + ${prompt} ${logger.green("stencil generate")} + ${prompt} ${logger.green("stencil g my-component")} +`); +}; + +// src/cli/task-info.ts +var taskInfo = (coreCompiler, sys, logger) => { + const details = sys.details; + const versions = coreCompiler.versions; + console.log(``); + console.log(`${logger.cyan(" System:")} ${sys.name} ${sys.version}`); + if (details) { + console.log(`${logger.cyan(" Platform:")} ${details.platform} (${details.release})`); + console.log( + `${logger.cyan(" CPU Model:")} ${details.cpuModel} (${sys.hardwareConcurrency} cpu${sys.hardwareConcurrency !== 1 ? "s" : ""})` + ); + } + console.log(`${logger.cyan(" Compiler:")} ${sys.getCompilerExecutingPath()}`); + console.log(`${logger.cyan(" Build:")} ${coreCompiler.buildId}`); + console.log(`${logger.cyan(" Stencil:")} ${coreCompiler.version}${logger.emoji(" " + coreCompiler.vermoji)}`); + console.log(`${logger.cyan(" TypeScript:")} ${versions.typescript}`); + console.log(`${logger.cyan(" Rollup:")} ${versions.rollup}`); + console.log(`${logger.cyan(" Parse5:")} ${versions.parse5}`); + console.log(`${logger.cyan(" jQuery:")} ${versions.jquery}`); + console.log(`${logger.cyan(" Terser:")} ${versions.terser}`); + console.log(``); +}; + +// src/cli/task-serve.ts +var taskServe = async (config) => { + config.suppressLogs = true; + config.flags.serve = true; + config.devServer.openBrowser = !!config.flags.open; + config.devServer.reloadStrategy = null; + config.devServer.initialLoadUrl = "/"; + config.devServer.websocket = false; + config.maxConcurrentWorkers = 1; + config.devServer.root = isString(config.flags.root) ? config.flags.root : config.sys.getCurrentDirectory(); + if (!config.sys.getDevServerExecutingPath || !config.sys.dynamicImport || !config.sys.onProcessInterrupt) { + throw new Error( + `Environment doesn't provide required functions: getDevServerExecutingPath, dynamicImport, onProcessInterrupt` + ); + } + const devServerPath = config.sys.getDevServerExecutingPath(); + const { start } = await config.sys.dynamicImport(devServerPath); + const devServer = await start(config.devServer, config.logger); + console.log(`${config.logger.cyan(" Root:")} ${devServer.root}`); + console.log(`${config.logger.cyan(" Address:")} ${devServer.address}`); + console.log(`${config.logger.cyan(" Port:")} ${devServer.port}`); + console.log(`${config.logger.cyan(" Server:")} ${devServer.browserUrl}`); + console.log(``); + config.sys.onProcessInterrupt(() => { + if (devServer) { + config.logger.debug(`dev server close: ${devServer.browserUrl}`); + devServer.close(); + } + }); +}; + +// src/cli/task-test.ts +var taskTest = async (config) => { + var _a; + config.buildDocs = false; + const testingRunOpts = { + e2e: !!config.flags.e2e, + screenshot: !!config.flags.screenshot, + spec: !!config.flags.spec, + updateScreenshot: !!config.flags.updateScreenshot + }; + const ensureModuleIds = ["@types/jest", "jest", "jest-cli"]; + if (testingRunOpts.e2e) { + const puppeteer = config.testing.browserExecutablePath ? "puppeteer-core" : "puppeteer"; + ensureModuleIds.push(puppeteer); + if (testingRunOpts.screenshot) { + config.logger.warn( + config.logger.yellow( + `EXPERIMENTAL: screenshot visual diff testing is currently under heavy development and has not reached a stable status. However, any assistance testing would be appreciated.` + ) + ); + } + } + const diagnostics = await ((_a = config.sys.lazyRequire) == null ? void 0 : _a.ensure(config.rootDir, ensureModuleIds)); + if (diagnostics && diagnostics.length > 0) { + config.logger.printDiagnostics(diagnostics); + return config.sys.exit(1); + } + try { + const { createTesting } = await import("../testing/index.js"); + const testing = await createTesting(config); + const passed = await testing.run(testingRunOpts); + await testing.destroy(); + if (!passed) { + return config.sys.exit(1); + } + } catch (e) { + config.logger.error(e); + return config.sys.exit(1); + } +}; + +// src/cli/run.ts +var run = async (init) => { + const { args, logger, sys } = init; + try { + const flags = parseFlags(args); + const task = flags.task; + if (flags.debug || flags.verbose) { + logger.setLevel("debug"); + } + if (flags.ci) { + logger.enableColors(false); + } + if (isFunction(sys.applyGlobalPatch)) { + sys.applyGlobalPatch(sys.getCurrentDirectory()); + } + if (task && task === "version" || flags.version) { + const coreCompiler2 = await loadCoreCompiler(sys); + console.log(coreCompiler2.version); + return; + } + if (!task || task === "help" || flags.help) { + await taskHelp(createConfigFlags({ task: "help", args }), logger, sys); + return; + } + startupLog(logger, task); + const findConfigResults = await findConfig({ sys, configPath: flags.config }); + if (findConfigResults.isErr) { + logger.printDiagnostics(findConfigResults.value); + return sys.exit(1); + } + const coreCompiler = await loadCoreCompiler(sys); + startupLogVersion(logger, task, coreCompiler); + loadedCompilerLog(sys, logger, flags, coreCompiler); + if (task === "info") { + taskInfo(coreCompiler, sys, logger); + return; + } + const foundConfig = result_exports.unwrap(findConfigResults); + const validated = await coreCompiler.loadConfig({ + config: { + flags + }, + configPath: foundConfig.configPath, + logger, + sys + }); + if (validated.diagnostics.length > 0) { + logger.printDiagnostics(validated.diagnostics); + if (hasError(validated.diagnostics)) { + return sys.exit(1); + } + } + if (isFunction(sys.applyGlobalPatch)) { + sys.applyGlobalPatch(validated.config.rootDir); + } + await telemetryAction(sys, validated.config, coreCompiler, async () => { + await runTask(coreCompiler, validated.config, task, sys); + }); + } catch (e) { + if (!shouldIgnoreError(e)) { + const details = `${logger.getLevel() === "debug" && e instanceof Error ? e.stack : ""}`; + logger.error(`uncaught cli error: ${e}${details}`); + return sys.exit(1); + } + } +}; +var runTask = async (coreCompiler, config, task, sys) => { + var _a; + const flags = createConfigFlags((_a = config.flags) != null ? _a : { task }); + config.flags = flags; + if (!config.sys) { + config.sys = sys; + } + const strictConfig = coreCompiler.validateConfig(config, {}).config; + switch (task) { + case "build": + await taskBuild(coreCompiler, strictConfig); + break; + case "docs": + await taskDocs(coreCompiler, strictConfig); + break; + case "generate": + case "g": + await taskGenerate(strictConfig); + break; + case "help": + await taskHelp(strictConfig.flags, strictConfig.logger, sys); + break; + case "prerender": + await taskPrerender(coreCompiler, strictConfig); + break; + case "serve": + await taskServe(strictConfig); + break; + case "telemetry": + await taskTelemetry(strictConfig.flags, sys, strictConfig.logger); + break; + case "test": + await taskTest(strictConfig); + break; + case "version": + console.log(coreCompiler.version); + break; + default: + strictConfig.logger.error( + `${strictConfig.logger.emoji("\u274C ")}Invalid stencil command, please see the options below:` + ); + await taskHelp(strictConfig.flags, strictConfig.logger, sys); + return config.sys.exit(1); + } +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + BOOLEAN_CLI_FLAGS, + parseFlags, + run, + runTask +}); diff --git a/node_modules/@stencil/core/cli/index.d.ts b/node_modules/@stencil/core/cli/index.d.ts new file mode 100644 index 00000000..fafc2781 --- /dev/null +++ b/node_modules/@stencil/core/cli/index.d.ts @@ -0,0 +1,19 @@ +import type { CliInitOptions, Config, Logger, TaskCommand } from '../internal/index'; +import type { ConfigFlags } from './config-flags'; +/** + * Runs the CLI with the given options. This is used by Stencil's default `bin/stencil` file, + * but can be used externally too. + * @param init a set of initialization options needed to run Stencil from its CLI + * @returns an empty promise + */ +export declare function run(init: CliInitOptions): Promise; +/** + * Run individual CLI tasks. + * @param coreCompiler The core Stencil compiler to be used. The `run()` method handles loading the core compiler, however, `runTask()` must be passed it. + * @param config Assumes the config has already been validated and has the "sys" and "logger" properties. + * @param task The task command to run, such as `build`. + * @returns an empty promise + */ +export declare function runTask(coreCompiler: any, config: Config, task: TaskCommand): Promise; +export declare function parseFlags(args: string[]): ConfigFlags; +export { Config, ConfigFlags, Logger, TaskCommand }; diff --git a/node_modules/@stencil/core/cli/index.js b/node_modules/@stencil/core/cli/index.js new file mode 100644 index 00000000..9f1441bd --- /dev/null +++ b/node_modules/@stencil/core/cli/index.js @@ -0,0 +1,4079 @@ +/*! + Stencil CLI v4.22.2 | MIT Licensed | https://stenciljs.com + */ +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { + get: (a, b) => (typeof require !== "undefined" ? require : a)[b] +}) : x)(function(x) { + if (typeof require !== "undefined") return require.apply(this, arguments); + throw Error('Dynamic require of "' + x + '" is not supported'); +}); +var __commonJS = (cb, mod) => function __require2() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); + +// node_modules/kleur/index.js +var require_kleur = __commonJS({ + "node_modules/kleur/index.js"(exports, module) { + "use strict"; + var { FORCE_COLOR, NODE_DISABLE_COLORS, TERM } = process.env; + var $ = { + enabled: !NODE_DISABLE_COLORS && TERM !== "dumb" && FORCE_COLOR !== "0", + // modifiers + reset: init(0, 0), + bold: init(1, 22), + dim: init(2, 22), + italic: init(3, 23), + underline: init(4, 24), + inverse: init(7, 27), + hidden: init(8, 28), + strikethrough: init(9, 29), + // colors + black: init(30, 39), + red: init(31, 39), + green: init(32, 39), + yellow: init(33, 39), + blue: init(34, 39), + magenta: init(35, 39), + cyan: init(36, 39), + white: init(37, 39), + gray: init(90, 39), + grey: init(90, 39), + // background colors + bgBlack: init(40, 49), + bgRed: init(41, 49), + bgGreen: init(42, 49), + bgYellow: init(43, 49), + bgBlue: init(44, 49), + bgMagenta: init(45, 49), + bgCyan: init(46, 49), + bgWhite: init(47, 49) + }; + function run2(arr, str) { + let i = 0, tmp, beg = "", end = ""; + for (; i < arr.length; i++) { + tmp = arr[i]; + beg += tmp.open; + end += tmp.close; + if (str.includes(tmp.close)) { + str = str.replace(tmp.rgx, tmp.close + tmp.open); + } + } + return beg + str + end; + } + function chain(has, keys) { + let ctx = { has, keys }; + ctx.reset = $.reset.bind(ctx); + ctx.bold = $.bold.bind(ctx); + ctx.dim = $.dim.bind(ctx); + ctx.italic = $.italic.bind(ctx); + ctx.underline = $.underline.bind(ctx); + ctx.inverse = $.inverse.bind(ctx); + ctx.hidden = $.hidden.bind(ctx); + ctx.strikethrough = $.strikethrough.bind(ctx); + ctx.black = $.black.bind(ctx); + ctx.red = $.red.bind(ctx); + ctx.green = $.green.bind(ctx); + ctx.yellow = $.yellow.bind(ctx); + ctx.blue = $.blue.bind(ctx); + ctx.magenta = $.magenta.bind(ctx); + ctx.cyan = $.cyan.bind(ctx); + ctx.white = $.white.bind(ctx); + ctx.gray = $.gray.bind(ctx); + ctx.grey = $.grey.bind(ctx); + ctx.bgBlack = $.bgBlack.bind(ctx); + ctx.bgRed = $.bgRed.bind(ctx); + ctx.bgGreen = $.bgGreen.bind(ctx); + ctx.bgYellow = $.bgYellow.bind(ctx); + ctx.bgBlue = $.bgBlue.bind(ctx); + ctx.bgMagenta = $.bgMagenta.bind(ctx); + ctx.bgCyan = $.bgCyan.bind(ctx); + ctx.bgWhite = $.bgWhite.bind(ctx); + return ctx; + } + function init(open, close) { + let blk = { + open: `\x1B[${open}m`, + close: `\x1B[${close}m`, + rgx: new RegExp(`\\x1b\\[${close}m`, "g") + }; + return function(txt) { + if (this !== void 0 && this.has !== void 0) { + this.has.includes(open) || (this.has.push(open), this.keys.push(blk)); + return txt === void 0 ? this : $.enabled ? run2(this.keys, txt + "") : txt + ""; + } + return txt === void 0 ? chain([open], [blk]) : $.enabled ? run2([blk], txt + "") : txt + ""; + }; + } + module.exports = $; + } +}); + +// node_modules/prompts/lib/util/action.js +var require_action = __commonJS({ + "node_modules/prompts/lib/util/action.js"(exports, module) { + "use strict"; + module.exports = (key, isSelect) => { + if (key.meta && key.name !== "escape") return; + if (key.ctrl) { + if (key.name === "a") return "first"; + if (key.name === "c") return "abort"; + if (key.name === "d") return "abort"; + if (key.name === "e") return "last"; + if (key.name === "g") return "reset"; + } + if (isSelect) { + if (key.name === "j") return "down"; + if (key.name === "k") return "up"; + } + if (key.name === "return") return "submit"; + if (key.name === "enter") return "submit"; + if (key.name === "backspace") return "delete"; + if (key.name === "delete") return "deleteForward"; + if (key.name === "abort") return "abort"; + if (key.name === "escape") return "exit"; + if (key.name === "tab") return "next"; + if (key.name === "pagedown") return "nextPage"; + if (key.name === "pageup") return "prevPage"; + if (key.name === "home") return "home"; + if (key.name === "end") return "end"; + if (key.name === "up") return "up"; + if (key.name === "down") return "down"; + if (key.name === "right") return "right"; + if (key.name === "left") return "left"; + return false; + }; + } +}); + +// node_modules/prompts/lib/util/strip.js +var require_strip = __commonJS({ + "node_modules/prompts/lib/util/strip.js"(exports, module) { + "use strict"; + module.exports = (str) => { + const pattern = [ + "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", + "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))" + ].join("|"); + const RGX = new RegExp(pattern, "g"); + return typeof str === "string" ? str.replace(RGX, "") : str; + }; + } +}); + +// node_modules/sisteransi/src/index.js +var require_src = __commonJS({ + "node_modules/sisteransi/src/index.js"(exports, module) { + "use strict"; + var ESC = "\x1B"; + var CSI = `${ESC}[`; + var beep = "\x07"; + var cursor = { + to(x, y) { + if (!y) return `${CSI}${x + 1}G`; + return `${CSI}${y + 1};${x + 1}H`; + }, + move(x, y) { + let ret = ""; + if (x < 0) ret += `${CSI}${-x}D`; + else if (x > 0) ret += `${CSI}${x}C`; + if (y < 0) ret += `${CSI}${-y}A`; + else if (y > 0) ret += `${CSI}${y}B`; + return ret; + }, + up: (count = 1) => `${CSI}${count}A`, + down: (count = 1) => `${CSI}${count}B`, + forward: (count = 1) => `${CSI}${count}C`, + backward: (count = 1) => `${CSI}${count}D`, + nextLine: (count = 1) => `${CSI}E`.repeat(count), + prevLine: (count = 1) => `${CSI}F`.repeat(count), + left: `${CSI}G`, + hide: `${CSI}?25l`, + show: `${CSI}?25h`, + save: `${ESC}7`, + restore: `${ESC}8` + }; + var scroll = { + up: (count = 1) => `${CSI}S`.repeat(count), + down: (count = 1) => `${CSI}T`.repeat(count) + }; + var erase = { + screen: `${CSI}2J`, + up: (count = 1) => `${CSI}1J`.repeat(count), + down: (count = 1) => `${CSI}J`.repeat(count), + line: `${CSI}2K`, + lineEnd: `${CSI}K`, + lineStart: `${CSI}1K`, + lines(count) { + let clear = ""; + for (let i = 0; i < count; i++) + clear += this.line + (i < count - 1 ? cursor.up() : ""); + if (count) + clear += cursor.left; + return clear; + } + }; + module.exports = { cursor, scroll, erase, beep }; + } +}); + +// node_modules/prompts/lib/util/clear.js +var require_clear = __commonJS({ + "node_modules/prompts/lib/util/clear.js"(exports, module) { + "use strict"; + var strip = require_strip(); + var { erase, cursor } = require_src(); + var width = (str) => [...strip(str)].length; + module.exports = function(prompt, perLine) { + if (!perLine) return erase.line + cursor.to(0); + let rows = 0; + const lines = prompt.split(/\r?\n/); + for (let line of lines) { + rows += 1 + Math.floor(Math.max(width(line) - 1, 0) / perLine); + } + return erase.lines(rows); + }; + } +}); + +// node_modules/prompts/lib/util/figures.js +var require_figures = __commonJS({ + "node_modules/prompts/lib/util/figures.js"(exports, module) { + "use strict"; + var main = { + arrowUp: "\u2191", + arrowDown: "\u2193", + arrowLeft: "\u2190", + arrowRight: "\u2192", + radioOn: "\u25C9", + radioOff: "\u25EF", + tick: "\u2714", + cross: "\u2716", + ellipsis: "\u2026", + pointerSmall: "\u203A", + line: "\u2500", + pointer: "\u276F" + }; + var win = { + arrowUp: main.arrowUp, + arrowDown: main.arrowDown, + arrowLeft: main.arrowLeft, + arrowRight: main.arrowRight, + radioOn: "(*)", + radioOff: "( )", + tick: "\u221A", + cross: "\xD7", + ellipsis: "...", + pointerSmall: "\xBB", + line: "\u2500", + pointer: ">" + }; + var figures = process.platform === "win32" ? win : main; + module.exports = figures; + } +}); + +// node_modules/prompts/lib/util/style.js +var require_style = __commonJS({ + "node_modules/prompts/lib/util/style.js"(exports, module) { + "use strict"; + var c = require_kleur(); + var figures = require_figures(); + var styles = Object.freeze({ + password: { scale: 1, render: (input) => "*".repeat(input.length) }, + emoji: { scale: 2, render: (input) => "\u{1F603}".repeat(input.length) }, + invisible: { scale: 0, render: (input) => "" }, + default: { scale: 1, render: (input) => `${input}` } + }); + var render = (type) => styles[type] || styles.default; + var symbols = Object.freeze({ + aborted: c.red(figures.cross), + done: c.green(figures.tick), + exited: c.yellow(figures.cross), + default: c.cyan("?") + }); + var symbol = (done, aborted, exited) => aborted ? symbols.aborted : exited ? symbols.exited : done ? symbols.done : symbols.default; + var delimiter = (completing) => c.gray(completing ? figures.ellipsis : figures.pointerSmall); + var item = (expandable, expanded) => c.gray(expandable ? expanded ? figures.pointerSmall : "+" : figures.line); + module.exports = { + styles, + render, + symbols, + symbol, + delimiter, + item + }; + } +}); + +// node_modules/prompts/lib/util/lines.js +var require_lines = __commonJS({ + "node_modules/prompts/lib/util/lines.js"(exports, module) { + "use strict"; + var strip = require_strip(); + module.exports = function(msg, perLine) { + let lines = String(strip(msg) || "").split(/\r?\n/); + if (!perLine) return lines.length; + return lines.map((l) => Math.ceil(l.length / perLine)).reduce((a, b) => a + b); + }; + } +}); + +// node_modules/prompts/lib/util/wrap.js +var require_wrap = __commonJS({ + "node_modules/prompts/lib/util/wrap.js"(exports, module) { + "use strict"; + module.exports = (msg, opts = {}) => { + const tab = Number.isSafeInteger(parseInt(opts.margin)) ? new Array(parseInt(opts.margin)).fill(" ").join("") : opts.margin || ""; + const width = opts.width; + return (msg || "").split(/\r?\n/g).map((line) => line.split(/\s+/g).reduce((arr, w) => { + if (w.length + tab.length >= width || arr[arr.length - 1].length + w.length + 1 < width) + arr[arr.length - 1] += ` ${w}`; + else arr.push(`${tab}${w}`); + return arr; + }, [tab]).join("\n")).join("\n"); + }; + } +}); + +// node_modules/prompts/lib/util/entriesToDisplay.js +var require_entriesToDisplay = __commonJS({ + "node_modules/prompts/lib/util/entriesToDisplay.js"(exports, module) { + "use strict"; + module.exports = (cursor, total, maxVisible) => { + maxVisible = maxVisible || total; + let startIndex = Math.min(total - maxVisible, cursor - Math.floor(maxVisible / 2)); + if (startIndex < 0) startIndex = 0; + let endIndex = Math.min(startIndex + maxVisible, total); + return { startIndex, endIndex }; + }; + } +}); + +// node_modules/prompts/lib/util/index.js +var require_util = __commonJS({ + "node_modules/prompts/lib/util/index.js"(exports, module) { + "use strict"; + module.exports = { + action: require_action(), + clear: require_clear(), + style: require_style(), + strip: require_strip(), + figures: require_figures(), + lines: require_lines(), + wrap: require_wrap(), + entriesToDisplay: require_entriesToDisplay() + }; + } +}); + +// node_modules/prompts/lib/elements/prompt.js +var require_prompt = __commonJS({ + "node_modules/prompts/lib/elements/prompt.js"(exports, module) { + "use strict"; + var readline = __require("readline"); + var { action } = require_util(); + var EventEmitter = __require("events"); + var { beep, cursor } = require_src(); + var color = require_kleur(); + var Prompt = class extends EventEmitter { + constructor(opts = {}) { + super(); + this.firstRender = true; + this.in = opts.stdin || process.stdin; + this.out = opts.stdout || process.stdout; + this.onRender = (opts.onRender || (() => void 0)).bind(this); + const rl = readline.createInterface({ input: this.in, escapeCodeTimeout: 50 }); + readline.emitKeypressEvents(this.in, rl); + if (this.in.isTTY) this.in.setRawMode(true); + const isSelect = ["SelectPrompt", "MultiselectPrompt"].indexOf(this.constructor.name) > -1; + const keypress = (str, key) => { + let a = action(key, isSelect); + if (a === false) { + this._ && this._(str, key); + } else if (typeof this[a] === "function") { + this[a](key); + } else { + this.bell(); + } + }; + this.close = () => { + this.out.write(cursor.show); + this.in.removeListener("keypress", keypress); + if (this.in.isTTY) this.in.setRawMode(false); + rl.close(); + this.emit(this.aborted ? "abort" : this.exited ? "exit" : "submit", this.value); + this.closed = true; + }; + this.in.on("keypress", keypress); + } + fire() { + this.emit("state", { + value: this.value, + aborted: !!this.aborted, + exited: !!this.exited + }); + } + bell() { + this.out.write(beep); + } + render() { + this.onRender(color); + if (this.firstRender) this.firstRender = false; + } + }; + module.exports = Prompt; + } +}); + +// node_modules/prompts/lib/elements/text.js +var require_text = __commonJS({ + "node_modules/prompts/lib/elements/text.js"(exports, module) { + var color = require_kleur(); + var Prompt = require_prompt(); + var { erase, cursor } = require_src(); + var { style, clear, lines, figures } = require_util(); + var TextPrompt = class extends Prompt { + constructor(opts = {}) { + super(opts); + this.transform = style.render(opts.style); + this.scale = this.transform.scale; + this.msg = opts.message; + this.initial = opts.initial || ``; + this.validator = opts.validate || (() => true); + this.value = ``; + this.errorMsg = opts.error || `Please Enter A Valid Value`; + this.cursor = Number(!!this.initial); + this.cursorOffset = 0; + this.clear = clear(``, this.out.columns); + this.render(); + } + set value(v) { + if (!v && this.initial) { + this.placeholder = true; + this.rendered = color.gray(this.transform.render(this.initial)); + } else { + this.placeholder = false; + this.rendered = this.transform.render(v); + } + this._value = v; + this.fire(); + } + get value() { + return this._value; + } + reset() { + this.value = ``; + this.cursor = Number(!!this.initial); + this.cursorOffset = 0; + this.fire(); + this.render(); + } + exit() { + this.abort(); + } + abort() { + this.value = this.value || this.initial; + this.done = this.aborted = true; + this.error = false; + this.red = false; + this.fire(); + this.render(); + this.out.write("\n"); + this.close(); + } + async validate() { + let valid = await this.validator(this.value); + if (typeof valid === `string`) { + this.errorMsg = valid; + valid = false; + } + this.error = !valid; + } + async submit() { + this.value = this.value || this.initial; + this.cursorOffset = 0; + this.cursor = this.rendered.length; + await this.validate(); + if (this.error) { + this.red = true; + this.fire(); + this.render(); + return; + } + this.done = true; + this.aborted = false; + this.fire(); + this.render(); + this.out.write("\n"); + this.close(); + } + next() { + if (!this.placeholder) return this.bell(); + this.value = this.initial; + this.cursor = this.rendered.length; + this.fire(); + this.render(); + } + moveCursor(n) { + if (this.placeholder) return; + this.cursor = this.cursor + n; + this.cursorOffset += n; + } + _(c, key) { + let s1 = this.value.slice(0, this.cursor); + let s2 = this.value.slice(this.cursor); + this.value = `${s1}${c}${s2}`; + this.red = false; + this.cursor = this.placeholder ? 0 : s1.length + 1; + this.render(); + } + delete() { + if (this.isCursorAtStart()) return this.bell(); + let s1 = this.value.slice(0, this.cursor - 1); + let s2 = this.value.slice(this.cursor); + this.value = `${s1}${s2}`; + this.red = false; + if (this.isCursorAtStart()) { + this.cursorOffset = 0; + } else { + this.cursorOffset++; + this.moveCursor(-1); + } + this.render(); + } + deleteForward() { + if (this.cursor * this.scale >= this.rendered.length || this.placeholder) return this.bell(); + let s1 = this.value.slice(0, this.cursor); + let s2 = this.value.slice(this.cursor + 1); + this.value = `${s1}${s2}`; + this.red = false; + if (this.isCursorAtEnd()) { + this.cursorOffset = 0; + } else { + this.cursorOffset++; + } + this.render(); + } + first() { + this.cursor = 0; + this.render(); + } + last() { + this.cursor = this.value.length; + this.render(); + } + left() { + if (this.cursor <= 0 || this.placeholder) return this.bell(); + this.moveCursor(-1); + this.render(); + } + right() { + if (this.cursor * this.scale >= this.rendered.length || this.placeholder) return this.bell(); + this.moveCursor(1); + this.render(); + } + isCursorAtStart() { + return this.cursor === 0 || this.placeholder && this.cursor === 1; + } + isCursorAtEnd() { + return this.cursor === this.rendered.length || this.placeholder && this.cursor === this.rendered.length + 1; + } + render() { + if (this.closed) return; + if (!this.firstRender) { + if (this.outputError) + this.out.write(cursor.down(lines(this.outputError, this.out.columns) - 1) + clear(this.outputError, this.out.columns)); + this.out.write(clear(this.outputText, this.out.columns)); + } + super.render(); + this.outputError = ""; + this.outputText = [ + style.symbol(this.done, this.aborted), + color.bold(this.msg), + style.delimiter(this.done), + this.red ? color.red(this.rendered) : this.rendered + ].join(` `); + if (this.error) { + this.outputError += this.errorMsg.split(` +`).reduce((a, l, i) => a + ` +${i ? " " : figures.pointerSmall} ${color.red().italic(l)}`, ``); + } + this.out.write(erase.line + cursor.to(0) + this.outputText + cursor.save + this.outputError + cursor.restore + cursor.move(this.cursorOffset, 0)); + } + }; + module.exports = TextPrompt; + } +}); + +// node_modules/prompts/lib/elements/select.js +var require_select = __commonJS({ + "node_modules/prompts/lib/elements/select.js"(exports, module) { + "use strict"; + var color = require_kleur(); + var Prompt = require_prompt(); + var { style, clear, figures, wrap, entriesToDisplay } = require_util(); + var { cursor } = require_src(); + var SelectPrompt = class extends Prompt { + constructor(opts = {}) { + super(opts); + this.msg = opts.message; + this.hint = opts.hint || "- Use arrow-keys. Return to submit."; + this.warn = opts.warn || "- This option is disabled"; + this.cursor = opts.initial || 0; + this.choices = opts.choices.map((ch, idx) => { + if (typeof ch === "string") + ch = { title: ch, value: idx }; + return { + title: ch && (ch.title || ch.value || ch), + value: ch && (ch.value === void 0 ? idx : ch.value), + description: ch && ch.description, + selected: ch && ch.selected, + disabled: ch && ch.disabled + }; + }); + this.optionsPerPage = opts.optionsPerPage || 10; + this.value = (this.choices[this.cursor] || {}).value; + this.clear = clear("", this.out.columns); + this.render(); + } + moveCursor(n) { + this.cursor = n; + this.value = this.choices[n].value; + this.fire(); + } + reset() { + this.moveCursor(0); + this.fire(); + this.render(); + } + exit() { + this.abort(); + } + abort() { + this.done = this.aborted = true; + this.fire(); + this.render(); + this.out.write("\n"); + this.close(); + } + submit() { + if (!this.selection.disabled) { + this.done = true; + this.aborted = false; + this.fire(); + this.render(); + this.out.write("\n"); + this.close(); + } else + this.bell(); + } + first() { + this.moveCursor(0); + this.render(); + } + last() { + this.moveCursor(this.choices.length - 1); + this.render(); + } + up() { + if (this.cursor === 0) { + this.moveCursor(this.choices.length - 1); + } else { + this.moveCursor(this.cursor - 1); + } + this.render(); + } + down() { + if (this.cursor === this.choices.length - 1) { + this.moveCursor(0); + } else { + this.moveCursor(this.cursor + 1); + } + this.render(); + } + next() { + this.moveCursor((this.cursor + 1) % this.choices.length); + this.render(); + } + _(c, key) { + if (c === " ") return this.submit(); + } + get selection() { + return this.choices[this.cursor]; + } + render() { + if (this.closed) return; + if (this.firstRender) this.out.write(cursor.hide); + else this.out.write(clear(this.outputText, this.out.columns)); + super.render(); + let { startIndex, endIndex } = entriesToDisplay(this.cursor, this.choices.length, this.optionsPerPage); + this.outputText = [ + style.symbol(this.done, this.aborted), + color.bold(this.msg), + style.delimiter(false), + this.done ? this.selection.title : this.selection.disabled ? color.yellow(this.warn) : color.gray(this.hint) + ].join(" "); + if (!this.done) { + this.outputText += "\n"; + for (let i = startIndex; i < endIndex; i++) { + let title, prefix, desc = "", v = this.choices[i]; + if (i === startIndex && startIndex > 0) { + prefix = figures.arrowUp; + } else if (i === endIndex - 1 && endIndex < this.choices.length) { + prefix = figures.arrowDown; + } else { + prefix = " "; + } + if (v.disabled) { + title = this.cursor === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title); + prefix = (this.cursor === i ? color.bold().gray(figures.pointer) + " " : " ") + prefix; + } else { + title = this.cursor === i ? color.cyan().underline(v.title) : v.title; + prefix = (this.cursor === i ? color.cyan(figures.pointer) + " " : " ") + prefix; + if (v.description && this.cursor === i) { + desc = ` - ${v.description}`; + if (prefix.length + title.length + desc.length >= this.out.columns || v.description.split(/\r?\n/).length > 1) { + desc = "\n" + wrap(v.description, { margin: 3, width: this.out.columns }); + } + } + } + this.outputText += `${prefix} ${title}${color.gray(desc)} +`; + } + } + this.out.write(this.outputText); + } + }; + module.exports = SelectPrompt; + } +}); + +// node_modules/prompts/lib/elements/toggle.js +var require_toggle = __commonJS({ + "node_modules/prompts/lib/elements/toggle.js"(exports, module) { + var color = require_kleur(); + var Prompt = require_prompt(); + var { style, clear } = require_util(); + var { cursor, erase } = require_src(); + var TogglePrompt = class extends Prompt { + constructor(opts = {}) { + super(opts); + this.msg = opts.message; + this.value = !!opts.initial; + this.active = opts.active || "on"; + this.inactive = opts.inactive || "off"; + this.initialValue = this.value; + this.render(); + } + reset() { + this.value = this.initialValue; + this.fire(); + this.render(); + } + exit() { + this.abort(); + } + abort() { + this.done = this.aborted = true; + this.fire(); + this.render(); + this.out.write("\n"); + this.close(); + } + submit() { + this.done = true; + this.aborted = false; + this.fire(); + this.render(); + this.out.write("\n"); + this.close(); + } + deactivate() { + if (this.value === false) return this.bell(); + this.value = false; + this.render(); + } + activate() { + if (this.value === true) return this.bell(); + this.value = true; + this.render(); + } + delete() { + this.deactivate(); + } + left() { + this.deactivate(); + } + right() { + this.activate(); + } + down() { + this.deactivate(); + } + up() { + this.activate(); + } + next() { + this.value = !this.value; + this.fire(); + this.render(); + } + _(c, key) { + if (c === " ") { + this.value = !this.value; + } else if (c === "1") { + this.value = true; + } else if (c === "0") { + this.value = false; + } else return this.bell(); + this.render(); + } + render() { + if (this.closed) return; + if (this.firstRender) this.out.write(cursor.hide); + else this.out.write(clear(this.outputText, this.out.columns)); + super.render(); + this.outputText = [ + style.symbol(this.done, this.aborted), + color.bold(this.msg), + style.delimiter(this.done), + this.value ? this.inactive : color.cyan().underline(this.inactive), + color.gray("/"), + this.value ? color.cyan().underline(this.active) : this.active + ].join(" "); + this.out.write(erase.line + cursor.to(0) + this.outputText); + } + }; + module.exports = TogglePrompt; + } +}); + +// node_modules/prompts/lib/dateparts/datepart.js +var require_datepart = __commonJS({ + "node_modules/prompts/lib/dateparts/datepart.js"(exports, module) { + "use strict"; + var DatePart = class _DatePart { + constructor({ token, date, parts, locales }) { + this.token = token; + this.date = date || /* @__PURE__ */ new Date(); + this.parts = parts || [this]; + this.locales = locales || {}; + } + up() { + } + down() { + } + next() { + const currentIdx = this.parts.indexOf(this); + return this.parts.find((part, idx) => idx > currentIdx && part instanceof _DatePart); + } + setTo(val) { + } + prev() { + let parts = [].concat(this.parts).reverse(); + const currentIdx = parts.indexOf(this); + return parts.find((part, idx) => idx > currentIdx && part instanceof _DatePart); + } + toString() { + return String(this.date); + } + }; + module.exports = DatePart; + } +}); + +// node_modules/prompts/lib/dateparts/meridiem.js +var require_meridiem = __commonJS({ + "node_modules/prompts/lib/dateparts/meridiem.js"(exports, module) { + "use strict"; + var DatePart = require_datepart(); + var Meridiem = class extends DatePart { + constructor(opts = {}) { + super(opts); + } + up() { + this.date.setHours((this.date.getHours() + 12) % 24); + } + down() { + this.up(); + } + toString() { + let meridiem = this.date.getHours() > 12 ? "pm" : "am"; + return /\A/.test(this.token) ? meridiem.toUpperCase() : meridiem; + } + }; + module.exports = Meridiem; + } +}); + +// node_modules/prompts/lib/dateparts/day.js +var require_day = __commonJS({ + "node_modules/prompts/lib/dateparts/day.js"(exports, module) { + "use strict"; + var DatePart = require_datepart(); + var pos = (n) => { + n = n % 10; + return n === 1 ? "st" : n === 2 ? "nd" : n === 3 ? "rd" : "th"; + }; + var Day = class extends DatePart { + constructor(opts = {}) { + super(opts); + } + up() { + this.date.setDate(this.date.getDate() + 1); + } + down() { + this.date.setDate(this.date.getDate() - 1); + } + setTo(val) { + this.date.setDate(parseInt(val.substr(-2))); + } + toString() { + let date = this.date.getDate(); + let day = this.date.getDay(); + return this.token === "DD" ? String(date).padStart(2, "0") : this.token === "Do" ? date + pos(date) : this.token === "d" ? day + 1 : this.token === "ddd" ? this.locales.weekdaysShort[day] : this.token === "dddd" ? this.locales.weekdays[day] : date; + } + }; + module.exports = Day; + } +}); + +// node_modules/prompts/lib/dateparts/hours.js +var require_hours = __commonJS({ + "node_modules/prompts/lib/dateparts/hours.js"(exports, module) { + "use strict"; + var DatePart = require_datepart(); + var Hours = class extends DatePart { + constructor(opts = {}) { + super(opts); + } + up() { + this.date.setHours(this.date.getHours() + 1); + } + down() { + this.date.setHours(this.date.getHours() - 1); + } + setTo(val) { + this.date.setHours(parseInt(val.substr(-2))); + } + toString() { + let hours = this.date.getHours(); + if (/h/.test(this.token)) + hours = hours % 12 || 12; + return this.token.length > 1 ? String(hours).padStart(2, "0") : hours; + } + }; + module.exports = Hours; + } +}); + +// node_modules/prompts/lib/dateparts/milliseconds.js +var require_milliseconds = __commonJS({ + "node_modules/prompts/lib/dateparts/milliseconds.js"(exports, module) { + "use strict"; + var DatePart = require_datepart(); + var Milliseconds = class extends DatePart { + constructor(opts = {}) { + super(opts); + } + up() { + this.date.setMilliseconds(this.date.getMilliseconds() + 1); + } + down() { + this.date.setMilliseconds(this.date.getMilliseconds() - 1); + } + setTo(val) { + this.date.setMilliseconds(parseInt(val.substr(-this.token.length))); + } + toString() { + return String(this.date.getMilliseconds()).padStart(4, "0").substr(0, this.token.length); + } + }; + module.exports = Milliseconds; + } +}); + +// node_modules/prompts/lib/dateparts/minutes.js +var require_minutes = __commonJS({ + "node_modules/prompts/lib/dateparts/minutes.js"(exports, module) { + "use strict"; + var DatePart = require_datepart(); + var Minutes = class extends DatePart { + constructor(opts = {}) { + super(opts); + } + up() { + this.date.setMinutes(this.date.getMinutes() + 1); + } + down() { + this.date.setMinutes(this.date.getMinutes() - 1); + } + setTo(val) { + this.date.setMinutes(parseInt(val.substr(-2))); + } + toString() { + let m = this.date.getMinutes(); + return this.token.length > 1 ? String(m).padStart(2, "0") : m; + } + }; + module.exports = Minutes; + } +}); + +// node_modules/prompts/lib/dateparts/month.js +var require_month = __commonJS({ + "node_modules/prompts/lib/dateparts/month.js"(exports, module) { + "use strict"; + var DatePart = require_datepart(); + var Month = class extends DatePart { + constructor(opts = {}) { + super(opts); + } + up() { + this.date.setMonth(this.date.getMonth() + 1); + } + down() { + this.date.setMonth(this.date.getMonth() - 1); + } + setTo(val) { + val = parseInt(val.substr(-2)) - 1; + this.date.setMonth(val < 0 ? 0 : val); + } + toString() { + let month = this.date.getMonth(); + let tl = this.token.length; + return tl === 2 ? String(month + 1).padStart(2, "0") : tl === 3 ? this.locales.monthsShort[month] : tl === 4 ? this.locales.months[month] : String(month + 1); + } + }; + module.exports = Month; + } +}); + +// node_modules/prompts/lib/dateparts/seconds.js +var require_seconds = __commonJS({ + "node_modules/prompts/lib/dateparts/seconds.js"(exports, module) { + "use strict"; + var DatePart = require_datepart(); + var Seconds = class extends DatePart { + constructor(opts = {}) { + super(opts); + } + up() { + this.date.setSeconds(this.date.getSeconds() + 1); + } + down() { + this.date.setSeconds(this.date.getSeconds() - 1); + } + setTo(val) { + this.date.setSeconds(parseInt(val.substr(-2))); + } + toString() { + let s = this.date.getSeconds(); + return this.token.length > 1 ? String(s).padStart(2, "0") : s; + } + }; + module.exports = Seconds; + } +}); + +// node_modules/prompts/lib/dateparts/year.js +var require_year = __commonJS({ + "node_modules/prompts/lib/dateparts/year.js"(exports, module) { + "use strict"; + var DatePart = require_datepart(); + var Year = class extends DatePart { + constructor(opts = {}) { + super(opts); + } + up() { + this.date.setFullYear(this.date.getFullYear() + 1); + } + down() { + this.date.setFullYear(this.date.getFullYear() - 1); + } + setTo(val) { + this.date.setFullYear(val.substr(-4)); + } + toString() { + let year = String(this.date.getFullYear()).padStart(4, "0"); + return this.token.length === 2 ? year.substr(-2) : year; + } + }; + module.exports = Year; + } +}); + +// node_modules/prompts/lib/dateparts/index.js +var require_dateparts = __commonJS({ + "node_modules/prompts/lib/dateparts/index.js"(exports, module) { + "use strict"; + module.exports = { + DatePart: require_datepart(), + Meridiem: require_meridiem(), + Day: require_day(), + Hours: require_hours(), + Milliseconds: require_milliseconds(), + Minutes: require_minutes(), + Month: require_month(), + Seconds: require_seconds(), + Year: require_year() + }; + } +}); + +// node_modules/prompts/lib/elements/date.js +var require_date = __commonJS({ + "node_modules/prompts/lib/elements/date.js"(exports, module) { + "use strict"; + var color = require_kleur(); + var Prompt = require_prompt(); + var { style, clear, figures } = require_util(); + var { erase, cursor } = require_src(); + var { DatePart, Meridiem, Day, Hours, Milliseconds, Minutes, Month, Seconds, Year } = require_dateparts(); + var regex = /\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g; + var regexGroups = { + 1: ({ token }) => token.replace(/\\(.)/g, "$1"), + 2: (opts) => new Day(opts), + // Day // TODO + 3: (opts) => new Month(opts), + // Month + 4: (opts) => new Year(opts), + // Year + 5: (opts) => new Meridiem(opts), + // AM/PM // TODO (special) + 6: (opts) => new Hours(opts), + // Hours + 7: (opts) => new Minutes(opts), + // Minutes + 8: (opts) => new Seconds(opts), + // Seconds + 9: (opts) => new Milliseconds(opts) + // Fractional seconds + }; + var dfltLocales = { + months: "January,February,March,April,May,June,July,August,September,October,November,December".split(","), + monthsShort: "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","), + weekdays: "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","), + weekdaysShort: "Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",") + }; + var DatePrompt = class extends Prompt { + constructor(opts = {}) { + super(opts); + this.msg = opts.message; + this.cursor = 0; + this.typed = ""; + this.locales = Object.assign(dfltLocales, opts.locales); + this._date = opts.initial || /* @__PURE__ */ new Date(); + this.errorMsg = opts.error || "Please Enter A Valid Value"; + this.validator = opts.validate || (() => true); + this.mask = opts.mask || "YYYY-MM-DD HH:mm:ss"; + this.clear = clear("", this.out.columns); + this.render(); + } + get value() { + return this.date; + } + get date() { + return this._date; + } + set date(date) { + if (date) this._date.setTime(date.getTime()); + } + set mask(mask) { + let result; + this.parts = []; + while (result = regex.exec(mask)) { + let match = result.shift(); + let idx = result.findIndex((gr) => gr != null); + this.parts.push(idx in regexGroups ? regexGroups[idx]({ token: result[idx] || match, date: this.date, parts: this.parts, locales: this.locales }) : result[idx] || match); + } + let parts = this.parts.reduce((arr, i) => { + if (typeof i === "string" && typeof arr[arr.length - 1] === "string") + arr[arr.length - 1] += i; + else arr.push(i); + return arr; + }, []); + this.parts.splice(0); + this.parts.push(...parts); + this.reset(); + } + moveCursor(n) { + this.typed = ""; + this.cursor = n; + this.fire(); + } + reset() { + this.moveCursor(this.parts.findIndex((p) => p instanceof DatePart)); + this.fire(); + this.render(); + } + exit() { + this.abort(); + } + abort() { + this.done = this.aborted = true; + this.error = false; + this.fire(); + this.render(); + this.out.write("\n"); + this.close(); + } + async validate() { + let valid = await this.validator(this.value); + if (typeof valid === "string") { + this.errorMsg = valid; + valid = false; + } + this.error = !valid; + } + async submit() { + await this.validate(); + if (this.error) { + this.color = "red"; + this.fire(); + this.render(); + return; + } + this.done = true; + this.aborted = false; + this.fire(); + this.render(); + this.out.write("\n"); + this.close(); + } + up() { + this.typed = ""; + this.parts[this.cursor].up(); + this.render(); + } + down() { + this.typed = ""; + this.parts[this.cursor].down(); + this.render(); + } + left() { + let prev = this.parts[this.cursor].prev(); + if (prev == null) return this.bell(); + this.moveCursor(this.parts.indexOf(prev)); + this.render(); + } + right() { + let next = this.parts[this.cursor].next(); + if (next == null) return this.bell(); + this.moveCursor(this.parts.indexOf(next)); + this.render(); + } + next() { + let next = this.parts[this.cursor].next(); + this.moveCursor(next ? this.parts.indexOf(next) : this.parts.findIndex((part) => part instanceof DatePart)); + this.render(); + } + _(c) { + if (/\d/.test(c)) { + this.typed += c; + this.parts[this.cursor].setTo(this.typed); + this.render(); + } + } + render() { + if (this.closed) return; + if (this.firstRender) this.out.write(cursor.hide); + else this.out.write(clear(this.outputText, this.out.columns)); + super.render(); + this.outputText = [ + style.symbol(this.done, this.aborted), + color.bold(this.msg), + style.delimiter(false), + this.parts.reduce((arr, p, idx) => arr.concat(idx === this.cursor && !this.done ? color.cyan().underline(p.toString()) : p), []).join("") + ].join(" "); + if (this.error) { + this.outputText += this.errorMsg.split("\n").reduce( + (a, l, i) => a + ` +${i ? ` ` : figures.pointerSmall} ${color.red().italic(l)}`, + `` + ); + } + this.out.write(erase.line + cursor.to(0) + this.outputText); + } + }; + module.exports = DatePrompt; + } +}); + +// node_modules/prompts/lib/elements/number.js +var require_number = __commonJS({ + "node_modules/prompts/lib/elements/number.js"(exports, module) { + var color = require_kleur(); + var Prompt = require_prompt(); + var { cursor, erase } = require_src(); + var { style, figures, clear, lines } = require_util(); + var isNumber = /[0-9]/; + var isDef = (any) => any !== void 0; + var round = (number, precision) => { + let factor = Math.pow(10, precision); + return Math.round(number * factor) / factor; + }; + var NumberPrompt = class extends Prompt { + constructor(opts = {}) { + super(opts); + this.transform = style.render(opts.style); + this.msg = opts.message; + this.initial = isDef(opts.initial) ? opts.initial : ""; + this.float = !!opts.float; + this.round = opts.round || 2; + this.inc = opts.increment || 1; + this.min = isDef(opts.min) ? opts.min : -Infinity; + this.max = isDef(opts.max) ? opts.max : Infinity; + this.errorMsg = opts.error || `Please Enter A Valid Value`; + this.validator = opts.validate || (() => true); + this.color = `cyan`; + this.value = ``; + this.typed = ``; + this.lastHit = 0; + this.render(); + } + set value(v) { + if (!v && v !== 0) { + this.placeholder = true; + this.rendered = color.gray(this.transform.render(`${this.initial}`)); + this._value = ``; + } else { + this.placeholder = false; + this.rendered = this.transform.render(`${round(v, this.round)}`); + this._value = round(v, this.round); + } + this.fire(); + } + get value() { + return this._value; + } + parse(x) { + return this.float ? parseFloat(x) : parseInt(x); + } + valid(c) { + return c === `-` || c === `.` && this.float || isNumber.test(c); + } + reset() { + this.typed = ``; + this.value = ``; + this.fire(); + this.render(); + } + exit() { + this.abort(); + } + abort() { + let x = this.value; + this.value = x !== `` ? x : this.initial; + this.done = this.aborted = true; + this.error = false; + this.fire(); + this.render(); + this.out.write(` +`); + this.close(); + } + async validate() { + let valid = await this.validator(this.value); + if (typeof valid === `string`) { + this.errorMsg = valid; + valid = false; + } + this.error = !valid; + } + async submit() { + await this.validate(); + if (this.error) { + this.color = `red`; + this.fire(); + this.render(); + return; + } + let x = this.value; + this.value = x !== `` ? x : this.initial; + this.done = true; + this.aborted = false; + this.error = false; + this.fire(); + this.render(); + this.out.write(` +`); + this.close(); + } + up() { + this.typed = ``; + if (this.value === "") { + this.value = this.min - this.inc; + } + if (this.value >= this.max) return this.bell(); + this.value += this.inc; + this.color = `cyan`; + this.fire(); + this.render(); + } + down() { + this.typed = ``; + if (this.value === "") { + this.value = this.min + this.inc; + } + if (this.value <= this.min) return this.bell(); + this.value -= this.inc; + this.color = `cyan`; + this.fire(); + this.render(); + } + delete() { + let val = this.value.toString(); + if (val.length === 0) return this.bell(); + this.value = this.parse(val = val.slice(0, -1)) || ``; + if (this.value !== "" && this.value < this.min) { + this.value = this.min; + } + this.color = `cyan`; + this.fire(); + this.render(); + } + next() { + this.value = this.initial; + this.fire(); + this.render(); + } + _(c, key) { + if (!this.valid(c)) return this.bell(); + const now = Date.now(); + if (now - this.lastHit > 1e3) this.typed = ``; + this.typed += c; + this.lastHit = now; + this.color = `cyan`; + if (c === `.`) return this.fire(); + this.value = Math.min(this.parse(this.typed), this.max); + if (this.value > this.max) this.value = this.max; + if (this.value < this.min) this.value = this.min; + this.fire(); + this.render(); + } + render() { + if (this.closed) return; + if (!this.firstRender) { + if (this.outputError) + this.out.write(cursor.down(lines(this.outputError, this.out.columns) - 1) + clear(this.outputError, this.out.columns)); + this.out.write(clear(this.outputText, this.out.columns)); + } + super.render(); + this.outputError = ""; + this.outputText = [ + style.symbol(this.done, this.aborted), + color.bold(this.msg), + style.delimiter(this.done), + !this.done || !this.done && !this.placeholder ? color[this.color]().underline(this.rendered) : this.rendered + ].join(` `); + if (this.error) { + this.outputError += this.errorMsg.split(` +`).reduce((a, l, i) => a + ` +${i ? ` ` : figures.pointerSmall} ${color.red().italic(l)}`, ``); + } + this.out.write(erase.line + cursor.to(0) + this.outputText + cursor.save + this.outputError + cursor.restore); + } + }; + module.exports = NumberPrompt; + } +}); + +// node_modules/prompts/lib/elements/multiselect.js +var require_multiselect = __commonJS({ + "node_modules/prompts/lib/elements/multiselect.js"(exports, module) { + "use strict"; + var color = require_kleur(); + var { cursor } = require_src(); + var Prompt = require_prompt(); + var { clear, figures, style, wrap, entriesToDisplay } = require_util(); + var MultiselectPrompt = class extends Prompt { + constructor(opts = {}) { + super(opts); + this.msg = opts.message; + this.cursor = opts.cursor || 0; + this.scrollIndex = opts.cursor || 0; + this.hint = opts.hint || ""; + this.warn = opts.warn || "- This option is disabled -"; + this.minSelected = opts.min; + this.showMinError = false; + this.maxChoices = opts.max; + this.instructions = opts.instructions; + this.optionsPerPage = opts.optionsPerPage || 10; + this.value = opts.choices.map((ch, idx) => { + if (typeof ch === "string") + ch = { title: ch, value: idx }; + return { + title: ch && (ch.title || ch.value || ch), + description: ch && ch.description, + value: ch && (ch.value === void 0 ? idx : ch.value), + selected: ch && ch.selected, + disabled: ch && ch.disabled + }; + }); + this.clear = clear("", this.out.columns); + if (!opts.overrideRender) { + this.render(); + } + } + reset() { + this.value.map((v) => !v.selected); + this.cursor = 0; + this.fire(); + this.render(); + } + selected() { + return this.value.filter((v) => v.selected); + } + exit() { + this.abort(); + } + abort() { + this.done = this.aborted = true; + this.fire(); + this.render(); + this.out.write("\n"); + this.close(); + } + submit() { + const selected = this.value.filter((e) => e.selected); + if (this.minSelected && selected.length < this.minSelected) { + this.showMinError = true; + this.render(); + } else { + this.done = true; + this.aborted = false; + this.fire(); + this.render(); + this.out.write("\n"); + this.close(); + } + } + first() { + this.cursor = 0; + this.render(); + } + last() { + this.cursor = this.value.length - 1; + this.render(); + } + next() { + this.cursor = (this.cursor + 1) % this.value.length; + this.render(); + } + up() { + if (this.cursor === 0) { + this.cursor = this.value.length - 1; + } else { + this.cursor--; + } + this.render(); + } + down() { + if (this.cursor === this.value.length - 1) { + this.cursor = 0; + } else { + this.cursor++; + } + this.render(); + } + left() { + this.value[this.cursor].selected = false; + this.render(); + } + right() { + if (this.value.filter((e) => e.selected).length >= this.maxChoices) return this.bell(); + this.value[this.cursor].selected = true; + this.render(); + } + handleSpaceToggle() { + const v = this.value[this.cursor]; + if (v.selected) { + v.selected = false; + this.render(); + } else if (v.disabled || this.value.filter((e) => e.selected).length >= this.maxChoices) { + return this.bell(); + } else { + v.selected = true; + this.render(); + } + } + toggleAll() { + if (this.maxChoices !== void 0 || this.value[this.cursor].disabled) { + return this.bell(); + } + const newSelected = !this.value[this.cursor].selected; + this.value.filter((v) => !v.disabled).forEach((v) => v.selected = newSelected); + this.render(); + } + _(c, key) { + if (c === " ") { + this.handleSpaceToggle(); + } else if (c === "a") { + this.toggleAll(); + } else { + return this.bell(); + } + } + renderInstructions() { + if (this.instructions === void 0 || this.instructions) { + if (typeof this.instructions === "string") { + return this.instructions; + } + return ` +Instructions: + ${figures.arrowUp}/${figures.arrowDown}: Highlight option + ${figures.arrowLeft}/${figures.arrowRight}/[space]: Toggle selection +` + (this.maxChoices === void 0 ? ` a: Toggle all +` : "") + ` enter/return: Complete answer`; + } + return ""; + } + renderOption(cursor2, v, i, arrowIndicator) { + const prefix = (v.selected ? color.green(figures.radioOn) : figures.radioOff) + " " + arrowIndicator + " "; + let title, desc; + if (v.disabled) { + title = cursor2 === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title); + } else { + title = cursor2 === i ? color.cyan().underline(v.title) : v.title; + if (cursor2 === i && v.description) { + desc = ` - ${v.description}`; + if (prefix.length + title.length + desc.length >= this.out.columns || v.description.split(/\r?\n/).length > 1) { + desc = "\n" + wrap(v.description, { margin: prefix.length, width: this.out.columns }); + } + } + } + return prefix + title + color.gray(desc || ""); + } + // shared with autocompleteMultiselect + paginateOptions(options) { + if (options.length === 0) { + return color.red("No matches for this query."); + } + let { startIndex, endIndex } = entriesToDisplay(this.cursor, options.length, this.optionsPerPage); + let prefix, styledOptions = []; + for (let i = startIndex; i < endIndex; i++) { + if (i === startIndex && startIndex > 0) { + prefix = figures.arrowUp; + } else if (i === endIndex - 1 && endIndex < options.length) { + prefix = figures.arrowDown; + } else { + prefix = " "; + } + styledOptions.push(this.renderOption(this.cursor, options[i], i, prefix)); + } + return "\n" + styledOptions.join("\n"); + } + // shared with autocomleteMultiselect + renderOptions(options) { + if (!this.done) { + return this.paginateOptions(options); + } + return ""; + } + renderDoneOrInstructions() { + if (this.done) { + return this.value.filter((e) => e.selected).map((v) => v.title).join(", "); + } + const output = [color.gray(this.hint), this.renderInstructions()]; + if (this.value[this.cursor].disabled) { + output.push(color.yellow(this.warn)); + } + return output.join(" "); + } + render() { + if (this.closed) return; + if (this.firstRender) this.out.write(cursor.hide); + super.render(); + let prompt = [ + style.symbol(this.done, this.aborted), + color.bold(this.msg), + style.delimiter(false), + this.renderDoneOrInstructions() + ].join(" "); + if (this.showMinError) { + prompt += color.red(`You must select a minimum of ${this.minSelected} choices.`); + this.showMinError = false; + } + prompt += this.renderOptions(this.value); + this.out.write(this.clear + prompt); + this.clear = clear(prompt, this.out.columns); + } + }; + module.exports = MultiselectPrompt; + } +}); + +// node_modules/prompts/lib/elements/autocomplete.js +var require_autocomplete = __commonJS({ + "node_modules/prompts/lib/elements/autocomplete.js"(exports, module) { + "use strict"; + var color = require_kleur(); + var Prompt = require_prompt(); + var { erase, cursor } = require_src(); + var { style, clear, figures, wrap, entriesToDisplay } = require_util(); + var getVal = (arr, i) => arr[i] && (arr[i].value || arr[i].title || arr[i]); + var getTitle = (arr, i) => arr[i] && (arr[i].title || arr[i].value || arr[i]); + var getIndex = (arr, valOrTitle) => { + const index = arr.findIndex((el) => el.value === valOrTitle || el.title === valOrTitle); + return index > -1 ? index : void 0; + }; + var AutocompletePrompt = class extends Prompt { + constructor(opts = {}) { + super(opts); + this.msg = opts.message; + this.suggest = opts.suggest; + this.choices = opts.choices; + this.initial = typeof opts.initial === "number" ? opts.initial : getIndex(opts.choices, opts.initial); + this.select = this.initial || opts.cursor || 0; + this.i18n = { noMatches: opts.noMatches || "no matches found" }; + this.fallback = opts.fallback || this.initial; + this.clearFirst = opts.clearFirst || false; + this.suggestions = []; + this.input = ""; + this.limit = opts.limit || 10; + this.cursor = 0; + this.transform = style.render(opts.style); + this.scale = this.transform.scale; + this.render = this.render.bind(this); + this.complete = this.complete.bind(this); + this.clear = clear("", this.out.columns); + this.complete(this.render); + this.render(); + } + set fallback(fb) { + this._fb = Number.isSafeInteger(parseInt(fb)) ? parseInt(fb) : fb; + } + get fallback() { + let choice; + if (typeof this._fb === "number") + choice = this.choices[this._fb]; + else if (typeof this._fb === "string") + choice = { title: this._fb }; + return choice || this._fb || { title: this.i18n.noMatches }; + } + moveSelect(i) { + this.select = i; + if (this.suggestions.length > 0) + this.value = getVal(this.suggestions, i); + else this.value = this.fallback.value; + this.fire(); + } + async complete(cb) { + const p = this.completing = this.suggest(this.input, this.choices); + const suggestions = await p; + if (this.completing !== p) return; + this.suggestions = suggestions.map((s, i, arr) => ({ title: getTitle(arr, i), value: getVal(arr, i), description: s.description })); + this.completing = false; + const l = Math.max(suggestions.length - 1, 0); + this.moveSelect(Math.min(l, this.select)); + cb && cb(); + } + reset() { + this.input = ""; + this.complete(() => { + this.moveSelect(this.initial !== void 0 ? this.initial : 0); + this.render(); + }); + this.render(); + } + exit() { + if (this.clearFirst && this.input.length > 0) { + this.reset(); + } else { + this.done = this.exited = true; + this.aborted = false; + this.fire(); + this.render(); + this.out.write("\n"); + this.close(); + } + } + abort() { + this.done = this.aborted = true; + this.exited = false; + this.fire(); + this.render(); + this.out.write("\n"); + this.close(); + } + submit() { + this.done = true; + this.aborted = this.exited = false; + this.fire(); + this.render(); + this.out.write("\n"); + this.close(); + } + _(c, key) { + let s1 = this.input.slice(0, this.cursor); + let s2 = this.input.slice(this.cursor); + this.input = `${s1}${c}${s2}`; + this.cursor = s1.length + 1; + this.complete(this.render); + this.render(); + } + delete() { + if (this.cursor === 0) return this.bell(); + let s1 = this.input.slice(0, this.cursor - 1); + let s2 = this.input.slice(this.cursor); + this.input = `${s1}${s2}`; + this.complete(this.render); + this.cursor = this.cursor - 1; + this.render(); + } + deleteForward() { + if (this.cursor * this.scale >= this.rendered.length) return this.bell(); + let s1 = this.input.slice(0, this.cursor); + let s2 = this.input.slice(this.cursor + 1); + this.input = `${s1}${s2}`; + this.complete(this.render); + this.render(); + } + first() { + this.moveSelect(0); + this.render(); + } + last() { + this.moveSelect(this.suggestions.length - 1); + this.render(); + } + up() { + if (this.select === 0) { + this.moveSelect(this.suggestions.length - 1); + } else { + this.moveSelect(this.select - 1); + } + this.render(); + } + down() { + if (this.select === this.suggestions.length - 1) { + this.moveSelect(0); + } else { + this.moveSelect(this.select + 1); + } + this.render(); + } + next() { + if (this.select === this.suggestions.length - 1) { + this.moveSelect(0); + } else this.moveSelect(this.select + 1); + this.render(); + } + nextPage() { + this.moveSelect(Math.min(this.select + this.limit, this.suggestions.length - 1)); + this.render(); + } + prevPage() { + this.moveSelect(Math.max(this.select - this.limit, 0)); + this.render(); + } + left() { + if (this.cursor <= 0) return this.bell(); + this.cursor = this.cursor - 1; + this.render(); + } + right() { + if (this.cursor * this.scale >= this.rendered.length) return this.bell(); + this.cursor = this.cursor + 1; + this.render(); + } + renderOption(v, hovered, isStart, isEnd) { + let desc; + let prefix = isStart ? figures.arrowUp : isEnd ? figures.arrowDown : " "; + let title = hovered ? color.cyan().underline(v.title) : v.title; + prefix = (hovered ? color.cyan(figures.pointer) + " " : " ") + prefix; + if (v.description) { + desc = ` - ${v.description}`; + if (prefix.length + title.length + desc.length >= this.out.columns || v.description.split(/\r?\n/).length > 1) { + desc = "\n" + wrap(v.description, { margin: 3, width: this.out.columns }); + } + } + return prefix + " " + title + color.gray(desc || ""); + } + render() { + if (this.closed) return; + if (this.firstRender) this.out.write(cursor.hide); + else this.out.write(clear(this.outputText, this.out.columns)); + super.render(); + let { startIndex, endIndex } = entriesToDisplay(this.select, this.choices.length, this.limit); + this.outputText = [ + style.symbol(this.done, this.aborted, this.exited), + color.bold(this.msg), + style.delimiter(this.completing), + this.done && this.suggestions[this.select] ? this.suggestions[this.select].title : this.rendered = this.transform.render(this.input) + ].join(" "); + if (!this.done) { + const suggestions = this.suggestions.slice(startIndex, endIndex).map((item, i) => this.renderOption( + item, + this.select === i + startIndex, + i === 0 && startIndex > 0, + i + startIndex === endIndex - 1 && endIndex < this.choices.length + )).join("\n"); + this.outputText += ` +` + (suggestions || color.gray(this.fallback.title)); + } + this.out.write(erase.line + cursor.to(0) + this.outputText); + } + }; + module.exports = AutocompletePrompt; + } +}); + +// node_modules/prompts/lib/elements/autocompleteMultiselect.js +var require_autocompleteMultiselect = __commonJS({ + "node_modules/prompts/lib/elements/autocompleteMultiselect.js"(exports, module) { + "use strict"; + var color = require_kleur(); + var { cursor } = require_src(); + var MultiselectPrompt = require_multiselect(); + var { clear, style, figures } = require_util(); + var AutocompleteMultiselectPrompt = class extends MultiselectPrompt { + constructor(opts = {}) { + opts.overrideRender = true; + super(opts); + this.inputValue = ""; + this.clear = clear("", this.out.columns); + this.filteredOptions = this.value; + this.render(); + } + last() { + this.cursor = this.filteredOptions.length - 1; + this.render(); + } + next() { + this.cursor = (this.cursor + 1) % this.filteredOptions.length; + this.render(); + } + up() { + if (this.cursor === 0) { + this.cursor = this.filteredOptions.length - 1; + } else { + this.cursor--; + } + this.render(); + } + down() { + if (this.cursor === this.filteredOptions.length - 1) { + this.cursor = 0; + } else { + this.cursor++; + } + this.render(); + } + left() { + this.filteredOptions[this.cursor].selected = false; + this.render(); + } + right() { + if (this.value.filter((e) => e.selected).length >= this.maxChoices) return this.bell(); + this.filteredOptions[this.cursor].selected = true; + this.render(); + } + delete() { + if (this.inputValue.length) { + this.inputValue = this.inputValue.substr(0, this.inputValue.length - 1); + this.updateFilteredOptions(); + } + } + updateFilteredOptions() { + const currentHighlight = this.filteredOptions[this.cursor]; + this.filteredOptions = this.value.filter((v) => { + if (this.inputValue) { + if (typeof v.title === "string") { + if (v.title.toLowerCase().includes(this.inputValue.toLowerCase())) { + return true; + } + } + if (typeof v.value === "string") { + if (v.value.toLowerCase().includes(this.inputValue.toLowerCase())) { + return true; + } + } + return false; + } + return true; + }); + const newHighlightIndex = this.filteredOptions.findIndex((v) => v === currentHighlight); + this.cursor = newHighlightIndex < 0 ? 0 : newHighlightIndex; + this.render(); + } + handleSpaceToggle() { + const v = this.filteredOptions[this.cursor]; + if (v.selected) { + v.selected = false; + this.render(); + } else if (v.disabled || this.value.filter((e) => e.selected).length >= this.maxChoices) { + return this.bell(); + } else { + v.selected = true; + this.render(); + } + } + handleInputChange(c) { + this.inputValue = this.inputValue + c; + this.updateFilteredOptions(); + } + _(c, key) { + if (c === " ") { + this.handleSpaceToggle(); + } else { + this.handleInputChange(c); + } + } + renderInstructions() { + if (this.instructions === void 0 || this.instructions) { + if (typeof this.instructions === "string") { + return this.instructions; + } + return ` +Instructions: + ${figures.arrowUp}/${figures.arrowDown}: Highlight option + ${figures.arrowLeft}/${figures.arrowRight}/[space]: Toggle selection + [a,b,c]/delete: Filter choices + enter/return: Complete answer +`; + } + return ""; + } + renderCurrentInput() { + return ` +Filtered results for: ${this.inputValue ? this.inputValue : color.gray("Enter something to filter")} +`; + } + renderOption(cursor2, v, i) { + let title; + if (v.disabled) title = cursor2 === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title); + else title = cursor2 === i ? color.cyan().underline(v.title) : v.title; + return (v.selected ? color.green(figures.radioOn) : figures.radioOff) + " " + title; + } + renderDoneOrInstructions() { + if (this.done) { + return this.value.filter((e) => e.selected).map((v) => v.title).join(", "); + } + const output = [color.gray(this.hint), this.renderInstructions(), this.renderCurrentInput()]; + if (this.filteredOptions.length && this.filteredOptions[this.cursor].disabled) { + output.push(color.yellow(this.warn)); + } + return output.join(" "); + } + render() { + if (this.closed) return; + if (this.firstRender) this.out.write(cursor.hide); + super.render(); + let prompt = [ + style.symbol(this.done, this.aborted), + color.bold(this.msg), + style.delimiter(false), + this.renderDoneOrInstructions() + ].join(" "); + if (this.showMinError) { + prompt += color.red(`You must select a minimum of ${this.minSelected} choices.`); + this.showMinError = false; + } + prompt += this.renderOptions(this.filteredOptions); + this.out.write(this.clear + prompt); + this.clear = clear(prompt, this.out.columns); + } + }; + module.exports = AutocompleteMultiselectPrompt; + } +}); + +// node_modules/prompts/lib/elements/confirm.js +var require_confirm = __commonJS({ + "node_modules/prompts/lib/elements/confirm.js"(exports, module) { + var color = require_kleur(); + var Prompt = require_prompt(); + var { style, clear } = require_util(); + var { erase, cursor } = require_src(); + var ConfirmPrompt = class extends Prompt { + constructor(opts = {}) { + super(opts); + this.msg = opts.message; + this.value = opts.initial; + this.initialValue = !!opts.initial; + this.yesMsg = opts.yes || "yes"; + this.yesOption = opts.yesOption || "(Y/n)"; + this.noMsg = opts.no || "no"; + this.noOption = opts.noOption || "(y/N)"; + this.render(); + } + reset() { + this.value = this.initialValue; + this.fire(); + this.render(); + } + exit() { + this.abort(); + } + abort() { + this.done = this.aborted = true; + this.fire(); + this.render(); + this.out.write("\n"); + this.close(); + } + submit() { + this.value = this.value || false; + this.done = true; + this.aborted = false; + this.fire(); + this.render(); + this.out.write("\n"); + this.close(); + } + _(c, key) { + if (c.toLowerCase() === "y") { + this.value = true; + return this.submit(); + } + if (c.toLowerCase() === "n") { + this.value = false; + return this.submit(); + } + return this.bell(); + } + render() { + if (this.closed) return; + if (this.firstRender) this.out.write(cursor.hide); + else this.out.write(clear(this.outputText, this.out.columns)); + super.render(); + this.outputText = [ + style.symbol(this.done, this.aborted), + color.bold(this.msg), + style.delimiter(this.done), + this.done ? this.value ? this.yesMsg : this.noMsg : color.gray(this.initialValue ? this.yesOption : this.noOption) + ].join(" "); + this.out.write(erase.line + cursor.to(0) + this.outputText); + } + }; + module.exports = ConfirmPrompt; + } +}); + +// node_modules/prompts/lib/elements/index.js +var require_elements = __commonJS({ + "node_modules/prompts/lib/elements/index.js"(exports, module) { + "use strict"; + module.exports = { + TextPrompt: require_text(), + SelectPrompt: require_select(), + TogglePrompt: require_toggle(), + DatePrompt: require_date(), + NumberPrompt: require_number(), + MultiselectPrompt: require_multiselect(), + AutocompletePrompt: require_autocomplete(), + AutocompleteMultiselectPrompt: require_autocompleteMultiselect(), + ConfirmPrompt: require_confirm() + }; + } +}); + +// node_modules/prompts/lib/prompts.js +var require_prompts = __commonJS({ + "node_modules/prompts/lib/prompts.js"(exports) { + "use strict"; + var $ = exports; + var el = require_elements(); + var noop = (v) => v; + function toPrompt(type, args, opts = {}) { + return new Promise((res, rej) => { + const p = new el[type](args); + const onAbort = opts.onAbort || noop; + const onSubmit = opts.onSubmit || noop; + const onExit = opts.onExit || noop; + p.on("state", args.onState || noop); + p.on("submit", (x) => res(onSubmit(x))); + p.on("exit", (x) => res(onExit(x))); + p.on("abort", (x) => rej(onAbort(x))); + }); + } + $.text = (args) => toPrompt("TextPrompt", args); + $.password = (args) => { + args.style = "password"; + return $.text(args); + }; + $.invisible = (args) => { + args.style = "invisible"; + return $.text(args); + }; + $.number = (args) => toPrompt("NumberPrompt", args); + $.date = (args) => toPrompt("DatePrompt", args); + $.confirm = (args) => toPrompt("ConfirmPrompt", args); + $.list = (args) => { + const sep = args.separator || ","; + return toPrompt("TextPrompt", args, { + onSubmit: (str) => str.split(sep).map((s) => s.trim()) + }); + }; + $.toggle = (args) => toPrompt("TogglePrompt", args); + $.select = (args) => toPrompt("SelectPrompt", args); + $.multiselect = (args) => { + args.choices = [].concat(args.choices || []); + const toSelected = (items) => items.filter((item) => item.selected).map((item) => item.value); + return toPrompt("MultiselectPrompt", args, { + onAbort: toSelected, + onSubmit: toSelected + }); + }; + $.autocompleteMultiselect = (args) => { + args.choices = [].concat(args.choices || []); + const toSelected = (items) => items.filter((item) => item.selected).map((item) => item.value); + return toPrompt("AutocompleteMultiselectPrompt", args, { + onAbort: toSelected, + onSubmit: toSelected + }); + }; + var byTitle = (input, choices) => Promise.resolve( + choices.filter((item) => item.title.slice(0, input.length).toLowerCase() === input.toLowerCase()) + ); + $.autocomplete = (args) => { + args.suggest = args.suggest || byTitle; + args.choices = [].concat(args.choices || []); + return toPrompt("AutocompletePrompt", args); + }; + } +}); + +// node_modules/prompts/lib/index.js +var require_lib = __commonJS({ + "node_modules/prompts/lib/index.js"(exports, module) { + "use strict"; + var prompts = require_prompts(); + var passOn = ["suggest", "format", "onState", "validate", "onRender", "type"]; + var noop = () => { + }; + async function prompt(questions = [], { onSubmit = noop, onCancel = noop } = {}) { + const answers = {}; + const override2 = prompt._override || {}; + questions = [].concat(questions); + let answer, question, quit, name, type, lastPrompt; + const getFormattedAnswer = async (question2, answer2, skipValidation = false) => { + if (!skipValidation && question2.validate && question2.validate(answer2) !== true) { + return; + } + return question2.format ? await question2.format(answer2, answers) : answer2; + }; + for (question of questions) { + ({ name, type } = question); + if (typeof type === "function") { + type = await type(answer, { ...answers }, question); + question["type"] = type; + } + if (!type) continue; + for (let key in question) { + if (passOn.includes(key)) continue; + let value = question[key]; + question[key] = typeof value === "function" ? await value(answer, { ...answers }, lastPrompt) : value; + } + lastPrompt = question; + if (typeof question.message !== "string") { + throw new Error("prompt message is required"); + } + ({ name, type } = question); + if (prompts[type] === void 0) { + throw new Error(`prompt type (${type}) is not defined`); + } + if (override2[question.name] !== void 0) { + answer = await getFormattedAnswer(question, override2[question.name]); + if (answer !== void 0) { + answers[name] = answer; + continue; + } + } + try { + answer = prompt._injected ? getInjectedAnswer(prompt._injected, question.initial) : await prompts[type](question); + answers[name] = answer = await getFormattedAnswer(question, answer, true); + quit = await onSubmit(question, answer, answers); + } catch (err2) { + quit = !await onCancel(question, answers); + } + if (quit) return answers; + } + return answers; + } + function getInjectedAnswer(injected, deafultValue) { + const answer = injected.shift(); + if (answer instanceof Error) { + throw answer; + } + return answer === void 0 ? deafultValue : answer; + } + function inject(answers) { + prompt._injected = (prompt._injected || []).concat(answers); + } + function override(answers) { + prompt._override = Object.assign({}, answers); + } + module.exports = Object.assign(prompt, { prompt, prompts, inject, override }); + } +}); + +// src/cli/config-flags.ts +var BOOLEAN_CLI_FLAGS = [ + "build", + "cache", + "checkVersion", + "ci", + "compare", + "debug", + "dev", + "devtools", + "docs", + "e2e", + "es5", + "esm", + "help", + "log", + "open", + "prerender", + "prerenderExternal", + "prod", + "profile", + "serviceWorker", + "screenshot", + "serve", + "skipNodeCheck", + "spec", + "ssr", + "stats", + "updateScreenshot", + "verbose", + "version", + "watch", + // JEST CLI OPTIONS + "all", + "automock", + "bail", + // 'cache', Stencil already supports this argument + "changedFilesWithAncestor", + // 'ci', Stencil already supports this argument + "clearCache", + "clearMocks", + "collectCoverage", + "color", + "colors", + "coverage", + // 'debug', Stencil already supports this argument + "detectLeaks", + "detectOpenHandles", + "errorOnDeprecated", + "expand", + "findRelatedTests", + "forceExit", + "init", + "injectGlobals", + "json", + "lastCommit", + "listTests", + "logHeapUsage", + "noStackTrace", + "notify", + "onlyChanged", + "onlyFailures", + "passWithNoTests", + "resetMocks", + "resetModules", + "restoreMocks", + "runInBand", + "runTestsByPath", + "showConfig", + "silent", + "skipFilter", + "testLocationInResults", + "updateSnapshot", + "useStderr", + // 'verbose', Stencil already supports this argument + // 'version', Stencil already supports this argument + // 'watch', Stencil already supports this argument + "watchAll", + "watchman" +]; +var NUMBER_CLI_FLAGS = [ + "port", + // JEST CLI ARGS + "maxConcurrency", + "testTimeout" +]; +var STRING_CLI_FLAGS = [ + "address", + "config", + "docsApi", + "docsJson", + "emulate", + "root", + "screenshotConnector", + // JEST CLI ARGS + "cacheDirectory", + "changedSince", + "collectCoverageFrom", + // 'config', Stencil already supports this argument + "coverageDirectory", + "coverageThreshold", + "env", + "filter", + "globalSetup", + "globalTeardown", + "globals", + "haste", + "moduleNameMapper", + "notifyMode", + "outputFile", + "preset", + "prettierPath", + "resolver", + "rootDir", + "runner", + "testEnvironment", + "testEnvironmentOptions", + "testFailureExitCode", + "testNamePattern", + "testResultsProcessor", + "testRunner", + "testSequencer", + "testURL", + "timers", + "transform" +]; +var STRING_ARRAY_CLI_FLAGS = [ + "collectCoverageOnlyFrom", + "coveragePathIgnorePatterns", + "coverageReporters", + "moduleDirectories", + "moduleFileExtensions", + "modulePathIgnorePatterns", + "modulePaths", + "projects", + "reporters", + "roots", + "selectProjects", + "setupFiles", + "setupFilesAfterEnv", + "snapshotSerializers", + "testMatch", + "testPathIgnorePatterns", + "testPathPattern", + "testRegex", + "transformIgnorePatterns", + "unmockedModulePathPatterns", + "watchPathIgnorePatterns" +]; +var STRING_NUMBER_CLI_FLAGS = ["maxWorkers"]; +var BOOLEAN_STRING_CLI_FLAGS = [ + /** + * `headless` is an argument passed through to Puppeteer (which is passed to Chrome) for end-to-end testing. + * Prior to Chrome v112, `headless` was treated like a boolean flag. Starting with Chrome v112, 'new' is an accepted + * option to support Chrome's new headless mode. In order to support this option in Stencil, both the boolean and + * string versions of the flag must be accepted. + * + * {@see https://developer.chrome.com/articles/new-headless/} + */ + "headless" +]; +var LOG_LEVEL_CLI_FLAGS = ["logLevel"]; +var CLI_FLAG_ALIASES = { + c: "config", + h: "help", + p: "port", + v: "version", + // JEST SPECIFIC CLI FLAGS + // these are defined in + // https://github.com/facebook/jest/blob/4156f86/packages/jest-cli/src/args.ts + b: "bail", + e: "expand", + f: "onlyFailures", + i: "runInBand", + o: "onlyChanged", + t: "testNamePattern", + u: "updateSnapshot", + w: "maxWorkers" +}; +var CLI_FLAG_REGEX = new RegExp(`^-[chpvbewofitu]{1}$`); +var createConfigFlags = (init = {}) => { + const flags = { + task: null, + args: [], + knownArgs: [], + unknownArgs: [], + ...init + }; + return flags; +}; + +// src/utils/constants.ts +var DIST_HYDRATE_SCRIPT = "dist-hydrate-script"; +var DOCS_CUSTOM = "docs-custom"; +var DOCS_JSON = "docs-json"; +var DOCS_README = "docs-readme"; +var DOCS_VSCODE = "docs-vscode"; +var WWW = "www"; + +// src/utils/helpers.ts +var dashToPascalCase = (str) => str.toLowerCase().split("-").map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1)).join(""); +var toCamelCase = (str) => { + const pascalCase = dashToPascalCase(str); + return pascalCase.charAt(0).toLowerCase() + pascalCase.slice(1); +}; +var isFunction = (v) => typeof v === "function"; +var isString = (v) => typeof v === "string"; + +// src/utils/message-utils.ts +var buildError = (diagnostics) => { + const diagnostic = { + level: "error", + type: "build", + header: "Build Error", + messageText: "build error", + relFilePath: void 0, + absFilePath: void 0, + lines: [] + }; + if (diagnostics) { + diagnostics.push(diagnostic); + } + return diagnostic; +}; +var catchError = (diagnostics, err2, msg) => { + const diagnostic = { + level: "error", + type: "build", + header: "Build Error", + messageText: "build error", + lines: [] + }; + if (isString(msg)) { + diagnostic.messageText = msg.length ? msg : "UNKNOWN ERROR"; + } else if (err2 != null) { + if (err2.stack != null) { + diagnostic.messageText = err2.stack.toString(); + } else { + if (err2.message != null) { + diagnostic.messageText = err2.message.length ? err2.message : "UNKNOWN ERROR"; + } else { + diagnostic.messageText = err2.toString(); + } + } + } + if (diagnostics != null && !shouldIgnoreError(diagnostic.messageText)) { + diagnostics.push(diagnostic); + } + return diagnostic; +}; +var hasError = (diagnostics) => { + if (diagnostics == null || diagnostics.length === 0) { + return false; + } + return diagnostics.some((d) => d.level === "error" && d.type !== "runtime"); +}; +var shouldIgnoreError = (msg) => { + return msg === TASK_CANCELED_MSG; +}; +var TASK_CANCELED_MSG = `task canceled`; + +// src/utils/path.ts +var normalizePath = (path, relativize = true) => { + if (typeof path !== "string") { + throw new Error(`invalid path to normalize`); + } + path = normalizeSlashes(path.trim()); + const components = pathComponents(path, getRootLength(path)); + const reducedComponents = reducePathComponents(components); + const rootPart = reducedComponents[0]; + const secondPart = reducedComponents[1]; + const normalized = rootPart + reducedComponents.slice(1).join("/"); + if (normalized === "") { + return "."; + } + if (rootPart === "" && secondPart && path.includes("/") && !secondPart.startsWith(".") && !secondPart.startsWith("@") && relativize) { + return "./" + normalized; + } + return normalized; +}; +var normalizeSlashes = (path) => path.replace(backslashRegExp, "/"); +var altDirectorySeparator = "\\"; +var urlSchemeSeparator = "://"; +var backslashRegExp = /\\/g; +var reducePathComponents = (components) => { + if (!Array.isArray(components) || components.length === 0) { + return []; + } + const reduced = [components[0]]; + for (let i = 1; i < components.length; i++) { + const component = components[i]; + if (!component) continue; + if (component === ".") continue; + if (component === "..") { + if (reduced.length > 1) { + if (reduced[reduced.length - 1] !== "..") { + reduced.pop(); + continue; + } + } else if (reduced[0]) continue; + } + reduced.push(component); + } + return reduced; +}; +var getRootLength = (path) => { + const rootLength = getEncodedRootLength(path); + return rootLength < 0 ? ~rootLength : rootLength; +}; +var getEncodedRootLength = (path) => { + if (!path) return 0; + const ch0 = path.charCodeAt(0); + if (ch0 === 47 /* slash */ || ch0 === 92 /* backslash */) { + if (path.charCodeAt(1) !== ch0) return 1; + const p1 = path.indexOf(ch0 === 47 /* slash */ ? "/" : altDirectorySeparator, 2); + if (p1 < 0) return path.length; + return p1 + 1; + } + if (isVolumeCharacter(ch0) && path.charCodeAt(1) === 58 /* colon */) { + const ch2 = path.charCodeAt(2); + if (ch2 === 47 /* slash */ || ch2 === 92 /* backslash */) return 3; + if (path.length === 2) return 2; + } + const schemeEnd = path.indexOf(urlSchemeSeparator); + if (schemeEnd !== -1) { + const authorityStart = schemeEnd + urlSchemeSeparator.length; + const authorityEnd = path.indexOf("/", authorityStart); + if (authorityEnd !== -1) { + const scheme = path.slice(0, schemeEnd); + const authority = path.slice(authorityStart, authorityEnd); + if (scheme === "file" && (authority === "" || authority === "localhost") && isVolumeCharacter(path.charCodeAt(authorityEnd + 1))) { + const volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path, authorityEnd + 2); + if (volumeSeparatorEnd !== -1) { + if (path.charCodeAt(volumeSeparatorEnd) === 47 /* slash */) { + return ~(volumeSeparatorEnd + 1); + } + if (volumeSeparatorEnd === path.length) { + return ~volumeSeparatorEnd; + } + } + } + return ~(authorityEnd + 1); + } + return ~path.length; + } + return 0; +}; +var isVolumeCharacter = (charCode) => charCode >= 97 /* a */ && charCode <= 122 /* z */ || charCode >= 65 /* A */ && charCode <= 90 /* Z */; +var getFileUrlVolumeSeparatorEnd = (url, start) => { + const ch0 = url.charCodeAt(start); + if (ch0 === 58 /* colon */) return start + 1; + if (ch0 === 37 /* percent */ && url.charCodeAt(start + 1) === 51 /* _3 */) { + const ch2 = url.charCodeAt(start + 2); + if (ch2 === 97 /* a */ || ch2 === 65 /* A */) return start + 3; + } + return -1; +}; +var pathComponents = (path, rootLength) => { + const root = path.substring(0, rootLength); + const rest = path.substring(rootLength).split("/"); + const restLen = rest.length; + if (restLen > 0 && !rest[restLen - 1]) { + rest.pop(); + } + return [root, ...rest]; +}; + +// src/utils/output-target.ts +var isOutputTargetHydrate = (o) => o.type === DIST_HYDRATE_SCRIPT; +var isOutputTargetDocs = (o) => o.type === DOCS_README || o.type === DOCS_JSON || o.type === DOCS_CUSTOM || o.type === DOCS_VSCODE; + +// src/utils/result.ts +var result_exports = {}; +__export(result_exports, { + err: () => err, + map: () => map, + ok: () => ok, + unwrap: () => unwrap, + unwrapErr: () => unwrapErr +}); +var ok = (value) => ({ + isOk: true, + isErr: false, + value +}); +var err = (value) => ({ + isOk: false, + isErr: true, + value +}); +function map(result, fn) { + if (result.isOk) { + const val = fn(result.value); + if (val instanceof Promise) { + return val.then((newVal) => ok(newVal)); + } else { + return ok(val); + } + } + if (result.isErr) { + const value = result.value; + return err(value); + } + throw "should never get here"; +} +var unwrap = (result) => { + if (result.isOk) { + return result.value; + } else { + throw result.value; + } +}; +var unwrapErr = (result) => { + if (result.isErr) { + return result.value; + } else { + throw result.value; + } +}; + +// src/utils/util.ts +var readOnlyArrayHasStringMember = (readOnlyArray, maybeMember) => readOnlyArray.includes(maybeMember); + +// src/utils/validation.ts +var validateComponentTag = (tag) => { + if (typeof tag !== "string") { + return `Tag "${tag}" must be a string type`; + } + if (tag !== tag.trim()) { + return `Tag can not contain white spaces`; + } + if (tag !== tag.toLowerCase()) { + return `Tag can not contain upper case characters`; + } + if (tag.length === 0) { + return `Received empty tag value`; + } + if (tag.indexOf(" ") > -1) { + return `"${tag}" tag cannot contain a space`; + } + if (tag.indexOf(",") > -1) { + return `"${tag}" tag cannot be used for multiple tags`; + } + const invalidChars = tag.replace(/\w|-/g, ""); + if (invalidChars !== "") { + return `"${tag}" tag contains invalid characters: ${invalidChars}`; + } + if (tag.indexOf("-") === -1) { + return `"${tag}" tag must contain a dash (-) to work as a valid web component`; + } + if (tag.indexOf("--") > -1) { + return `"${tag}" tag cannot contain multiple dashes (--) next to each other`; + } + if (tag.indexOf("-") === 0) { + return `"${tag}" tag cannot start with a dash (-)`; + } + if (tag.lastIndexOf("-") === tag.length - 1) { + return `"${tag}" tag cannot end with a dash (-)`; + } + return void 0; +}; + +// src/declarations/stencil-public-compiler.ts +var LOG_LEVELS = ["debug", "info", "warn", "error"]; + +// src/cli/parse-flags.ts +var parseFlags = (args) => { + const flags = createConfigFlags(); + flags.args = Array.isArray(args) ? args.slice() : []; + if (flags.args.length > 0 && flags.args[0] && !flags.args[0].startsWith("-")) { + flags.task = flags.args[0]; + parseArgs(flags, args.slice(1)); + } else { + parseArgs(flags, flags.args); + } + if (flags.task != null) { + const i = flags.args.indexOf(flags.task); + if (i > -1) { + flags.args.splice(i, 1); + } + } + return flags; +}; +var parseArgs = (flags, args) => { + const argsCopy = args.concat(); + while (argsCopy.length > 0) { + parseCLITerm(flags, argsCopy); + } +}; +var parseCLITerm = (flags, args) => { + const arg = args.shift(); + if (arg === void 0) return; + const isNegatedBoolean = !readOnlyArrayHasStringMember(BOOLEAN_CLI_FLAGS, normalizeFlagName(arg)) && readOnlyArrayHasStringMember(BOOLEAN_CLI_FLAGS, normalizeNegativeFlagName(arg)); + const isNegatedBooleanOrString = !readOnlyArrayHasStringMember(BOOLEAN_STRING_CLI_FLAGS, normalizeFlagName(arg)) && readOnlyArrayHasStringMember(BOOLEAN_STRING_CLI_FLAGS, normalizeNegativeFlagName(arg)); + if (arg.startsWith("--") && arg.includes("=")) { + const [originalArg, value] = parseEqualsArg(arg); + setCLIArg(flags, arg.split("=")[0], normalizeFlagName(originalArg), value); + } else if (arg.startsWith("-") && arg.includes("=")) { + const [originalArg, value] = parseEqualsArg(arg); + setCLIArg(flags, desugarRawAlias(originalArg), normalizeFlagName(originalArg), value); + } else if (CLI_FLAG_REGEX.test(arg)) { + setCLIArg(flags, desugarRawAlias(arg), normalizeFlagName(arg), parseCLIValue(args)); + } else if (arg.startsWith("--no-") && arg.length > "--no-".length) { + const normalized = normalizeNegativeFlagName(arg); + setCLIArg(flags, arg, normalized, ""); + } else if (arg.startsWith("--no") && (isNegatedBoolean || isNegatedBooleanOrString)) { + setCLIArg(flags, arg, normalizeNegativeFlagName(arg), ""); + } else if (arg.startsWith("--") && arg.length > "--".length) { + setCLIArg(flags, arg, normalizeFlagName(arg), parseCLIValue(args)); + } else { + flags.unknownArgs.push(arg); + } +}; +var normalizeNegativeFlagName = (flagName) => { + const trimmed = flagName.replace(/^--no[-]?/, ""); + return normalizeFlagName(trimmed.charAt(0).toLowerCase() + trimmed.slice(1)); +}; +var normalizeFlagName = (flagName) => { + const trimmed = flagName.replace(/^-+/, ""); + return trimmed.includes("-") ? toCamelCase(trimmed) : trimmed; +}; +var setCLIArg = (flags, rawArg, normalizedArg, value) => { + normalizedArg = desugarAlias(normalizedArg); + if (readOnlyArrayHasStringMember(BOOLEAN_CLI_FLAGS, normalizedArg)) { + const parsed = typeof value === "string" ? ( + // check if the value is `'true'` + value === "true" + ) : ( + // no value was supplied, default to true + true + ); + flags[normalizedArg] = parsed; + flags.knownArgs.push(rawArg); + if (typeof value === "string" && value !== "") { + flags.knownArgs.push(value); + } + } else if (readOnlyArrayHasStringMember(STRING_CLI_FLAGS, normalizedArg)) { + if (typeof value === "string") { + flags[normalizedArg] = value; + flags.knownArgs.push(rawArg); + flags.knownArgs.push(value); + } else { + throwCLIParsingError(rawArg, "expected a string argument but received nothing"); + } + } else if (readOnlyArrayHasStringMember(STRING_ARRAY_CLI_FLAGS, normalizedArg)) { + if (typeof value === "string") { + if (!Array.isArray(flags[normalizedArg])) { + flags[normalizedArg] = []; + } + const targetArray = flags[normalizedArg]; + if (Array.isArray(targetArray)) { + targetArray.push(value); + flags.knownArgs.push(rawArg); + flags.knownArgs.push(value); + } + } else { + throwCLIParsingError(rawArg, "expected a string argument but received nothing"); + } + } else if (readOnlyArrayHasStringMember(NUMBER_CLI_FLAGS, normalizedArg)) { + if (typeof value === "string") { + const parsed = parseInt(value, 10); + if (isNaN(parsed)) { + throwNumberParsingError(rawArg, value); + } else { + flags[normalizedArg] = parsed; + flags.knownArgs.push(rawArg); + flags.knownArgs.push(value); + } + } else { + throwCLIParsingError(rawArg, "expected a number argument but received nothing"); + } + } else if (readOnlyArrayHasStringMember(STRING_NUMBER_CLI_FLAGS, normalizedArg)) { + if (typeof value === "string") { + if (CLI_ARG_STRING_REGEX.test(value)) { + flags[normalizedArg] = value; + } else { + const parsed = Number(value); + if (isNaN(parsed)) { + throwNumberParsingError(rawArg, value); + } else { + flags[normalizedArg] = parsed; + } + } + flags.knownArgs.push(rawArg); + flags.knownArgs.push(value); + } else { + throwCLIParsingError(rawArg, "expected a string or a number but received nothing"); + } + } else if (readOnlyArrayHasStringMember(BOOLEAN_STRING_CLI_FLAGS, normalizedArg)) { + const derivedValue = typeof value === "string" ? value ? value : false : true; + flags[normalizedArg] = derivedValue; + flags.knownArgs.push(rawArg); + if (typeof derivedValue === "string" && derivedValue) { + flags.knownArgs.push(derivedValue); + } + } else if (readOnlyArrayHasStringMember(LOG_LEVEL_CLI_FLAGS, normalizedArg)) { + if (typeof value === "string") { + if (isLogLevel(value)) { + flags[normalizedArg] = value; + flags.knownArgs.push(rawArg); + flags.knownArgs.push(value); + } else { + throwCLIParsingError(rawArg, `expected to receive a valid log level but received "${String(value)}"`); + } + } else { + throwCLIParsingError(rawArg, "expected to receive a valid log level but received nothing"); + } + } else { + flags.unknownArgs.push(rawArg); + if (typeof value === "string") { + flags.unknownArgs.push(value); + } + } +}; +var CLI_ARG_STRING_REGEX = /[^\d\.Ee\+\-]+/g; +var Empty = Symbol("Empty"); +var parseCLIValue = (args) => { + if (args[0] === void 0) { + return Empty; + } + if (!args[0].startsWith("-")) { + const value = args.shift(); + if (typeof value === "string") { + return value; + } + } + return Empty; +}; +var parseEqualsArg = (arg) => { + const [originalArg, ...splitSections] = arg.split("="); + const value = splitSections.join("="); + return [originalArg, value === "" ? Empty : value]; +}; +var isLogLevel = (maybeLogLevel) => readOnlyArrayHasStringMember(LOG_LEVELS, maybeLogLevel); +var throwCLIParsingError = (flag, message) => { + throw new Error(`when parsing CLI flag "${flag}": ${message}`); +}; +var throwNumberParsingError = (flag, value) => { + throwCLIParsingError(flag, `expected a number but received "${value}"`); +}; +var desugarAlias = (maybeAlias) => { + const possiblyDesugared = CLI_FLAG_ALIASES[maybeAlias]; + if (typeof possiblyDesugared === "string") { + return possiblyDesugared; + } + return maybeAlias; +}; +var desugarRawAlias = (rawAlias) => "--" + desugarAlias(normalizeFlagName(rawAlias)); + +// src/cli/find-config.ts +var findConfig = async (opts) => { + const sys = opts.sys; + const cwd = sys.getCurrentDirectory(); + const rootDir = normalizePath(cwd); + let configPath = opts.configPath; + if (isString(configPath)) { + if (!sys.platformPath.isAbsolute(configPath)) { + configPath = normalizePath(sys.platformPath.join(cwd, configPath)); + } else { + configPath = normalizePath(configPath); + } + } else { + configPath = rootDir; + } + const results = { + configPath, + rootDir: normalizePath(cwd) + }; + const stat = await sys.stat(configPath); + if (stat.error) { + const diagnostics = []; + const diagnostic = buildError(diagnostics); + diagnostic.absFilePath = configPath; + diagnostic.header = `Invalid config path`; + diagnostic.messageText = `Config path "${configPath}" not found`; + return result_exports.err(diagnostics); + } + if (stat.isFile) { + results.configPath = configPath; + results.rootDir = sys.platformPath.dirname(configPath); + } else if (stat.isDirectory) { + for (const configName of ["stencil.config.ts", "stencil.config.js"]) { + const testConfigFilePath = sys.platformPath.join(configPath, configName); + const stat2 = await sys.stat(testConfigFilePath); + if (stat2.isFile) { + results.configPath = testConfigFilePath; + results.rootDir = sys.platformPath.dirname(testConfigFilePath); + break; + } + } + } + return result_exports.ok(results); +}; + +// src/cli/load-compiler.ts +var loadCoreCompiler = async (sys) => { + return await sys.dynamicImport(sys.getCompilerExecutingPath()); +}; + +// src/cli/logs.ts +var startupLog = (logger, task) => { + if (task === "info" || task === "serve" || task === "version") { + return; + } + logger.info(logger.cyan(`@stencil/core`)); +}; +var startupLogVersion = (logger, task, coreCompiler) => { + if (task === "info" || task === "serve" || task === "version") { + return; + } + const isDevBuild = coreCompiler.version.includes("-dev."); + let startupMsg; + if (isDevBuild) { + startupMsg = logger.yellow(`[LOCAL DEV] v${coreCompiler.version}`); + } else { + startupMsg = logger.cyan(`v${coreCompiler.version}`); + } + startupMsg += logger.emoji(" " + coreCompiler.vermoji); + logger.info(startupMsg); +}; +var loadedCompilerLog = (sys, logger, flags, coreCompiler) => { + const sysDetails = sys.details; + const runtimeInfo = `${sys.name} ${sys.version}`; + const platformInfo = sysDetails ? `${sysDetails.platform}, ${sysDetails.cpuModel}` : `Unknown Platform, Unknown CPU Model`; + const statsInfo = sysDetails ? `cpus: ${sys.hardwareConcurrency}, freemem: ${Math.round( + sysDetails.freemem() / 1e6 + )}MB, totalmem: ${Math.round(sysDetails.totalmem / 1e6)}MB` : "Unknown CPU Core Count, Unknown Memory"; + if (logger.getLevel() === "debug") { + logger.debug(runtimeInfo); + logger.debug(platformInfo); + logger.debug(statsInfo); + logger.debug(`compiler: ${sys.getCompilerExecutingPath()}`); + logger.debug(`build: ${coreCompiler.buildId}`); + } else if (flags.ci) { + logger.info(runtimeInfo); + logger.info(platformInfo); + logger.info(statsInfo); + } +}; +var startupCompilerLog = (coreCompiler, config) => { + if (config.suppressLogs === true) { + return; + } + const { logger } = config; + const isDebug = logger.getLevel() === "debug"; + const isPrerelease = coreCompiler.version.includes("-"); + const isDevBuild = coreCompiler.version.includes("-dev."); + if (isPrerelease && !isDevBuild) { + logger.warn( + logger.yellow( + `This is a prerelease build, undocumented changes might happen at any time. Technical support is not available for prereleases, but any assistance testing is appreciated.` + ) + ); + } + if (config.devMode && !isDebug) { + if (config.buildEs5) { + logger.warn( + `Generating ES5 during development is a very task expensive, initial and incremental builds will be much slower. Drop the '--es5' flag and use a modern browser for development.` + ); + } + if (!config.enableCache) { + logger.warn(`Disabling cache during development will slow down incremental builds.`); + } + } +}; + +// src/cli/check-version.ts +var startCheckVersion = async (config, currentVersion) => { + if (config.devMode && !config.flags.ci && !currentVersion.includes("-dev.") && isFunction(config.sys.checkVersion)) { + return config.sys.checkVersion(config.logger, currentVersion); + } + return null; +}; +var printCheckVersionResults = async (versionChecker) => { + if (versionChecker) { + const checkVersionResults = await versionChecker; + if (isFunction(checkVersionResults)) { + checkVersionResults(); + } + } +}; + +// src/cli/task-prerender.ts +var taskPrerender = async (coreCompiler, config) => { + startupCompilerLog(coreCompiler, config); + const hydrateAppFilePath = config.flags.unknownArgs[0]; + if (typeof hydrateAppFilePath !== "string") { + config.logger.error(`Missing hydrate app script path`); + return config.sys.exit(1); + } + const srcIndexHtmlPath = config.srcIndexHtml; + const diagnostics = await runPrerenderTask(coreCompiler, config, hydrateAppFilePath, void 0, srcIndexHtmlPath); + config.logger.printDiagnostics(diagnostics); + if (diagnostics.some((d) => d.level === "error")) { + return config.sys.exit(1); + } +}; +var runPrerenderTask = async (coreCompiler, config, hydrateAppFilePath, componentGraph, srcIndexHtmlPath) => { + const diagnostics = []; + try { + const prerenderer = await coreCompiler.createPrerenderer(config); + const results = await prerenderer.start({ + hydrateAppFilePath, + componentGraph, + srcIndexHtmlPath + }); + diagnostics.push(...results.diagnostics); + } catch (e) { + catchError(diagnostics, e); + } + return diagnostics; +}; + +// src/cli/task-watch.ts +var taskWatch = async (coreCompiler, config) => { + let devServer = null; + let exitCode = 0; + try { + startupCompilerLog(coreCompiler, config); + const versionChecker = startCheckVersion(config, coreCompiler.version); + const compiler = await coreCompiler.createCompiler(config); + const watcher = await compiler.createWatcher(); + if (!config.sys.getDevServerExecutingPath || !config.sys.dynamicImport || !config.sys.onProcessInterrupt) { + throw new Error( + `Environment doesn't provide required functions: getDevServerExecutingPath, dynamicImport, onProcessInterrupt` + ); + } + if (config.flags.serve) { + const devServerPath = config.sys.getDevServerExecutingPath(); + const { start } = await config.sys.dynamicImport(devServerPath); + devServer = await start(config.devServer, config.logger, watcher); + } + config.sys.onProcessInterrupt(() => { + config.logger.debug(`close watch`); + compiler && compiler.destroy(); + }); + const rmVersionCheckerLog = watcher.on("buildFinish", async () => { + rmVersionCheckerLog(); + printCheckVersionResults(versionChecker); + }); + if (devServer) { + const rmDevServerLog = watcher.on("buildFinish", () => { + var _a; + rmDevServerLog(); + const url = (_a = devServer == null ? void 0 : devServer.browserUrl) != null ? _a : "UNKNOWN URL"; + config.logger.info(`${config.logger.cyan(url)} +`); + }); + } + const closeResults = await watcher.start(); + if (closeResults.exitCode > 0) { + exitCode = closeResults.exitCode; + } + } catch (e) { + exitCode = 1; + config.logger.error(e); + } + if (devServer) { + await devServer.close(); + } + if (exitCode > 0) { + return config.sys.exit(exitCode); + } +}; + +// src/cli/telemetry/helpers.ts +var tryFn = async (fn, ...args) => { + try { + return await fn(...args); + } catch { + } + return null; +}; +var isInteractive = (sys, flags, object) => { + const terminalInfo = object || Object.freeze({ + tty: sys.isTTY() ? true : false, + ci: ["CI", "BUILD_ID", "BUILD_NUMBER", "BITBUCKET_COMMIT", "CODEBUILD_BUILD_ARN"].filter( + (v) => { + var _a; + return !!((_a = sys.getEnvironmentVar) == null ? void 0 : _a.call(sys, v)); + } + ).length > 0 || !!flags.ci + }); + return terminalInfo.tty && !terminalInfo.ci; +}; +var UUID_REGEX = new RegExp(/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i); +function uuidv4() { + return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => { + const r = Math.random() * 16 | 0; + const v = c == "x" ? r : r & 3 | 8; + return v.toString(16); + }); +} +async function readJson(sys, path) { + const file = await sys.readFile(path); + return !!file && JSON.parse(file); +} +function hasDebug(flags) { + return !!flags.debug; +} +function hasVerbose(flags) { + return !!flags.verbose && hasDebug(flags); +} + +// src/cli/ionic-config.ts +var isTest = () => process.env.JEST_WORKER_ID !== void 0; +var defaultConfig = (sys) => sys.resolvePath(`${sys.homeDir()}/.ionic/${isTest() ? "tmp-config.json" : "config.json"}`); +var defaultConfigDirectory = (sys) => sys.resolvePath(`${sys.homeDir()}/.ionic`); +async function readConfig(sys) { + let config = await readJson(sys, defaultConfig(sys)); + if (!config) { + config = { + "tokens.telemetry": uuidv4(), + "telemetry.stencil": true + }; + await writeConfig(sys, config); + } else if (!config["tokens.telemetry"] || !UUID_REGEX.test(config["tokens.telemetry"])) { + const newUuid = uuidv4(); + await writeConfig(sys, { ...config, "tokens.telemetry": newUuid }); + config["tokens.telemetry"] = newUuid; + } + return config; +} +async function writeConfig(sys, config) { + let result = false; + try { + await sys.createDir(defaultConfigDirectory(sys), { recursive: true }); + await sys.writeFile(defaultConfig(sys), JSON.stringify(config, null, 2)); + result = true; + } catch (error) { + console.error(`Stencil Telemetry: couldn't write configuration file to ${defaultConfig(sys)} - ${error}.`); + } + return result; +} +async function updateConfig(sys, newOptions) { + const config = await readConfig(sys); + return await writeConfig(sys, Object.assign(config, newOptions)); +} + +// src/cli/telemetry/shouldTrack.ts +async function shouldTrack(config, sys, ci) { + return !ci && isInteractive(sys, config.flags) && await checkTelemetry(sys); +} + +// src/cli/telemetry/telemetry.ts +async function telemetryBuildFinishedAction(sys, config, coreCompiler, result) { + const tracking = await shouldTrack(config, sys, !!config.flags.ci); + if (!tracking) { + return; + } + const component_count = result.componentGraph ? Object.keys(result.componentGraph).length : void 0; + const data = await prepareData(coreCompiler, config, sys, result.duration, component_count); + await sendMetric(sys, config, "stencil_cli_command", data); + config.logger.debug(`${config.logger.blue("Telemetry")}: ${config.logger.gray(JSON.stringify(data))}`); +} +async function telemetryAction(sys, config, coreCompiler, action) { + const tracking = await shouldTrack(config, sys, !!config.flags.ci); + let duration = void 0; + let error; + if (action) { + const start = /* @__PURE__ */ new Date(); + try { + await action(); + } catch (e) { + error = e; + } + const end = /* @__PURE__ */ new Date(); + duration = end.getTime() - start.getTime(); + } + if (!tracking || config.flags.task == "build" && !config.flags.args.includes("--watch")) { + return; + } + const data = await prepareData(coreCompiler, config, sys, duration); + await sendMetric(sys, config, "stencil_cli_command", data); + config.logger.debug(`${config.logger.blue("Telemetry")}: ${config.logger.gray(JSON.stringify(data))}`); + if (error) { + throw error; + } +} +function hasAppTarget(config) { + return config.outputTargets.some( + (target) => target.type === WWW && (!!target.serviceWorker || !!target.baseUrl && target.baseUrl !== "/") + ); +} +function isUsingYarn(sys) { + var _a, _b; + return ((_b = (_a = sys.getEnvironmentVar) == null ? void 0 : _a.call(sys, "npm_execpath")) == null ? void 0 : _b.includes("yarn")) || false; +} +function getActiveTargets(config) { + const result = config.outputTargets.map((t) => t.type); + return Array.from(new Set(result)); +} +var prepareData = async (coreCompiler, config, sys, duration_ms, component_count = void 0) => { + var _a, _b, _c; + const { typescript, rollup } = coreCompiler.versions || { typescript: "unknown", rollup: "unknown" }; + const { packages, packagesNoVersions } = await getInstalledPackages(sys, config); + const targets = getActiveTargets(config); + const yarn = isUsingYarn(sys); + const stencil = coreCompiler.version || "unknown"; + const system = `${sys.name} ${sys.version}`; + const os_name = (_a = sys.details) == null ? void 0 : _a.platform; + const os_version = (_b = sys.details) == null ? void 0 : _b.release; + const cpu_model = (_c = sys.details) == null ? void 0 : _c.cpuModel; + const build = coreCompiler.buildId || "unknown"; + const has_app_pwa_config = hasAppTarget(config); + const anonymizedConfig = anonymizeConfigForTelemetry(config); + return { + arguments: config.flags.args, + build, + component_count, + config: anonymizedConfig, + cpu_model, + duration_ms, + has_app_pwa_config, + os_name, + os_version, + packages, + packages_no_versions: packagesNoVersions, + rollup, + stencil, + system, + system_major: getMajorVersion(system), + targets, + task: config.flags.task, + typescript, + yarn + }; +}; +var OUTPUT_TARGET_KEYS_TO_KEEP = ["type"]; +var CONFIG_PROPS_TO_ANONYMIZE = [ + "rootDir", + "fsNamespace", + "packageJsonFilePath", + "namespace", + "srcDir", + "srcIndexHtml", + "buildLogFilePath", + "cacheDir", + "configPath", + "tsconfig" +]; +var CONFIG_PROPS_TO_DELETE = [ + "commonjs", + "devServer", + "env", + "logger", + "rollupConfig", + "sys", + "testing", + "tsCompilerOptions" +]; +var anonymizeConfigForTelemetry = (config) => { + const anonymizedConfig = { ...config }; + for (const prop of CONFIG_PROPS_TO_ANONYMIZE) { + if (anonymizedConfig[prop] !== void 0) { + anonymizedConfig[prop] = "omitted"; + } + } + anonymizedConfig.outputTargets = config.outputTargets.map((target) => { + const anonymizedOT = JSON.parse( + JSON.stringify(target, (key, value) => { + if (!(typeof value === "string")) { + return value; + } + if (OUTPUT_TARGET_KEYS_TO_KEEP.includes(key)) { + return value; + } + return "omitted"; + }) + ); + if (isOutputTargetHydrate(target) && target.external) { + anonymizedOT["external"] = target.external.concat(); + } + return anonymizedOT; + }); + for (const prop of CONFIG_PROPS_TO_DELETE) { + delete anonymizedConfig[prop]; + } + return anonymizedConfig; +}; +async function getInstalledPackages(sys, config) { + let packages = []; + let packagesNoVersions = []; + const yarn = isUsingYarn(sys); + try { + const appRootDir = sys.getCurrentDirectory(); + const packageJson = await tryFn( + readJson, + sys, + sys.resolvePath(appRootDir + "/package.json") + ); + if (!packageJson) { + return { packages, packagesNoVersions }; + } + const rawPackages = Object.entries({ + ...packageJson.devDependencies, + ...packageJson.dependencies + }); + const ionicPackages = rawPackages.filter( + ([k]) => k.startsWith("@stencil/") || k.startsWith("@ionic/") || k.startsWith("@capacitor/") + ); + try { + packages = yarn ? await yarnPackages(sys, ionicPackages) : await npmPackages(sys, ionicPackages); + } catch (e) { + packages = ionicPackages.map(([k, v]) => `${k}@${v.replace("^", "")}`); + } + packagesNoVersions = ionicPackages.map(([k]) => `${k}`); + return { packages, packagesNoVersions }; + } catch (err2) { + hasDebug(config.flags) && console.error(err2); + return { packages, packagesNoVersions }; + } +} +async function npmPackages(sys, ionicPackages) { + const appRootDir = sys.getCurrentDirectory(); + const packageLockJson = await tryFn(readJson, sys, sys.resolvePath(appRootDir + "/package-lock.json")); + return ionicPackages.map(([k, v]) => { + var _a, _b, _c, _d; + let version = (_d = (_c = (_a = packageLockJson == null ? void 0 : packageLockJson.dependencies[k]) == null ? void 0 : _a.version) != null ? _c : (_b = packageLockJson == null ? void 0 : packageLockJson.devDependencies[k]) == null ? void 0 : _b.version) != null ? _d : v; + version = version.includes("file:") ? sanitizeDeclaredVersion(v) : version; + return `${k}@${version}`; + }); +} +async function yarnPackages(sys, ionicPackages) { + var _a; + const appRootDir = sys.getCurrentDirectory(); + const yarnLock = sys.readFileSync(sys.resolvePath(appRootDir + "/yarn.lock")); + const yarnLockYml = (_a = sys.parseYarnLockFile) == null ? void 0 : _a.call(sys, yarnLock); + return ionicPackages.map(([k, v]) => { + var _a2; + const identifiedVersion = `${k}@${v}`; + let version = (_a2 = yarnLockYml == null ? void 0 : yarnLockYml.object[identifiedVersion]) == null ? void 0 : _a2.version; + version = version && version.includes("undefined") ? sanitizeDeclaredVersion(identifiedVersion) : version; + return `${k}@${version}`; + }); +} +function sanitizeDeclaredVersion(version) { + return version.replace(/[*^~]/g, ""); +} +async function sendMetric(sys, config, name, value) { + const session_id = await getTelemetryToken(sys); + const message = { + name, + timestamp: (/* @__PURE__ */ new Date()).toISOString(), + source: "stencil_cli", + value, + session_id + }; + await sendTelemetry(sys, config, message); +} +async function getTelemetryToken(sys) { + const config = await readConfig(sys); + if (config["tokens.telemetry"] === void 0) { + config["tokens.telemetry"] = uuidv4(); + await writeConfig(sys, config); + } + return config["tokens.telemetry"]; +} +async function sendTelemetry(sys, config, data) { + try { + const now = (/* @__PURE__ */ new Date()).toISOString(); + const body = { + metrics: [data], + sent_at: now + }; + if (!sys.fetch) { + throw new Error("No fetch implementation available"); + } + const response = await sys.fetch("https://api.ionicjs.com/events/metrics", { + method: "POST", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(body) + }); + hasVerbose(config.flags) && console.debug("\nSent %O metric to events service (status: %O)", data.name, response.status, "\n"); + if (response.status !== 204) { + hasVerbose(config.flags) && console.debug("\nBad response from events service. Request body: %O", response.body.toString(), "\n"); + } + } catch (e) { + hasVerbose(config.flags) && console.debug("Telemetry request failed:", e); + } +} +async function checkTelemetry(sys) { + const config = await readConfig(sys); + if (config["telemetry.stencil"] === void 0) { + config["telemetry.stencil"] = true; + await writeConfig(sys, config); + } + return config["telemetry.stencil"]; +} +async function enableTelemetry(sys) { + return await updateConfig(sys, { "telemetry.stencil": true }); +} +async function disableTelemetry(sys) { + return await updateConfig(sys, { "telemetry.stencil": false }); +} +function getMajorVersion(version) { + const parts = version.split("."); + return parts[0]; +} + +// src/cli/task-build.ts +var taskBuild = async (coreCompiler, config) => { + if (config.flags.watch) { + await taskWatch(coreCompiler, config); + return; + } + let exitCode = 0; + try { + startupCompilerLog(coreCompiler, config); + const versionChecker = startCheckVersion(config, coreCompiler.version); + const compiler = await coreCompiler.createCompiler(config); + const results = await compiler.build(); + await telemetryBuildFinishedAction(config.sys, config, coreCompiler, results); + await compiler.destroy(); + if (results.hasError) { + exitCode = 1; + } else if (config.flags.prerender) { + const prerenderDiagnostics = await runPrerenderTask( + coreCompiler, + config, + results.hydrateAppFilePath, + results.componentGraph, + void 0 + ); + config.logger.printDiagnostics(prerenderDiagnostics); + if (prerenderDiagnostics.some((d) => d.level === "error")) { + exitCode = 1; + } + } + await printCheckVersionResults(versionChecker); + } catch (e) { + exitCode = 1; + config.logger.error(e); + } + if (exitCode > 0) { + return config.sys.exit(exitCode); + } +}; + +// src/cli/task-docs.ts +var taskDocs = async (coreCompiler, config) => { + config.devServer = {}; + config.outputTargets = config.outputTargets.filter(isOutputTargetDocs); + config.devMode = true; + startupCompilerLog(coreCompiler, config); + const compiler = await coreCompiler.createCompiler(config); + await compiler.build(); + await compiler.destroy(); +}; + +// src/cli/task-generate.ts +import { join as join2, parse, relative } from "path"; +var taskGenerate = async (config) => { + if (!config.configPath) { + config.logger.error("Please run this command in your root directory (i. e. the one containing stencil.config.ts)."); + return config.sys.exit(1); + } + const absoluteSrcDir = config.srcDir; + if (!absoluteSrcDir) { + config.logger.error(`Stencil's srcDir was not specified.`); + return config.sys.exit(1); + } + const { prompt } = await Promise.resolve().then(() => __toESM(require_lib())); + const input = config.flags.unknownArgs.find((arg) => !arg.startsWith("-")) || (await prompt({ name: "tagName", type: "text", message: "Component tag name (dash-case):" })).tagName; + if (void 0 === input) { + return; + } + const { dir, base: componentName } = parse(input); + const tagError = validateComponentTag(componentName); + if (tagError) { + config.logger.error(tagError); + return config.sys.exit(1); + } + let cssExtension = "css"; + if (!!config.plugins.find((plugin) => plugin.name === "sass")) { + cssExtension = await chooseSassExtension(); + } else if (!!config.plugins.find((plugin) => plugin.name === "less")) { + cssExtension = "less"; + } + const filesToGenerateExt = await chooseFilesToGenerate(cssExtension); + if (!filesToGenerateExt) { + return; + } + const extensionsToGenerate = ["tsx", ...filesToGenerateExt]; + const testFolder = extensionsToGenerate.some(isTest2) ? "test" : ""; + const outDir = join2(absoluteSrcDir, "components", dir, componentName); + await config.sys.createDir(normalizePath(join2(outDir, testFolder)), { recursive: true }); + const filesToGenerate = extensionsToGenerate.map((extension) => ({ + extension, + path: getFilepathForFile(outDir, componentName, extension) + })); + await checkForOverwrite(filesToGenerate, config); + const writtenFiles = await Promise.all( + filesToGenerate.map( + (file) => getBoilerplateAndWriteFile( + config, + componentName, + extensionsToGenerate.includes("css") || extensionsToGenerate.includes("sass") || extensionsToGenerate.includes("scss") || extensionsToGenerate.includes("less"), + file, + cssExtension + ) + ) + ).catch((error) => config.logger.error(error)); + if (!writtenFiles) { + return config.sys.exit(1); + } + console.log(); + console.log(`${config.logger.gray("$")} stencil generate ${input}`); + console.log(); + console.log(config.logger.bold("The following files have been generated:")); + const absoluteRootDir = config.rootDir; + writtenFiles.map((file) => console.log(` - ${relative(absoluteRootDir, file)}`)); +}; +var chooseFilesToGenerate = async (cssExtension) => { + const { prompt } = await Promise.resolve().then(() => __toESM(require_lib())); + return (await prompt({ + name: "filesToGenerate", + type: "multiselect", + message: "Which additional files do you want to generate?", + choices: [ + { value: cssExtension, title: `Stylesheet (.${cssExtension})`, selected: true }, + { value: "spec.tsx", title: "Spec Test (.spec.tsx)", selected: true }, + { value: "e2e.ts", title: "E2E Test (.e2e.ts)", selected: true } + ] + })).filesToGenerate; +}; +var chooseSassExtension = async () => { + const { prompt } = await Promise.resolve().then(() => __toESM(require_lib())); + return (await prompt({ + name: "sassFormat", + type: "select", + message: "Which Sass format would you like to use? (More info: https://sass-lang.com/documentation/syntax/#the-indented-syntax)", + choices: [ + { value: "sass", title: `*.sass Format`, selected: true }, + { value: "scss", title: "*.scss Format" } + ] + })).sassFormat; +}; +var getFilepathForFile = (filePath, componentName, extension) => isTest2(extension) ? normalizePath(join2(filePath, "test", `${componentName}.${extension}`)) : normalizePath(join2(filePath, `${componentName}.${extension}`)); +var getBoilerplateAndWriteFile = async (config, componentName, withCss, file, styleExtension) => { + const boilerplate = getBoilerplateByExtension(componentName, file.extension, withCss, styleExtension); + await config.sys.writeFile(normalizePath(file.path), boilerplate); + return file.path; +}; +var checkForOverwrite = async (files, config) => { + const alreadyPresent = []; + await Promise.all( + files.map(async ({ path }) => { + if (await config.sys.readFile(path) !== void 0) { + alreadyPresent.push(path); + } + }) + ); + if (alreadyPresent.length > 0) { + config.logger.error( + "Generating code would overwrite the following files:", + ...alreadyPresent.map((path) => " " + normalizePath(path)) + ); + await config.sys.exit(1); + } +}; +var isTest2 = (extension) => { + return extension === "e2e.ts" || extension === "spec.tsx"; +}; +var getBoilerplateByExtension = (tagName, extension, withCss, styleExtension) => { + switch (extension) { + case "tsx": + return getComponentBoilerplate(tagName, withCss, styleExtension); + case "css": + case "less": + case "sass": + case "scss": + return getStyleUrlBoilerplate(styleExtension); + case "spec.tsx": + return getSpecTestBoilerplate(tagName); + case "e2e.ts": + return getE2eTestBoilerplate(tagName); + default: + throw new Error(`Unkown extension "${extension}".`); + } +}; +var getComponentBoilerplate = (tagName, hasStyle, styleExtension) => { + const decorator = [`{`]; + decorator.push(` tag: '${tagName}',`); + if (hasStyle) { + decorator.push(` styleUrl: '${tagName}.${styleExtension}',`); + } + decorator.push(` shadow: true,`); + decorator.push(`}`); + return `import { Component, Host, h } from '@stencil/core'; + +@Component(${decorator.join("\n")}) +export class ${toPascalCase(tagName)} { + render() { + return ( + + + + ); + } +} +`; +}; +var getStyleUrlBoilerplate = (ext) => ext === "sass" ? `:host + display: block +` : `:host { + display: block; +} +`; +var getSpecTestBoilerplate = (tagName) => `import { newSpecPage } from '@stencil/core/testing'; +import { ${toPascalCase(tagName)} } from '../${tagName}'; + +describe('${tagName}', () => { + it('renders', async () => { + const page = await newSpecPage({ + components: [${toPascalCase(tagName)}], + html: \`<${tagName}>\`, + }); + expect(page.root).toEqualHtml(\` + <${tagName}> + + + + + \`); + }); +}); +`; +var getE2eTestBoilerplate = (tagName) => `import { newE2EPage } from '@stencil/core/testing'; + +describe('${tagName}', () => { + it('renders', async () => { + const page = await newE2EPage(); + await page.setContent('<${tagName}>'); + + const element = await page.find('${tagName}'); + expect(element).toHaveClass('hydrated'); + }); +}); +`; +var toPascalCase = (str) => str.split("-").reduce((res, part) => res + part[0].toUpperCase() + part.slice(1), ""); + +// src/cli/task-telemetry.ts +var taskTelemetry = async (flags, sys, logger) => { + var _a; + const prompt = logger.dim(((_a = sys.details) == null ? void 0 : _a.platform) === "windows" ? ">" : "$"); + const isEnabling = flags.args.includes("on"); + const isDisabling = flags.args.includes("off"); + const INFORMATION = `Opt in or out of telemetry. Information about the data we collect is available on our website: ${logger.bold( + "https://stenciljs.com/telemetry" + )}`; + const THANK_YOU = `Thank you for helping to make Stencil better! \u{1F496}`; + const ENABLED_MESSAGE = `${logger.green("Enabled")}. ${THANK_YOU} + +`; + const DISABLED_MESSAGE = `${logger.red("Disabled")} + +`; + const hasTelemetry = await checkTelemetry(sys); + if (isEnabling) { + const result = await enableTelemetry(sys); + result ? console.log(` + ${logger.bold("Telemetry is now ") + ENABLED_MESSAGE}`) : console.log(`Something went wrong when enabling Telemetry.`); + return; + } + if (isDisabling) { + const result = await disableTelemetry(sys); + result ? console.log(` + ${logger.bold("Telemetry is now ") + DISABLED_MESSAGE}`) : console.log(`Something went wrong when disabling Telemetry.`); + return; + } + console.log(` ${logger.bold("Telemetry:")} ${logger.dim(INFORMATION)}`); + console.log(` + ${logger.bold("Status")}: ${hasTelemetry ? ENABLED_MESSAGE : DISABLED_MESSAGE}`); + console.log(` ${prompt} ${logger.green("stencil telemetry [off|on]")} + + ${logger.cyan("off")} ${logger.dim(".............")} Disable sharing anonymous usage data + ${logger.cyan("on")} ${logger.dim("..............")} Enable sharing anonymous usage data + `); +}; + +// src/cli/task-help.ts +var taskHelp = async (flags, logger, sys) => { + var _a; + const prompt = logger.dim(((_a = sys.details) == null ? void 0 : _a.platform) === "windows" ? ">" : "$"); + console.log(` + ${logger.bold("Build:")} ${logger.dim("Build components for development or production.")} + + ${prompt} ${logger.green("stencil build [--dev] [--watch] [--prerender] [--debug]")} + + ${logger.cyan("--dev")} ${logger.dim(".............")} Development build + ${logger.cyan("--watch")} ${logger.dim("...........")} Rebuild when files update + ${logger.cyan("--serve")} ${logger.dim("...........")} Start the dev-server + ${logger.cyan("--prerender")} ${logger.dim(".......")} Prerender the application + ${logger.cyan("--docs")} ${logger.dim("............")} Generate component readme.md docs + ${logger.cyan("--config")} ${logger.dim("..........")} Set stencil config file + ${logger.cyan("--stats")} ${logger.dim("...........")} Write stencil-stats.json file + ${logger.cyan("--log")} ${logger.dim(".............")} Write stencil-build.log file + ${logger.cyan("--debug")} ${logger.dim("...........")} Set the log level to debug + + + ${logger.bold("Test:")} ${logger.dim("Run unit and end-to-end tests.")} + + ${prompt} ${logger.green("stencil test [--spec] [--e2e]")} + + ${logger.cyan("--spec")} ${logger.dim("............")} Run unit tests with Jest + ${logger.cyan("--e2e")} ${logger.dim(".............")} Run e2e tests with Puppeteer + + + ${logger.bold("Generate:")} ${logger.dim("Bootstrap components.")} + + ${prompt} ${logger.green("stencil generate")} or ${logger.green("stencil g")} + +`); + await taskTelemetry(flags, sys, logger); + console.log(` + ${logger.bold("Examples:")} + + ${prompt} ${logger.green("stencil build --dev --watch --serve")} + ${prompt} ${logger.green("stencil build --prerender")} + ${prompt} ${logger.green("stencil test --spec --e2e")} + ${prompt} ${logger.green("stencil telemetry on")} + ${prompt} ${logger.green("stencil generate")} + ${prompt} ${logger.green("stencil g my-component")} +`); +}; + +// src/cli/task-info.ts +var taskInfo = (coreCompiler, sys, logger) => { + const details = sys.details; + const versions = coreCompiler.versions; + console.log(``); + console.log(`${logger.cyan(" System:")} ${sys.name} ${sys.version}`); + if (details) { + console.log(`${logger.cyan(" Platform:")} ${details.platform} (${details.release})`); + console.log( + `${logger.cyan(" CPU Model:")} ${details.cpuModel} (${sys.hardwareConcurrency} cpu${sys.hardwareConcurrency !== 1 ? "s" : ""})` + ); + } + console.log(`${logger.cyan(" Compiler:")} ${sys.getCompilerExecutingPath()}`); + console.log(`${logger.cyan(" Build:")} ${coreCompiler.buildId}`); + console.log(`${logger.cyan(" Stencil:")} ${coreCompiler.version}${logger.emoji(" " + coreCompiler.vermoji)}`); + console.log(`${logger.cyan(" TypeScript:")} ${versions.typescript}`); + console.log(`${logger.cyan(" Rollup:")} ${versions.rollup}`); + console.log(`${logger.cyan(" Parse5:")} ${versions.parse5}`); + console.log(`${logger.cyan(" jQuery:")} ${versions.jquery}`); + console.log(`${logger.cyan(" Terser:")} ${versions.terser}`); + console.log(``); +}; + +// src/cli/task-serve.ts +var taskServe = async (config) => { + config.suppressLogs = true; + config.flags.serve = true; + config.devServer.openBrowser = !!config.flags.open; + config.devServer.reloadStrategy = null; + config.devServer.initialLoadUrl = "/"; + config.devServer.websocket = false; + config.maxConcurrentWorkers = 1; + config.devServer.root = isString(config.flags.root) ? config.flags.root : config.sys.getCurrentDirectory(); + if (!config.sys.getDevServerExecutingPath || !config.sys.dynamicImport || !config.sys.onProcessInterrupt) { + throw new Error( + `Environment doesn't provide required functions: getDevServerExecutingPath, dynamicImport, onProcessInterrupt` + ); + } + const devServerPath = config.sys.getDevServerExecutingPath(); + const { start } = await config.sys.dynamicImport(devServerPath); + const devServer = await start(config.devServer, config.logger); + console.log(`${config.logger.cyan(" Root:")} ${devServer.root}`); + console.log(`${config.logger.cyan(" Address:")} ${devServer.address}`); + console.log(`${config.logger.cyan(" Port:")} ${devServer.port}`); + console.log(`${config.logger.cyan(" Server:")} ${devServer.browserUrl}`); + console.log(``); + config.sys.onProcessInterrupt(() => { + if (devServer) { + config.logger.debug(`dev server close: ${devServer.browserUrl}`); + devServer.close(); + } + }); +}; + +// src/cli/task-test.ts +var taskTest = async (config) => { + var _a; + config.buildDocs = false; + const testingRunOpts = { + e2e: !!config.flags.e2e, + screenshot: !!config.flags.screenshot, + spec: !!config.flags.spec, + updateScreenshot: !!config.flags.updateScreenshot + }; + const ensureModuleIds = ["@types/jest", "jest", "jest-cli"]; + if (testingRunOpts.e2e) { + const puppeteer = config.testing.browserExecutablePath ? "puppeteer-core" : "puppeteer"; + ensureModuleIds.push(puppeteer); + if (testingRunOpts.screenshot) { + config.logger.warn( + config.logger.yellow( + `EXPERIMENTAL: screenshot visual diff testing is currently under heavy development and has not reached a stable status. However, any assistance testing would be appreciated.` + ) + ); + } + } + const diagnostics = await ((_a = config.sys.lazyRequire) == null ? void 0 : _a.ensure(config.rootDir, ensureModuleIds)); + if (diagnostics && diagnostics.length > 0) { + config.logger.printDiagnostics(diagnostics); + return config.sys.exit(1); + } + try { + const { createTesting } = await import("../testing/index.js"); + const testing = await createTesting(config); + const passed = await testing.run(testingRunOpts); + await testing.destroy(); + if (!passed) { + return config.sys.exit(1); + } + } catch (e) { + config.logger.error(e); + return config.sys.exit(1); + } +}; + +// src/cli/run.ts +var run = async (init) => { + const { args, logger, sys } = init; + try { + const flags = parseFlags(args); + const task = flags.task; + if (flags.debug || flags.verbose) { + logger.setLevel("debug"); + } + if (flags.ci) { + logger.enableColors(false); + } + if (isFunction(sys.applyGlobalPatch)) { + sys.applyGlobalPatch(sys.getCurrentDirectory()); + } + if (task && task === "version" || flags.version) { + const coreCompiler2 = await loadCoreCompiler(sys); + console.log(coreCompiler2.version); + return; + } + if (!task || task === "help" || flags.help) { + await taskHelp(createConfigFlags({ task: "help", args }), logger, sys); + return; + } + startupLog(logger, task); + const findConfigResults = await findConfig({ sys, configPath: flags.config }); + if (findConfigResults.isErr) { + logger.printDiagnostics(findConfigResults.value); + return sys.exit(1); + } + const coreCompiler = await loadCoreCompiler(sys); + startupLogVersion(logger, task, coreCompiler); + loadedCompilerLog(sys, logger, flags, coreCompiler); + if (task === "info") { + taskInfo(coreCompiler, sys, logger); + return; + } + const foundConfig = result_exports.unwrap(findConfigResults); + const validated = await coreCompiler.loadConfig({ + config: { + flags + }, + configPath: foundConfig.configPath, + logger, + sys + }); + if (validated.diagnostics.length > 0) { + logger.printDiagnostics(validated.diagnostics); + if (hasError(validated.diagnostics)) { + return sys.exit(1); + } + } + if (isFunction(sys.applyGlobalPatch)) { + sys.applyGlobalPatch(validated.config.rootDir); + } + await telemetryAction(sys, validated.config, coreCompiler, async () => { + await runTask(coreCompiler, validated.config, task, sys); + }); + } catch (e) { + if (!shouldIgnoreError(e)) { + const details = `${logger.getLevel() === "debug" && e instanceof Error ? e.stack : ""}`; + logger.error(`uncaught cli error: ${e}${details}`); + return sys.exit(1); + } + } +}; +var runTask = async (coreCompiler, config, task, sys) => { + var _a; + const flags = createConfigFlags((_a = config.flags) != null ? _a : { task }); + config.flags = flags; + if (!config.sys) { + config.sys = sys; + } + const strictConfig = coreCompiler.validateConfig(config, {}).config; + switch (task) { + case "build": + await taskBuild(coreCompiler, strictConfig); + break; + case "docs": + await taskDocs(coreCompiler, strictConfig); + break; + case "generate": + case "g": + await taskGenerate(strictConfig); + break; + case "help": + await taskHelp(strictConfig.flags, strictConfig.logger, sys); + break; + case "prerender": + await taskPrerender(coreCompiler, strictConfig); + break; + case "serve": + await taskServe(strictConfig); + break; + case "telemetry": + await taskTelemetry(strictConfig.flags, sys, strictConfig.logger); + break; + case "test": + await taskTest(strictConfig); + break; + case "version": + console.log(coreCompiler.version); + break; + default: + strictConfig.logger.error( + `${strictConfig.logger.emoji("\u274C ")}Invalid stencil command, please see the options below:` + ); + await taskHelp(strictConfig.flags, strictConfig.logger, sys); + return config.sys.exit(1); + } +}; +export { + BOOLEAN_CLI_FLAGS, + parseFlags, + run, + runTask +}; diff --git a/node_modules/@stencil/core/cli/package.json b/node_modules/@stencil/core/cli/package.json new file mode 100644 index 00000000..0bbce7aa --- /dev/null +++ b/node_modules/@stencil/core/cli/package.json @@ -0,0 +1,14 @@ +{ + "name": "@stencil/core/cli", + "version": "4.22.2", + "description": "Stencil CLI.", + "main": "./index.cjs", + "module": "./index.js", + "types": "./index.d.ts", + "exports": { + "import": "./index.js", + "require": "./index.cjs" + }, + "type": "module", + "private": true +} diff --git a/node_modules/@stencil/core/compiler/lib.d.ts b/node_modules/@stencil/core/compiler/lib.d.ts new file mode 100644 index 00000000..b6bb44b2 --- /dev/null +++ b/node_modules/@stencil/core/compiler/lib.d.ts @@ -0,0 +1,22 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + + +/// + +/// +/// +/// +/// diff --git a/node_modules/@stencil/core/compiler/lib.decorators.d.ts b/node_modules/@stencil/core/compiler/lib.decorators.d.ts new file mode 100644 index 00000000..5ac09b82 --- /dev/null +++ b/node_modules/@stencil/core/compiler/lib.decorators.d.ts @@ -0,0 +1,386 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + + +/// + +/** + * The decorator context types provided to class element decorators. + */ +type ClassMemberDecoratorContext = + | ClassMethodDecoratorContext + | ClassGetterDecoratorContext + | ClassSetterDecoratorContext + | ClassFieldDecoratorContext + | ClassAccessorDecoratorContext; + +/** + * The decorator context types provided to any decorator. + */ +type DecoratorContext = + | ClassDecoratorContext + | ClassMemberDecoratorContext; + +type DecoratorMetadataObject = Record & object; + +type DecoratorMetadata = typeof globalThis extends { Symbol: { readonly metadata: symbol; }; } ? DecoratorMetadataObject : DecoratorMetadataObject | undefined; + +/** + * Context provided to a class decorator. + * @template Class The type of the decorated class associated with this context. + */ +interface ClassDecoratorContext< + Class extends abstract new (...args: any) => any = abstract new (...args: any) => any, +> { + /** The kind of element that was decorated. */ + readonly kind: "class"; + + /** The name of the decorated class. */ + readonly name: string | undefined; + + /** + * Adds a callback to be invoked after the class definition has been finalized. + * + * @example + * ```ts + * function customElement(name: string): ClassDecoratorFunction { + * return (target, context) => { + * context.addInitializer(function () { + * customElements.define(name, this); + * }); + * } + * } + * + * @customElement("my-element") + * class MyElement {} + * ``` + */ + addInitializer(initializer: (this: Class) => void): void; + + readonly metadata: DecoratorMetadata; +} + +/** + * Context provided to a class method decorator. + * @template This The type on which the class element will be defined. For a static class element, this will be + * the type of the constructor. For a non-static class element, this will be the type of the instance. + * @template Value The type of the decorated class method. + */ +interface ClassMethodDecoratorContext< + This = unknown, + Value extends (this: This, ...args: any) => any = (this: This, ...args: any) => any, +> { + /** The kind of class element that was decorated. */ + readonly kind: "method"; + + /** The name of the decorated class element. */ + readonly name: string | symbol; + + /** A value indicating whether the class element is a static (`true`) or instance (`false`) element. */ + readonly static: boolean; + + /** A value indicating whether the class element has a private name. */ + readonly private: boolean; + + /** An object that can be used to access the current value of the class element at runtime. */ + readonly access: { + /** + * Determines whether an object has a property with the same name as the decorated element. + */ + has(object: This): boolean; + /** + * Gets the current value of the method from the provided object. + * + * @example + * let fn = context.access.get(instance); + */ + get(object: This): Value; + }; + + /** + * Adds a callback to be invoked either before static initializers are run (when + * decorating a `static` element), or before instance initializers are run (when + * decorating a non-`static` element). + * + * @example + * ```ts + * const bound: ClassMethodDecoratorFunction = (value, context) { + * if (context.private) throw new TypeError("Not supported on private methods."); + * context.addInitializer(function () { + * this[context.name] = this[context.name].bind(this); + * }); + * } + * + * class C { + * message = "Hello"; + * + * @bound + * m() { + * console.log(this.message); + * } + * } + * ``` + */ + addInitializer(initializer: (this: This) => void): void; + + readonly metadata: DecoratorMetadata; +} + +/** + * Context provided to a class getter decorator. + * @template This The type on which the class element will be defined. For a static class element, this will be + * the type of the constructor. For a non-static class element, this will be the type of the instance. + * @template Value The property type of the decorated class getter. + */ +interface ClassGetterDecoratorContext< + This = unknown, + Value = unknown, +> { + /** The kind of class element that was decorated. */ + readonly kind: "getter"; + + /** The name of the decorated class element. */ + readonly name: string | symbol; + + /** A value indicating whether the class element is a static (`true`) or instance (`false`) element. */ + readonly static: boolean; + + /** A value indicating whether the class element has a private name. */ + readonly private: boolean; + + /** An object that can be used to access the current value of the class element at runtime. */ + readonly access: { + /** + * Determines whether an object has a property with the same name as the decorated element. + */ + has(object: This): boolean; + /** + * Invokes the getter on the provided object. + * + * @example + * let value = context.access.get(instance); + */ + get(object: This): Value; + }; + + /** + * Adds a callback to be invoked either before static initializers are run (when + * decorating a `static` element), or before instance initializers are run (when + * decorating a non-`static` element). + */ + addInitializer(initializer: (this: This) => void): void; + + readonly metadata: DecoratorMetadata; +} + +/** + * Context provided to a class setter decorator. + * @template This The type on which the class element will be defined. For a static class element, this will be + * the type of the constructor. For a non-static class element, this will be the type of the instance. + * @template Value The type of the decorated class setter. + */ +interface ClassSetterDecoratorContext< + This = unknown, + Value = unknown, +> { + /** The kind of class element that was decorated. */ + readonly kind: "setter"; + + /** The name of the decorated class element. */ + readonly name: string | symbol; + + /** A value indicating whether the class element is a static (`true`) or instance (`false`) element. */ + readonly static: boolean; + + /** A value indicating whether the class element has a private name. */ + readonly private: boolean; + + /** An object that can be used to access the current value of the class element at runtime. */ + readonly access: { + /** + * Determines whether an object has a property with the same name as the decorated element. + */ + has(object: This): boolean; + /** + * Invokes the setter on the provided object. + * + * @example + * context.access.set(instance, value); + */ + set(object: This, value: Value): void; + }; + + /** + * Adds a callback to be invoked either before static initializers are run (when + * decorating a `static` element), or before instance initializers are run (when + * decorating a non-`static` element). + */ + addInitializer(initializer: (this: This) => void): void; + + readonly metadata: DecoratorMetadata; +} + +/** + * Context provided to a class `accessor` field decorator. + * @template This The type on which the class element will be defined. For a static class element, this will be + * the type of the constructor. For a non-static class element, this will be the type of the instance. + * @template Value The type of decorated class field. + */ +interface ClassAccessorDecoratorContext< + This = unknown, + Value = unknown, +> { + /** The kind of class element that was decorated. */ + readonly kind: "accessor"; + + /** The name of the decorated class element. */ + readonly name: string | symbol; + + /** A value indicating whether the class element is a static (`true`) or instance (`false`) element. */ + readonly static: boolean; + + /** A value indicating whether the class element has a private name. */ + readonly private: boolean; + + /** An object that can be used to access the current value of the class element at runtime. */ + readonly access: { + /** + * Determines whether an object has a property with the same name as the decorated element. + */ + has(object: This): boolean; + + /** + * Invokes the getter on the provided object. + * + * @example + * let value = context.access.get(instance); + */ + get(object: This): Value; + + /** + * Invokes the setter on the provided object. + * + * @example + * context.access.set(instance, value); + */ + set(object: This, value: Value): void; + }; + + /** + * Adds a callback to be invoked either before static initializers are run (when + * decorating a `static` element), or before instance initializers are run (when + * decorating a non-`static` element). + */ + addInitializer(initializer: (this: This) => void): void; + + readonly metadata: DecoratorMetadata; +} + +/** + * Describes the target provided to class `accessor` field decorators. + * @template This The `this` type to which the target applies. + * @template Value The property type for the class `accessor` field. + */ +interface ClassAccessorDecoratorTarget { + /** + * Invokes the getter that was defined prior to decorator application. + * + * @example + * let value = target.get.call(instance); + */ + get(this: This): Value; + + /** + * Invokes the setter that was defined prior to decorator application. + * + * @example + * target.set.call(instance, value); + */ + set(this: This, value: Value): void; +} + +/** + * Describes the allowed return value from a class `accessor` field decorator. + * @template This The `this` type to which the target applies. + * @template Value The property type for the class `accessor` field. + */ +interface ClassAccessorDecoratorResult { + /** + * An optional replacement getter function. If not provided, the existing getter function is used instead. + */ + get?(this: This): Value; + + /** + * An optional replacement setter function. If not provided, the existing setter function is used instead. + */ + set?(this: This, value: Value): void; + + /** + * An optional initializer mutator that is invoked when the underlying field initializer is evaluated. + * @param value The incoming initializer value. + * @returns The replacement initializer value. + */ + init?(this: This, value: Value): Value; +} + +/** + * Context provided to a class field decorator. + * @template This The type on which the class element will be defined. For a static class element, this will be + * the type of the constructor. For a non-static class element, this will be the type of the instance. + * @template Value The type of the decorated class field. + */ +interface ClassFieldDecoratorContext< + This = unknown, + Value = unknown, +> { + /** The kind of class element that was decorated. */ + readonly kind: "field"; + + /** The name of the decorated class element. */ + readonly name: string | symbol; + + /** A value indicating whether the class element is a static (`true`) or instance (`false`) element. */ + readonly static: boolean; + + /** A value indicating whether the class element has a private name. */ + readonly private: boolean; + + /** An object that can be used to access the current value of the class element at runtime. */ + readonly access: { + /** + * Determines whether an object has a property with the same name as the decorated element. + */ + has(object: This): boolean; + + /** + * Gets the value of the field on the provided object. + */ + get(object: This): Value; + + /** + * Sets the value of the field on the provided object. + */ + set(object: This, value: Value): void; + }; + + /** + * Adds a callback to be invoked either before static initializers are run (when + * decorating a `static` element), or before instance initializers are run (when + * decorating a non-`static` element). + */ + addInitializer(initializer: (this: This) => void): void; + + readonly metadata: DecoratorMetadata; +} diff --git a/node_modules/@stencil/core/compiler/lib.decorators.legacy.d.ts b/node_modules/@stencil/core/compiler/lib.decorators.legacy.d.ts new file mode 100644 index 00000000..26fbcb52 --- /dev/null +++ b/node_modules/@stencil/core/compiler/lib.decorators.legacy.d.ts @@ -0,0 +1,22 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + + +/// + +declare type ClassDecorator = (target: TFunction) => TFunction | void; +declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void; +declare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void; +declare type ParameterDecorator = (target: Object, propertyKey: string | symbol | undefined, parameterIndex: number) => void; diff --git a/node_modules/@stencil/core/compiler/lib.dom.asynciterable.d.ts b/node_modules/@stencil/core/compiler/lib.dom.asynciterable.d.ts new file mode 100644 index 00000000..28e1bfd8 --- /dev/null +++ b/node_modules/@stencil/core/compiler/lib.dom.asynciterable.d.ts @@ -0,0 +1,33 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + + +/// + +///////////////////////////// +/// Window Async Iterable APIs +///////////////////////////// + +interface FileSystemDirectoryHandle { + [Symbol.asyncIterator](): AsyncIterableIterator<[string, FileSystemHandle]>; + entries(): AsyncIterableIterator<[string, FileSystemHandle]>; + keys(): AsyncIterableIterator; + values(): AsyncIterableIterator; +} + +interface ReadableStream { + [Symbol.asyncIterator](options?: ReadableStreamIteratorOptions): AsyncIterableIterator; + values(options?: ReadableStreamIteratorOptions): AsyncIterableIterator; +} diff --git a/node_modules/@stencil/core/compiler/lib.dom.d.ts b/node_modules/@stencil/core/compiler/lib.dom.d.ts new file mode 100644 index 00000000..079a8615 --- /dev/null +++ b/node_modules/@stencil/core/compiler/lib.dom.d.ts @@ -0,0 +1,28596 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + + +/// + +///////////////////////////// +/// Window APIs +///////////////////////////// + +interface AddEventListenerOptions extends EventListenerOptions { + once?: boolean; + passive?: boolean; + signal?: AbortSignal; +} + +interface AesCbcParams extends Algorithm { + iv: BufferSource; +} + +interface AesCtrParams extends Algorithm { + counter: BufferSource; + length: number; +} + +interface AesDerivedKeyParams extends Algorithm { + length: number; +} + +interface AesGcmParams extends Algorithm { + additionalData?: BufferSource; + iv: BufferSource; + tagLength?: number; +} + +interface AesKeyAlgorithm extends KeyAlgorithm { + length: number; +} + +interface AesKeyGenParams extends Algorithm { + length: number; +} + +interface Algorithm { + name: string; +} + +interface AnalyserOptions extends AudioNodeOptions { + fftSize?: number; + maxDecibels?: number; + minDecibels?: number; + smoothingTimeConstant?: number; +} + +interface AnimationEventInit extends EventInit { + animationName?: string; + elapsedTime?: number; + pseudoElement?: string; +} + +interface AnimationPlaybackEventInit extends EventInit { + currentTime?: CSSNumberish | null; + timelineTime?: CSSNumberish | null; +} + +interface AssignedNodesOptions { + flatten?: boolean; +} + +interface AudioBufferOptions { + length: number; + numberOfChannels?: number; + sampleRate: number; +} + +interface AudioBufferSourceOptions { + buffer?: AudioBuffer | null; + detune?: number; + loop?: boolean; + loopEnd?: number; + loopStart?: number; + playbackRate?: number; +} + +interface AudioConfiguration { + bitrate?: number; + channels?: string; + contentType: string; + samplerate?: number; + spatialRendering?: boolean; +} + +interface AudioContextOptions { + latencyHint?: AudioContextLatencyCategory | number; + sampleRate?: number; +} + +interface AudioNodeOptions { + channelCount?: number; + channelCountMode?: ChannelCountMode; + channelInterpretation?: ChannelInterpretation; +} + +interface AudioProcessingEventInit extends EventInit { + inputBuffer: AudioBuffer; + outputBuffer: AudioBuffer; + playbackTime: number; +} + +interface AudioTimestamp { + contextTime?: number; + performanceTime?: DOMHighResTimeStamp; +} + +interface AudioWorkletNodeOptions extends AudioNodeOptions { + numberOfInputs?: number; + numberOfOutputs?: number; + outputChannelCount?: number[]; + parameterData?: Record; + processorOptions?: any; +} + +interface AuthenticationExtensionsClientInputs { + appid?: string; + credProps?: boolean; + hmacCreateSecret?: boolean; + minPinLength?: boolean; +} + +interface AuthenticationExtensionsClientOutputs { + appid?: boolean; + credProps?: CredentialPropertiesOutput; + hmacCreateSecret?: boolean; +} + +interface AuthenticatorSelectionCriteria { + authenticatorAttachment?: AuthenticatorAttachment; + requireResidentKey?: boolean; + residentKey?: ResidentKeyRequirement; + userVerification?: UserVerificationRequirement; +} + +interface AvcEncoderConfig { + format?: AvcBitstreamFormat; +} + +interface BiquadFilterOptions extends AudioNodeOptions { + Q?: number; + detune?: number; + frequency?: number; + gain?: number; + type?: BiquadFilterType; +} + +interface BlobEventInit { + data: Blob; + timecode?: DOMHighResTimeStamp; +} + +interface BlobPropertyBag { + endings?: EndingType; + type?: string; +} + +interface CSSMatrixComponentOptions { + is2D?: boolean; +} + +interface CSSNumericType { + angle?: number; + flex?: number; + frequency?: number; + length?: number; + percent?: number; + percentHint?: CSSNumericBaseType; + resolution?: number; + time?: number; +} + +interface CSSStyleSheetInit { + baseURL?: string; + disabled?: boolean; + media?: MediaList | string; +} + +interface CacheQueryOptions { + ignoreMethod?: boolean; + ignoreSearch?: boolean; + ignoreVary?: boolean; +} + +interface CanvasRenderingContext2DSettings { + alpha?: boolean; + colorSpace?: PredefinedColorSpace; + desynchronized?: boolean; + willReadFrequently?: boolean; +} + +interface ChannelMergerOptions extends AudioNodeOptions { + numberOfInputs?: number; +} + +interface ChannelSplitterOptions extends AudioNodeOptions { + numberOfOutputs?: number; +} + +interface CheckVisibilityOptions { + checkOpacity?: boolean; + checkVisibilityCSS?: boolean; + contentVisibilityAuto?: boolean; + opacityProperty?: boolean; + visibilityProperty?: boolean; +} + +interface ClientQueryOptions { + includeUncontrolled?: boolean; + type?: ClientTypes; +} + +interface ClipboardEventInit extends EventInit { + clipboardData?: DataTransfer | null; +} + +interface ClipboardItemOptions { + presentationStyle?: PresentationStyle; +} + +interface CloseEventInit extends EventInit { + code?: number; + reason?: string; + wasClean?: boolean; +} + +interface CompositionEventInit extends UIEventInit { + data?: string; +} + +interface ComputedEffectTiming extends EffectTiming { + activeDuration?: CSSNumberish; + currentIteration?: number | null; + endTime?: CSSNumberish; + localTime?: CSSNumberish | null; + progress?: number | null; + startTime?: CSSNumberish; +} + +interface ComputedKeyframe { + composite: CompositeOperationOrAuto; + computedOffset: number; + easing: string; + offset: number | null; + [property: string]: string | number | null | undefined; +} + +interface ConstantSourceOptions { + offset?: number; +} + +interface ConstrainBooleanParameters { + exact?: boolean; + ideal?: boolean; +} + +interface ConstrainDOMStringParameters { + exact?: string | string[]; + ideal?: string | string[]; +} + +interface ConstrainDoubleRange extends DoubleRange { + exact?: number; + ideal?: number; +} + +interface ConstrainULongRange extends ULongRange { + exact?: number; + ideal?: number; +} + +interface ContentVisibilityAutoStateChangeEventInit extends EventInit { + skipped?: boolean; +} + +interface ConvolverOptions extends AudioNodeOptions { + buffer?: AudioBuffer | null; + disableNormalization?: boolean; +} + +interface CredentialCreationOptions { + publicKey?: PublicKeyCredentialCreationOptions; + signal?: AbortSignal; +} + +interface CredentialPropertiesOutput { + rk?: boolean; +} + +interface CredentialRequestOptions { + mediation?: CredentialMediationRequirement; + publicKey?: PublicKeyCredentialRequestOptions; + signal?: AbortSignal; +} + +interface CryptoKeyPair { + privateKey: CryptoKey; + publicKey: CryptoKey; +} + +interface CustomEventInit extends EventInit { + detail?: T; +} + +interface DOMMatrix2DInit { + a?: number; + b?: number; + c?: number; + d?: number; + e?: number; + f?: number; + m11?: number; + m12?: number; + m21?: number; + m22?: number; + m41?: number; + m42?: number; +} + +interface DOMMatrixInit extends DOMMatrix2DInit { + is2D?: boolean; + m13?: number; + m14?: number; + m23?: number; + m24?: number; + m31?: number; + m32?: number; + m33?: number; + m34?: number; + m43?: number; + m44?: number; +} + +interface DOMPointInit { + w?: number; + x?: number; + y?: number; + z?: number; +} + +interface DOMQuadInit { + p1?: DOMPointInit; + p2?: DOMPointInit; + p3?: DOMPointInit; + p4?: DOMPointInit; +} + +interface DOMRectInit { + height?: number; + width?: number; + x?: number; + y?: number; +} + +interface DelayOptions extends AudioNodeOptions { + delayTime?: number; + maxDelayTime?: number; +} + +interface DeviceMotionEventAccelerationInit { + x?: number | null; + y?: number | null; + z?: number | null; +} + +interface DeviceMotionEventInit extends EventInit { + acceleration?: DeviceMotionEventAccelerationInit; + accelerationIncludingGravity?: DeviceMotionEventAccelerationInit; + interval?: number; + rotationRate?: DeviceMotionEventRotationRateInit; +} + +interface DeviceMotionEventRotationRateInit { + alpha?: number | null; + beta?: number | null; + gamma?: number | null; +} + +interface DeviceOrientationEventInit extends EventInit { + absolute?: boolean; + alpha?: number | null; + beta?: number | null; + gamma?: number | null; +} + +interface DisplayMediaStreamOptions { + audio?: boolean | MediaTrackConstraints; + video?: boolean | MediaTrackConstraints; +} + +interface DocumentTimelineOptions { + originTime?: DOMHighResTimeStamp; +} + +interface DoubleRange { + max?: number; + min?: number; +} + +interface DragEventInit extends MouseEventInit { + dataTransfer?: DataTransfer | null; +} + +interface DynamicsCompressorOptions extends AudioNodeOptions { + attack?: number; + knee?: number; + ratio?: number; + release?: number; + threshold?: number; +} + +interface EcKeyAlgorithm extends KeyAlgorithm { + namedCurve: NamedCurve; +} + +interface EcKeyGenParams extends Algorithm { + namedCurve: NamedCurve; +} + +interface EcKeyImportParams extends Algorithm { + namedCurve: NamedCurve; +} + +interface EcdhKeyDeriveParams extends Algorithm { + public: CryptoKey; +} + +interface EcdsaParams extends Algorithm { + hash: HashAlgorithmIdentifier; +} + +interface EffectTiming { + delay?: number; + direction?: PlaybackDirection; + duration?: number | CSSNumericValue | string; + easing?: string; + endDelay?: number; + fill?: FillMode; + iterationStart?: number; + iterations?: number; + playbackRate?: number; +} + +interface ElementCreationOptions { + is?: string; +} + +interface ElementDefinitionOptions { + extends?: string; +} + +interface EncodedVideoChunkInit { + data: AllowSharedBufferSource; + duration?: number; + timestamp: number; + type: EncodedVideoChunkType; +} + +interface EncodedVideoChunkMetadata { + decoderConfig?: VideoDecoderConfig; +} + +interface ErrorEventInit extends EventInit { + colno?: number; + error?: any; + filename?: string; + lineno?: number; + message?: string; +} + +interface EventInit { + bubbles?: boolean; + cancelable?: boolean; + composed?: boolean; +} + +interface EventListenerOptions { + capture?: boolean; +} + +interface EventModifierInit extends UIEventInit { + altKey?: boolean; + ctrlKey?: boolean; + metaKey?: boolean; + modifierAltGraph?: boolean; + modifierCapsLock?: boolean; + modifierFn?: boolean; + modifierFnLock?: boolean; + modifierHyper?: boolean; + modifierNumLock?: boolean; + modifierScrollLock?: boolean; + modifierSuper?: boolean; + modifierSymbol?: boolean; + modifierSymbolLock?: boolean; + shiftKey?: boolean; +} + +interface EventSourceInit { + withCredentials?: boolean; +} + +interface FilePropertyBag extends BlobPropertyBag { + lastModified?: number; +} + +interface FileSystemCreateWritableOptions { + keepExistingData?: boolean; +} + +interface FileSystemFlags { + create?: boolean; + exclusive?: boolean; +} + +interface FileSystemGetDirectoryOptions { + create?: boolean; +} + +interface FileSystemGetFileOptions { + create?: boolean; +} + +interface FileSystemRemoveOptions { + recursive?: boolean; +} + +interface FocusEventInit extends UIEventInit { + relatedTarget?: EventTarget | null; +} + +interface FocusOptions { + preventScroll?: boolean; +} + +interface FontFaceDescriptors { + ascentOverride?: string; + descentOverride?: string; + display?: FontDisplay; + featureSettings?: string; + lineGapOverride?: string; + stretch?: string; + style?: string; + unicodeRange?: string; + weight?: string; +} + +interface FontFaceSetLoadEventInit extends EventInit { + fontfaces?: FontFace[]; +} + +interface FormDataEventInit extends EventInit { + formData: FormData; +} + +interface FullscreenOptions { + navigationUI?: FullscreenNavigationUI; +} + +interface GainOptions extends AudioNodeOptions { + gain?: number; +} + +interface GamepadEffectParameters { + duration?: number; + leftTrigger?: number; + rightTrigger?: number; + startDelay?: number; + strongMagnitude?: number; + weakMagnitude?: number; +} + +interface GamepadEventInit extends EventInit { + gamepad: Gamepad; +} + +interface GetAnimationsOptions { + subtree?: boolean; +} + +interface GetNotificationOptions { + tag?: string; +} + +interface GetRootNodeOptions { + composed?: boolean; +} + +interface HashChangeEventInit extends EventInit { + newURL?: string; + oldURL?: string; +} + +interface HkdfParams extends Algorithm { + hash: HashAlgorithmIdentifier; + info: BufferSource; + salt: BufferSource; +} + +interface HmacImportParams extends Algorithm { + hash: HashAlgorithmIdentifier; + length?: number; +} + +interface HmacKeyAlgorithm extends KeyAlgorithm { + hash: KeyAlgorithm; + length: number; +} + +interface HmacKeyGenParams extends Algorithm { + hash: HashAlgorithmIdentifier; + length?: number; +} + +interface IDBDatabaseInfo { + name?: string; + version?: number; +} + +interface IDBIndexParameters { + multiEntry?: boolean; + unique?: boolean; +} + +interface IDBObjectStoreParameters { + autoIncrement?: boolean; + keyPath?: string | string[] | null; +} + +interface IDBTransactionOptions { + durability?: IDBTransactionDurability; +} + +interface IDBVersionChangeEventInit extends EventInit { + newVersion?: number | null; + oldVersion?: number; +} + +interface IIRFilterOptions extends AudioNodeOptions { + feedback: number[]; + feedforward: number[]; +} + +interface IdleRequestOptions { + timeout?: number; +} + +interface ImageBitmapOptions { + colorSpaceConversion?: ColorSpaceConversion; + imageOrientation?: ImageOrientation; + premultiplyAlpha?: PremultiplyAlpha; + resizeHeight?: number; + resizeQuality?: ResizeQuality; + resizeWidth?: number; +} + +interface ImageBitmapRenderingContextSettings { + alpha?: boolean; +} + +interface ImageDataSettings { + colorSpace?: PredefinedColorSpace; +} + +interface ImageEncodeOptions { + quality?: number; + type?: string; +} + +interface ImportMeta { + url: string; +} + +interface InputEventInit extends UIEventInit { + data?: string | null; + dataTransfer?: DataTransfer | null; + inputType?: string; + isComposing?: boolean; + targetRanges?: StaticRange[]; +} + +interface IntersectionObserverEntryInit { + boundingClientRect: DOMRectInit; + intersectionRatio: number; + intersectionRect: DOMRectInit; + isIntersecting: boolean; + rootBounds: DOMRectInit | null; + target: Element; + time: DOMHighResTimeStamp; +} + +interface IntersectionObserverInit { + root?: Element | Document | null; + rootMargin?: string; + threshold?: number | number[]; +} + +interface JsonWebKey { + alg?: string; + crv?: string; + d?: string; + dp?: string; + dq?: string; + e?: string; + ext?: boolean; + k?: string; + key_ops?: string[]; + kty?: string; + n?: string; + oth?: RsaOtherPrimesInfo[]; + p?: string; + q?: string; + qi?: string; + use?: string; + x?: string; + y?: string; +} + +interface KeyAlgorithm { + name: string; +} + +interface KeyboardEventInit extends EventModifierInit { + /** @deprecated */ + charCode?: number; + code?: string; + isComposing?: boolean; + key?: string; + /** @deprecated */ + keyCode?: number; + location?: number; + repeat?: boolean; +} + +interface Keyframe { + composite?: CompositeOperationOrAuto; + easing?: string; + offset?: number | null; + [property: string]: string | number | null | undefined; +} + +interface KeyframeAnimationOptions extends KeyframeEffectOptions { + id?: string; + timeline?: AnimationTimeline | null; +} + +interface KeyframeEffectOptions extends EffectTiming { + composite?: CompositeOperation; + iterationComposite?: IterationCompositeOperation; + pseudoElement?: string | null; +} + +interface LockInfo { + clientId?: string; + mode?: LockMode; + name?: string; +} + +interface LockManagerSnapshot { + held?: LockInfo[]; + pending?: LockInfo[]; +} + +interface LockOptions { + ifAvailable?: boolean; + mode?: LockMode; + signal?: AbortSignal; + steal?: boolean; +} + +interface MIDIConnectionEventInit extends EventInit { + port?: MIDIPort; +} + +interface MIDIMessageEventInit extends EventInit { + data?: Uint8Array; +} + +interface MIDIOptions { + software?: boolean; + sysex?: boolean; +} + +interface MediaCapabilitiesDecodingInfo extends MediaCapabilitiesInfo { + configuration?: MediaDecodingConfiguration; +} + +interface MediaCapabilitiesEncodingInfo extends MediaCapabilitiesInfo { + configuration?: MediaEncodingConfiguration; +} + +interface MediaCapabilitiesInfo { + powerEfficient: boolean; + smooth: boolean; + supported: boolean; +} + +interface MediaConfiguration { + audio?: AudioConfiguration; + video?: VideoConfiguration; +} + +interface MediaDecodingConfiguration extends MediaConfiguration { + type: MediaDecodingType; +} + +interface MediaElementAudioSourceOptions { + mediaElement: HTMLMediaElement; +} + +interface MediaEncodingConfiguration extends MediaConfiguration { + type: MediaEncodingType; +} + +interface MediaEncryptedEventInit extends EventInit { + initData?: ArrayBuffer | null; + initDataType?: string; +} + +interface MediaImage { + sizes?: string; + src: string; + type?: string; +} + +interface MediaKeyMessageEventInit extends EventInit { + message: ArrayBuffer; + messageType: MediaKeyMessageType; +} + +interface MediaKeySystemConfiguration { + audioCapabilities?: MediaKeySystemMediaCapability[]; + distinctiveIdentifier?: MediaKeysRequirement; + initDataTypes?: string[]; + label?: string; + persistentState?: MediaKeysRequirement; + sessionTypes?: string[]; + videoCapabilities?: MediaKeySystemMediaCapability[]; +} + +interface MediaKeySystemMediaCapability { + contentType?: string; + encryptionScheme?: string | null; + robustness?: string; +} + +interface MediaMetadataInit { + album?: string; + artist?: string; + artwork?: MediaImage[]; + title?: string; +} + +interface MediaPositionState { + duration?: number; + playbackRate?: number; + position?: number; +} + +interface MediaQueryListEventInit extends EventInit { + matches?: boolean; + media?: string; +} + +interface MediaRecorderOptions { + audioBitsPerSecond?: number; + bitsPerSecond?: number; + mimeType?: string; + videoBitsPerSecond?: number; +} + +interface MediaSessionActionDetails { + action: MediaSessionAction; + fastSeek?: boolean; + seekOffset?: number; + seekTime?: number; +} + +interface MediaStreamAudioSourceOptions { + mediaStream: MediaStream; +} + +interface MediaStreamConstraints { + audio?: boolean | MediaTrackConstraints; + peerIdentity?: string; + preferCurrentTab?: boolean; + video?: boolean | MediaTrackConstraints; +} + +interface MediaStreamTrackEventInit extends EventInit { + track: MediaStreamTrack; +} + +interface MediaTrackCapabilities { + aspectRatio?: DoubleRange; + autoGainControl?: boolean[]; + channelCount?: ULongRange; + deviceId?: string; + displaySurface?: string; + echoCancellation?: boolean[]; + facingMode?: string[]; + frameRate?: DoubleRange; + groupId?: string; + height?: ULongRange; + noiseSuppression?: boolean[]; + sampleRate?: ULongRange; + sampleSize?: ULongRange; + width?: ULongRange; +} + +interface MediaTrackConstraintSet { + aspectRatio?: ConstrainDouble; + autoGainControl?: ConstrainBoolean; + channelCount?: ConstrainULong; + deviceId?: ConstrainDOMString; + displaySurface?: ConstrainDOMString; + echoCancellation?: ConstrainBoolean; + facingMode?: ConstrainDOMString; + frameRate?: ConstrainDouble; + groupId?: ConstrainDOMString; + height?: ConstrainULong; + noiseSuppression?: ConstrainBoolean; + sampleRate?: ConstrainULong; + sampleSize?: ConstrainULong; + width?: ConstrainULong; +} + +interface MediaTrackConstraints extends MediaTrackConstraintSet { + advanced?: MediaTrackConstraintSet[]; +} + +interface MediaTrackSettings { + aspectRatio?: number; + autoGainControl?: boolean; + channelCount?: number; + deviceId?: string; + displaySurface?: string; + echoCancellation?: boolean; + facingMode?: string; + frameRate?: number; + groupId?: string; + height?: number; + noiseSuppression?: boolean; + sampleRate?: number; + sampleSize?: number; + width?: number; +} + +interface MediaTrackSupportedConstraints { + aspectRatio?: boolean; + autoGainControl?: boolean; + channelCount?: boolean; + deviceId?: boolean; + displaySurface?: boolean; + echoCancellation?: boolean; + facingMode?: boolean; + frameRate?: boolean; + groupId?: boolean; + height?: boolean; + noiseSuppression?: boolean; + sampleRate?: boolean; + sampleSize?: boolean; + width?: boolean; +} + +interface MessageEventInit extends EventInit { + data?: T; + lastEventId?: string; + origin?: string; + ports?: MessagePort[]; + source?: MessageEventSource | null; +} + +interface MouseEventInit extends EventModifierInit { + button?: number; + buttons?: number; + clientX?: number; + clientY?: number; + movementX?: number; + movementY?: number; + relatedTarget?: EventTarget | null; + screenX?: number; + screenY?: number; +} + +interface MultiCacheQueryOptions extends CacheQueryOptions { + cacheName?: string; +} + +interface MutationObserverInit { + /** Set to a list of attribute local names (without namespace) if not all attribute mutations need to be observed and attributes is true or omitted. */ + attributeFilter?: string[]; + /** Set to true if attributes is true or omitted and target's attribute value before the mutation needs to be recorded. */ + attributeOldValue?: boolean; + /** Set to true if mutations to target's attributes are to be observed. Can be omitted if attributeOldValue or attributeFilter is specified. */ + attributes?: boolean; + /** Set to true if mutations to target's data are to be observed. Can be omitted if characterDataOldValue is specified. */ + characterData?: boolean; + /** Set to true if characterData is set to true or omitted and target's data before the mutation needs to be recorded. */ + characterDataOldValue?: boolean; + /** Set to true if mutations to target's children are to be observed. */ + childList?: boolean; + /** Set to true if mutations to not just target, but also target's descendants are to be observed. */ + subtree?: boolean; +} + +interface NavigationPreloadState { + enabled?: boolean; + headerValue?: string; +} + +interface NotificationOptions { + badge?: string; + body?: string; + data?: any; + dir?: NotificationDirection; + icon?: string; + lang?: string; + requireInteraction?: boolean; + silent?: boolean | null; + tag?: string; +} + +interface OfflineAudioCompletionEventInit extends EventInit { + renderedBuffer: AudioBuffer; +} + +interface OfflineAudioContextOptions { + length: number; + numberOfChannels?: number; + sampleRate: number; +} + +interface OptionalEffectTiming { + delay?: number; + direction?: PlaybackDirection; + duration?: number | string; + easing?: string; + endDelay?: number; + fill?: FillMode; + iterationStart?: number; + iterations?: number; + playbackRate?: number; +} + +interface OscillatorOptions extends AudioNodeOptions { + detune?: number; + frequency?: number; + periodicWave?: PeriodicWave; + type?: OscillatorType; +} + +interface PageTransitionEventInit extends EventInit { + persisted?: boolean; +} + +interface PannerOptions extends AudioNodeOptions { + coneInnerAngle?: number; + coneOuterAngle?: number; + coneOuterGain?: number; + distanceModel?: DistanceModelType; + maxDistance?: number; + orientationX?: number; + orientationY?: number; + orientationZ?: number; + panningModel?: PanningModelType; + positionX?: number; + positionY?: number; + positionZ?: number; + refDistance?: number; + rolloffFactor?: number; +} + +interface PaymentCurrencyAmount { + currency: string; + value: string; +} + +interface PaymentDetailsBase { + displayItems?: PaymentItem[]; + modifiers?: PaymentDetailsModifier[]; +} + +interface PaymentDetailsInit extends PaymentDetailsBase { + id?: string; + total: PaymentItem; +} + +interface PaymentDetailsModifier { + additionalDisplayItems?: PaymentItem[]; + data?: any; + supportedMethods: string; + total?: PaymentItem; +} + +interface PaymentDetailsUpdate extends PaymentDetailsBase { + paymentMethodErrors?: any; + total?: PaymentItem; +} + +interface PaymentItem { + amount: PaymentCurrencyAmount; + label: string; + pending?: boolean; +} + +interface PaymentMethodChangeEventInit extends PaymentRequestUpdateEventInit { + methodDetails?: any; + methodName?: string; +} + +interface PaymentMethodData { + data?: any; + supportedMethods: string; +} + +interface PaymentRequestUpdateEventInit extends EventInit { +} + +interface PaymentValidationErrors { + error?: string; + paymentMethod?: any; +} + +interface Pbkdf2Params extends Algorithm { + hash: HashAlgorithmIdentifier; + iterations: number; + salt: BufferSource; +} + +interface PerformanceMarkOptions { + detail?: any; + startTime?: DOMHighResTimeStamp; +} + +interface PerformanceMeasureOptions { + detail?: any; + duration?: DOMHighResTimeStamp; + end?: string | DOMHighResTimeStamp; + start?: string | DOMHighResTimeStamp; +} + +interface PerformanceObserverInit { + buffered?: boolean; + entryTypes?: string[]; + type?: string; +} + +interface PeriodicWaveConstraints { + disableNormalization?: boolean; +} + +interface PeriodicWaveOptions extends PeriodicWaveConstraints { + imag?: number[] | Float32Array; + real?: number[] | Float32Array; +} + +interface PermissionDescriptor { + name: PermissionName; +} + +interface PictureInPictureEventInit extends EventInit { + pictureInPictureWindow: PictureInPictureWindow; +} + +interface PlaneLayout { + offset: number; + stride: number; +} + +interface PointerEventInit extends MouseEventInit { + coalescedEvents?: PointerEvent[]; + height?: number; + isPrimary?: boolean; + pointerId?: number; + pointerType?: string; + predictedEvents?: PointerEvent[]; + pressure?: number; + tangentialPressure?: number; + tiltX?: number; + tiltY?: number; + twist?: number; + width?: number; +} + +interface PopStateEventInit extends EventInit { + state?: any; +} + +interface PositionOptions { + enableHighAccuracy?: boolean; + maximumAge?: number; + timeout?: number; +} + +interface ProgressEventInit extends EventInit { + lengthComputable?: boolean; + loaded?: number; + total?: number; +} + +interface PromiseRejectionEventInit extends EventInit { + promise: Promise; + reason?: any; +} + +interface PropertyDefinition { + inherits: boolean; + initialValue?: string; + name: string; + syntax?: string; +} + +interface PropertyIndexedKeyframes { + composite?: CompositeOperationOrAuto | CompositeOperationOrAuto[]; + easing?: string | string[]; + offset?: number | (number | null)[]; + [property: string]: string | string[] | number | null | (number | null)[] | undefined; +} + +interface PublicKeyCredentialCreationOptions { + attestation?: AttestationConveyancePreference; + authenticatorSelection?: AuthenticatorSelectionCriteria; + challenge: BufferSource; + excludeCredentials?: PublicKeyCredentialDescriptor[]; + extensions?: AuthenticationExtensionsClientInputs; + pubKeyCredParams: PublicKeyCredentialParameters[]; + rp: PublicKeyCredentialRpEntity; + timeout?: number; + user: PublicKeyCredentialUserEntity; +} + +interface PublicKeyCredentialDescriptor { + id: BufferSource; + transports?: AuthenticatorTransport[]; + type: PublicKeyCredentialType; +} + +interface PublicKeyCredentialEntity { + name: string; +} + +interface PublicKeyCredentialParameters { + alg: COSEAlgorithmIdentifier; + type: PublicKeyCredentialType; +} + +interface PublicKeyCredentialRequestOptions { + allowCredentials?: PublicKeyCredentialDescriptor[]; + challenge: BufferSource; + extensions?: AuthenticationExtensionsClientInputs; + rpId?: string; + timeout?: number; + userVerification?: UserVerificationRequirement; +} + +interface PublicKeyCredentialRpEntity extends PublicKeyCredentialEntity { + id?: string; +} + +interface PublicKeyCredentialUserEntity extends PublicKeyCredentialEntity { + displayName: string; + id: BufferSource; +} + +interface PushSubscriptionJSON { + endpoint?: string; + expirationTime?: EpochTimeStamp | null; + keys?: Record; +} + +interface PushSubscriptionOptionsInit { + applicationServerKey?: BufferSource | string | null; + userVisibleOnly?: boolean; +} + +interface QueuingStrategy { + highWaterMark?: number; + size?: QueuingStrategySize; +} + +interface QueuingStrategyInit { + /** + * Creates a new ByteLengthQueuingStrategy with the provided high water mark. + * + * Note that the provided high water mark will not be validated ahead of time. Instead, if it is negative, NaN, or not a number, the resulting ByteLengthQueuingStrategy will cause the corresponding stream constructor to throw. + */ + highWaterMark: number; +} + +interface RTCAnswerOptions extends RTCOfferAnswerOptions { +} + +interface RTCCertificateExpiration { + expires?: number; +} + +interface RTCConfiguration { + bundlePolicy?: RTCBundlePolicy; + certificates?: RTCCertificate[]; + iceCandidatePoolSize?: number; + iceServers?: RTCIceServer[]; + iceTransportPolicy?: RTCIceTransportPolicy; + rtcpMuxPolicy?: RTCRtcpMuxPolicy; +} + +interface RTCDTMFToneChangeEventInit extends EventInit { + tone?: string; +} + +interface RTCDataChannelEventInit extends EventInit { + channel: RTCDataChannel; +} + +interface RTCDataChannelInit { + id?: number; + maxPacketLifeTime?: number; + maxRetransmits?: number; + negotiated?: boolean; + ordered?: boolean; + protocol?: string; +} + +interface RTCDtlsFingerprint { + algorithm?: string; + value?: string; +} + +interface RTCEncodedAudioFrameMetadata { + contributingSources?: number[]; + payloadType?: number; + sequenceNumber?: number; + synchronizationSource?: number; +} + +interface RTCEncodedVideoFrameMetadata { + contributingSources?: number[]; + dependencies?: number[]; + frameId?: number; + height?: number; + payloadType?: number; + spatialIndex?: number; + synchronizationSource?: number; + temporalIndex?: number; + timestamp?: number; + width?: number; +} + +interface RTCErrorEventInit extends EventInit { + error: RTCError; +} + +interface RTCErrorInit { + errorDetail: RTCErrorDetailType; + httpRequestStatusCode?: number; + receivedAlert?: number; + sctpCauseCode?: number; + sdpLineNumber?: number; + sentAlert?: number; +} + +interface RTCIceCandidateInit { + candidate?: string; + sdpMLineIndex?: number | null; + sdpMid?: string | null; + usernameFragment?: string | null; +} + +interface RTCIceCandidatePair { + local: RTCIceCandidate; + remote: RTCIceCandidate; +} + +interface RTCIceCandidatePairStats extends RTCStats { + availableIncomingBitrate?: number; + availableOutgoingBitrate?: number; + bytesReceived?: number; + bytesSent?: number; + currentRoundTripTime?: number; + lastPacketReceivedTimestamp?: DOMHighResTimeStamp; + lastPacketSentTimestamp?: DOMHighResTimeStamp; + localCandidateId: string; + nominated?: boolean; + remoteCandidateId: string; + requestsReceived?: number; + requestsSent?: number; + responsesReceived?: number; + responsesSent?: number; + state: RTCStatsIceCandidatePairState; + totalRoundTripTime?: number; + transportId: string; +} + +interface RTCIceServer { + credential?: string; + urls: string | string[]; + username?: string; +} + +interface RTCInboundRtpStreamStats extends RTCReceivedRtpStreamStats { + audioLevel?: number; + bytesReceived?: number; + concealedSamples?: number; + concealmentEvents?: number; + decoderImplementation?: string; + estimatedPlayoutTimestamp?: DOMHighResTimeStamp; + fecPacketsDiscarded?: number; + fecPacketsReceived?: number; + firCount?: number; + frameHeight?: number; + frameWidth?: number; + framesDecoded?: number; + framesDropped?: number; + framesPerSecond?: number; + framesReceived?: number; + headerBytesReceived?: number; + insertedSamplesForDeceleration?: number; + jitterBufferDelay?: number; + jitterBufferEmittedCount?: number; + keyFramesDecoded?: number; + lastPacketReceivedTimestamp?: DOMHighResTimeStamp; + mid?: string; + nackCount?: number; + packetsDiscarded?: number; + pliCount?: number; + qpSum?: number; + remoteId?: string; + removedSamplesForAcceleration?: number; + silentConcealedSamples?: number; + totalAudioEnergy?: number; + totalDecodeTime?: number; + totalInterFrameDelay?: number; + totalProcessingDelay?: number; + totalSamplesDuration?: number; + totalSamplesReceived?: number; + totalSquaredInterFrameDelay?: number; + trackIdentifier: string; +} + +interface RTCLocalSessionDescriptionInit { + sdp?: string; + type?: RTCSdpType; +} + +interface RTCOfferAnswerOptions { +} + +interface RTCOfferOptions extends RTCOfferAnswerOptions { + iceRestart?: boolean; + offerToReceiveAudio?: boolean; + offerToReceiveVideo?: boolean; +} + +interface RTCOutboundRtpStreamStats extends RTCSentRtpStreamStats { + firCount?: number; + frameHeight?: number; + frameWidth?: number; + framesEncoded?: number; + framesPerSecond?: number; + framesSent?: number; + headerBytesSent?: number; + hugeFramesSent?: number; + keyFramesEncoded?: number; + mediaSourceId?: string; + nackCount?: number; + pliCount?: number; + qpSum?: number; + qualityLimitationResolutionChanges?: number; + remoteId?: string; + retransmittedBytesSent?: number; + retransmittedPacketsSent?: number; + rid?: string; + rtxSsrc?: number; + targetBitrate?: number; + totalEncodeTime?: number; + totalEncodedBytesTarget?: number; + totalPacketSendDelay?: number; +} + +interface RTCPeerConnectionIceErrorEventInit extends EventInit { + address?: string | null; + errorCode: number; + errorText?: string; + port?: number | null; + url?: string; +} + +interface RTCPeerConnectionIceEventInit extends EventInit { + candidate?: RTCIceCandidate | null; + url?: string | null; +} + +interface RTCReceivedRtpStreamStats extends RTCRtpStreamStats { + jitter?: number; + packetsLost?: number; + packetsReceived?: number; +} + +interface RTCRtcpParameters { + cname?: string; + reducedSize?: boolean; +} + +interface RTCRtpCapabilities { + codecs: RTCRtpCodecCapability[]; + headerExtensions: RTCRtpHeaderExtensionCapability[]; +} + +interface RTCRtpCodec { + channels?: number; + clockRate: number; + mimeType: string; + sdpFmtpLine?: string; +} + +interface RTCRtpCodecCapability extends RTCRtpCodec { +} + +interface RTCRtpCodecParameters extends RTCRtpCodec { + payloadType: number; +} + +interface RTCRtpCodingParameters { + rid?: string; +} + +interface RTCRtpContributingSource { + audioLevel?: number; + rtpTimestamp: number; + source: number; + timestamp: DOMHighResTimeStamp; +} + +interface RTCRtpEncodingParameters extends RTCRtpCodingParameters { + active?: boolean; + maxBitrate?: number; + maxFramerate?: number; + networkPriority?: RTCPriorityType; + priority?: RTCPriorityType; + scaleResolutionDownBy?: number; +} + +interface RTCRtpHeaderExtensionCapability { + uri: string; +} + +interface RTCRtpHeaderExtensionParameters { + encrypted?: boolean; + id: number; + uri: string; +} + +interface RTCRtpParameters { + codecs: RTCRtpCodecParameters[]; + headerExtensions: RTCRtpHeaderExtensionParameters[]; + rtcp: RTCRtcpParameters; +} + +interface RTCRtpReceiveParameters extends RTCRtpParameters { +} + +interface RTCRtpSendParameters extends RTCRtpParameters { + degradationPreference?: RTCDegradationPreference; + encodings: RTCRtpEncodingParameters[]; + transactionId: string; +} + +interface RTCRtpStreamStats extends RTCStats { + codecId?: string; + kind: string; + ssrc: number; + transportId?: string; +} + +interface RTCRtpSynchronizationSource extends RTCRtpContributingSource { +} + +interface RTCRtpTransceiverInit { + direction?: RTCRtpTransceiverDirection; + sendEncodings?: RTCRtpEncodingParameters[]; + streams?: MediaStream[]; +} + +interface RTCSentRtpStreamStats extends RTCRtpStreamStats { + bytesSent?: number; + packetsSent?: number; +} + +interface RTCSessionDescriptionInit { + sdp?: string; + type: RTCSdpType; +} + +interface RTCSetParameterOptions { +} + +interface RTCStats { + id: string; + timestamp: DOMHighResTimeStamp; + type: RTCStatsType; +} + +interface RTCTrackEventInit extends EventInit { + receiver: RTCRtpReceiver; + streams?: MediaStream[]; + track: MediaStreamTrack; + transceiver: RTCRtpTransceiver; +} + +interface RTCTransportStats extends RTCStats { + bytesReceived?: number; + bytesSent?: number; + dtlsCipher?: string; + dtlsState: RTCDtlsTransportState; + localCertificateId?: string; + remoteCertificateId?: string; + selectedCandidatePairId?: string; + srtpCipher?: string; + tlsVersion?: string; +} + +interface ReadableStreamGetReaderOptions { + /** + * Creates a ReadableStreamBYOBReader and locks the stream to the new reader. + * + * This call behaves the same way as the no-argument variant, except that it only works on readable byte streams, i.e. streams which were constructed specifically with the ability to handle "bring your own buffer" reading. The returned BYOB reader provides the ability to directly read individual chunks from the stream via its read() method, into developer-supplied buffers, allowing more precise control over allocation. + */ + mode?: ReadableStreamReaderMode; +} + +interface ReadableStreamIteratorOptions { + /** + * Asynchronously iterates over the chunks in the stream's internal queue. + * + * Asynchronously iterating over the stream will lock it, preventing any other consumer from acquiring a reader. The lock will be released if the async iterator's return() method is called, e.g. by breaking out of the loop. + * + * By default, calling the async iterator's return() method will also cancel the stream. To prevent this, use the stream's values() method, passing true for the preventCancel option. + */ + preventCancel?: boolean; +} + +interface ReadableStreamReadDoneResult { + done: true; + value?: T; +} + +interface ReadableStreamReadValueResult { + done: false; + value: T; +} + +interface ReadableWritablePair { + readable: ReadableStream; + /** + * Provides a convenient, chainable way of piping this readable stream through a transform stream (or any other { writable, readable } pair). It simply pipes the stream into the writable side of the supplied pair, and returns the readable side for further use. + * + * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader. + */ + writable: WritableStream; +} + +interface RegistrationOptions { + scope?: string; + type?: WorkerType; + updateViaCache?: ServiceWorkerUpdateViaCache; +} + +interface ReportingObserverOptions { + buffered?: boolean; + types?: string[]; +} + +interface RequestInit { + /** A BodyInit object or null to set request's body. */ + body?: BodyInit | null; + /** A string indicating how the request will interact with the browser's cache to set request's cache. */ + cache?: RequestCache; + /** A string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL. Sets request's credentials. */ + credentials?: RequestCredentials; + /** A Headers object, an object literal, or an array of two-item arrays to set request's headers. */ + headers?: HeadersInit; + /** A cryptographic hash of the resource to be fetched by request. Sets request's integrity. */ + integrity?: string; + /** A boolean to set request's keepalive. */ + keepalive?: boolean; + /** A string to set request's method. */ + method?: string; + /** A string to indicate whether the request will use CORS, or will be restricted to same-origin URLs. Sets request's mode. */ + mode?: RequestMode; + priority?: RequestPriority; + /** A string indicating whether request follows redirects, results in an error upon encountering a redirect, or returns the redirect (in an opaque fashion). Sets request's redirect. */ + redirect?: RequestRedirect; + /** A string whose value is a same-origin URL, "about:client", or the empty string, to set request's referrer. */ + referrer?: string; + /** A referrer policy to set request's referrerPolicy. */ + referrerPolicy?: ReferrerPolicy; + /** An AbortSignal to set request's signal. */ + signal?: AbortSignal | null; + /** Can only be null. Used to disassociate request from any Window. */ + window?: null; +} + +interface ResizeObserverOptions { + box?: ResizeObserverBoxOptions; +} + +interface ResponseInit { + headers?: HeadersInit; + status?: number; + statusText?: string; +} + +interface RsaHashedImportParams extends Algorithm { + hash: HashAlgorithmIdentifier; +} + +interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm { + hash: KeyAlgorithm; +} + +interface RsaHashedKeyGenParams extends RsaKeyGenParams { + hash: HashAlgorithmIdentifier; +} + +interface RsaKeyAlgorithm extends KeyAlgorithm { + modulusLength: number; + publicExponent: BigInteger; +} + +interface RsaKeyGenParams extends Algorithm { + modulusLength: number; + publicExponent: BigInteger; +} + +interface RsaOaepParams extends Algorithm { + label?: BufferSource; +} + +interface RsaOtherPrimesInfo { + d?: string; + r?: string; + t?: string; +} + +interface RsaPssParams extends Algorithm { + saltLength: number; +} + +interface SVGBoundingBoxOptions { + clipped?: boolean; + fill?: boolean; + markers?: boolean; + stroke?: boolean; +} + +interface ScrollIntoViewOptions extends ScrollOptions { + block?: ScrollLogicalPosition; + inline?: ScrollLogicalPosition; +} + +interface ScrollOptions { + behavior?: ScrollBehavior; +} + +interface ScrollToOptions extends ScrollOptions { + left?: number; + top?: number; +} + +interface SecurityPolicyViolationEventInit extends EventInit { + blockedURI?: string; + columnNumber?: number; + disposition?: SecurityPolicyViolationEventDisposition; + documentURI?: string; + effectiveDirective?: string; + lineNumber?: number; + originalPolicy?: string; + referrer?: string; + sample?: string; + sourceFile?: string; + statusCode?: number; + violatedDirective?: string; +} + +interface ShadowRootInit { + delegatesFocus?: boolean; + mode: ShadowRootMode; + serializable?: boolean; + slotAssignment?: SlotAssignmentMode; +} + +interface ShareData { + files?: File[]; + text?: string; + title?: string; + url?: string; +} + +interface SpeechSynthesisErrorEventInit extends SpeechSynthesisEventInit { + error: SpeechSynthesisErrorCode; +} + +interface SpeechSynthesisEventInit extends EventInit { + charIndex?: number; + charLength?: number; + elapsedTime?: number; + name?: string; + utterance: SpeechSynthesisUtterance; +} + +interface StaticRangeInit { + endContainer: Node; + endOffset: number; + startContainer: Node; + startOffset: number; +} + +interface StereoPannerOptions extends AudioNodeOptions { + pan?: number; +} + +interface StorageEstimate { + quota?: number; + usage?: number; +} + +interface StorageEventInit extends EventInit { + key?: string | null; + newValue?: string | null; + oldValue?: string | null; + storageArea?: Storage | null; + url?: string; +} + +interface StreamPipeOptions { + preventAbort?: boolean; + preventCancel?: boolean; + /** + * Pipes this readable stream to a given writable stream destination. The way in which the piping process behaves under various error conditions can be customized with a number of passed options. It returns a promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered. + * + * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader. + * + * Errors and closures of the source and destination streams propagate as follows: + * + * An error in this source readable stream will abort destination, unless preventAbort is truthy. The returned promise will be rejected with the source's error, or with any error that occurs during aborting the destination. + * + * An error in destination will cancel this source readable stream, unless preventCancel is truthy. The returned promise will be rejected with the destination's error, or with any error that occurs during canceling the source. + * + * When this source readable stream closes, destination will be closed, unless preventClose is truthy. The returned promise will be fulfilled once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. + * + * If destination starts out closed or closing, this source readable stream will be canceled, unless preventCancel is true. The returned promise will be rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. + * + * The signal option can be set to an AbortSignal to allow aborting an ongoing pipe operation via the corresponding AbortController. In this case, this source readable stream will be canceled, and destination aborted, unless the respective options preventCancel or preventAbort are set. + */ + preventClose?: boolean; + signal?: AbortSignal; +} + +interface StructuredSerializeOptions { + transfer?: Transferable[]; +} + +interface SubmitEventInit extends EventInit { + submitter?: HTMLElement | null; +} + +interface TextDecodeOptions { + stream?: boolean; +} + +interface TextDecoderOptions { + fatal?: boolean; + ignoreBOM?: boolean; +} + +interface TextEncoderEncodeIntoResult { + read: number; + written: number; +} + +interface ToggleEventInit extends EventInit { + newState?: string; + oldState?: string; +} + +interface TouchEventInit extends EventModifierInit { + changedTouches?: Touch[]; + targetTouches?: Touch[]; + touches?: Touch[]; +} + +interface TouchInit { + altitudeAngle?: number; + azimuthAngle?: number; + clientX?: number; + clientY?: number; + force?: number; + identifier: number; + pageX?: number; + pageY?: number; + radiusX?: number; + radiusY?: number; + rotationAngle?: number; + screenX?: number; + screenY?: number; + target: EventTarget; + touchType?: TouchType; +} + +interface TrackEventInit extends EventInit { + track?: TextTrack | null; +} + +interface Transformer { + flush?: TransformerFlushCallback; + readableType?: undefined; + start?: TransformerStartCallback; + transform?: TransformerTransformCallback; + writableType?: undefined; +} + +interface TransitionEventInit extends EventInit { + elapsedTime?: number; + propertyName?: string; + pseudoElement?: string; +} + +interface UIEventInit extends EventInit { + detail?: number; + view?: Window | null; + /** @deprecated */ + which?: number; +} + +interface ULongRange { + max?: number; + min?: number; +} + +interface UnderlyingByteSource { + autoAllocateChunkSize?: number; + cancel?: UnderlyingSourceCancelCallback; + pull?: (controller: ReadableByteStreamController) => void | PromiseLike; + start?: (controller: ReadableByteStreamController) => any; + type: "bytes"; +} + +interface UnderlyingDefaultSource { + cancel?: UnderlyingSourceCancelCallback; + pull?: (controller: ReadableStreamDefaultController) => void | PromiseLike; + start?: (controller: ReadableStreamDefaultController) => any; + type?: undefined; +} + +interface UnderlyingSink { + abort?: UnderlyingSinkAbortCallback; + close?: UnderlyingSinkCloseCallback; + start?: UnderlyingSinkStartCallback; + type?: undefined; + write?: UnderlyingSinkWriteCallback; +} + +interface UnderlyingSource { + autoAllocateChunkSize?: number; + cancel?: UnderlyingSourceCancelCallback; + pull?: UnderlyingSourcePullCallback; + start?: UnderlyingSourceStartCallback; + type?: ReadableStreamType; +} + +interface ValidityStateFlags { + badInput?: boolean; + customError?: boolean; + patternMismatch?: boolean; + rangeOverflow?: boolean; + rangeUnderflow?: boolean; + stepMismatch?: boolean; + tooLong?: boolean; + tooShort?: boolean; + typeMismatch?: boolean; + valueMissing?: boolean; +} + +interface VideoColorSpaceInit { + fullRange?: boolean | null; + matrix?: VideoMatrixCoefficients | null; + primaries?: VideoColorPrimaries | null; + transfer?: VideoTransferCharacteristics | null; +} + +interface VideoConfiguration { + bitrate: number; + colorGamut?: ColorGamut; + contentType: string; + framerate: number; + hdrMetadataType?: HdrMetadataType; + height: number; + scalabilityMode?: string; + transferFunction?: TransferFunction; + width: number; +} + +interface VideoDecoderConfig { + codec: string; + codedHeight?: number; + codedWidth?: number; + colorSpace?: VideoColorSpaceInit; + description?: AllowSharedBufferSource; + displayAspectHeight?: number; + displayAspectWidth?: number; + hardwareAcceleration?: HardwareAcceleration; + optimizeForLatency?: boolean; +} + +interface VideoDecoderInit { + error: WebCodecsErrorCallback; + output: VideoFrameOutputCallback; +} + +interface VideoDecoderSupport { + config?: VideoDecoderConfig; + supported?: boolean; +} + +interface VideoEncoderConfig { + alpha?: AlphaOption; + avc?: AvcEncoderConfig; + bitrate?: number; + bitrateMode?: VideoEncoderBitrateMode; + codec: string; + displayHeight?: number; + displayWidth?: number; + framerate?: number; + hardwareAcceleration?: HardwareAcceleration; + height: number; + latencyMode?: LatencyMode; + scalabilityMode?: string; + width: number; +} + +interface VideoEncoderEncodeOptions { + keyFrame?: boolean; +} + +interface VideoEncoderInit { + error: WebCodecsErrorCallback; + output: EncodedVideoChunkOutputCallback; +} + +interface VideoEncoderSupport { + config?: VideoEncoderConfig; + supported?: boolean; +} + +interface VideoFrameBufferInit { + codedHeight: number; + codedWidth: number; + colorSpace?: VideoColorSpaceInit; + displayHeight?: number; + displayWidth?: number; + duration?: number; + format: VideoPixelFormat; + layout?: PlaneLayout[]; + timestamp: number; + visibleRect?: DOMRectInit; +} + +interface VideoFrameCallbackMetadata { + captureTime?: DOMHighResTimeStamp; + expectedDisplayTime: DOMHighResTimeStamp; + height: number; + mediaTime: number; + presentationTime: DOMHighResTimeStamp; + presentedFrames: number; + processingDuration?: number; + receiveTime?: DOMHighResTimeStamp; + rtpTimestamp?: number; + width: number; +} + +interface VideoFrameCopyToOptions { + layout?: PlaneLayout[]; + rect?: DOMRectInit; +} + +interface VideoFrameInit { + alpha?: AlphaOption; + displayHeight?: number; + displayWidth?: number; + duration?: number; + timestamp?: number; + visibleRect?: DOMRectInit; +} + +interface WaveShaperOptions extends AudioNodeOptions { + curve?: number[] | Float32Array; + oversample?: OverSampleType; +} + +interface WebGLContextAttributes { + alpha?: boolean; + antialias?: boolean; + depth?: boolean; + desynchronized?: boolean; + failIfMajorPerformanceCaveat?: boolean; + powerPreference?: WebGLPowerPreference; + premultipliedAlpha?: boolean; + preserveDrawingBuffer?: boolean; + stencil?: boolean; +} + +interface WebGLContextEventInit extends EventInit { + statusMessage?: string; +} + +interface WebTransportCloseInfo { + closeCode?: number; + reason?: string; +} + +interface WebTransportErrorOptions { + source?: WebTransportErrorSource; + streamErrorCode?: number | null; +} + +interface WebTransportHash { + algorithm?: string; + value?: BufferSource; +} + +interface WebTransportOptions { + allowPooling?: boolean; + congestionControl?: WebTransportCongestionControl; + requireUnreliable?: boolean; + serverCertificateHashes?: WebTransportHash[]; +} + +interface WebTransportSendStreamOptions { + sendOrder?: number; +} + +interface WheelEventInit extends MouseEventInit { + deltaMode?: number; + deltaX?: number; + deltaY?: number; + deltaZ?: number; +} + +interface WindowPostMessageOptions extends StructuredSerializeOptions { + targetOrigin?: string; +} + +interface WorkerOptions { + credentials?: RequestCredentials; + name?: string; + type?: WorkerType; +} + +interface WorkletOptions { + credentials?: RequestCredentials; +} + +interface WriteParams { + data?: BufferSource | Blob | string | null; + position?: number | null; + size?: number | null; + type: WriteCommandType; +} + +type NodeFilter = ((node: Node) => number) | { acceptNode(node: Node): number; }; + +declare var NodeFilter: { + readonly FILTER_ACCEPT: 1; + readonly FILTER_REJECT: 2; + readonly FILTER_SKIP: 3; + readonly SHOW_ALL: 0xFFFFFFFF; + readonly SHOW_ELEMENT: 0x1; + readonly SHOW_ATTRIBUTE: 0x2; + readonly SHOW_TEXT: 0x4; + readonly SHOW_CDATA_SECTION: 0x8; + readonly SHOW_ENTITY_REFERENCE: 0x10; + readonly SHOW_ENTITY: 0x20; + readonly SHOW_PROCESSING_INSTRUCTION: 0x40; + readonly SHOW_COMMENT: 0x80; + readonly SHOW_DOCUMENT: 0x100; + readonly SHOW_DOCUMENT_TYPE: 0x200; + readonly SHOW_DOCUMENT_FRAGMENT: 0x400; + readonly SHOW_NOTATION: 0x800; +}; + +type XPathNSResolver = ((prefix: string | null) => string | null) | { lookupNamespaceURI(prefix: string | null): string | null; }; + +/** + * The ANGLE_instanced_arrays extension is part of the WebGL API and allows to draw the same object, or groups of similar objects multiple times, if they share the same vertex data, primitive count and type. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ANGLE_instanced_arrays) + */ +interface ANGLE_instanced_arrays { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ANGLE_instanced_arrays/drawArraysInstancedANGLE) */ + drawArraysInstancedANGLE(mode: GLenum, first: GLint, count: GLsizei, primcount: GLsizei): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ANGLE_instanced_arrays/drawElementsInstancedANGLE) */ + drawElementsInstancedANGLE(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, primcount: GLsizei): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ANGLE_instanced_arrays/vertexAttribDivisorANGLE) */ + vertexAttribDivisorANGLE(index: GLuint, divisor: GLuint): void; + readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: 0x88FE; +} + +interface ARIAMixin { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaAtomic) */ + ariaAtomic: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaAutoComplete) */ + ariaAutoComplete: string | null; + ariaBrailleLabel: string | null; + ariaBrailleRoleDescription: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaBusy) */ + ariaBusy: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaChecked) */ + ariaChecked: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaColCount) */ + ariaColCount: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaColIndex) */ + ariaColIndex: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaColSpan) */ + ariaColSpan: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaCurrent) */ + ariaCurrent: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaDescription) */ + ariaDescription: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaDisabled) */ + ariaDisabled: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaExpanded) */ + ariaExpanded: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaHasPopup) */ + ariaHasPopup: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaHidden) */ + ariaHidden: string | null; + ariaInvalid: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaKeyShortcuts) */ + ariaKeyShortcuts: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaLabel) */ + ariaLabel: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaLevel) */ + ariaLevel: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaLive) */ + ariaLive: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaModal) */ + ariaModal: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaMultiLine) */ + ariaMultiLine: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaMultiSelectable) */ + ariaMultiSelectable: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaOrientation) */ + ariaOrientation: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaPlaceholder) */ + ariaPlaceholder: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaPosInSet) */ + ariaPosInSet: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaPressed) */ + ariaPressed: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaReadOnly) */ + ariaReadOnly: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaRequired) */ + ariaRequired: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaRoleDescription) */ + ariaRoleDescription: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaRowCount) */ + ariaRowCount: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaRowIndex) */ + ariaRowIndex: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaRowSpan) */ + ariaRowSpan: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaSelected) */ + ariaSelected: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaSetSize) */ + ariaSetSize: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaSort) */ + ariaSort: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaValueMax) */ + ariaValueMax: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaValueMin) */ + ariaValueMin: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaValueNow) */ + ariaValueNow: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaValueText) */ + ariaValueText: string | null; + role: string | null; +} + +/** + * A controller object that allows you to abort one or more DOM requests as and when desired. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController) + */ +interface AbortController { + /** + * Returns the AbortSignal object associated with this object. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/signal) + */ + readonly signal: AbortSignal; + /** + * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/abort) + */ + abort(reason?: any): void; +} + +declare var AbortController: { + prototype: AbortController; + new(): AbortController; +}; + +interface AbortSignalEventMap { + "abort": Event; +} + +/** + * A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal) + */ +interface AbortSignal extends EventTarget { + /** + * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted) + */ + readonly aborted: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */ + onabort: ((this: AbortSignal, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/reason) */ + readonly reason: any; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted) */ + throwIfAborted(): void; + addEventListener(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var AbortSignal: { + prototype: AbortSignal; + new(): AbortSignal; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static) */ + abort(reason?: any): AbortSignal; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static) */ + any(signals: AbortSignal[]): AbortSignal; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/timeout_static) */ + timeout(milliseconds: number): AbortSignal; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbstractRange) */ +interface AbstractRange { + /** + * Returns true if range is collapsed, and false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbstractRange/collapsed) + */ + readonly collapsed: boolean; + /** + * Returns range's end node. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbstractRange/endContainer) + */ + readonly endContainer: Node; + /** + * Returns range's end offset. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbstractRange/endOffset) + */ + readonly endOffset: number; + /** + * Returns range's start node. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbstractRange/startContainer) + */ + readonly startContainer: Node; + /** + * Returns range's start offset. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbstractRange/startOffset) + */ + readonly startOffset: number; +} + +declare var AbstractRange: { + prototype: AbstractRange; + new(): AbstractRange; +}; + +interface AbstractWorkerEventMap { + "error": ErrorEvent; +} + +interface AbstractWorker { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorker/error_event) */ + onerror: ((this: AbstractWorker, ev: ErrorEvent) => any) | null; + addEventListener(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +/** + * A node able to provide real-time frequency and time-domain analysis information. It is an AudioNode that passes the audio stream unchanged from the input to the output, but allows you to take the generated data, process it, and create audio visualizations. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnalyserNode) + */ +interface AnalyserNode extends AudioNode { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnalyserNode/fftSize) */ + fftSize: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnalyserNode/frequencyBinCount) */ + readonly frequencyBinCount: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnalyserNode/maxDecibels) */ + maxDecibels: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnalyserNode/minDecibels) */ + minDecibels: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnalyserNode/smoothingTimeConstant) */ + smoothingTimeConstant: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnalyserNode/getByteFrequencyData) */ + getByteFrequencyData(array: Uint8Array): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnalyserNode/getByteTimeDomainData) */ + getByteTimeDomainData(array: Uint8Array): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnalyserNode/getFloatFrequencyData) */ + getFloatFrequencyData(array: Float32Array): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnalyserNode/getFloatTimeDomainData) */ + getFloatTimeDomainData(array: Float32Array): void; +} + +declare var AnalyserNode: { + prototype: AnalyserNode; + new(context: BaseAudioContext, options?: AnalyserOptions): AnalyserNode; +}; + +interface Animatable { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/animate) */ + animate(keyframes: Keyframe[] | PropertyIndexedKeyframes | null, options?: number | KeyframeAnimationOptions): Animation; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) */ + getAnimations(options?: GetAnimationsOptions): Animation[]; +} + +interface AnimationEventMap { + "cancel": AnimationPlaybackEvent; + "finish": AnimationPlaybackEvent; + "remove": Event; +} + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation) */ +interface Animation extends EventTarget { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/currentTime) */ + currentTime: CSSNumberish | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/effect) */ + effect: AnimationEffect | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/finished) */ + readonly finished: Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/id) */ + id: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/cancel_event) */ + oncancel: ((this: Animation, ev: AnimationPlaybackEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/finish_event) */ + onfinish: ((this: Animation, ev: AnimationPlaybackEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/remove_event) */ + onremove: ((this: Animation, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/pending) */ + readonly pending: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/playState) */ + readonly playState: AnimationPlayState; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/playbackRate) */ + playbackRate: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/ready) */ + readonly ready: Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/replaceState) */ + readonly replaceState: AnimationReplaceState; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/startTime) */ + startTime: CSSNumberish | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/timeline) */ + timeline: AnimationTimeline | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/cancel) */ + cancel(): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/commitStyles) */ + commitStyles(): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/finish) */ + finish(): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/pause) */ + pause(): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/persist) */ + persist(): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/play) */ + play(): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/reverse) */ + reverse(): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/updatePlaybackRate) */ + updatePlaybackRate(playbackRate: number): void; + addEventListener(type: K, listener: (this: Animation, ev: AnimationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: Animation, ev: AnimationEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var Animation: { + prototype: Animation; + new(effect?: AnimationEffect | null, timeline?: AnimationTimeline | null): Animation; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationEffect) */ +interface AnimationEffect { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationEffect/getComputedTiming) */ + getComputedTiming(): ComputedEffectTiming; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationEffect/getTiming) */ + getTiming(): EffectTiming; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationEffect/updateTiming) */ + updateTiming(timing?: OptionalEffectTiming): void; +} + +declare var AnimationEffect: { + prototype: AnimationEffect; + new(): AnimationEffect; +}; + +/** + * Events providing information related to animations. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationEvent) + */ +interface AnimationEvent extends Event { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationEvent/animationName) */ + readonly animationName: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationEvent/elapsedTime) */ + readonly elapsedTime: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationEvent/pseudoElement) */ + readonly pseudoElement: string; +} + +declare var AnimationEvent: { + prototype: AnimationEvent; + new(type: string, animationEventInitDict?: AnimationEventInit): AnimationEvent; +}; + +interface AnimationFrameProvider { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/cancelAnimationFrame) */ + cancelAnimationFrame(handle: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/requestAnimationFrame) */ + requestAnimationFrame(callback: FrameRequestCallback): number; +} + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationPlaybackEvent) */ +interface AnimationPlaybackEvent extends Event { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationPlaybackEvent/currentTime) */ + readonly currentTime: CSSNumberish | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationPlaybackEvent/timelineTime) */ + readonly timelineTime: CSSNumberish | null; +} + +declare var AnimationPlaybackEvent: { + prototype: AnimationPlaybackEvent; + new(type: string, eventInitDict?: AnimationPlaybackEventInit): AnimationPlaybackEvent; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationTimeline) */ +interface AnimationTimeline { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationTimeline/currentTime) */ + readonly currentTime: CSSNumberish | null; +} + +declare var AnimationTimeline: { + prototype: AnimationTimeline; + new(): AnimationTimeline; +}; + +/** + * A DOM element's attribute as an object. In most DOM methods, you will probably directly retrieve the attribute as a string (e.g., Element.getAttribute(), but certain functions (e.g., Element.getAttributeNode()) or means of iterating give Attr types. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Attr) + */ +interface Attr extends Node { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Attr/localName) */ + readonly localName: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Attr/name) */ + readonly name: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Attr/namespaceURI) */ + readonly namespaceURI: string | null; + readonly ownerDocument: Document; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Attr/ownerElement) */ + readonly ownerElement: Element | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Attr/prefix) */ + readonly prefix: string | null; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Attr/specified) + */ + readonly specified: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Attr/value) */ + value: string; +} + +declare var Attr: { + prototype: Attr; + new(): Attr; +}; + +/** + * A short audio asset residing in memory, created from an audio file using the AudioContext.decodeAudioData() method, or from raw data using AudioContext.createBuffer(). Once put into an AudioBuffer, the audio can then be played by being passed into an AudioBufferSourceNode. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBuffer) + */ +interface AudioBuffer { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBuffer/duration) */ + readonly duration: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBuffer/length) */ + readonly length: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBuffer/numberOfChannels) */ + readonly numberOfChannels: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBuffer/sampleRate) */ + readonly sampleRate: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBuffer/copyFromChannel) */ + copyFromChannel(destination: Float32Array, channelNumber: number, bufferOffset?: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBuffer/copyToChannel) */ + copyToChannel(source: Float32Array, channelNumber: number, bufferOffset?: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBuffer/getChannelData) */ + getChannelData(channel: number): Float32Array; +} + +declare var AudioBuffer: { + prototype: AudioBuffer; + new(options: AudioBufferOptions): AudioBuffer; +}; + +/** + * An AudioScheduledSourceNode which represents an audio source consisting of in-memory audio data, stored in an AudioBuffer. It's especially useful for playing back audio which has particularly stringent timing accuracy requirements, such as for sounds that must match a specific rhythm and can be kept in memory rather than being played from disk or the network. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBufferSourceNode) + */ +interface AudioBufferSourceNode extends AudioScheduledSourceNode { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBufferSourceNode/buffer) */ + buffer: AudioBuffer | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBufferSourceNode/detune) */ + readonly detune: AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBufferSourceNode/loop) */ + loop: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBufferSourceNode/loopEnd) */ + loopEnd: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBufferSourceNode/loopStart) */ + loopStart: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBufferSourceNode/playbackRate) */ + readonly playbackRate: AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBufferSourceNode/start) */ + start(when?: number, offset?: number, duration?: number): void; + addEventListener(type: K, listener: (this: AudioBufferSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: AudioBufferSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var AudioBufferSourceNode: { + prototype: AudioBufferSourceNode; + new(context: BaseAudioContext, options?: AudioBufferSourceOptions): AudioBufferSourceNode; +}; + +/** + * An audio-processing graph built from audio modules linked together, each represented by an AudioNode. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioContext) + */ +interface AudioContext extends BaseAudioContext { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioContext/baseLatency) */ + readonly baseLatency: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioContext/outputLatency) */ + readonly outputLatency: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioContext/close) */ + close(): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioContext/createMediaElementSource) */ + createMediaElementSource(mediaElement: HTMLMediaElement): MediaElementAudioSourceNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioContext/createMediaStreamDestination) */ + createMediaStreamDestination(): MediaStreamAudioDestinationNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioContext/createMediaStreamSource) */ + createMediaStreamSource(mediaStream: MediaStream): MediaStreamAudioSourceNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioContext/getOutputTimestamp) */ + getOutputTimestamp(): AudioTimestamp; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioContext/resume) */ + resume(): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioContext/suspend) */ + suspend(): Promise; + addEventListener(type: K, listener: (this: AudioContext, ev: BaseAudioContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: AudioContext, ev: BaseAudioContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var AudioContext: { + prototype: AudioContext; + new(contextOptions?: AudioContextOptions): AudioContext; +}; + +/** + * AudioDestinationNode has no output (as it is the output, no more AudioNode can be linked after it in the audio graph) and one input. The number of channels in the input must be between 0 and the maxChannelCount value or an exception is raised. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioDestinationNode) + */ +interface AudioDestinationNode extends AudioNode { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioDestinationNode/maxChannelCount) */ + readonly maxChannelCount: number; +} + +declare var AudioDestinationNode: { + prototype: AudioDestinationNode; + new(): AudioDestinationNode; +}; + +/** + * The position and orientation of the unique person listening to the audio scene, and is used in audio spatialization. All PannerNodes spatialize in relation to the AudioListener stored in the BaseAudioContext.listener attribute. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioListener) + */ +interface AudioListener { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioListener/forwardX) */ + readonly forwardX: AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioListener/forwardY) */ + readonly forwardY: AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioListener/forwardZ) */ + readonly forwardZ: AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioListener/positionX) */ + readonly positionX: AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioListener/positionY) */ + readonly positionY: AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioListener/positionZ) */ + readonly positionZ: AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioListener/upX) */ + readonly upX: AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioListener/upY) */ + readonly upY: AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioListener/upZ) */ + readonly upZ: AudioParam; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioListener/setOrientation) + */ + setOrientation(x: number, y: number, z: number, xUp: number, yUp: number, zUp: number): void; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioListener/setPosition) + */ + setPosition(x: number, y: number, z: number): void; +} + +declare var AudioListener: { + prototype: AudioListener; + new(): AudioListener; +}; + +/** + * A generic interface for representing an audio processing module. Examples include: + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioNode) + */ +interface AudioNode extends EventTarget { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioNode/channelCount) */ + channelCount: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioNode/channelCountMode) */ + channelCountMode: ChannelCountMode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioNode/channelInterpretation) */ + channelInterpretation: ChannelInterpretation; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioNode/context) */ + readonly context: BaseAudioContext; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioNode/numberOfInputs) */ + readonly numberOfInputs: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioNode/numberOfOutputs) */ + readonly numberOfOutputs: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) */ + connect(destinationNode: AudioNode, output?: number, input?: number): AudioNode; + connect(destinationParam: AudioParam, output?: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) */ + disconnect(): void; + disconnect(output: number): void; + disconnect(destinationNode: AudioNode): void; + disconnect(destinationNode: AudioNode, output: number): void; + disconnect(destinationNode: AudioNode, output: number, input: number): void; + disconnect(destinationParam: AudioParam): void; + disconnect(destinationParam: AudioParam, output: number): void; +} + +declare var AudioNode: { + prototype: AudioNode; + new(): AudioNode; +}; + +/** + * The Web Audio API's AudioParam interface represents an audio-related parameter, usually a parameter of an AudioNode (such as GainNode.gain). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioParam) + */ +interface AudioParam { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioParam/automationRate) */ + automationRate: AutomationRate; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioParam/defaultValue) */ + readonly defaultValue: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioParam/maxValue) */ + readonly maxValue: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioParam/minValue) */ + readonly minValue: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioParam/value) */ + value: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioParam/cancelAndHoldAtTime) */ + cancelAndHoldAtTime(cancelTime: number): AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioParam/cancelScheduledValues) */ + cancelScheduledValues(cancelTime: number): AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioParam/exponentialRampToValueAtTime) */ + exponentialRampToValueAtTime(value: number, endTime: number): AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioParam/linearRampToValueAtTime) */ + linearRampToValueAtTime(value: number, endTime: number): AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioParam/setTargetAtTime) */ + setTargetAtTime(target: number, startTime: number, timeConstant: number): AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioParam/setValueAtTime) */ + setValueAtTime(value: number, startTime: number): AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioParam/setValueCurveAtTime) */ + setValueCurveAtTime(values: number[] | Float32Array, startTime: number, duration: number): AudioParam; +} + +declare var AudioParam: { + prototype: AudioParam; + new(): AudioParam; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioParamMap) */ +interface AudioParamMap { + forEach(callbackfn: (value: AudioParam, key: string, parent: AudioParamMap) => void, thisArg?: any): void; +} + +declare var AudioParamMap: { + prototype: AudioParamMap; + new(): AudioParamMap; +}; + +/** + * The Web Audio API events that occur when a ScriptProcessorNode input buffer is ready to be processed. + * @deprecated As of the August 29 2014 Web Audio API spec publication, this feature has been marked as deprecated, and is soon to be replaced by AudioWorklet. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioProcessingEvent) + */ +interface AudioProcessingEvent extends Event { + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioProcessingEvent/inputBuffer) + */ + readonly inputBuffer: AudioBuffer; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioProcessingEvent/outputBuffer) + */ + readonly outputBuffer: AudioBuffer; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioProcessingEvent/playbackTime) + */ + readonly playbackTime: number; +} + +/** @deprecated */ +declare var AudioProcessingEvent: { + prototype: AudioProcessingEvent; + new(type: string, eventInitDict: AudioProcessingEventInit): AudioProcessingEvent; +}; + +interface AudioScheduledSourceNodeEventMap { + "ended": Event; +} + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioScheduledSourceNode) */ +interface AudioScheduledSourceNode extends AudioNode { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioScheduledSourceNode/ended_event) */ + onended: ((this: AudioScheduledSourceNode, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioScheduledSourceNode/start) */ + start(when?: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioScheduledSourceNode/stop) */ + stop(when?: number): void; + addEventListener(type: K, listener: (this: AudioScheduledSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: AudioScheduledSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var AudioScheduledSourceNode: { + prototype: AudioScheduledSourceNode; + new(): AudioScheduledSourceNode; +}; + +/** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioWorklet) + */ +interface AudioWorklet extends Worklet { +} + +declare var AudioWorklet: { + prototype: AudioWorklet; + new(): AudioWorklet; +}; + +interface AudioWorkletNodeEventMap { + "processorerror": Event; +} + +/** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioWorkletNode) + */ +interface AudioWorkletNode extends AudioNode { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioWorkletNode/processorerror_event) */ + onprocessorerror: ((this: AudioWorkletNode, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioWorkletNode/parameters) */ + readonly parameters: AudioParamMap; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioWorkletNode/port) */ + readonly port: MessagePort; + addEventListener(type: K, listener: (this: AudioWorkletNode, ev: AudioWorkletNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: AudioWorkletNode, ev: AudioWorkletNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var AudioWorkletNode: { + prototype: AudioWorkletNode; + new(context: BaseAudioContext, name: string, options?: AudioWorkletNodeOptions): AudioWorkletNode; +}; + +/** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAssertionResponse) + */ +interface AuthenticatorAssertionResponse extends AuthenticatorResponse { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAssertionResponse/authenticatorData) */ + readonly authenticatorData: ArrayBuffer; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAssertionResponse/signature) */ + readonly signature: ArrayBuffer; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAssertionResponse/userHandle) */ + readonly userHandle: ArrayBuffer | null; +} + +declare var AuthenticatorAssertionResponse: { + prototype: AuthenticatorAssertionResponse; + new(): AuthenticatorAssertionResponse; +}; + +/** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse) + */ +interface AuthenticatorAttestationResponse extends AuthenticatorResponse { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/attestationObject) */ + readonly attestationObject: ArrayBuffer; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/getAuthenticatorData) */ + getAuthenticatorData(): ArrayBuffer; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/getPublicKey) */ + getPublicKey(): ArrayBuffer | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/getPublicKeyAlgorithm) */ + getPublicKeyAlgorithm(): COSEAlgorithmIdentifier; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/getTransports) */ + getTransports(): string[]; +} + +declare var AuthenticatorAttestationResponse: { + prototype: AuthenticatorAttestationResponse; + new(): AuthenticatorAttestationResponse; +}; + +/** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorResponse) + */ +interface AuthenticatorResponse { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorResponse/clientDataJSON) */ + readonly clientDataJSON: ArrayBuffer; +} + +declare var AuthenticatorResponse: { + prototype: AuthenticatorResponse; + new(): AuthenticatorResponse; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BarProp) */ +interface BarProp { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BarProp/visible) */ + readonly visible: boolean; +} + +declare var BarProp: { + prototype: BarProp; + new(): BarProp; +}; + +interface BaseAudioContextEventMap { + "statechange": Event; +} + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext) */ +interface BaseAudioContext extends EventTarget { + /** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/audioWorklet) + */ + readonly audioWorklet: AudioWorklet; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/currentTime) */ + readonly currentTime: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/destination) */ + readonly destination: AudioDestinationNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/listener) */ + readonly listener: AudioListener; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/statechange_event) */ + onstatechange: ((this: BaseAudioContext, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/sampleRate) */ + readonly sampleRate: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/state) */ + readonly state: AudioContextState; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createAnalyser) */ + createAnalyser(): AnalyserNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createBiquadFilter) */ + createBiquadFilter(): BiquadFilterNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createBuffer) */ + createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createBufferSource) */ + createBufferSource(): AudioBufferSourceNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createChannelMerger) */ + createChannelMerger(numberOfInputs?: number): ChannelMergerNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createChannelSplitter) */ + createChannelSplitter(numberOfOutputs?: number): ChannelSplitterNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createConstantSource) */ + createConstantSource(): ConstantSourceNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createConvolver) */ + createConvolver(): ConvolverNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createDelay) */ + createDelay(maxDelayTime?: number): DelayNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createDynamicsCompressor) */ + createDynamicsCompressor(): DynamicsCompressorNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createGain) */ + createGain(): GainNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createIIRFilter) */ + createIIRFilter(feedforward: number[], feedback: number[]): IIRFilterNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createOscillator) */ + createOscillator(): OscillatorNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createPanner) */ + createPanner(): PannerNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createPeriodicWave) */ + createPeriodicWave(real: number[] | Float32Array, imag: number[] | Float32Array, constraints?: PeriodicWaveConstraints): PeriodicWave; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createScriptProcessor) + */ + createScriptProcessor(bufferSize?: number, numberOfInputChannels?: number, numberOfOutputChannels?: number): ScriptProcessorNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createStereoPanner) */ + createStereoPanner(): StereoPannerNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createWaveShaper) */ + createWaveShaper(): WaveShaperNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/decodeAudioData) */ + decodeAudioData(audioData: ArrayBuffer, successCallback?: DecodeSuccessCallback | null, errorCallback?: DecodeErrorCallback | null): Promise; + addEventListener(type: K, listener: (this: BaseAudioContext, ev: BaseAudioContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: BaseAudioContext, ev: BaseAudioContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var BaseAudioContext: { + prototype: BaseAudioContext; + new(): BaseAudioContext; +}; + +/** + * The beforeunload event is fired when the window, the document and its resources are about to be unloaded. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/BeforeUnloadEvent) + */ +interface BeforeUnloadEvent extends Event { + /** @deprecated */ + returnValue: any; +} + +declare var BeforeUnloadEvent: { + prototype: BeforeUnloadEvent; + new(): BeforeUnloadEvent; +}; + +/** + * A simple low-order filter, and is created using the AudioContext.createBiquadFilter() method. It is an AudioNode that can represent different kinds of filters, tone control devices, and graphic equalizers. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/BiquadFilterNode) + */ +interface BiquadFilterNode extends AudioNode { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BiquadFilterNode/Q) */ + readonly Q: AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BiquadFilterNode/detune) */ + readonly detune: AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BiquadFilterNode/frequency) */ + readonly frequency: AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BiquadFilterNode/gain) */ + readonly gain: AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BiquadFilterNode/type) */ + type: BiquadFilterType; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BiquadFilterNode/getFrequencyResponse) */ + getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void; +} + +declare var BiquadFilterNode: { + prototype: BiquadFilterNode; + new(context: BaseAudioContext, options?: BiquadFilterOptions): BiquadFilterNode; +}; + +/** + * A file-like object of immutable, raw data. Blobs represent data that isn't necessarily in a JavaScript-native format. The File interface is based on Blob, inheriting blob functionality and expanding it to support files on the user's system. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob) + */ +interface Blob { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) */ + readonly size: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) */ + readonly type: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer) */ + arrayBuffer(): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */ + slice(start?: number, end?: number, contentType?: string): Blob; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream) */ + stream(): ReadableStream; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */ + text(): Promise; +} + +declare var Blob: { + prototype: Blob; + new(blobParts?: BlobPart[], options?: BlobPropertyBag): Blob; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BlobEvent) */ +interface BlobEvent extends Event { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BlobEvent/data) */ + readonly data: Blob; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BlobEvent/timecode) */ + readonly timecode: DOMHighResTimeStamp; +} + +declare var BlobEvent: { + prototype: BlobEvent; + new(type: string, eventInitDict: BlobEventInit): BlobEvent; +}; + +interface Body { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body) */ + readonly body: ReadableStream | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */ + readonly bodyUsed: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer) */ + arrayBuffer(): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob) */ + blob(): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/formData) */ + formData(): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/json) */ + json(): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/text) */ + text(): Promise; +} + +interface BroadcastChannelEventMap { + "message": MessageEvent; + "messageerror": MessageEvent; +} + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BroadcastChannel) */ +interface BroadcastChannel extends EventTarget { + /** + * Returns the channel name (as passed to the constructor). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/BroadcastChannel/name) + */ + readonly name: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BroadcastChannel/message_event) */ + onmessage: ((this: BroadcastChannel, ev: MessageEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BroadcastChannel/messageerror_event) */ + onmessageerror: ((this: BroadcastChannel, ev: MessageEvent) => any) | null; + /** + * Closes the BroadcastChannel object, opening it up to garbage collection. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/BroadcastChannel/close) + */ + close(): void; + /** + * Sends the given message to other BroadcastChannel objects set up for this channel. Messages can be structured objects, e.g. nested objects and arrays. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/BroadcastChannel/postMessage) + */ + postMessage(message: any): void; + addEventListener(type: K, listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var BroadcastChannel: { + prototype: BroadcastChannel; + new(name: string): BroadcastChannel; +}; + +/** + * This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy) + */ +interface ByteLengthQueuingStrategy extends QueuingStrategy { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/highWaterMark) */ + readonly highWaterMark: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/size) */ + readonly size: QueuingStrategySize; +} + +declare var ByteLengthQueuingStrategy: { + prototype: ByteLengthQueuingStrategy; + new(init: QueuingStrategyInit): ByteLengthQueuingStrategy; +}; + +/** + * A CDATA section that can be used within XML to include extended portions of unescaped text. The symbols < and & don’t need escaping as they normally do when inside a CDATA section. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CDATASection) + */ +interface CDATASection extends Text { +} + +declare var CDATASection: { + prototype: CDATASection; + new(): CDATASection; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSAnimation) */ +interface CSSAnimation extends Animation { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSAnimation/animationName) */ + readonly animationName: string; + addEventListener(type: K, listener: (this: CSSAnimation, ev: AnimationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: CSSAnimation, ev: AnimationEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var CSSAnimation: { + prototype: CSSAnimation; + new(): CSSAnimation; +}; + +/** + * A single condition CSS at-rule, which consists of a condition and a statement block. It is a child of CSSGroupingRule. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSConditionRule) + */ +interface CSSConditionRule extends CSSGroupingRule { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSConditionRule/conditionText) */ + readonly conditionText: string; +} + +declare var CSSConditionRule: { + prototype: CSSConditionRule; + new(): CSSConditionRule; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSContainerRule) */ +interface CSSContainerRule extends CSSConditionRule { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSContainerRule/containerName) */ + readonly containerName: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSContainerRule/containerQuery) */ + readonly containerQuery: string; +} + +declare var CSSContainerRule: { + prototype: CSSContainerRule; + new(): CSSContainerRule; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSCounterStyleRule) */ +interface CSSCounterStyleRule extends CSSRule { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSCounterStyleRule/additiveSymbols) */ + additiveSymbols: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSCounterStyleRule/fallback) */ + fallback: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSCounterStyleRule/name) */ + name: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSCounterStyleRule/negative) */ + negative: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSCounterStyleRule/pad) */ + pad: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSCounterStyleRule/prefix) */ + prefix: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSCounterStyleRule/range) */ + range: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSCounterStyleRule/speakAs) */ + speakAs: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSCounterStyleRule/suffix) */ + suffix: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSCounterStyleRule/symbols) */ + symbols: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSCounterStyleRule/system) */ + system: string; +} + +declare var CSSCounterStyleRule: { + prototype: CSSCounterStyleRule; + new(): CSSCounterStyleRule; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSFontFaceRule) */ +interface CSSFontFaceRule extends CSSRule { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSFontFaceRule/style) */ + readonly style: CSSStyleDeclaration; +} + +declare var CSSFontFaceRule: { + prototype: CSSFontFaceRule; + new(): CSSFontFaceRule; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSFontFeatureValuesRule) */ +interface CSSFontFeatureValuesRule extends CSSRule { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSFontFeatureValuesRule/fontFamily) */ + fontFamily: string; +} + +declare var CSSFontFeatureValuesRule: { + prototype: CSSFontFeatureValuesRule; + new(): CSSFontFeatureValuesRule; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSFontPaletteValuesRule) */ +interface CSSFontPaletteValuesRule extends CSSRule { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSFontPaletteValuesRule/basePalette) */ + readonly basePalette: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSFontPaletteValuesRule/fontFamily) */ + readonly fontFamily: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSFontPaletteValuesRule/name) */ + readonly name: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSFontPaletteValuesRule/overrideColors) */ + readonly overrideColors: string; +} + +declare var CSSFontPaletteValuesRule: { + prototype: CSSFontPaletteValuesRule; + new(): CSSFontPaletteValuesRule; +}; + +/** + * Any CSS at-rule that contains other rules nested within it. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSGroupingRule) + */ +interface CSSGroupingRule extends CSSRule { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSGroupingRule/cssRules) */ + readonly cssRules: CSSRuleList; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSGroupingRule/deleteRule) */ + deleteRule(index: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSGroupingRule/insertRule) */ + insertRule(rule: string, index?: number): number; +} + +declare var CSSGroupingRule: { + prototype: CSSGroupingRule; + new(): CSSGroupingRule; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSImageValue) */ +interface CSSImageValue extends CSSStyleValue { +} + +declare var CSSImageValue: { + prototype: CSSImageValue; + new(): CSSImageValue; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSImportRule) */ +interface CSSImportRule extends CSSRule { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSImportRule/href) */ + readonly href: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSImportRule/layerName) */ + readonly layerName: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSImportRule/media) */ + readonly media: MediaList; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSImportRule/styleSheet) */ + readonly styleSheet: CSSStyleSheet | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSImportRule/supportsText) */ + readonly supportsText: string | null; +} + +declare var CSSImportRule: { + prototype: CSSImportRule; + new(): CSSImportRule; +}; + +/** + * An object representing a set of style for a given keyframe. It corresponds to the contains of a single keyframe of a @keyframes at-rule. It implements the CSSRule interface with a type value of 8 (CSSRule.KEYFRAME_RULE). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSKeyframeRule) + */ +interface CSSKeyframeRule extends CSSRule { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSKeyframeRule/keyText) */ + keyText: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSKeyframeRule/style) */ + readonly style: CSSStyleDeclaration; +} + +declare var CSSKeyframeRule: { + prototype: CSSKeyframeRule; + new(): CSSKeyframeRule; +}; + +/** + * An object representing a complete set of keyframes for a CSS animation. It corresponds to the contains of a whole @keyframes at-rule. It implements the CSSRule interface with a type value of 7 (CSSRule.KEYFRAMES_RULE). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSKeyframesRule) + */ +interface CSSKeyframesRule extends CSSRule { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSKeyframesRule/cssRules) */ + readonly cssRules: CSSRuleList; + readonly length: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSKeyframesRule/name) */ + name: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSKeyframesRule/appendRule) */ + appendRule(rule: string): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSKeyframesRule/deleteRule) */ + deleteRule(select: string): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSKeyframesRule/findRule) */ + findRule(select: string): CSSKeyframeRule | null; + [index: number]: CSSKeyframeRule; +} + +declare var CSSKeyframesRule: { + prototype: CSSKeyframesRule; + new(): CSSKeyframesRule; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSKeywordValue) */ +interface CSSKeywordValue extends CSSStyleValue { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSKeywordValue/value) */ + value: string; +} + +declare var CSSKeywordValue: { + prototype: CSSKeywordValue; + new(value: string): CSSKeywordValue; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSLayerBlockRule) */ +interface CSSLayerBlockRule extends CSSGroupingRule { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSLayerBlockRule/name) */ + readonly name: string; +} + +declare var CSSLayerBlockRule: { + prototype: CSSLayerBlockRule; + new(): CSSLayerBlockRule; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSLayerStatementRule) */ +interface CSSLayerStatementRule extends CSSRule { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSLayerStatementRule/nameList) */ + readonly nameList: ReadonlyArray; +} + +declare var CSSLayerStatementRule: { + prototype: CSSLayerStatementRule; + new(): CSSLayerStatementRule; +}; + +interface CSSMathClamp extends CSSMathValue { + readonly lower: CSSNumericValue; + readonly upper: CSSNumericValue; + readonly value: CSSNumericValue; +} + +declare var CSSMathClamp: { + prototype: CSSMathClamp; + new(lower: CSSNumberish, value: CSSNumberish, upper: CSSNumberish): CSSMathClamp; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathInvert) */ +interface CSSMathInvert extends CSSMathValue { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathInvert/value) */ + readonly value: CSSNumericValue; +} + +declare var CSSMathInvert: { + prototype: CSSMathInvert; + new(arg: CSSNumberish): CSSMathInvert; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathMax) */ +interface CSSMathMax extends CSSMathValue { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathMax/values) */ + readonly values: CSSNumericArray; +} + +declare var CSSMathMax: { + prototype: CSSMathMax; + new(...args: CSSNumberish[]): CSSMathMax; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathMin) */ +interface CSSMathMin extends CSSMathValue { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathMin/values) */ + readonly values: CSSNumericArray; +} + +declare var CSSMathMin: { + prototype: CSSMathMin; + new(...args: CSSNumberish[]): CSSMathMin; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathNegate) */ +interface CSSMathNegate extends CSSMathValue { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathNegate/value) */ + readonly value: CSSNumericValue; +} + +declare var CSSMathNegate: { + prototype: CSSMathNegate; + new(arg: CSSNumberish): CSSMathNegate; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathProduct) */ +interface CSSMathProduct extends CSSMathValue { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathProduct/values) */ + readonly values: CSSNumericArray; +} + +declare var CSSMathProduct: { + prototype: CSSMathProduct; + new(...args: CSSNumberish[]): CSSMathProduct; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathSum) */ +interface CSSMathSum extends CSSMathValue { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathSum/values) */ + readonly values: CSSNumericArray; +} + +declare var CSSMathSum: { + prototype: CSSMathSum; + new(...args: CSSNumberish[]): CSSMathSum; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathValue) */ +interface CSSMathValue extends CSSNumericValue { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathValue/operator) */ + readonly operator: CSSMathOperator; +} + +declare var CSSMathValue: { + prototype: CSSMathValue; + new(): CSSMathValue; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMatrixComponent) */ +interface CSSMatrixComponent extends CSSTransformComponent { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMatrixComponent/matrix) */ + matrix: DOMMatrix; +} + +declare var CSSMatrixComponent: { + prototype: CSSMatrixComponent; + new(matrix: DOMMatrixReadOnly, options?: CSSMatrixComponentOptions): CSSMatrixComponent; +}; + +/** + * A single CSS @media rule. It implements the CSSConditionRule interface, and therefore the CSSGroupingRule and the CSSRule interface with a type value of 4 (CSSRule.MEDIA_RULE). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMediaRule) + */ +interface CSSMediaRule extends CSSConditionRule { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMediaRule/media) */ + readonly media: MediaList; +} + +declare var CSSMediaRule: { + prototype: CSSMediaRule; + new(): CSSMediaRule; +}; + +/** + * An object representing a single CSS @namespace at-rule. It implements the CSSRule interface, with a type value of 10 (CSSRule.NAMESPACE_RULE). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNamespaceRule) + */ +interface CSSNamespaceRule extends CSSRule { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNamespaceRule/namespaceURI) */ + readonly namespaceURI: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNamespaceRule/prefix) */ + readonly prefix: string; +} + +declare var CSSNamespaceRule: { + prototype: CSSNamespaceRule; + new(): CSSNamespaceRule; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericArray) */ +interface CSSNumericArray { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericArray/length) */ + readonly length: number; + forEach(callbackfn: (value: CSSNumericValue, key: number, parent: CSSNumericArray) => void, thisArg?: any): void; + [index: number]: CSSNumericValue; +} + +declare var CSSNumericArray: { + prototype: CSSNumericArray; + new(): CSSNumericArray; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue) */ +interface CSSNumericValue extends CSSStyleValue { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/add) */ + add(...values: CSSNumberish[]): CSSNumericValue; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/div) */ + div(...values: CSSNumberish[]): CSSNumericValue; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/equals) */ + equals(...value: CSSNumberish[]): boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/max) */ + max(...values: CSSNumberish[]): CSSNumericValue; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/min) */ + min(...values: CSSNumberish[]): CSSNumericValue; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/mul) */ + mul(...values: CSSNumberish[]): CSSNumericValue; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/sub) */ + sub(...values: CSSNumberish[]): CSSNumericValue; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/to) */ + to(unit: string): CSSUnitValue; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/toSum) */ + toSum(...units: string[]): CSSMathSum; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/type) */ + type(): CSSNumericType; +} + +declare var CSSNumericValue: { + prototype: CSSNumericValue; + new(): CSSNumericValue; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/parse_static) */ + parse(cssText: string): CSSNumericValue; +}; + +/** + * CSSPageRule is an interface representing a single CSS @page rule. It implements the CSSRule interface with a type value of 6 (CSSRule.PAGE_RULE). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSPageRule) + */ +interface CSSPageRule extends CSSGroupingRule { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSPageRule/selectorText) */ + selectorText: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSPageRule/style) */ + readonly style: CSSStyleDeclaration; +} + +declare var CSSPageRule: { + prototype: CSSPageRule; + new(): CSSPageRule; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSPerspective) */ +interface CSSPerspective extends CSSTransformComponent { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSPerspective/length) */ + length: CSSPerspectiveValue; +} + +declare var CSSPerspective: { + prototype: CSSPerspective; + new(length: CSSPerspectiveValue): CSSPerspective; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSPropertyRule) */ +interface CSSPropertyRule extends CSSRule { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSPropertyRule/inherits) */ + readonly inherits: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSPropertyRule/initialValue) */ + readonly initialValue: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSPropertyRule/name) */ + readonly name: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSPropertyRule/syntax) */ + readonly syntax: string; +} + +declare var CSSPropertyRule: { + prototype: CSSPropertyRule; + new(): CSSPropertyRule; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRotate) */ +interface CSSRotate extends CSSTransformComponent { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRotate/angle) */ + angle: CSSNumericValue; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRotate/x) */ + x: CSSNumberish; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRotate/y) */ + y: CSSNumberish; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRotate/z) */ + z: CSSNumberish; +} + +declare var CSSRotate: { + prototype: CSSRotate; + new(angle: CSSNumericValue): CSSRotate; + new(x: CSSNumberish, y: CSSNumberish, z: CSSNumberish, angle: CSSNumericValue): CSSRotate; +}; + +/** + * A single CSS rule. There are several types of rules, listed in the Type constants section below. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRule) + */ +interface CSSRule { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRule/cssText) */ + cssText: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRule/parentRule) */ + readonly parentRule: CSSRule | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRule/parentStyleSheet) */ + readonly parentStyleSheet: CSSStyleSheet | null; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRule/type) + */ + readonly type: number; + readonly STYLE_RULE: 1; + readonly CHARSET_RULE: 2; + readonly IMPORT_RULE: 3; + readonly MEDIA_RULE: 4; + readonly FONT_FACE_RULE: 5; + readonly PAGE_RULE: 6; + readonly NAMESPACE_RULE: 10; + readonly KEYFRAMES_RULE: 7; + readonly KEYFRAME_RULE: 8; + readonly SUPPORTS_RULE: 12; + readonly COUNTER_STYLE_RULE: 11; + readonly FONT_FEATURE_VALUES_RULE: 14; +} + +declare var CSSRule: { + prototype: CSSRule; + new(): CSSRule; + readonly STYLE_RULE: 1; + readonly CHARSET_RULE: 2; + readonly IMPORT_RULE: 3; + readonly MEDIA_RULE: 4; + readonly FONT_FACE_RULE: 5; + readonly PAGE_RULE: 6; + readonly NAMESPACE_RULE: 10; + readonly KEYFRAMES_RULE: 7; + readonly KEYFRAME_RULE: 8; + readonly SUPPORTS_RULE: 12; + readonly COUNTER_STYLE_RULE: 11; + readonly FONT_FEATURE_VALUES_RULE: 14; +}; + +/** + * A CSSRuleList is an (indirect-modify only) array-like object containing an ordered collection of CSSRule objects. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRuleList) + */ +interface CSSRuleList { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRuleList/length) */ + readonly length: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRuleList/item) */ + item(index: number): CSSRule | null; + [index: number]: CSSRule; +} + +declare var CSSRuleList: { + prototype: CSSRuleList; + new(): CSSRuleList; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSScale) */ +interface CSSScale extends CSSTransformComponent { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSScale/x) */ + x: CSSNumberish; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSScale/y) */ + y: CSSNumberish; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSScale/z) */ + z: CSSNumberish; +} + +declare var CSSScale: { + prototype: CSSScale; + new(x: CSSNumberish, y: CSSNumberish, z?: CSSNumberish): CSSScale; +}; + +interface CSSScopeRule extends CSSGroupingRule { + readonly end: string | null; + readonly start: string | null; +} + +declare var CSSScopeRule: { + prototype: CSSScopeRule; + new(): CSSScopeRule; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSSkew) */ +interface CSSSkew extends CSSTransformComponent { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSSkew/ax) */ + ax: CSSNumericValue; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSSkew/ay) */ + ay: CSSNumericValue; +} + +declare var CSSSkew: { + prototype: CSSSkew; + new(ax: CSSNumericValue, ay: CSSNumericValue): CSSSkew; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSSkewX) */ +interface CSSSkewX extends CSSTransformComponent { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSSkewX/ax) */ + ax: CSSNumericValue; +} + +declare var CSSSkewX: { + prototype: CSSSkewX; + new(ax: CSSNumericValue): CSSSkewX; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSSkewY) */ +interface CSSSkewY extends CSSTransformComponent { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSSkewY/ay) */ + ay: CSSNumericValue; +} + +declare var CSSSkewY: { + prototype: CSSSkewY; + new(ay: CSSNumericValue): CSSSkewY; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStartingStyleRule) */ +interface CSSStartingStyleRule extends CSSGroupingRule { +} + +declare var CSSStartingStyleRule: { + prototype: CSSStartingStyleRule; + new(): CSSStartingStyleRule; +}; + +/** + * An object that is a CSS declaration block, and exposes style information and various style-related methods and properties. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration) + */ +interface CSSStyleDeclaration { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/accent-color) */ + accentColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/align-content) */ + alignContent: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/align-items) */ + alignItems: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/align-self) */ + alignSelf: string; + alignmentBaseline: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/all) */ + all: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation) */ + animation: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation-composition) */ + animationComposition: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation-delay) */ + animationDelay: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation-direction) */ + animationDirection: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation-duration) */ + animationDuration: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation-fill-mode) */ + animationFillMode: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation-iteration-count) */ + animationIterationCount: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation-name) */ + animationName: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation-play-state) */ + animationPlayState: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation-timing-function) */ + animationTimingFunction: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/appearance) */ + appearance: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/aspect-ratio) */ + aspectRatio: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/backdrop-filter) */ + backdropFilter: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/backface-visibility) */ + backfaceVisibility: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/background) */ + background: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/background-attachment) */ + backgroundAttachment: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/background-blend-mode) */ + backgroundBlendMode: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/background-clip) */ + backgroundClip: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/background-color) */ + backgroundColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/background-image) */ + backgroundImage: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/background-origin) */ + backgroundOrigin: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/background-position) */ + backgroundPosition: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/background-position-x) */ + backgroundPositionX: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/background-position-y) */ + backgroundPositionY: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/background-repeat) */ + backgroundRepeat: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/background-size) */ + backgroundSize: string; + baselineShift: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/baseline-source) */ + baselineSource: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/block-size) */ + blockSize: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border) */ + border: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-block) */ + borderBlock: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-block-color) */ + borderBlockColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-block-end) */ + borderBlockEnd: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-block-end-color) */ + borderBlockEndColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-block-end-style) */ + borderBlockEndStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-block-end-width) */ + borderBlockEndWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-block-start) */ + borderBlockStart: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-block-start-color) */ + borderBlockStartColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-block-start-style) */ + borderBlockStartStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-block-start-width) */ + borderBlockStartWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-block-style) */ + borderBlockStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-block-width) */ + borderBlockWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-bottom) */ + borderBottom: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-bottom-color) */ + borderBottomColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-bottom-left-radius) */ + borderBottomLeftRadius: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-bottom-right-radius) */ + borderBottomRightRadius: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-bottom-style) */ + borderBottomStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-bottom-width) */ + borderBottomWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-collapse) */ + borderCollapse: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-color) */ + borderColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-end-end-radius) */ + borderEndEndRadius: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-end-start-radius) */ + borderEndStartRadius: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-image) */ + borderImage: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-image-outset) */ + borderImageOutset: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-image-repeat) */ + borderImageRepeat: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-image-slice) */ + borderImageSlice: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-image-source) */ + borderImageSource: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-image-width) */ + borderImageWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-inline) */ + borderInline: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-inline-color) */ + borderInlineColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-inline-end) */ + borderInlineEnd: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-inline-end-color) */ + borderInlineEndColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-inline-end-style) */ + borderInlineEndStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-inline-end-width) */ + borderInlineEndWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-inline-start) */ + borderInlineStart: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-inline-start-color) */ + borderInlineStartColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-inline-start-style) */ + borderInlineStartStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-inline-start-width) */ + borderInlineStartWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-inline-style) */ + borderInlineStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-inline-width) */ + borderInlineWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-left) */ + borderLeft: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-left-color) */ + borderLeftColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-left-style) */ + borderLeftStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-left-width) */ + borderLeftWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-radius) */ + borderRadius: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-right) */ + borderRight: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-right-color) */ + borderRightColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-right-style) */ + borderRightStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-right-width) */ + borderRightWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-spacing) */ + borderSpacing: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-start-end-radius) */ + borderStartEndRadius: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-start-start-radius) */ + borderStartStartRadius: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-style) */ + borderStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-top) */ + borderTop: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-top-color) */ + borderTopColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-top-left-radius) */ + borderTopLeftRadius: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-top-right-radius) */ + borderTopRightRadius: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-top-style) */ + borderTopStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-top-width) */ + borderTopWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-width) */ + borderWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/bottom) */ + bottom: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/box-shadow) */ + boxShadow: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/box-sizing) */ + boxSizing: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/break-after) */ + breakAfter: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/break-before) */ + breakBefore: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/break-inside) */ + breakInside: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/caption-side) */ + captionSide: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/caret-color) */ + caretColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/clear) */ + clear: string; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/clip) + */ + clip: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/clip-path) */ + clipPath: string; + clipRule: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/color) */ + color: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/color-interpolation) */ + colorInterpolation: string; + colorInterpolationFilters: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/color-scheme) */ + colorScheme: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/column-count) */ + columnCount: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/column-fill) */ + columnFill: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/column-gap) */ + columnGap: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/column-rule) */ + columnRule: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/column-rule-color) */ + columnRuleColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/column-rule-style) */ + columnRuleStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/column-rule-width) */ + columnRuleWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/column-span) */ + columnSpan: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/column-width) */ + columnWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/columns) */ + columns: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/contain) */ + contain: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/contain-intrinsic-contain-intrinsic-block-size) */ + containIntrinsicBlockSize: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/contain-intrinsic-height) */ + containIntrinsicHeight: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/contain-intrinsic-contain-intrinsic-inline-size) */ + containIntrinsicInlineSize: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/contain-intrinsic-size) */ + containIntrinsicSize: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/contain-intrinsic-width) */ + containIntrinsicWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/container) */ + container: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/container-name) */ + containerName: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/container-type) */ + containerType: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/content) */ + content: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/content-visibility) */ + contentVisibility: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/counter-increment) */ + counterIncrement: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/counter-reset) */ + counterReset: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/counter-set) */ + counterSet: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/cssFloat) */ + cssFloat: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/cssText) */ + cssText: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/cursor) */ + cursor: string; + cx: string; + cy: string; + d: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/direction) */ + direction: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/display) */ + display: string; + dominantBaseline: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/empty-cells) */ + emptyCells: string; + fill: string; + fillOpacity: string; + fillRule: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/filter) */ + filter: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/flex) */ + flex: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/flex-basis) */ + flexBasis: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/flex-direction) */ + flexDirection: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/flex-flow) */ + flexFlow: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/flex-grow) */ + flexGrow: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/flex-shrink) */ + flexShrink: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/flex-wrap) */ + flexWrap: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/float) */ + float: string; + floodColor: string; + floodOpacity: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font) */ + font: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-family) */ + fontFamily: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-feature-settings) */ + fontFeatureSettings: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-kerning) */ + fontKerning: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-optical-sizing) */ + fontOpticalSizing: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-palette) */ + fontPalette: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-size) */ + fontSize: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-size-adjust) */ + fontSizeAdjust: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-stretch) */ + fontStretch: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-style) */ + fontStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-synthesis) */ + fontSynthesis: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-synthesis-small-caps) */ + fontSynthesisSmallCaps: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-synthesis-style) */ + fontSynthesisStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-synthesis-weight) */ + fontSynthesisWeight: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-variant) */ + fontVariant: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-variant-alternates) */ + fontVariantAlternates: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-variant-caps) */ + fontVariantCaps: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-variant-east-asian) */ + fontVariantEastAsian: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-variant-ligatures) */ + fontVariantLigatures: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-variant-numeric) */ + fontVariantNumeric: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-variant-position) */ + fontVariantPosition: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-variation-settings) */ + fontVariationSettings: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-weight) */ + fontWeight: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/forced-color-adjust) */ + forcedColorAdjust: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/gap) */ + gap: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/grid) */ + grid: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/grid-area) */ + gridArea: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/grid-auto-columns) */ + gridAutoColumns: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/grid-auto-flow) */ + gridAutoFlow: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/grid-auto-rows) */ + gridAutoRows: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/grid-column) */ + gridColumn: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/grid-column-end) */ + gridColumnEnd: string; + /** @deprecated This is a legacy alias of `columnGap`. */ + gridColumnGap: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/grid-column-start) */ + gridColumnStart: string; + /** @deprecated This is a legacy alias of `gap`. */ + gridGap: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/grid-row) */ + gridRow: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/grid-row-end) */ + gridRowEnd: string; + /** @deprecated This is a legacy alias of `rowGap`. */ + gridRowGap: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/grid-row-start) */ + gridRowStart: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/grid-template) */ + gridTemplate: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/grid-template-areas) */ + gridTemplateAreas: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/grid-template-columns) */ + gridTemplateColumns: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/grid-template-rows) */ + gridTemplateRows: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/height) */ + height: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/hyphenate-character) */ + hyphenateCharacter: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/hyphens) */ + hyphens: string; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/image-orientation) + */ + imageOrientation: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/image-rendering) */ + imageRendering: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/inline-size) */ + inlineSize: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/inset) */ + inset: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/inset-block) */ + insetBlock: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/inset-block-end) */ + insetBlockEnd: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/inset-block-start) */ + insetBlockStart: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/inset-inline) */ + insetInline: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/inset-inline-end) */ + insetInlineEnd: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/inset-inline-start) */ + insetInlineStart: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/isolation) */ + isolation: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/justify-content) */ + justifyContent: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/justify-items) */ + justifyItems: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/justify-self) */ + justifySelf: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/left) */ + left: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/length) */ + readonly length: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/letter-spacing) */ + letterSpacing: string; + lightingColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/line-break) */ + lineBreak: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/line-height) */ + lineHeight: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/list-style) */ + listStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/list-style-image) */ + listStyleImage: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/list-style-position) */ + listStylePosition: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/list-style-type) */ + listStyleType: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/margin) */ + margin: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/margin-block) */ + marginBlock: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/margin-block-end) */ + marginBlockEnd: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/margin-block-start) */ + marginBlockStart: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/margin-bottom) */ + marginBottom: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/margin-inline) */ + marginInline: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/margin-inline-end) */ + marginInlineEnd: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/margin-inline-start) */ + marginInlineStart: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/margin-left) */ + marginLeft: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/margin-right) */ + marginRight: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/margin-top) */ + marginTop: string; + marker: string; + markerEnd: string; + markerMid: string; + markerStart: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask) */ + mask: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-clip) */ + maskClip: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-composite) */ + maskComposite: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-image) */ + maskImage: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-mode) */ + maskMode: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-origin) */ + maskOrigin: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-position) */ + maskPosition: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-repeat) */ + maskRepeat: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-size) */ + maskSize: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-type) */ + maskType: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/math-depth) */ + mathDepth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/math-style) */ + mathStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/max-block-size) */ + maxBlockSize: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/max-height) */ + maxHeight: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/max-inline-size) */ + maxInlineSize: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/max-width) */ + maxWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/min-block-size) */ + minBlockSize: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/min-height) */ + minHeight: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/min-inline-size) */ + minInlineSize: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/min-width) */ + minWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mix-blend-mode) */ + mixBlendMode: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/object-fit) */ + objectFit: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/object-position) */ + objectPosition: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/offset) */ + offset: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/offset-anchor) */ + offsetAnchor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/offset-distance) */ + offsetDistance: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/offset-path) */ + offsetPath: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/offset-position) */ + offsetPosition: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/offset-rotate) */ + offsetRotate: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/opacity) */ + opacity: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/order) */ + order: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/orphans) */ + orphans: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/outline) */ + outline: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/outline-color) */ + outlineColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/outline-offset) */ + outlineOffset: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/outline-style) */ + outlineStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/outline-width) */ + outlineWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/overflow) */ + overflow: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/overflow-anchor) */ + overflowAnchor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/overflow-clip-margin) */ + overflowClipMargin: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/overflow-wrap) */ + overflowWrap: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/overflow-x) */ + overflowX: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/overflow-y) */ + overflowY: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior) */ + overscrollBehavior: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior-block) */ + overscrollBehaviorBlock: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior-inline) */ + overscrollBehaviorInline: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior-x) */ + overscrollBehaviorX: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior-y) */ + overscrollBehaviorY: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/padding) */ + padding: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/padding-block) */ + paddingBlock: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/padding-block-end) */ + paddingBlockEnd: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/padding-block-start) */ + paddingBlockStart: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/padding-bottom) */ + paddingBottom: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/padding-inline) */ + paddingInline: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/padding-inline-end) */ + paddingInlineEnd: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/padding-inline-start) */ + paddingInlineStart: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/padding-left) */ + paddingLeft: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/padding-right) */ + paddingRight: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/padding-top) */ + paddingTop: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/page) */ + page: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/page-break-after) */ + pageBreakAfter: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/page-break-before) */ + pageBreakBefore: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/page-break-inside) */ + pageBreakInside: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/paint-order) */ + paintOrder: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/parentRule) */ + readonly parentRule: CSSRule | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/perspective) */ + perspective: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/perspective-origin) */ + perspectiveOrigin: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/place-content) */ + placeContent: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/place-items) */ + placeItems: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/place-self) */ + placeSelf: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/pointer-events) */ + pointerEvents: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/position) */ + position: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/print-color-adjust) */ + printColorAdjust: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/quotes) */ + quotes: string; + r: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/resize) */ + resize: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/right) */ + right: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/rotate) */ + rotate: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/row-gap) */ + rowGap: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/ruby-position) */ + rubyPosition: string; + rx: string; + ry: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scale) */ + scale: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-behavior) */ + scrollBehavior: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-margin) */ + scrollMargin: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-margin-block) */ + scrollMarginBlock: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-margin-block-end) */ + scrollMarginBlockEnd: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-margin-block-start) */ + scrollMarginBlockStart: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-margin-bottom) */ + scrollMarginBottom: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-margin-inline) */ + scrollMarginInline: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-margin-inline-end) */ + scrollMarginInlineEnd: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-margin-inline-start) */ + scrollMarginInlineStart: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-margin-left) */ + scrollMarginLeft: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-margin-right) */ + scrollMarginRight: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-margin-top) */ + scrollMarginTop: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-padding) */ + scrollPadding: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-padding-block) */ + scrollPaddingBlock: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-padding-block-end) */ + scrollPaddingBlockEnd: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-padding-block-start) */ + scrollPaddingBlockStart: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-padding-bottom) */ + scrollPaddingBottom: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-padding-inline) */ + scrollPaddingInline: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-padding-inline-end) */ + scrollPaddingInlineEnd: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-padding-inline-start) */ + scrollPaddingInlineStart: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-padding-left) */ + scrollPaddingLeft: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-padding-right) */ + scrollPaddingRight: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-padding-top) */ + scrollPaddingTop: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-snap-align) */ + scrollSnapAlign: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-snap-stop) */ + scrollSnapStop: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-snap-type) */ + scrollSnapType: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scrollbar-color) */ + scrollbarColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scrollbar-gutter) */ + scrollbarGutter: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scrollbar-width) */ + scrollbarWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/shape-image-threshold) */ + shapeImageThreshold: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/shape-margin) */ + shapeMargin: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/shape-outside) */ + shapeOutside: string; + shapeRendering: string; + stopColor: string; + stopOpacity: string; + stroke: string; + strokeDasharray: string; + strokeDashoffset: string; + strokeLinecap: string; + strokeLinejoin: string; + strokeMiterlimit: string; + strokeOpacity: string; + strokeWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/tab-size) */ + tabSize: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/table-layout) */ + tableLayout: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-align) */ + textAlign: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-align-last) */ + textAlignLast: string; + textAnchor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-combine-upright) */ + textCombineUpright: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-decoration) */ + textDecoration: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-decoration-color) */ + textDecorationColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-decoration-line) */ + textDecorationLine: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-decoration-skip-ink) */ + textDecorationSkipInk: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-decoration-style) */ + textDecorationStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-decoration-thickness) */ + textDecorationThickness: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-emphasis) */ + textEmphasis: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-emphasis-color) */ + textEmphasisColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-emphasis-position) */ + textEmphasisPosition: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-emphasis-style) */ + textEmphasisStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-indent) */ + textIndent: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-orientation) */ + textOrientation: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-overflow) */ + textOverflow: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-rendering) */ + textRendering: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-shadow) */ + textShadow: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-transform) */ + textTransform: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-underline-offset) */ + textUnderlineOffset: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-underline-position) */ + textUnderlinePosition: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-wrap) */ + textWrap: string; + textWrapMode: string; + textWrapStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/top) */ + top: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/touch-action) */ + touchAction: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/transform) */ + transform: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/transform-box) */ + transformBox: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/transform-origin) */ + transformOrigin: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/transform-style) */ + transformStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/transition) */ + transition: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/transition-behavior) */ + transitionBehavior: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/transition-delay) */ + transitionDelay: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/transition-duration) */ + transitionDuration: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/transition-property) */ + transitionProperty: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/transition-timing-function) */ + transitionTimingFunction: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/translate) */ + translate: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/unicode-bidi) */ + unicodeBidi: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/user-select) */ + userSelect: string; + vectorEffect: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/vertical-align) */ + verticalAlign: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/visibility) */ + visibility: string; + /** + * @deprecated This is a legacy alias of `alignContent`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/align-content) + */ + webkitAlignContent: string; + /** + * @deprecated This is a legacy alias of `alignItems`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/align-items) + */ + webkitAlignItems: string; + /** + * @deprecated This is a legacy alias of `alignSelf`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/align-self) + */ + webkitAlignSelf: string; + /** + * @deprecated This is a legacy alias of `animation`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation) + */ + webkitAnimation: string; + /** + * @deprecated This is a legacy alias of `animationDelay`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation-delay) + */ + webkitAnimationDelay: string; + /** + * @deprecated This is a legacy alias of `animationDirection`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation-direction) + */ + webkitAnimationDirection: string; + /** + * @deprecated This is a legacy alias of `animationDuration`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation-duration) + */ + webkitAnimationDuration: string; + /** + * @deprecated This is a legacy alias of `animationFillMode`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation-fill-mode) + */ + webkitAnimationFillMode: string; + /** + * @deprecated This is a legacy alias of `animationIterationCount`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation-iteration-count) + */ + webkitAnimationIterationCount: string; + /** + * @deprecated This is a legacy alias of `animationName`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation-name) + */ + webkitAnimationName: string; + /** + * @deprecated This is a legacy alias of `animationPlayState`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation-play-state) + */ + webkitAnimationPlayState: string; + /** + * @deprecated This is a legacy alias of `animationTimingFunction`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation-timing-function) + */ + webkitAnimationTimingFunction: string; + /** + * @deprecated This is a legacy alias of `appearance`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/appearance) + */ + webkitAppearance: string; + /** + * @deprecated This is a legacy alias of `backfaceVisibility`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/backface-visibility) + */ + webkitBackfaceVisibility: string; + /** + * @deprecated This is a legacy alias of `backgroundClip`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/background-clip) + */ + webkitBackgroundClip: string; + /** + * @deprecated This is a legacy alias of `backgroundOrigin`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/background-origin) + */ + webkitBackgroundOrigin: string; + /** + * @deprecated This is a legacy alias of `backgroundSize`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/background-size) + */ + webkitBackgroundSize: string; + /** + * @deprecated This is a legacy alias of `borderBottomLeftRadius`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-bottom-left-radius) + */ + webkitBorderBottomLeftRadius: string; + /** + * @deprecated This is a legacy alias of `borderBottomRightRadius`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-bottom-right-radius) + */ + webkitBorderBottomRightRadius: string; + /** + * @deprecated This is a legacy alias of `borderRadius`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-radius) + */ + webkitBorderRadius: string; + /** + * @deprecated This is a legacy alias of `borderTopLeftRadius`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-top-left-radius) + */ + webkitBorderTopLeftRadius: string; + /** + * @deprecated This is a legacy alias of `borderTopRightRadius`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-top-right-radius) + */ + webkitBorderTopRightRadius: string; + /** + * @deprecated This is a legacy alias of `boxAlign`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/box-align) + */ + webkitBoxAlign: string; + /** + * @deprecated This is a legacy alias of `boxFlex`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/box-flex) + */ + webkitBoxFlex: string; + /** + * @deprecated This is a legacy alias of `boxOrdinalGroup`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/box-ordinal-group) + */ + webkitBoxOrdinalGroup: string; + /** + * @deprecated This is a legacy alias of `boxOrient`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/box-orient) + */ + webkitBoxOrient: string; + /** + * @deprecated This is a legacy alias of `boxPack`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/box-pack) + */ + webkitBoxPack: string; + /** + * @deprecated This is a legacy alias of `boxShadow`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/box-shadow) + */ + webkitBoxShadow: string; + /** + * @deprecated This is a legacy alias of `boxSizing`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/box-sizing) + */ + webkitBoxSizing: string; + /** + * @deprecated This is a legacy alias of `filter`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/filter) + */ + webkitFilter: string; + /** + * @deprecated This is a legacy alias of `flex`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/flex) + */ + webkitFlex: string; + /** + * @deprecated This is a legacy alias of `flexBasis`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/flex-basis) + */ + webkitFlexBasis: string; + /** + * @deprecated This is a legacy alias of `flexDirection`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/flex-direction) + */ + webkitFlexDirection: string; + /** + * @deprecated This is a legacy alias of `flexFlow`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/flex-flow) + */ + webkitFlexFlow: string; + /** + * @deprecated This is a legacy alias of `flexGrow`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/flex-grow) + */ + webkitFlexGrow: string; + /** + * @deprecated This is a legacy alias of `flexShrink`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/flex-shrink) + */ + webkitFlexShrink: string; + /** + * @deprecated This is a legacy alias of `flexWrap`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/flex-wrap) + */ + webkitFlexWrap: string; + /** + * @deprecated This is a legacy alias of `justifyContent`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/justify-content) + */ + webkitJustifyContent: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/-webkit-line-clamp) */ + webkitLineClamp: string; + /** + * @deprecated This is a legacy alias of `mask`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask) + */ + webkitMask: string; + /** + * @deprecated This is a legacy alias of `maskBorder`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-border) + */ + webkitMaskBoxImage: string; + /** + * @deprecated This is a legacy alias of `maskBorderOutset`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-border-outset) + */ + webkitMaskBoxImageOutset: string; + /** + * @deprecated This is a legacy alias of `maskBorderRepeat`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-border-repeat) + */ + webkitMaskBoxImageRepeat: string; + /** + * @deprecated This is a legacy alias of `maskBorderSlice`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-border-slice) + */ + webkitMaskBoxImageSlice: string; + /** + * @deprecated This is a legacy alias of `maskBorderSource`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-border-source) + */ + webkitMaskBoxImageSource: string; + /** + * @deprecated This is a legacy alias of `maskBorderWidth`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-border-width) + */ + webkitMaskBoxImageWidth: string; + /** + * @deprecated This is a legacy alias of `maskClip`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-clip) + */ + webkitMaskClip: string; + /** + * @deprecated This is a legacy alias of `maskComposite`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-composite) + */ + webkitMaskComposite: string; + /** + * @deprecated This is a legacy alias of `maskImage`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-image) + */ + webkitMaskImage: string; + /** + * @deprecated This is a legacy alias of `maskOrigin`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-origin) + */ + webkitMaskOrigin: string; + /** + * @deprecated This is a legacy alias of `maskPosition`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-position) + */ + webkitMaskPosition: string; + /** + * @deprecated This is a legacy alias of `maskRepeat`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-repeat) + */ + webkitMaskRepeat: string; + /** + * @deprecated This is a legacy alias of `maskSize`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-size) + */ + webkitMaskSize: string; + /** + * @deprecated This is a legacy alias of `order`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/order) + */ + webkitOrder: string; + /** + * @deprecated This is a legacy alias of `perspective`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/perspective) + */ + webkitPerspective: string; + /** + * @deprecated This is a legacy alias of `perspectiveOrigin`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/perspective-origin) + */ + webkitPerspectiveOrigin: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/-webkit-text-fill-color) */ + webkitTextFillColor: string; + /** + * @deprecated This is a legacy alias of `textSizeAdjust`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-size-adjust) + */ + webkitTextSizeAdjust: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/-webkit-text-stroke) */ + webkitTextStroke: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/-webkit-text-stroke-color) */ + webkitTextStrokeColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/-webkit-text-stroke-width) */ + webkitTextStrokeWidth: string; + /** + * @deprecated This is a legacy alias of `transform`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/transform) + */ + webkitTransform: string; + /** + * @deprecated This is a legacy alias of `transformOrigin`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/transform-origin) + */ + webkitTransformOrigin: string; + /** + * @deprecated This is a legacy alias of `transformStyle`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/transform-style) + */ + webkitTransformStyle: string; + /** + * @deprecated This is a legacy alias of `transition`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/transition) + */ + webkitTransition: string; + /** + * @deprecated This is a legacy alias of `transitionDelay`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/transition-delay) + */ + webkitTransitionDelay: string; + /** + * @deprecated This is a legacy alias of `transitionDuration`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/transition-duration) + */ + webkitTransitionDuration: string; + /** + * @deprecated This is a legacy alias of `transitionProperty`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/transition-property) + */ + webkitTransitionProperty: string; + /** + * @deprecated This is a legacy alias of `transitionTimingFunction`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/transition-timing-function) + */ + webkitTransitionTimingFunction: string; + /** + * @deprecated This is a legacy alias of `userSelect`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/user-select) + */ + webkitUserSelect: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/white-space) */ + whiteSpace: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/white-space-collapse) */ + whiteSpaceCollapse: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/widows) */ + widows: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/width) */ + width: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/will-change) */ + willChange: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/word-break) */ + wordBreak: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/word-spacing) */ + wordSpacing: string; + /** @deprecated */ + wordWrap: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/writing-mode) */ + writingMode: string; + x: string; + y: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/z-index) */ + zIndex: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/zoom) */ + zoom: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/getPropertyPriority) */ + getPropertyPriority(property: string): string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/getPropertyValue) */ + getPropertyValue(property: string): string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/item) */ + item(index: number): string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/removeProperty) */ + removeProperty(property: string): string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/setProperty) */ + setProperty(property: string, value: string | null, priority?: string): void; + [index: number]: string; +} + +declare var CSSStyleDeclaration: { + prototype: CSSStyleDeclaration; + new(): CSSStyleDeclaration; +}; + +/** + * CSSStyleRule represents a single CSS style rule. It implements the CSSRule interface with a type value of 1 (CSSRule.STYLE_RULE). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleRule) + */ +interface CSSStyleRule extends CSSGroupingRule { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleRule/selectorText) */ + selectorText: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleRule/style) */ + readonly style: CSSStyleDeclaration; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleRule/styleMap) */ + readonly styleMap: StylePropertyMap; +} + +declare var CSSStyleRule: { + prototype: CSSStyleRule; + new(): CSSStyleRule; +}; + +/** + * A single CSS style sheet. It inherits properties and methods from its parent, StyleSheet. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleSheet) + */ +interface CSSStyleSheet extends StyleSheet { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleSheet/cssRules) */ + readonly cssRules: CSSRuleList; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleSheet/ownerRule) */ + readonly ownerRule: CSSRule | null; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleSheet/rules) + */ + readonly rules: CSSRuleList; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleSheet/addRule) + */ + addRule(selector?: string, style?: string, index?: number): number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleSheet/deleteRule) */ + deleteRule(index: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleSheet/insertRule) */ + insertRule(rule: string, index?: number): number; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleSheet/removeRule) + */ + removeRule(index?: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleSheet/replace) */ + replace(text: string): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleSheet/replaceSync) */ + replaceSync(text: string): void; +} + +declare var CSSStyleSheet: { + prototype: CSSStyleSheet; + new(options?: CSSStyleSheetInit): CSSStyleSheet; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleValue) */ +interface CSSStyleValue { + toString(): string; +} + +declare var CSSStyleValue: { + prototype: CSSStyleValue; + new(): CSSStyleValue; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleValue/parse_static) */ + parse(property: string, cssText: string): CSSStyleValue; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleValue/parseAll_static) */ + parseAll(property: string, cssText: string): CSSStyleValue[]; +}; + +/** + * An object representing a single CSS @supports at-rule. It implements the CSSConditionRule interface, and therefore the CSSRule and CSSGroupingRule interfaces with a type value of 12 (CSSRule.SUPPORTS_RULE). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSSupportsRule) + */ +interface CSSSupportsRule extends CSSConditionRule { +} + +declare var CSSSupportsRule: { + prototype: CSSSupportsRule; + new(): CSSSupportsRule; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTransformComponent) */ +interface CSSTransformComponent { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTransformComponent/is2D) */ + is2D: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTransformComponent/toMatrix) */ + toMatrix(): DOMMatrix; + toString(): string; +} + +declare var CSSTransformComponent: { + prototype: CSSTransformComponent; + new(): CSSTransformComponent; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTransformValue) */ +interface CSSTransformValue extends CSSStyleValue { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTransformValue/is2D) */ + readonly is2D: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTransformValue/length) */ + readonly length: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTransformValue/toMatrix) */ + toMatrix(): DOMMatrix; + forEach(callbackfn: (value: CSSTransformComponent, key: number, parent: CSSTransformValue) => void, thisArg?: any): void; + [index: number]: CSSTransformComponent; +} + +declare var CSSTransformValue: { + prototype: CSSTransformValue; + new(transforms: CSSTransformComponent[]): CSSTransformValue; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTransition) */ +interface CSSTransition extends Animation { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTransition/transitionProperty) */ + readonly transitionProperty: string; + addEventListener(type: K, listener: (this: CSSTransition, ev: AnimationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: CSSTransition, ev: AnimationEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var CSSTransition: { + prototype: CSSTransition; + new(): CSSTransition; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTranslate) */ +interface CSSTranslate extends CSSTransformComponent { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTranslate/x) */ + x: CSSNumericValue; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTranslate/y) */ + y: CSSNumericValue; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTranslate/z) */ + z: CSSNumericValue; +} + +declare var CSSTranslate: { + prototype: CSSTranslate; + new(x: CSSNumericValue, y: CSSNumericValue, z?: CSSNumericValue): CSSTranslate; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSUnitValue) */ +interface CSSUnitValue extends CSSNumericValue { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSUnitValue/unit) */ + readonly unit: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSUnitValue/value) */ + value: number; +} + +declare var CSSUnitValue: { + prototype: CSSUnitValue; + new(value: number, unit: string): CSSUnitValue; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSUnparsedValue) */ +interface CSSUnparsedValue extends CSSStyleValue { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSUnparsedValue/length) */ + readonly length: number; + forEach(callbackfn: (value: CSSUnparsedSegment, key: number, parent: CSSUnparsedValue) => void, thisArg?: any): void; + [index: number]: CSSUnparsedSegment; +} + +declare var CSSUnparsedValue: { + prototype: CSSUnparsedValue; + new(members: CSSUnparsedSegment[]): CSSUnparsedValue; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSVariableReferenceValue) */ +interface CSSVariableReferenceValue { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSVariableReferenceValue/fallback) */ + readonly fallback: CSSUnparsedValue | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSVariableReferenceValue/variable) */ + variable: string; +} + +declare var CSSVariableReferenceValue: { + prototype: CSSVariableReferenceValue; + new(variable: string, fallback?: CSSUnparsedValue | null): CSSVariableReferenceValue; +}; + +/** + * Provides a storage mechanism for Request / Response object pairs that are cached, for example as part of the ServiceWorker life cycle. Note that the Cache interface is exposed to windowed scopes as well as workers. You don't have to use it in conjunction with service workers, even though it is defined in the service worker spec. + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Cache) + */ +interface Cache { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Cache/add) */ + add(request: RequestInfo | URL): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Cache/addAll) */ + addAll(requests: RequestInfo[]): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Cache/delete) */ + delete(request: RequestInfo | URL, options?: CacheQueryOptions): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Cache/keys) */ + keys(request?: RequestInfo | URL, options?: CacheQueryOptions): Promise>; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Cache/match) */ + match(request: RequestInfo | URL, options?: CacheQueryOptions): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Cache/matchAll) */ + matchAll(request?: RequestInfo | URL, options?: CacheQueryOptions): Promise>; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Cache/put) */ + put(request: RequestInfo | URL, response: Response): Promise; +} + +declare var Cache: { + prototype: Cache; + new(): Cache; +}; + +/** + * The storage for Cache objects. + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage) + */ +interface CacheStorage { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/delete) */ + delete(cacheName: string): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/has) */ + has(cacheName: string): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/keys) */ + keys(): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/match) */ + match(request: RequestInfo | URL, options?: MultiCacheQueryOptions): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open) */ + open(cacheName: string): Promise; +} + +declare var CacheStorage: { + prototype: CacheStorage; + new(): CacheStorage; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasCaptureMediaStreamTrack) */ +interface CanvasCaptureMediaStreamTrack extends MediaStreamTrack { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasCaptureMediaStreamTrack/canvas) */ + readonly canvas: HTMLCanvasElement; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasCaptureMediaStreamTrack/requestFrame) */ + requestFrame(): void; + addEventListener(type: K, listener: (this: CanvasCaptureMediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: CanvasCaptureMediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var CanvasCaptureMediaStreamTrack: { + prototype: CanvasCaptureMediaStreamTrack; + new(): CanvasCaptureMediaStreamTrack; +}; + +interface CanvasCompositing { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/globalAlpha) */ + globalAlpha: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation) */ + globalCompositeOperation: GlobalCompositeOperation; +} + +interface CanvasDrawImage { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/drawImage) */ + drawImage(image: CanvasImageSource, dx: number, dy: number): void; + drawImage(image: CanvasImageSource, dx: number, dy: number, dw: number, dh: number): void; + drawImage(image: CanvasImageSource, sx: number, sy: number, sw: number, sh: number, dx: number, dy: number, dw: number, dh: number): void; +} + +interface CanvasDrawPath { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/beginPath) */ + beginPath(): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/clip) */ + clip(fillRule?: CanvasFillRule): void; + clip(path: Path2D, fillRule?: CanvasFillRule): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/fill) */ + fill(fillRule?: CanvasFillRule): void; + fill(path: Path2D, fillRule?: CanvasFillRule): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/isPointInPath) */ + isPointInPath(x: number, y: number, fillRule?: CanvasFillRule): boolean; + isPointInPath(path: Path2D, x: number, y: number, fillRule?: CanvasFillRule): boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/isPointInStroke) */ + isPointInStroke(x: number, y: number): boolean; + isPointInStroke(path: Path2D, x: number, y: number): boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/stroke) */ + stroke(): void; + stroke(path: Path2D): void; +} + +interface CanvasFillStrokeStyles { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/fillStyle) */ + fillStyle: string | CanvasGradient | CanvasPattern; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/strokeStyle) */ + strokeStyle: string | CanvasGradient | CanvasPattern; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createConicGradient) */ + createConicGradient(startAngle: number, x: number, y: number): CanvasGradient; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createLinearGradient) */ + createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createPattern) */ + createPattern(image: CanvasImageSource, repetition: string | null): CanvasPattern | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createRadialGradient) */ + createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; +} + +interface CanvasFilters { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/filter) */ + filter: string; +} + +/** + * An opaque object describing a gradient. It is returned by the methods CanvasRenderingContext2D.createLinearGradient() or CanvasRenderingContext2D.createRadialGradient(). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasGradient) + */ +interface CanvasGradient { + /** + * Adds a color stop with the given color to the gradient at the given offset. 0.0 is the offset at one end of the gradient, 1.0 is the offset at the other end. + * + * Throws an "IndexSizeError" DOMException if the offset is out of range. Throws a "SyntaxError" DOMException if the color cannot be parsed. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasGradient/addColorStop) + */ + addColorStop(offset: number, color: string): void; +} + +declare var CanvasGradient: { + prototype: CanvasGradient; + new(): CanvasGradient; +}; + +interface CanvasImageData { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createImageData) */ + createImageData(sw: number, sh: number, settings?: ImageDataSettings): ImageData; + createImageData(imagedata: ImageData): ImageData; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/getImageData) */ + getImageData(sx: number, sy: number, sw: number, sh: number, settings?: ImageDataSettings): ImageData; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/putImageData) */ + putImageData(imagedata: ImageData, dx: number, dy: number): void; + putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX: number, dirtyY: number, dirtyWidth: number, dirtyHeight: number): void; +} + +interface CanvasImageSmoothing { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/imageSmoothingEnabled) */ + imageSmoothingEnabled: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/imageSmoothingQuality) */ + imageSmoothingQuality: ImageSmoothingQuality; +} + +interface CanvasPath { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/arc) */ + arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, counterclockwise?: boolean): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/arcTo) */ + arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/bezierCurveTo) */ + bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/closePath) */ + closePath(): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/ellipse) */ + ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, counterclockwise?: boolean): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/lineTo) */ + lineTo(x: number, y: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/moveTo) */ + moveTo(x: number, y: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/quadraticCurveTo) */ + quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/rect) */ + rect(x: number, y: number, w: number, h: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/roundRect) */ + roundRect(x: number, y: number, w: number, h: number, radii?: number | DOMPointInit | (number | DOMPointInit)[]): void; +} + +interface CanvasPathDrawingStyles { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/lineCap) */ + lineCap: CanvasLineCap; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/lineDashOffset) */ + lineDashOffset: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/lineJoin) */ + lineJoin: CanvasLineJoin; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/lineWidth) */ + lineWidth: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/miterLimit) */ + miterLimit: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/getLineDash) */ + getLineDash(): number[]; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setLineDash) */ + setLineDash(segments: number[]): void; +} + +/** + * An opaque object describing a pattern, based on an image, a canvas, or a video, created by the CanvasRenderingContext2D.createPattern() method. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasPattern) + */ +interface CanvasPattern { + /** + * Sets the transformation matrix that will be used when rendering the pattern during a fill or stroke painting operation. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasPattern/setTransform) + */ + setTransform(transform?: DOMMatrix2DInit): void; +} + +declare var CanvasPattern: { + prototype: CanvasPattern; + new(): CanvasPattern; +}; + +interface CanvasRect { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/clearRect) */ + clearRect(x: number, y: number, w: number, h: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/fillRect) */ + fillRect(x: number, y: number, w: number, h: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/strokeRect) */ + strokeRect(x: number, y: number, w: number, h: number): void; +} + +/** + * The CanvasRenderingContext2D interface, part of the Canvas API, provides the 2D rendering context for the drawing surface of a element. It is used for drawing shapes, text, images, and other objects. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D) + */ +interface CanvasRenderingContext2D extends CanvasCompositing, CanvasDrawImage, CanvasDrawPath, CanvasFillStrokeStyles, CanvasFilters, CanvasImageData, CanvasImageSmoothing, CanvasPath, CanvasPathDrawingStyles, CanvasRect, CanvasShadowStyles, CanvasState, CanvasText, CanvasTextDrawingStyles, CanvasTransform, CanvasUserInterface { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/canvas) */ + readonly canvas: HTMLCanvasElement; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/getContextAttributes) */ + getContextAttributes(): CanvasRenderingContext2DSettings; +} + +declare var CanvasRenderingContext2D: { + prototype: CanvasRenderingContext2D; + new(): CanvasRenderingContext2D; +}; + +interface CanvasShadowStyles { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/shadowBlur) */ + shadowBlur: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/shadowColor) */ + shadowColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/shadowOffsetX) */ + shadowOffsetX: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/shadowOffsetY) */ + shadowOffsetY: number; +} + +interface CanvasState { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/reset) */ + reset(): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/restore) */ + restore(): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/save) */ + save(): void; +} + +interface CanvasText { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/fillText) */ + fillText(text: string, x: number, y: number, maxWidth?: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/measureText) */ + measureText(text: string): TextMetrics; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/strokeText) */ + strokeText(text: string, x: number, y: number, maxWidth?: number): void; +} + +interface CanvasTextDrawingStyles { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/direction) */ + direction: CanvasDirection; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/font) */ + font: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/fontKerning) */ + fontKerning: CanvasFontKerning; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/fontStretch) */ + fontStretch: CanvasFontStretch; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/fontVariantCaps) */ + fontVariantCaps: CanvasFontVariantCaps; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/letterSpacing) */ + letterSpacing: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/textAlign) */ + textAlign: CanvasTextAlign; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/textBaseline) */ + textBaseline: CanvasTextBaseline; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/textRendering) */ + textRendering: CanvasTextRendering; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/wordSpacing) */ + wordSpacing: string; +} + +interface CanvasTransform { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/getTransform) */ + getTransform(): DOMMatrix; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/resetTransform) */ + resetTransform(): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/rotate) */ + rotate(angle: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/scale) */ + scale(x: number, y: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setTransform) */ + setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void; + setTransform(transform?: DOMMatrix2DInit): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/transform) */ + transform(a: number, b: number, c: number, d: number, e: number, f: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/translate) */ + translate(x: number, y: number): void; +} + +interface CanvasUserInterface { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/drawFocusIfNeeded) */ + drawFocusIfNeeded(element: Element): void; + drawFocusIfNeeded(path: Path2D, element: Element): void; +} + +/** + * The ChannelMergerNode interface, often used in conjunction with its opposite, ChannelSplitterNode, reunites different mono inputs into a single output. Each input is used to fill a channel of the output. This is useful for accessing each channels separately, e.g. for performing channel mixing where gain must be separately controlled on each channel. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ChannelMergerNode) + */ +interface ChannelMergerNode extends AudioNode { +} + +declare var ChannelMergerNode: { + prototype: ChannelMergerNode; + new(context: BaseAudioContext, options?: ChannelMergerOptions): ChannelMergerNode; +}; + +/** + * The ChannelSplitterNode interface, often used in conjunction with its opposite, ChannelMergerNode, separates the different channels of an audio source into a set of mono outputs. This is useful for accessing each channel separately, e.g. for performing channel mixing where gain must be separately controlled on each channel. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ChannelSplitterNode) + */ +interface ChannelSplitterNode extends AudioNode { +} + +declare var ChannelSplitterNode: { + prototype: ChannelSplitterNode; + new(context: BaseAudioContext, options?: ChannelSplitterOptions): ChannelSplitterNode; +}; + +/** + * The CharacterData abstract interface represents a Node object that contains characters. This is an abstract interface, meaning there aren't any object of type CharacterData: it is implemented by other interfaces, like Text, Comment, or ProcessingInstruction which aren't abstract. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CharacterData) + */ +interface CharacterData extends Node, ChildNode, NonDocumentTypeChildNode { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CharacterData/data) */ + data: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CharacterData/length) */ + readonly length: number; + readonly ownerDocument: Document; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CharacterData/appendData) */ + appendData(data: string): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CharacterData/deleteData) */ + deleteData(offset: number, count: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CharacterData/insertData) */ + insertData(offset: number, data: string): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceData) */ + replaceData(offset: number, count: number, data: string): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CharacterData/substringData) */ + substringData(offset: number, count: number): string; +} + +declare var CharacterData: { + prototype: CharacterData; + new(): CharacterData; +}; + +interface ChildNode extends Node { + /** + * Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. + * + * Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CharacterData/after) + */ + after(...nodes: (Node | string)[]): void; + /** + * Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. + * + * Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CharacterData/before) + */ + before(...nodes: (Node | string)[]): void; + /** + * Removes node. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) + */ + remove(): void; + /** + * Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. + * + * Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) + */ + replaceWith(...nodes: (Node | string)[]): void; +} + +/** @deprecated */ +interface ClientRect extends DOMRect { +} + +/** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Clipboard) + */ +interface Clipboard extends EventTarget { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Clipboard/read) */ + read(): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Clipboard/readText) */ + readText(): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Clipboard/write) */ + write(data: ClipboardItems): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Clipboard/writeText) */ + writeText(data: string): Promise; +} + +declare var Clipboard: { + prototype: Clipboard; + new(): Clipboard; +}; + +/** + * Events providing information related to modification of the clipboard, that is cut, copy, and paste events. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ClipboardEvent) + */ +interface ClipboardEvent extends Event { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ClipboardEvent/clipboardData) */ + readonly clipboardData: DataTransfer | null; +} + +declare var ClipboardEvent: { + prototype: ClipboardEvent; + new(type: string, eventInitDict?: ClipboardEventInit): ClipboardEvent; +}; + +/** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ClipboardItem) + */ +interface ClipboardItem { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ClipboardItem/types) */ + readonly types: ReadonlyArray; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ClipboardItem/getType) */ + getType(type: string): Promise; +} + +declare var ClipboardItem: { + prototype: ClipboardItem; + new(items: Record>, options?: ClipboardItemOptions): ClipboardItem; +}; + +/** + * A CloseEvent is sent to clients using WebSockets when the connection is closed. This is delivered to the listener indicated by the WebSocket object's onclose attribute. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent) + */ +interface CloseEvent extends Event { + /** + * Returns the WebSocket connection close code provided by the server. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/code) + */ + readonly code: number; + /** + * Returns the WebSocket connection close reason provided by the server. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/reason) + */ + readonly reason: string; + /** + * Returns true if the connection closed cleanly; false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/wasClean) + */ + readonly wasClean: boolean; +} + +declare var CloseEvent: { + prototype: CloseEvent; + new(type: string, eventInitDict?: CloseEventInit): CloseEvent; +}; + +/** + * Textual notations within markup; although it is generally not visually shown, such comments are available to be read in the source view. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Comment) + */ +interface Comment extends CharacterData { +} + +declare var Comment: { + prototype: Comment; + new(data?: string): Comment; +}; + +/** + * The DOM CompositionEvent represents events that occur due to the user indirectly entering text. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompositionEvent) + */ +interface CompositionEvent extends UIEvent { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompositionEvent/data) */ + readonly data: string; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompositionEvent/initCompositionEvent) + */ + initCompositionEvent(typeArg: string, bubblesArg?: boolean, cancelableArg?: boolean, viewArg?: WindowProxy | null, dataArg?: string): void; +} + +declare var CompositionEvent: { + prototype: CompositionEvent; + new(type: string, eventInitDict?: CompositionEventInit): CompositionEvent; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream) */ +interface CompressionStream extends GenericTransformStream { +} + +declare var CompressionStream: { + prototype: CompressionStream; + new(format: CompressionFormat): CompressionStream; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ConstantSourceNode) */ +interface ConstantSourceNode extends AudioScheduledSourceNode { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ConstantSourceNode/offset) */ + readonly offset: AudioParam; + addEventListener(type: K, listener: (this: ConstantSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: ConstantSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var ConstantSourceNode: { + prototype: ConstantSourceNode; + new(context: BaseAudioContext, options?: ConstantSourceOptions): ConstantSourceNode; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ContentVisibilityAutoStateChangeEvent) */ +interface ContentVisibilityAutoStateChangeEvent extends Event { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ContentVisibilityAutoStateChangeEvent/skipped) */ + readonly skipped: boolean; +} + +declare var ContentVisibilityAutoStateChangeEvent: { + prototype: ContentVisibilityAutoStateChangeEvent; + new(type: string, eventInitDict?: ContentVisibilityAutoStateChangeEventInit): ContentVisibilityAutoStateChangeEvent; +}; + +/** + * An AudioNode that performs a Linear Convolution on a given AudioBuffer, often used to achieve a reverb effect. A ConvolverNode always has exactly one input and one output. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ConvolverNode) + */ +interface ConvolverNode extends AudioNode { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ConvolverNode/buffer) */ + buffer: AudioBuffer | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ConvolverNode/normalize) */ + normalize: boolean; +} + +declare var ConvolverNode: { + prototype: ConvolverNode; + new(context: BaseAudioContext, options?: ConvolverOptions): ConvolverNode; +}; + +/** + * This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy) + */ +interface CountQueuingStrategy extends QueuingStrategy { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/highWaterMark) */ + readonly highWaterMark: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/size) */ + readonly size: QueuingStrategySize; +} + +declare var CountQueuingStrategy: { + prototype: CountQueuingStrategy; + new(init: QueuingStrategyInit): CountQueuingStrategy; +}; + +/** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Credential) + */ +interface Credential { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Credential/id) */ + readonly id: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Credential/type) */ + readonly type: string; +} + +declare var Credential: { + prototype: Credential; + new(): Credential; +}; + +/** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CredentialsContainer) + */ +interface CredentialsContainer { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CredentialsContainer/create) */ + create(options?: CredentialCreationOptions): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CredentialsContainer/get) */ + get(options?: CredentialRequestOptions): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CredentialsContainer/preventSilentAccess) */ + preventSilentAccess(): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CredentialsContainer/store) */ + store(credential: Credential): Promise; +} + +declare var CredentialsContainer: { + prototype: CredentialsContainer; + new(): CredentialsContainer; +}; + +/** + * Basic cryptography features available in the current context. It allows access to a cryptographically strong random number generator and to cryptographic primitives. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto) + */ +interface Crypto { + /** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle) + */ + readonly subtle: SubtleCrypto; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues) */ + getRandomValues(array: T): T; + /** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/randomUUID) + */ + randomUUID(): `${string}-${string}-${string}-${string}-${string}`; +} + +declare var Crypto: { + prototype: Crypto; + new(): Crypto; +}; + +/** + * The CryptoKey dictionary of the Web Crypto API represents a cryptographic key. + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey) + */ +interface CryptoKey { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/algorithm) */ + readonly algorithm: KeyAlgorithm; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable) */ + readonly extractable: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type) */ + readonly type: KeyType; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/usages) */ + readonly usages: KeyUsage[]; +} + +declare var CryptoKey: { + prototype: CryptoKey; + new(): CryptoKey; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomElementRegistry) */ +interface CustomElementRegistry { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomElementRegistry/define) */ + define(name: string, constructor: CustomElementConstructor, options?: ElementDefinitionOptions): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomElementRegistry/get) */ + get(name: string): CustomElementConstructor | undefined; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomElementRegistry/getName) */ + getName(constructor: CustomElementConstructor): string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomElementRegistry/upgrade) */ + upgrade(root: Node): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomElementRegistry/whenDefined) */ + whenDefined(name: string): Promise; +} + +declare var CustomElementRegistry: { + prototype: CustomElementRegistry; + new(): CustomElementRegistry; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent) */ +interface CustomEvent extends Event { + /** + * Returns any custom data event was created with. Typically used for synthetic events. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent/detail) + */ + readonly detail: T; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent/initCustomEvent) + */ + initCustomEvent(type: string, bubbles?: boolean, cancelable?: boolean, detail?: T): void; +} + +declare var CustomEvent: { + prototype: CustomEvent; + new(type: string, eventInitDict?: CustomEventInit): CustomEvent; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomStateSet) */ +interface CustomStateSet { + forEach(callbackfn: (value: string, key: string, parent: CustomStateSet) => void, thisArg?: any): void; +} + +declare var CustomStateSet: { + prototype: CustomStateSet; + new(): CustomStateSet; +}; + +/** + * An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException) + */ +interface DOMException extends Error { + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code) + */ + readonly code: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message) */ + readonly message: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name) */ + readonly name: string; + readonly INDEX_SIZE_ERR: 1; + readonly DOMSTRING_SIZE_ERR: 2; + readonly HIERARCHY_REQUEST_ERR: 3; + readonly WRONG_DOCUMENT_ERR: 4; + readonly INVALID_CHARACTER_ERR: 5; + readonly NO_DATA_ALLOWED_ERR: 6; + readonly NO_MODIFICATION_ALLOWED_ERR: 7; + readonly NOT_FOUND_ERR: 8; + readonly NOT_SUPPORTED_ERR: 9; + readonly INUSE_ATTRIBUTE_ERR: 10; + readonly INVALID_STATE_ERR: 11; + readonly SYNTAX_ERR: 12; + readonly INVALID_MODIFICATION_ERR: 13; + readonly NAMESPACE_ERR: 14; + readonly INVALID_ACCESS_ERR: 15; + readonly VALIDATION_ERR: 16; + readonly TYPE_MISMATCH_ERR: 17; + readonly SECURITY_ERR: 18; + readonly NETWORK_ERR: 19; + readonly ABORT_ERR: 20; + readonly URL_MISMATCH_ERR: 21; + readonly QUOTA_EXCEEDED_ERR: 22; + readonly TIMEOUT_ERR: 23; + readonly INVALID_NODE_TYPE_ERR: 24; + readonly DATA_CLONE_ERR: 25; +} + +declare var DOMException: { + prototype: DOMException; + new(message?: string, name?: string): DOMException; + readonly INDEX_SIZE_ERR: 1; + readonly DOMSTRING_SIZE_ERR: 2; + readonly HIERARCHY_REQUEST_ERR: 3; + readonly WRONG_DOCUMENT_ERR: 4; + readonly INVALID_CHARACTER_ERR: 5; + readonly NO_DATA_ALLOWED_ERR: 6; + readonly NO_MODIFICATION_ALLOWED_ERR: 7; + readonly NOT_FOUND_ERR: 8; + readonly NOT_SUPPORTED_ERR: 9; + readonly INUSE_ATTRIBUTE_ERR: 10; + readonly INVALID_STATE_ERR: 11; + readonly SYNTAX_ERR: 12; + readonly INVALID_MODIFICATION_ERR: 13; + readonly NAMESPACE_ERR: 14; + readonly INVALID_ACCESS_ERR: 15; + readonly VALIDATION_ERR: 16; + readonly TYPE_MISMATCH_ERR: 17; + readonly SECURITY_ERR: 18; + readonly NETWORK_ERR: 19; + readonly ABORT_ERR: 20; + readonly URL_MISMATCH_ERR: 21; + readonly QUOTA_EXCEEDED_ERR: 22; + readonly TIMEOUT_ERR: 23; + readonly INVALID_NODE_TYPE_ERR: 24; + readonly DATA_CLONE_ERR: 25; +}; + +/** + * An object providing methods which are not dependent on any particular document. Such an object is returned by the Document.implementation property. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMImplementation) + */ +interface DOMImplementation { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMImplementation/createDocument) */ + createDocument(namespace: string | null, qualifiedName: string | null, doctype?: DocumentType | null): XMLDocument; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMImplementation/createDocumentType) */ + createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMImplementation/createHTMLDocument) */ + createHTMLDocument(title?: string): Document; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMImplementation/hasFeature) + */ + hasFeature(...args: any[]): true; +} + +declare var DOMImplementation: { + prototype: DOMImplementation; + new(): DOMImplementation; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrix) */ +interface DOMMatrix extends DOMMatrixReadOnly { + a: number; + b: number; + c: number; + d: number; + e: number; + f: number; + m11: number; + m12: number; + m13: number; + m14: number; + m21: number; + m22: number; + m23: number; + m24: number; + m31: number; + m32: number; + m33: number; + m34: number; + m41: number; + m42: number; + m43: number; + m44: number; + invertSelf(): DOMMatrix; + multiplySelf(other?: DOMMatrixInit): DOMMatrix; + preMultiplySelf(other?: DOMMatrixInit): DOMMatrix; + rotateAxisAngleSelf(x?: number, y?: number, z?: number, angle?: number): DOMMatrix; + rotateFromVectorSelf(x?: number, y?: number): DOMMatrix; + rotateSelf(rotX?: number, rotY?: number, rotZ?: number): DOMMatrix; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrix/scale3dSelf) */ + scale3dSelf(scale?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrix/scaleSelf) */ + scaleSelf(scaleX?: number, scaleY?: number, scaleZ?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix; + setMatrixValue(transformList: string): DOMMatrix; + skewXSelf(sx?: number): DOMMatrix; + skewYSelf(sy?: number): DOMMatrix; + translateSelf(tx?: number, ty?: number, tz?: number): DOMMatrix; +} + +declare var DOMMatrix: { + prototype: DOMMatrix; + new(init?: string | number[]): DOMMatrix; + fromFloat32Array(array32: Float32Array): DOMMatrix; + fromFloat64Array(array64: Float64Array): DOMMatrix; + fromMatrix(other?: DOMMatrixInit): DOMMatrix; +}; + +type SVGMatrix = DOMMatrix; +declare var SVGMatrix: typeof DOMMatrix; + +type WebKitCSSMatrix = DOMMatrix; +declare var WebKitCSSMatrix: typeof DOMMatrix; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly) */ +interface DOMMatrixReadOnly { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/a) */ + readonly a: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/b) */ + readonly b: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/c) */ + readonly c: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/d) */ + readonly d: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/e) */ + readonly e: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/f) */ + readonly f: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/is2D) */ + readonly is2D: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/isIdentity) */ + readonly isIdentity: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m11) */ + readonly m11: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m12) */ + readonly m12: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m13) */ + readonly m13: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m14) */ + readonly m14: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m21) */ + readonly m21: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m22) */ + readonly m22: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m23) */ + readonly m23: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m24) */ + readonly m24: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m31) */ + readonly m31: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m32) */ + readonly m32: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m33) */ + readonly m33: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m34) */ + readonly m34: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m41) */ + readonly m41: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m42) */ + readonly m42: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m43) */ + readonly m43: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m44) */ + readonly m44: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/flipX) */ + flipX(): DOMMatrix; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/flipY) */ + flipY(): DOMMatrix; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/inverse) */ + inverse(): DOMMatrix; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/multiply) */ + multiply(other?: DOMMatrixInit): DOMMatrix; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/rotate) */ + rotate(rotX?: number, rotY?: number, rotZ?: number): DOMMatrix; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/rotateAxisAngle) */ + rotateAxisAngle(x?: number, y?: number, z?: number, angle?: number): DOMMatrix; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/rotateFromVector) */ + rotateFromVector(x?: number, y?: number): DOMMatrix; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/scale) */ + scale(scaleX?: number, scaleY?: number, scaleZ?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/scale3d) */ + scale3d(scale?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/scaleNonUniform) + */ + scaleNonUniform(scaleX?: number, scaleY?: number): DOMMatrix; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/skewX) */ + skewX(sx?: number): DOMMatrix; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/skewY) */ + skewY(sy?: number): DOMMatrix; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/toFloat32Array) */ + toFloat32Array(): Float32Array; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/toFloat64Array) */ + toFloat64Array(): Float64Array; + toJSON(): any; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/transformPoint) */ + transformPoint(point?: DOMPointInit): DOMPoint; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/translate) */ + translate(tx?: number, ty?: number, tz?: number): DOMMatrix; + toString(): string; +} + +declare var DOMMatrixReadOnly: { + prototype: DOMMatrixReadOnly; + new(init?: string | number[]): DOMMatrixReadOnly; + fromFloat32Array(array32: Float32Array): DOMMatrixReadOnly; + fromFloat64Array(array64: Float64Array): DOMMatrixReadOnly; + fromMatrix(other?: DOMMatrixInit): DOMMatrixReadOnly; +}; + +/** + * Provides the ability to parse XML or HTML source code from a string into a DOM Document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMParser) + */ +interface DOMParser { + /** + * Parses string using either the HTML or XML parser, according to type, and returns the resulting Document. type can be "text/html" (which will invoke the HTML parser), or any of "text/xml", "application/xml", "application/xhtml+xml", or "image/svg+xml" (which will invoke the XML parser). + * + * For the XML parser, if string cannot be parsed, then the returned Document will contain elements describing the resulting error. + * + * Note that script elements are not evaluated during parsing, and the resulting document's encoding will always be UTF-8. + * + * Values other than the above for type will cause a TypeError exception to be thrown. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMParser/parseFromString) + */ + parseFromString(string: string, type: DOMParserSupportedType): Document; +} + +declare var DOMParser: { + prototype: DOMParser; + new(): DOMParser; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMPoint) */ +interface DOMPoint extends DOMPointReadOnly { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMPoint/w) */ + w: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMPoint/x) */ + x: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMPoint/y) */ + y: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMPoint/z) */ + z: number; +} + +declare var DOMPoint: { + prototype: DOMPoint; + new(x?: number, y?: number, z?: number, w?: number): DOMPoint; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMPoint/fromPoint_static) */ + fromPoint(other?: DOMPointInit): DOMPoint; +}; + +type SVGPoint = DOMPoint; +declare var SVGPoint: typeof DOMPoint; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMPointReadOnly) */ +interface DOMPointReadOnly { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMPointReadOnly/w) */ + readonly w: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMPointReadOnly/x) */ + readonly x: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMPointReadOnly/y) */ + readonly y: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMPointReadOnly/z) */ + readonly z: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMPointReadOnly/matrixTransform) */ + matrixTransform(matrix?: DOMMatrixInit): DOMPoint; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMPointReadOnly/toJSON) */ + toJSON(): any; +} + +declare var DOMPointReadOnly: { + prototype: DOMPointReadOnly; + new(x?: number, y?: number, z?: number, w?: number): DOMPointReadOnly; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMPointReadOnly/fromPoint_static) */ + fromPoint(other?: DOMPointInit): DOMPointReadOnly; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMQuad) */ +interface DOMQuad { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMQuad/p1) */ + readonly p1: DOMPoint; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMQuad/p2) */ + readonly p2: DOMPoint; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMQuad/p3) */ + readonly p3: DOMPoint; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMQuad/p4) */ + readonly p4: DOMPoint; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMQuad/getBounds) */ + getBounds(): DOMRect; + toJSON(): any; +} + +declare var DOMQuad: { + prototype: DOMQuad; + new(p1?: DOMPointInit, p2?: DOMPointInit, p3?: DOMPointInit, p4?: DOMPointInit): DOMQuad; + fromQuad(other?: DOMQuadInit): DOMQuad; + fromRect(other?: DOMRectInit): DOMQuad; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRect) */ +interface DOMRect extends DOMRectReadOnly { + height: number; + width: number; + x: number; + y: number; +} + +declare var DOMRect: { + prototype: DOMRect; + new(x?: number, y?: number, width?: number, height?: number): DOMRect; + fromRect(other?: DOMRectInit): DOMRect; +}; + +type SVGRect = DOMRect; +declare var SVGRect: typeof DOMRect; + +interface DOMRectList { + readonly length: number; + item(index: number): DOMRect | null; + [index: number]: DOMRect; +} + +declare var DOMRectList: { + prototype: DOMRectList; + new(): DOMRectList; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly) */ +interface DOMRectReadOnly { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/bottom) */ + readonly bottom: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/height) */ + readonly height: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/left) */ + readonly left: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/right) */ + readonly right: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/top) */ + readonly top: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/width) */ + readonly width: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/x) */ + readonly x: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/y) */ + readonly y: number; + toJSON(): any; +} + +declare var DOMRectReadOnly: { + prototype: DOMRectReadOnly; + new(x?: number, y?: number, width?: number, height?: number): DOMRectReadOnly; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/fromRect_static) */ + fromRect(other?: DOMRectInit): DOMRectReadOnly; +}; + +/** + * A type returned by some APIs which contains a list of DOMString (strings). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMStringList) + */ +interface DOMStringList { + /** + * Returns the number of strings in strings. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMStringList/length) + */ + readonly length: number; + /** + * Returns true if strings contains string, and false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMStringList/contains) + */ + contains(string: string): boolean; + /** + * Returns the string with index index from strings. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMStringList/item) + */ + item(index: number): string | null; + [index: number]: string; +} + +declare var DOMStringList: { + prototype: DOMStringList; + new(): DOMStringList; +}; + +/** + * Used by the dataset HTML attribute to represent data for custom attributes added to elements. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMStringMap) + */ +interface DOMStringMap { + [name: string]: string | undefined; +} + +declare var DOMStringMap: { + prototype: DOMStringMap; + new(): DOMStringMap; +}; + +/** + * A set of space-separated tokens. Such a set is returned by Element.classList, HTMLLinkElement.relList, HTMLAnchorElement.relList, HTMLAreaElement.relList, HTMLIframeElement.sandbox, or HTMLOutputElement.htmlFor. It is indexed beginning with 0 as with JavaScript Array objects. DOMTokenList is always case-sensitive. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMTokenList) + */ +interface DOMTokenList { + /** + * Returns the number of tokens. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMTokenList/length) + */ + readonly length: number; + /** + * Returns the associated set as string. + * + * Can be set, to change the associated attribute. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMTokenList/value) + */ + value: string; + toString(): string; + /** + * Adds all arguments passed, except those already present. + * + * Throws a "SyntaxError" DOMException if one of the arguments is the empty string. + * + * Throws an "InvalidCharacterError" DOMException if one of the arguments contains any ASCII whitespace. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMTokenList/add) + */ + add(...tokens: string[]): void; + /** + * Returns true if token is present, and false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMTokenList/contains) + */ + contains(token: string): boolean; + /** + * Returns the token with index index. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMTokenList/item) + */ + item(index: number): string | null; + /** + * Removes arguments passed, if they are present. + * + * Throws a "SyntaxError" DOMException if one of the arguments is the empty string. + * + * Throws an "InvalidCharacterError" DOMException if one of the arguments contains any ASCII whitespace. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMTokenList/remove) + */ + remove(...tokens: string[]): void; + /** + * Replaces token with newToken. + * + * Returns true if token was replaced with newToken, and false otherwise. + * + * Throws a "SyntaxError" DOMException if one of the arguments is the empty string. + * + * Throws an "InvalidCharacterError" DOMException if one of the arguments contains any ASCII whitespace. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMTokenList/replace) + */ + replace(token: string, newToken: string): boolean; + /** + * Returns true if token is in the associated attribute's supported tokens. Returns false otherwise. + * + * Throws a TypeError if the associated attribute has no supported tokens defined. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMTokenList/supports) + */ + supports(token: string): boolean; + /** + * If force is not given, "toggles" token, removing it if it's present and adding it if it's not present. If force is true, adds token (same as add()). If force is false, removes token (same as remove()). + * + * Returns true if token is now present, and false otherwise. + * + * Throws a "SyntaxError" DOMException if token is empty. + * + * Throws an "InvalidCharacterError" DOMException if token contains any spaces. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMTokenList/toggle) + */ + toggle(token: string, force?: boolean): boolean; + forEach(callbackfn: (value: string, key: number, parent: DOMTokenList) => void, thisArg?: any): void; + [index: number]: string; +} + +declare var DOMTokenList: { + prototype: DOMTokenList; + new(): DOMTokenList; +}; + +/** + * Used to hold the data that is being dragged during a drag and drop operation. It may hold one or more data items, each of one or more data types. For more information about drag and drop, see HTML Drag and Drop API. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransfer) + */ +interface DataTransfer { + /** + * Returns the kind of operation that is currently selected. If the kind of operation isn't one of those that is allowed by the effectAllowed attribute, then the operation will fail. + * + * Can be set, to change the selected operation. + * + * The possible values are "none", "copy", "link", and "move". + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransfer/dropEffect) + */ + dropEffect: "none" | "copy" | "link" | "move"; + /** + * Returns the kinds of operations that are to be allowed. + * + * Can be set (during the dragstart event), to change the allowed operations. + * + * The possible values are "none", "copy", "copyLink", "copyMove", "link", "linkMove", "move", "all", and "uninitialized", + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransfer/effectAllowed) + */ + effectAllowed: "none" | "copy" | "copyLink" | "copyMove" | "link" | "linkMove" | "move" | "all" | "uninitialized"; + /** + * Returns a FileList of the files being dragged, if any. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransfer/files) + */ + readonly files: FileList; + /** + * Returns a DataTransferItemList object, with the drag data. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransfer/items) + */ + readonly items: DataTransferItemList; + /** + * Returns a frozen array listing the formats that were set in the dragstart event. In addition, if any files are being dragged, then one of the types will be the string "Files". + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransfer/types) + */ + readonly types: ReadonlyArray; + /** + * Removes the data of the specified formats. Removes all data if the argument is omitted. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransfer/clearData) + */ + clearData(format?: string): void; + /** + * Returns the specified data. If there is no such data, returns the empty string. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransfer/getData) + */ + getData(format: string): string; + /** + * Adds the specified data. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransfer/setData) + */ + setData(format: string, data: string): void; + /** + * Uses the given element to update the drag feedback, replacing any previously specified feedback. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransfer/setDragImage) + */ + setDragImage(image: Element, x: number, y: number): void; +} + +declare var DataTransfer: { + prototype: DataTransfer; + new(): DataTransfer; +}; + +/** + * One drag data item. During a drag operation, each drag event has a dataTransfer property which contains a list of drag data items. Each item in the list is a DataTransferItem object. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransferItem) + */ +interface DataTransferItem { + /** + * Returns the drag data item kind, one of: "string", "file". + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransferItem/kind) + */ + readonly kind: string; + /** + * Returns the drag data item type string. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransferItem/type) + */ + readonly type: string; + /** + * Returns a File object, if the drag data item kind is File. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransferItem/getAsFile) + */ + getAsFile(): File | null; + /** + * Invokes the callback with the string data as the argument, if the drag data item kind is text. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransferItem/getAsString) + */ + getAsString(callback: FunctionStringCallback | null): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransferItem/webkitGetAsEntry) */ + webkitGetAsEntry(): FileSystemEntry | null; +} + +declare var DataTransferItem: { + prototype: DataTransferItem; + new(): DataTransferItem; +}; + +/** + * A list of DataTransferItem objects representing items being dragged. During a drag operation, each DragEvent has a dataTransfer property and that property is a DataTransferItemList. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransferItemList) + */ +interface DataTransferItemList { + /** + * Returns the number of items in the drag data store. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransferItemList/length) + */ + readonly length: number; + /** + * Adds a new entry for the given data to the drag data store. If the data is plain text then a type string has to be provided also. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransferItemList/add) + */ + add(data: string, type: string): DataTransferItem | null; + add(data: File): DataTransferItem | null; + /** + * Removes all the entries in the drag data store. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransferItemList/clear) + */ + clear(): void; + /** + * Removes the indexth entry in the drag data store. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransferItemList/remove) + */ + remove(index: number): void; + [index: number]: DataTransferItem; +} + +declare var DataTransferItemList: { + prototype: DataTransferItemList; + new(): DataTransferItemList; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream) */ +interface DecompressionStream extends GenericTransformStream { +} + +declare var DecompressionStream: { + prototype: DecompressionStream; + new(format: CompressionFormat): DecompressionStream; +}; + +/** + * A delay-line; an AudioNode audio-processing module that causes a delay between the arrival of an input data and its propagation to the output. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DelayNode) + */ +interface DelayNode extends AudioNode { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DelayNode/delayTime) */ + readonly delayTime: AudioParam; +} + +declare var DelayNode: { + prototype: DelayNode; + new(context: BaseAudioContext, options?: DelayOptions): DelayNode; +}; + +/** + * The DeviceMotionEvent provides web developers with information about the speed of changes for the device's position and orientation. + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DeviceMotionEvent) + */ +interface DeviceMotionEvent extends Event { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DeviceMotionEvent/acceleration) */ + readonly acceleration: DeviceMotionEventAcceleration | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DeviceMotionEvent/accelerationIncludingGravity) */ + readonly accelerationIncludingGravity: DeviceMotionEventAcceleration | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DeviceMotionEvent/interval) */ + readonly interval: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DeviceMotionEvent/rotationRate) */ + readonly rotationRate: DeviceMotionEventRotationRate | null; +} + +declare var DeviceMotionEvent: { + prototype: DeviceMotionEvent; + new(type: string, eventInitDict?: DeviceMotionEventInit): DeviceMotionEvent; +}; + +/** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DeviceMotionEventAcceleration) + */ +interface DeviceMotionEventAcceleration { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DeviceMotionEventAcceleration/x) */ + readonly x: number | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DeviceMotionEventAcceleration/y) */ + readonly y: number | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DeviceMotionEventAcceleration/z) */ + readonly z: number | null; +} + +/** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DeviceMotionEventRotationRate) + */ +interface DeviceMotionEventRotationRate { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DeviceMotionEventRotationRate/alpha) */ + readonly alpha: number | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DeviceMotionEventRotationRate/beta) */ + readonly beta: number | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DeviceMotionEventRotationRate/gamma) */ + readonly gamma: number | null; +} + +/** + * The DeviceOrientationEvent provides web developers with information from the physical orientation of the device running the web page. + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DeviceOrientationEvent) + */ +interface DeviceOrientationEvent extends Event { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DeviceOrientationEvent/absolute) */ + readonly absolute: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DeviceOrientationEvent/alpha) */ + readonly alpha: number | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DeviceOrientationEvent/beta) */ + readonly beta: number | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DeviceOrientationEvent/gamma) */ + readonly gamma: number | null; +} + +declare var DeviceOrientationEvent: { + prototype: DeviceOrientationEvent; + new(type: string, eventInitDict?: DeviceOrientationEventInit): DeviceOrientationEvent; +}; + +interface DocumentEventMap extends GlobalEventHandlersEventMap { + "DOMContentLoaded": Event; + "fullscreenchange": Event; + "fullscreenerror": Event; + "pointerlockchange": Event; + "pointerlockerror": Event; + "readystatechange": Event; + "visibilitychange": Event; +} + +/** + * Any web page loaded in the browser and serves as an entry point into the web page's content, which is the DOM tree. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document) + */ +interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEventHandlers, NonElementParentNode, ParentNode, XPathEvaluatorBase { + /** + * Sets or gets the URL for the current document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/URL) + */ + readonly URL: string; + /** + * Sets or gets the color of all active links in the document. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/alinkColor) + */ + alinkColor: string; + /** + * Returns a reference to the collection of elements contained by the object. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/all) + */ + readonly all: HTMLAllCollection; + /** + * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/anchors) + */ + readonly anchors: HTMLCollectionOf; + /** + * Retrieves a collection of all applet objects in the document. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/applets) + */ + readonly applets: HTMLCollection; + /** + * Deprecated. Sets or retrieves a value that indicates the background color behind the object. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/bgColor) + */ + bgColor: string; + /** + * Specifies the beginning and end of the document body. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/body) + */ + body: HTMLElement; + /** + * Returns document's encoding. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/characterSet) + */ + readonly characterSet: string; + /** + * Gets or sets the character set used to encode the object. + * @deprecated This is a legacy alias of `characterSet`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/characterSet) + */ + readonly charset: string; + /** + * Gets a value that indicates whether standards-compliant mode is switched on for the object. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/compatMode) + */ + readonly compatMode: string; + /** + * Returns document's content type. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/contentType) + */ + readonly contentType: string; + /** + * Returns the HTTP cookies that apply to the Document. If there are no cookies or cookies can't be applied to this resource, the empty string will be returned. + * + * Can be set, to add a new cookie to the element's set of HTTP cookies. + * + * If the contents are sandboxed into a unique origin (e.g. in an iframe with the sandbox attribute), a "SecurityError" DOMException will be thrown on getting and setting. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/cookie) + */ + cookie: string; + /** + * Returns the script element, or the SVG script element, that is currently executing, as long as the element represents a classic script. In the case of reentrant script execution, returns the one that most recently started executing amongst those that have not yet finished executing. + * + * Returns null if the Document is not currently executing a script or SVG script element (e.g., because the running script is an event handler, or a timeout), or if the currently executing script or SVG script element represents a module script. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/currentScript) + */ + readonly currentScript: HTMLOrSVGScriptElement | null; + /** + * Returns the Window object of the active document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/defaultView) + */ + readonly defaultView: (WindowProxy & typeof globalThis) | null; + /** + * Sets or gets a value that indicates whether the document can be edited. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/designMode) + */ + designMode: string; + /** + * Sets or retrieves a value that indicates the reading order of the object. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/dir) + */ + dir: string; + /** + * Gets an object representing the document type declaration associated with the current document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/doctype) + */ + readonly doctype: DocumentType | null; + /** + * Gets a reference to the root node of the document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/documentElement) + */ + readonly documentElement: HTMLElement; + /** + * Returns document's URL. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/documentURI) + */ + readonly documentURI: string; + /** + * Sets or gets the security domain of the document. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/domain) + */ + domain: string; + /** + * Retrieves a collection of all embed objects in the document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/embeds) + */ + readonly embeds: HTMLCollectionOf; + /** + * Sets or gets the foreground (text) color of the document. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/fgColor) + */ + fgColor: string; + /** + * Retrieves a collection, in source order, of all form objects in the document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/forms) + */ + readonly forms: HTMLCollectionOf; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/fullscreen) + */ + readonly fullscreen: boolean; + /** + * Returns true if document has the ability to display elements fullscreen and fullscreen is supported, or false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/fullscreenEnabled) + */ + readonly fullscreenEnabled: boolean; + /** + * Returns the head element. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/head) + */ + readonly head: HTMLHeadElement; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/hidden) */ + readonly hidden: boolean; + /** + * Retrieves a collection, in source order, of img objects in the document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/images) + */ + readonly images: HTMLCollectionOf; + /** + * Gets the implementation object of the current document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/implementation) + */ + readonly implementation: DOMImplementation; + /** + * Returns the character encoding used to create the webpage that is loaded into the document object. + * @deprecated This is a legacy alias of `characterSet`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/characterSet) + */ + readonly inputEncoding: string; + /** + * Gets the date that the page was last modified, if the page supplies one. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/lastModified) + */ + readonly lastModified: string; + /** + * Sets or gets the color of the document links. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/linkColor) + */ + linkColor: string; + /** + * Retrieves a collection of all a objects that specify the href property and all area objects in the document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/links) + */ + readonly links: HTMLCollectionOf; + /** + * Contains information about the current URL. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/location) + */ + get location(): Location; + set location(href: string | Location); + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/fullscreenchange_event) */ + onfullscreenchange: ((this: Document, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/fullscreenerror_event) */ + onfullscreenerror: ((this: Document, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/pointerlockchange_event) */ + onpointerlockchange: ((this: Document, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/pointerlockerror_event) */ + onpointerlockerror: ((this: Document, ev: Event) => any) | null; + /** + * Fires when the state of the object has changed. + * @param ev The event + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/readystatechange_event) + */ + onreadystatechange: ((this: Document, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/visibilitychange_event) */ + onvisibilitychange: ((this: Document, ev: Event) => any) | null; + readonly ownerDocument: null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/pictureInPictureEnabled) */ + readonly pictureInPictureEnabled: boolean; + /** + * Return an HTMLCollection of the embed elements in the Document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/plugins) + */ + readonly plugins: HTMLCollectionOf; + /** + * Retrieves a value that indicates the current state of the object. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/readyState) + */ + readonly readyState: DocumentReadyState; + /** + * Gets the URL of the location that referred the user to the current page. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/referrer) + */ + readonly referrer: string; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/rootElement) + */ + readonly rootElement: SVGSVGElement | null; + /** + * Retrieves a collection of all script objects in the document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/scripts) + */ + readonly scripts: HTMLCollectionOf; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/scrollingElement) */ + readonly scrollingElement: Element | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/timeline) */ + readonly timeline: DocumentTimeline; + /** + * Contains the title of the document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/title) + */ + title: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/visibilityState) */ + readonly visibilityState: DocumentVisibilityState; + /** + * Sets or gets the color of the links that the user has visited. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/vlinkColor) + */ + vlinkColor: string; + /** + * Moves node from another document and returns it. + * + * If node is a document, throws a "NotSupportedError" DOMException or, if node is a shadow root, throws a "HierarchyRequestError" DOMException. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/adoptNode) + */ + adoptNode(node: T): T; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/captureEvents) + */ + captureEvents(): void; + /** @deprecated */ + caretRangeFromPoint(x: number, y: number): Range | null; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/clear) + */ + clear(): void; + /** + * Closes an output stream and forces the sent data to display. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/close) + */ + close(): void; + /** + * Creates an attribute object with a specified name. + * @param name String that sets the attribute object's name. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/createAttribute) + */ + createAttribute(localName: string): Attr; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/createAttributeNS) */ + createAttributeNS(namespace: string | null, qualifiedName: string): Attr; + /** + * Returns a CDATASection node whose data is data. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/createCDATASection) + */ + createCDATASection(data: string): CDATASection; + /** + * Creates a comment object with the specified data. + * @param data Sets the comment object's data. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/createComment) + */ + createComment(data: string): Comment; + /** + * Creates a new document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/createDocumentFragment) + */ + createDocumentFragment(): DocumentFragment; + /** + * Creates an instance of the element for the specified tag. + * @param tagName The name of an element. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/createElement) + */ + createElement(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; + /** @deprecated */ + createElement(tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]; + createElement(tagName: string, options?: ElementCreationOptions): HTMLElement; + /** + * Returns an element with namespace namespace. Its namespace prefix will be everything before ":" (U+003E) in qualifiedName or null. Its local name will be everything after ":" (U+003E) in qualifiedName or qualifiedName. + * + * If localName does not match the Name production an "InvalidCharacterError" DOMException will be thrown. + * + * If one of the following conditions is true a "NamespaceError" DOMException will be thrown: + * + * localName does not match the QName production. + * Namespace prefix is not null and namespace is the empty string. + * Namespace prefix is "xml" and namespace is not the XML namespace. + * qualifiedName or namespace prefix is "xmlns" and namespace is not the XMLNS namespace. + * namespace is the XMLNS namespace and neither qualifiedName nor namespace prefix is "xmlns". + * + * When supplied, options's is can be used to create a customized built-in element. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/createElementNS) + */ + createElementNS(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: string): HTMLElement; + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: K): SVGElementTagNameMap[K]; + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: string): SVGElement; + createElementNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", qualifiedName: K): MathMLElementTagNameMap[K]; + createElementNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", qualifiedName: string): MathMLElement; + createElementNS(namespaceURI: string | null, qualifiedName: string, options?: ElementCreationOptions): Element; + createElementNS(namespace: string | null, qualifiedName: string, options?: string | ElementCreationOptions): Element; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/createEvent) */ + createEvent(eventInterface: "AnimationEvent"): AnimationEvent; + createEvent(eventInterface: "AnimationPlaybackEvent"): AnimationPlaybackEvent; + createEvent(eventInterface: "AudioProcessingEvent"): AudioProcessingEvent; + createEvent(eventInterface: "BeforeUnloadEvent"): BeforeUnloadEvent; + createEvent(eventInterface: "BlobEvent"): BlobEvent; + createEvent(eventInterface: "ClipboardEvent"): ClipboardEvent; + createEvent(eventInterface: "CloseEvent"): CloseEvent; + createEvent(eventInterface: "CompositionEvent"): CompositionEvent; + createEvent(eventInterface: "ContentVisibilityAutoStateChangeEvent"): ContentVisibilityAutoStateChangeEvent; + createEvent(eventInterface: "CustomEvent"): CustomEvent; + createEvent(eventInterface: "DeviceMotionEvent"): DeviceMotionEvent; + createEvent(eventInterface: "DeviceOrientationEvent"): DeviceOrientationEvent; + createEvent(eventInterface: "DragEvent"): DragEvent; + createEvent(eventInterface: "ErrorEvent"): ErrorEvent; + createEvent(eventInterface: "Event"): Event; + createEvent(eventInterface: "Events"): Event; + createEvent(eventInterface: "FocusEvent"): FocusEvent; + createEvent(eventInterface: "FontFaceSetLoadEvent"): FontFaceSetLoadEvent; + createEvent(eventInterface: "FormDataEvent"): FormDataEvent; + createEvent(eventInterface: "GamepadEvent"): GamepadEvent; + createEvent(eventInterface: "HashChangeEvent"): HashChangeEvent; + createEvent(eventInterface: "IDBVersionChangeEvent"): IDBVersionChangeEvent; + createEvent(eventInterface: "InputEvent"): InputEvent; + createEvent(eventInterface: "KeyboardEvent"): KeyboardEvent; + createEvent(eventInterface: "MIDIConnectionEvent"): MIDIConnectionEvent; + createEvent(eventInterface: "MIDIMessageEvent"): MIDIMessageEvent; + createEvent(eventInterface: "MediaEncryptedEvent"): MediaEncryptedEvent; + createEvent(eventInterface: "MediaKeyMessageEvent"): MediaKeyMessageEvent; + createEvent(eventInterface: "MediaQueryListEvent"): MediaQueryListEvent; + createEvent(eventInterface: "MediaStreamTrackEvent"): MediaStreamTrackEvent; + createEvent(eventInterface: "MessageEvent"): MessageEvent; + createEvent(eventInterface: "MouseEvent"): MouseEvent; + createEvent(eventInterface: "MouseEvents"): MouseEvent; + createEvent(eventInterface: "MutationEvent"): MutationEvent; + createEvent(eventInterface: "MutationEvents"): MutationEvent; + createEvent(eventInterface: "OfflineAudioCompletionEvent"): OfflineAudioCompletionEvent; + createEvent(eventInterface: "PageTransitionEvent"): PageTransitionEvent; + createEvent(eventInterface: "PaymentMethodChangeEvent"): PaymentMethodChangeEvent; + createEvent(eventInterface: "PaymentRequestUpdateEvent"): PaymentRequestUpdateEvent; + createEvent(eventInterface: "PictureInPictureEvent"): PictureInPictureEvent; + createEvent(eventInterface: "PointerEvent"): PointerEvent; + createEvent(eventInterface: "PopStateEvent"): PopStateEvent; + createEvent(eventInterface: "ProgressEvent"): ProgressEvent; + createEvent(eventInterface: "PromiseRejectionEvent"): PromiseRejectionEvent; + createEvent(eventInterface: "RTCDTMFToneChangeEvent"): RTCDTMFToneChangeEvent; + createEvent(eventInterface: "RTCDataChannelEvent"): RTCDataChannelEvent; + createEvent(eventInterface: "RTCErrorEvent"): RTCErrorEvent; + createEvent(eventInterface: "RTCPeerConnectionIceErrorEvent"): RTCPeerConnectionIceErrorEvent; + createEvent(eventInterface: "RTCPeerConnectionIceEvent"): RTCPeerConnectionIceEvent; + createEvent(eventInterface: "RTCTrackEvent"): RTCTrackEvent; + createEvent(eventInterface: "SecurityPolicyViolationEvent"): SecurityPolicyViolationEvent; + createEvent(eventInterface: "SpeechSynthesisErrorEvent"): SpeechSynthesisErrorEvent; + createEvent(eventInterface: "SpeechSynthesisEvent"): SpeechSynthesisEvent; + createEvent(eventInterface: "StorageEvent"): StorageEvent; + createEvent(eventInterface: "SubmitEvent"): SubmitEvent; + createEvent(eventInterface: "ToggleEvent"): ToggleEvent; + createEvent(eventInterface: "TouchEvent"): TouchEvent; + createEvent(eventInterface: "TrackEvent"): TrackEvent; + createEvent(eventInterface: "TransitionEvent"): TransitionEvent; + createEvent(eventInterface: "UIEvent"): UIEvent; + createEvent(eventInterface: "UIEvents"): UIEvent; + createEvent(eventInterface: "WebGLContextEvent"): WebGLContextEvent; + createEvent(eventInterface: "WheelEvent"): WheelEvent; + createEvent(eventInterface: string): Event; + /** + * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. + * @param root The root element or node to start traversing on. + * @param whatToShow The type of nodes or elements to appear in the node list + * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/createNodeIterator) + */ + createNodeIterator(root: Node, whatToShow?: number, filter?: NodeFilter | null): NodeIterator; + /** + * Returns a ProcessingInstruction node whose target is target and data is data. If target does not match the Name production an "InvalidCharacterError" DOMException will be thrown. If data contains "?>" an "InvalidCharacterError" DOMException will be thrown. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/createProcessingInstruction) + */ + createProcessingInstruction(target: string, data: string): ProcessingInstruction; + /** + * Returns an empty range object that has both of its boundary points positioned at the beginning of the document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/createRange) + */ + createRange(): Range; + /** + * Creates a text string from the specified value. + * @param data String that specifies the nodeValue property of the text node. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/createTextNode) + */ + createTextNode(data: string): Text; + /** + * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document. + * @param root The root element or node to start traversing on. + * @param whatToShow The type of nodes or elements to appear in the node list. For more information, see whatToShow. + * @param filter A custom NodeFilter function to use. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/createTreeWalker) + */ + createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter | null): TreeWalker; + /** + * Executes a command on the current document, current selection, or the given range. + * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script. + * @param showUI Display the user interface, defaults to false. + * @param value Value to assign. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/execCommand) + */ + execCommand(commandId: string, showUI?: boolean, value?: string): boolean; + /** + * Stops document's fullscreen element from being displayed fullscreen and resolves promise when done. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/exitFullscreen) + */ + exitFullscreen(): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/exitPictureInPicture) */ + exitPictureInPicture(): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/exitPointerLock) */ + exitPointerLock(): void; + /** + * Returns a reference to the first object with the specified value of the ID attribute. + * @param elementId String that specifies the ID value. + */ + getElementById(elementId: string): HTMLElement | null; + /** + * Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/getElementsByClassName) + */ + getElementsByClassName(classNames: string): HTMLCollectionOf; + /** + * Gets a collection of objects based on the value of the NAME or ID attribute. + * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/getElementsByName) + */ + getElementsByName(elementName: string): NodeListOf; + /** + * Retrieves a collection of objects based on the specified element name. + * @param name Specifies the name of an element. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/getElementsByTagName) + */ + getElementsByTagName(qualifiedName: K): HTMLCollectionOf; + getElementsByTagName(qualifiedName: K): HTMLCollectionOf; + getElementsByTagName(qualifiedName: K): HTMLCollectionOf; + /** @deprecated */ + getElementsByTagName(qualifiedName: K): HTMLCollectionOf; + getElementsByTagName(qualifiedName: string): HTMLCollectionOf; + /** + * If namespace and localName are "*" returns a HTMLCollection of all descendant elements. + * + * If only namespace is "*" returns a HTMLCollection of all descendant elements whose local name is localName. + * + * If only localName is "*" returns a HTMLCollection of all descendant elements whose namespace is namespace. + * + * Otherwise, returns a HTMLCollection of all descendant elements whose namespace is namespace and local name is localName. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/getElementsByTagNameNS) + */ + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf; + /** + * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/getSelection) + */ + getSelection(): Selection | null; + /** + * Gets a value indicating whether the object currently has focus. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/hasFocus) + */ + hasFocus(): boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/hasStorageAccess) */ + hasStorageAccess(): Promise; + /** + * Returns a copy of node. If deep is true, the copy also includes the node's descendants. + * + * If node is a document or a shadow root, throws a "NotSupportedError" DOMException. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/importNode) + */ + importNode(node: T, deep?: boolean): T; + /** + * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method. + * @param url Specifies a MIME type for the document. + * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element. + * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported. + * @param replace Specifies whether the existing entry for the document is replaced in the history list. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/open) + */ + open(unused1?: string, unused2?: string): Document; + open(url: string | URL, name: string, features: string): WindowProxy | null; + /** + * Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document. + * @param commandId Specifies a command identifier. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/queryCommandEnabled) + */ + queryCommandEnabled(commandId: string): boolean; + /** + * Returns a Boolean value that indicates whether the specified command is in the indeterminate state. + * @param commandId String that specifies a command identifier. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/queryCommandIndeterm) + */ + queryCommandIndeterm(commandId: string): boolean; + /** + * Returns a Boolean value that indicates the current state of the command. + * @param commandId String that specifies a command identifier. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/queryCommandState) + */ + queryCommandState(commandId: string): boolean; + /** + * Returns a Boolean value that indicates whether the current command is supported on the current range. + * @param commandId Specifies a command identifier. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/queryCommandSupported) + */ + queryCommandSupported(commandId: string): boolean; + /** + * Returns the current value of the document, range, or current selection for the given command. + * @param commandId String that specifies a command identifier. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/queryCommandValue) + */ + queryCommandValue(commandId: string): string; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/releaseEvents) + */ + releaseEvents(): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/requestStorageAccess) */ + requestStorageAccess(): Promise; + /** + * Writes one or more HTML expressions to a document in the specified window. + * @param content Specifies the text and HTML tags to write. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/write) + */ + write(...text: string[]): void; + /** + * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window. + * @param content The text and HTML tags to write. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/writeln) + */ + writeln(...text: string[]): void; + addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var Document: { + prototype: Document; + new(): Document; + parseHTMLUnsafe(html: string): Document; +}; + +/** + * A minimal document object that has no parent. It is used as a lightweight version of Document that stores a segment of a document structure comprised of nodes just like a standard document. The key difference is that because the document fragment isn't part of the active document tree structure, changes made to the fragment don't affect the document, cause reflow, or incur any performance impact that can occur when changes are made. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DocumentFragment) + */ +interface DocumentFragment extends Node, NonElementParentNode, ParentNode { + readonly ownerDocument: Document; + getElementById(elementId: string): HTMLElement | null; +} + +declare var DocumentFragment: { + prototype: DocumentFragment; + new(): DocumentFragment; +}; + +interface DocumentOrShadowRoot { + /** + * Returns the deepest element in the document through which or to which key events are being routed. This is, roughly speaking, the focused element in the document. + * + * For the purposes of this API, when a child browsing context is focused, its container is focused in the parent browsing context. For example, if the user moves the focus to a text control in an iframe, the iframe is the element returned by the activeElement API in the iframe's node document. + * + * Similarly, when the focused element is in a different node tree than documentOrShadowRoot, the element returned will be the host that's located in the same node tree as documentOrShadowRoot if documentOrShadowRoot is a shadow-including inclusive ancestor of the focused element, and null if not. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/activeElement) + */ + readonly activeElement: Element | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/adoptedStyleSheets) */ + adoptedStyleSheets: CSSStyleSheet[]; + /** + * Returns document's fullscreen element. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/fullscreenElement) + */ + readonly fullscreenElement: Element | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/pictureInPictureElement) */ + readonly pictureInPictureElement: Element | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/pointerLockElement) */ + readonly pointerLockElement: Element | null; + /** + * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/styleSheets) + */ + readonly styleSheets: StyleSheetList; + /** + * Returns the element for the specified x coordinate and the specified y coordinate. + * @param x The x-offset + * @param y The y-offset + */ + elementFromPoint(x: number, y: number): Element | null; + elementsFromPoint(x: number, y: number): Element[]; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/getAnimations) */ + getAnimations(): Animation[]; +} + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DocumentTimeline) */ +interface DocumentTimeline extends AnimationTimeline { +} + +declare var DocumentTimeline: { + prototype: DocumentTimeline; + new(options?: DocumentTimelineOptions): DocumentTimeline; +}; + +/** + * A Node containing a doctype. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DocumentType) + */ +interface DocumentType extends Node, ChildNode { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DocumentType/name) */ + readonly name: string; + readonly ownerDocument: Document; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DocumentType/publicId) */ + readonly publicId: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DocumentType/systemId) */ + readonly systemId: string; +} + +declare var DocumentType: { + prototype: DocumentType; + new(): DocumentType; +}; + +/** + * A DOM event that represents a drag and drop interaction. The user initiates a drag by placing a pointer device (such as a mouse) on the touch surface and then dragging the pointer to a new location (such as another DOM element). Applications are free to interpret a drag and drop interaction in an application-specific way. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DragEvent) + */ +interface DragEvent extends MouseEvent { + /** + * Returns the DataTransfer object for the event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DragEvent/dataTransfer) + */ + readonly dataTransfer: DataTransfer | null; +} + +declare var DragEvent: { + prototype: DragEvent; + new(type: string, eventInitDict?: DragEventInit): DragEvent; +}; + +/** + * Inherits properties from its parent, AudioNode. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DynamicsCompressorNode) + */ +interface DynamicsCompressorNode extends AudioNode { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DynamicsCompressorNode/attack) */ + readonly attack: AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DynamicsCompressorNode/knee) */ + readonly knee: AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DynamicsCompressorNode/ratio) */ + readonly ratio: AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DynamicsCompressorNode/reduction) */ + readonly reduction: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DynamicsCompressorNode/release) */ + readonly release: AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DynamicsCompressorNode/threshold) */ + readonly threshold: AudioParam; +} + +declare var DynamicsCompressorNode: { + prototype: DynamicsCompressorNode; + new(context: BaseAudioContext, options?: DynamicsCompressorOptions): DynamicsCompressorNode; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EXT_blend_minmax) */ +interface EXT_blend_minmax { + readonly MIN_EXT: 0x8007; + readonly MAX_EXT: 0x8008; +} + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EXT_color_buffer_float) */ +interface EXT_color_buffer_float { +} + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EXT_color_buffer_half_float) */ +interface EXT_color_buffer_half_float { + readonly RGBA16F_EXT: 0x881A; + readonly RGB16F_EXT: 0x881B; + readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: 0x8211; + readonly UNSIGNED_NORMALIZED_EXT: 0x8C17; +} + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EXT_float_blend) */ +interface EXT_float_blend { +} + +/** + * The EXT_frag_depth extension is part of the WebGL API and enables to set a depth value of a fragment from within the fragment shader. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EXT_frag_depth) + */ +interface EXT_frag_depth { +} + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EXT_sRGB) */ +interface EXT_sRGB { + readonly SRGB_EXT: 0x8C40; + readonly SRGB_ALPHA_EXT: 0x8C42; + readonly SRGB8_ALPHA8_EXT: 0x8C43; + readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: 0x8210; +} + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EXT_shader_texture_lod) */ +interface EXT_shader_texture_lod { +} + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EXT_texture_compression_bptc) */ +interface EXT_texture_compression_bptc { + readonly COMPRESSED_RGBA_BPTC_UNORM_EXT: 0x8E8C; + readonly COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT: 0x8E8D; + readonly COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT: 0x8E8E; + readonly COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT: 0x8E8F; +} + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EXT_texture_compression_rgtc) */ +interface EXT_texture_compression_rgtc { + readonly COMPRESSED_RED_RGTC1_EXT: 0x8DBB; + readonly COMPRESSED_SIGNED_RED_RGTC1_EXT: 0x8DBC; + readonly COMPRESSED_RED_GREEN_RGTC2_EXT: 0x8DBD; + readonly COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT: 0x8DBE; +} + +/** + * The EXT_texture_filter_anisotropic extension is part of the WebGL API and exposes two constants for anisotropic filtering (AF). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EXT_texture_filter_anisotropic) + */ +interface EXT_texture_filter_anisotropic { + readonly TEXTURE_MAX_ANISOTROPY_EXT: 0x84FE; + readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: 0x84FF; +} + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EXT_texture_norm16) */ +interface EXT_texture_norm16 { + readonly R16_EXT: 0x822A; + readonly RG16_EXT: 0x822C; + readonly RGB16_EXT: 0x8054; + readonly RGBA16_EXT: 0x805B; + readonly R16_SNORM_EXT: 0x8F98; + readonly RG16_SNORM_EXT: 0x8F99; + readonly RGB16_SNORM_EXT: 0x8F9A; + readonly RGBA16_SNORM_EXT: 0x8F9B; +} + +interface ElementEventMap { + "fullscreenchange": Event; + "fullscreenerror": Event; +} + +/** + * Element is the most general base class from which all objects in a Document inherit. It only has methods and properties common to all kinds of elements. More specific classes inherit from Element. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element) + */ +interface Element extends Node, ARIAMixin, Animatable, ChildNode, InnerHTML, NonDocumentTypeChildNode, ParentNode, Slottable { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/attributes) */ + readonly attributes: NamedNodeMap; + /** + * Allows for manipulation of element's class content attribute as a set of whitespace-separated tokens through a DOMTokenList object. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/classList) + */ + readonly classList: DOMTokenList; + /** + * Returns the value of element's class content attribute. Can be set to change it. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/className) + */ + className: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/clientHeight) */ + readonly clientHeight: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/clientLeft) */ + readonly clientLeft: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/clientTop) */ + readonly clientTop: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/clientWidth) */ + readonly clientWidth: number; + /** + * Returns the value of element's id content attribute. Can be set to change it. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/id) + */ + id: string; + /** + * Returns the local name. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/localName) + */ + readonly localName: string; + /** + * Returns the namespace. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/namespaceURI) + */ + readonly namespaceURI: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/fullscreenchange_event) */ + onfullscreenchange: ((this: Element, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/fullscreenerror_event) */ + onfullscreenerror: ((this: Element, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/outerHTML) */ + outerHTML: string; + readonly ownerDocument: Document; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/part) */ + readonly part: DOMTokenList; + /** + * Returns the namespace prefix. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/prefix) + */ + readonly prefix: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/scrollHeight) */ + readonly scrollHeight: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/scrollLeft) */ + scrollLeft: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/scrollTop) */ + scrollTop: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/scrollWidth) */ + readonly scrollWidth: number; + /** + * Returns element's shadow root, if any, and if shadow root's mode is "open", and null otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/shadowRoot) + */ + readonly shadowRoot: ShadowRoot | null; + /** + * Returns the value of element's slot content attribute. Can be set to change it. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/slot) + */ + slot: string; + /** + * Returns the HTML-uppercased qualified name. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/tagName) + */ + readonly tagName: string; + /** + * Creates a shadow root for element and returns it. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) + */ + attachShadow(init: ShadowRootInit): ShadowRoot; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) */ + checkVisibility(options?: CheckVisibilityOptions): boolean; + /** + * Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/closest) + */ + closest(selector: K): HTMLElementTagNameMap[K] | null; + closest(selector: K): SVGElementTagNameMap[K] | null; + closest(selector: K): MathMLElementTagNameMap[K] | null; + closest(selectors: string): E | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) */ + computedStyleMap(): StylePropertyMapReadOnly; + /** + * Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) + */ + getAttribute(qualifiedName: string): string | null; + /** + * Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) + */ + getAttributeNS(namespace: string | null, localName: string): string | null; + /** + * Returns the qualified names of all element's attributes. Can contain duplicates. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) + */ + getAttributeNames(): string[]; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) */ + getAttributeNode(qualifiedName: string): Attr | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) */ + getAttributeNodeNS(namespace: string | null, localName: string): Attr | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) */ + getBoundingClientRect(): DOMRect; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) */ + getClientRects(): DOMRectList; + /** + * Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) + */ + getElementsByClassName(classNames: string): HTMLCollectionOf; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) */ + getElementsByTagName(qualifiedName: K): HTMLCollectionOf; + getElementsByTagName(qualifiedName: K): HTMLCollectionOf; + getElementsByTagName(qualifiedName: K): HTMLCollectionOf; + /** @deprecated */ + getElementsByTagName(qualifiedName: K): HTMLCollectionOf; + getElementsByTagName(qualifiedName: string): HTMLCollectionOf; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) */ + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf; + /** + * Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) + */ + hasAttribute(qualifiedName: string): boolean; + /** + * Returns true if element has an attribute whose namespace is namespace and local name is localName. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) + */ + hasAttributeNS(namespace: string | null, localName: string): boolean; + /** + * Returns true if element has attributes, and false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) + */ + hasAttributes(): boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) */ + hasPointerCapture(pointerId: number): boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) */ + insertAdjacentElement(where: InsertPosition, element: Element): Element | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) */ + insertAdjacentHTML(position: InsertPosition, text: string): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) */ + insertAdjacentText(where: InsertPosition, data: string): void; + /** + * Returns true if matching selectors against element's root yields element, and false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/matches) + */ + matches(selectors: string): boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) */ + releasePointerCapture(pointerId: number): void; + /** + * Removes element's first attribute whose qualified name is qualifiedName. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) + */ + removeAttribute(qualifiedName: string): void; + /** + * Removes element's attribute whose namespace is namespace and local name is localName. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) + */ + removeAttributeNS(namespace: string | null, localName: string): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) */ + removeAttributeNode(attr: Attr): Attr; + /** + * Displays element fullscreen and resolves promise when done. + * + * When supplied, options's navigationUI member indicates whether showing navigation UI while in fullscreen is preferred or not. If set to "show", navigation simplicity is preferred over screen space, and if set to "hide", more screen space is preferred. User agents are always free to honor user preference over the application's. The default value "auto" indicates no application preference. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) + */ + requestFullscreen(options?: FullscreenOptions): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) */ + requestPointerLock(): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/scroll) */ + scroll(options?: ScrollToOptions): void; + scroll(x: number, y: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) */ + scrollBy(options?: ScrollToOptions): void; + scrollBy(x: number, y: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) */ + scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) */ + scrollTo(options?: ScrollToOptions): void; + scrollTo(x: number, y: number): void; + /** + * Sets the value of element's first attribute whose qualified name is qualifiedName to value. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) + */ + setAttribute(qualifiedName: string, value: string): void; + /** + * Sets the value of element's attribute whose namespace is namespace and local name is localName to value. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) + */ + setAttributeNS(namespace: string | null, qualifiedName: string, value: string): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) */ + setAttributeNode(attr: Attr): Attr | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) */ + setAttributeNodeNS(attr: Attr): Attr | null; + setHTMLUnsafe(html: string): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) */ + setPointerCapture(pointerId: number): void; + /** + * If force is not given, "toggles" qualifiedName, removing it if it is present and adding it if it is not present. If force is true, adds qualifiedName. If force is false, removes qualifiedName. + * + * Returns true if qualifiedName is now present, and false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) + */ + toggleAttribute(qualifiedName: string, force?: boolean): boolean; + /** + * @deprecated This is a legacy alias of `matches`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/matches) + */ + webkitMatchesSelector(selectors: string): boolean; + addEventListener(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var Element: { + prototype: Element; + new(): Element; +}; + +interface ElementCSSInlineStyle { + readonly attributeStyleMap: StylePropertyMap; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/style) */ + readonly style: CSSStyleDeclaration; +} + +interface ElementContentEditable { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/contentEditable) */ + contentEditable: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/enterKeyHint) */ + enterKeyHint: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/inputMode) */ + inputMode: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/isContentEditable) */ + readonly isContentEditable: boolean; +} + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ElementInternals) */ +interface ElementInternals extends ARIAMixin { + /** + * Returns the form owner of internals's target element. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ElementInternals/form) + */ + readonly form: HTMLFormElement | null; + /** + * Returns a NodeList of all the label elements that internals's target element is associated with. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ElementInternals/labels) + */ + readonly labels: NodeList; + /** + * Returns the ShadowRoot for internals's target element, if the target element is a shadow host, or null otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ElementInternals/shadowRoot) + */ + readonly shadowRoot: ShadowRoot | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ElementInternals/states) */ + readonly states: CustomStateSet; + /** + * Returns the error message that would be shown to the user if internals's target element was to be checked for validity. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ElementInternals/validationMessage) + */ + readonly validationMessage: string; + /** + * Returns the ValidityState object for internals's target element. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ElementInternals/validity) + */ + readonly validity: ValidityState; + /** + * Returns true if internals's target element will be validated when the form is submitted; false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ElementInternals/willValidate) + */ + readonly willValidate: boolean; + /** + * Returns true if internals's target element has no validity problems; false otherwise. Fires an invalid event at the element in the latter case. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ElementInternals/checkValidity) + */ + checkValidity(): boolean; + /** + * Returns true if internals's target element has no validity problems; otherwise, returns false, fires an invalid event at the element, and (if the event isn't canceled) reports the problem to the user. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ElementInternals/reportValidity) + */ + reportValidity(): boolean; + /** + * Sets both the state and submission value of internals's target element to value. + * + * If value is null, the element won't participate in form submission. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ElementInternals/setFormValue) + */ + setFormValue(value: File | string | FormData | null, state?: File | string | FormData | null): void; + /** + * Marks internals's target element as suffering from the constraints indicated by the flags argument, and sets the element's validation message to message. If anchor is specified, the user agent might use it to indicate problems with the constraints of internals's target element when the form owner is validated interactively or reportValidity() is called. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ElementInternals/setValidity) + */ + setValidity(flags?: ValidityStateFlags, message?: string, anchor?: HTMLElement): void; +} + +declare var ElementInternals: { + prototype: ElementInternals; + new(): ElementInternals; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EncodedVideoChunk) */ +interface EncodedVideoChunk { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EncodedVideoChunk/byteLength) */ + readonly byteLength: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EncodedVideoChunk/duration) */ + readonly duration: number | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EncodedVideoChunk/timestamp) */ + readonly timestamp: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EncodedVideoChunk/type) */ + readonly type: EncodedVideoChunkType; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EncodedVideoChunk/copyTo) */ + copyTo(destination: AllowSharedBufferSource): void; +} + +declare var EncodedVideoChunk: { + prototype: EncodedVideoChunk; + new(init: EncodedVideoChunkInit): EncodedVideoChunk; +}; + +/** + * Events providing information related to errors in scripts or in files. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent) + */ +interface ErrorEvent extends Event { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/colno) */ + readonly colno: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/error) */ + readonly error: any; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/filename) */ + readonly filename: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/lineno) */ + readonly lineno: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/message) */ + readonly message: string; +} + +declare var ErrorEvent: { + prototype: ErrorEvent; + new(type: string, eventInitDict?: ErrorEventInit): ErrorEvent; +}; + +/** + * An event which takes place in the DOM. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event) + */ +interface Event { + /** + * Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/bubbles) + */ + readonly bubbles: boolean; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble) + */ + cancelBubble: boolean; + /** + * Returns true or false depending on how event was initialized. Its return value does not always carry meaning, but true can indicate that part of the operation during which event was dispatched, can be canceled by invoking the preventDefault() method. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelable) + */ + readonly cancelable: boolean; + /** + * Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composed) + */ + readonly composed: boolean; + /** + * Returns the object whose event listener's callback is currently being invoked. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/currentTarget) + */ + readonly currentTarget: EventTarget | null; + /** + * Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/defaultPrevented) + */ + readonly defaultPrevented: boolean; + /** + * Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/eventPhase) + */ + readonly eventPhase: number; + /** + * Returns true if event was dispatched by the user agent, and false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/isTrusted) + */ + readonly isTrusted: boolean; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/returnValue) + */ + returnValue: boolean; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/srcElement) + */ + readonly srcElement: EventTarget | null; + /** + * Returns the object to which event is dispatched (its target). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/target) + */ + readonly target: EventTarget | null; + /** + * Returns the event's timestamp as the number of milliseconds measured relative to the time origin. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/timeStamp) + */ + readonly timeStamp: DOMHighResTimeStamp; + /** + * Returns the type of event, e.g. "click", "hashchange", or "submit". + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/type) + */ + readonly type: string; + /** + * Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composedPath) + */ + composedPath(): EventTarget[]; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/initEvent) + */ + initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void; + /** + * If invoked when the cancelable attribute value is true, and while executing a listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/preventDefault) + */ + preventDefault(): void; + /** + * Invoking this method prevents event from reaching any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any other objects. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation) + */ + stopImmediatePropagation(): void; + /** + * When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation) + */ + stopPropagation(): void; + readonly NONE: 0; + readonly CAPTURING_PHASE: 1; + readonly AT_TARGET: 2; + readonly BUBBLING_PHASE: 3; +} + +declare var Event: { + prototype: Event; + new(type: string, eventInitDict?: EventInit): Event; + readonly NONE: 0; + readonly CAPTURING_PHASE: 1; + readonly AT_TARGET: 2; + readonly BUBBLING_PHASE: 3; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventCounts) */ +interface EventCounts { + forEach(callbackfn: (value: number, key: string, parent: EventCounts) => void, thisArg?: any): void; +} + +declare var EventCounts: { + prototype: EventCounts; + new(): EventCounts; +}; + +interface EventListener { + (evt: Event): void; +} + +interface EventListenerObject { + handleEvent(object: Event): void; +} + +interface EventSourceEventMap { + "error": Event; + "message": MessageEvent; + "open": Event; +} + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource) */ +interface EventSource extends EventTarget { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */ + onerror: ((this: EventSource, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */ + onmessage: ((this: EventSource, ev: MessageEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */ + onopen: ((this: EventSource, ev: Event) => any) | null; + /** + * Returns the state of this EventSource object's connection. It can have the values described below. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState) + */ + readonly readyState: number; + /** + * Returns the URL providing the event stream. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url) + */ + readonly url: string; + /** + * Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials) + */ + readonly withCredentials: boolean; + /** + * Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close) + */ + close(): void; + readonly CONNECTING: 0; + readonly OPEN: 1; + readonly CLOSED: 2; + addEventListener(type: K, listener: (this: EventSource, ev: EventSourceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: (this: EventSource, event: MessageEvent) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: EventSource, ev: EventSourceEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: (this: EventSource, event: MessageEvent) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var EventSource: { + prototype: EventSource; + new(url: string | URL, eventSourceInitDict?: EventSourceInit): EventSource; + readonly CONNECTING: 0; + readonly OPEN: 1; + readonly CLOSED: 2; +}; + +/** + * EventTarget is a DOM interface implemented by objects that can receive events and may have listeners for them. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget) + */ +interface EventTarget { + /** + * Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched. + * + * The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture. + * + * When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET. + * + * When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners. + * + * When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. + * + * If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. + * + * The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) + */ + addEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean): void; + /** + * Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) + */ + dispatchEvent(event: Event): boolean; + /** + * Removes the event listener in target's event listener list with the same type, callback, and options. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) + */ + removeEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void; +} + +declare var EventTarget: { + prototype: EventTarget; + new(): EventTarget; +}; + +/** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/External) + */ +interface External { + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/External/AddSearchProvider) + */ + AddSearchProvider(): void; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/External/IsSearchProviderInstalled) + */ + IsSearchProviderInstalled(): void; +} + +/** @deprecated */ +declare var External: { + prototype: External; + new(): External; +}; + +/** + * Provides information about files and allows JavaScript in a web page to access their content. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/File) + */ +interface File extends Blob { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) */ + readonly lastModified: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name) */ + readonly name: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/webkitRelativePath) */ + readonly webkitRelativePath: string; +} + +declare var File: { + prototype: File; + new(fileBits: BlobPart[], fileName: string, options?: FilePropertyBag): File; +}; + +/** + * An object of this type is returned by the files property of the HTML element; this lets you access the list of files selected with the element. It's also used for a list of files dropped into web content when using the drag and drop API; see the DataTransfer object for details on this usage. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileList) + */ +interface FileList { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileList/length) */ + readonly length: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileList/item) */ + item(index: number): File | null; + [index: number]: File; +} + +declare var FileList: { + prototype: FileList; + new(): FileList; +}; + +interface FileReaderEventMap { + "abort": ProgressEvent; + "error": ProgressEvent; + "load": ProgressEvent; + "loadend": ProgressEvent; + "loadstart": ProgressEvent; + "progress": ProgressEvent; +} + +/** + * Lets web applications asynchronously read the contents of files (or raw data buffers) stored on the user's computer, using File or Blob objects to specify the file or data to read. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileReader) + */ +interface FileReader extends EventTarget { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileReader/error) */ + readonly error: DOMException | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileReader/abort_event) */ + onabort: ((this: FileReader, ev: ProgressEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileReader/error_event) */ + onerror: ((this: FileReader, ev: ProgressEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileReader/load_event) */ + onload: ((this: FileReader, ev: ProgressEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileReader/loadend_event) */ + onloadend: ((this: FileReader, ev: ProgressEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileReader/loadstart_event) */ + onloadstart: ((this: FileReader, ev: ProgressEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileReader/progress_event) */ + onprogress: ((this: FileReader, ev: ProgressEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileReader/readyState) */ + readonly readyState: typeof FileReader.EMPTY | typeof FileReader.LOADING | typeof FileReader.DONE; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileReader/result) */ + readonly result: string | ArrayBuffer | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileReader/abort) */ + abort(): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileReader/readAsArrayBuffer) */ + readAsArrayBuffer(blob: Blob): void; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileReader/readAsBinaryString) + */ + readAsBinaryString(blob: Blob): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileReader/readAsDataURL) */ + readAsDataURL(blob: Blob): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileReader/readAsText) */ + readAsText(blob: Blob, encoding?: string): void; + readonly EMPTY: 0; + readonly LOADING: 1; + readonly DONE: 2; + addEventListener(type: K, listener: (this: FileReader, ev: FileReaderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: FileReader, ev: FileReaderEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var FileReader: { + prototype: FileReader; + new(): FileReader; + readonly EMPTY: 0; + readonly LOADING: 1; + readonly DONE: 2; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystem) */ +interface FileSystem { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystem/name) */ + readonly name: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystem/root) */ + readonly root: FileSystemDirectoryEntry; +} + +declare var FileSystem: { + prototype: FileSystem; + new(): FileSystem; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryEntry) */ +interface FileSystemDirectoryEntry extends FileSystemEntry { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryEntry/createReader) */ + createReader(): FileSystemDirectoryReader; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryEntry/getDirectory) */ + getDirectory(path?: string | null, options?: FileSystemFlags, successCallback?: FileSystemEntryCallback, errorCallback?: ErrorCallback): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryEntry/getFile) */ + getFile(path?: string | null, options?: FileSystemFlags, successCallback?: FileSystemEntryCallback, errorCallback?: ErrorCallback): void; +} + +declare var FileSystemDirectoryEntry: { + prototype: FileSystemDirectoryEntry; + new(): FileSystemDirectoryEntry; +}; + +/** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryHandle) + */ +interface FileSystemDirectoryHandle extends FileSystemHandle { + readonly kind: "directory"; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryHandle/getDirectoryHandle) */ + getDirectoryHandle(name: string, options?: FileSystemGetDirectoryOptions): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryHandle/getFileHandle) */ + getFileHandle(name: string, options?: FileSystemGetFileOptions): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryHandle/removeEntry) */ + removeEntry(name: string, options?: FileSystemRemoveOptions): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryHandle/resolve) */ + resolve(possibleDescendant: FileSystemHandle): Promise; +} + +declare var FileSystemDirectoryHandle: { + prototype: FileSystemDirectoryHandle; + new(): FileSystemDirectoryHandle; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryReader) */ +interface FileSystemDirectoryReader { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryReader/readEntries) */ + readEntries(successCallback: FileSystemEntriesCallback, errorCallback?: ErrorCallback): void; +} + +declare var FileSystemDirectoryReader: { + prototype: FileSystemDirectoryReader; + new(): FileSystemDirectoryReader; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemEntry) */ +interface FileSystemEntry { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemEntry/filesystem) */ + readonly filesystem: FileSystem; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemEntry/fullPath) */ + readonly fullPath: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemEntry/isDirectory) */ + readonly isDirectory: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemEntry/isFile) */ + readonly isFile: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemEntry/name) */ + readonly name: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemEntry/getParent) */ + getParent(successCallback?: FileSystemEntryCallback, errorCallback?: ErrorCallback): void; +} + +declare var FileSystemEntry: { + prototype: FileSystemEntry; + new(): FileSystemEntry; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemFileEntry) */ +interface FileSystemFileEntry extends FileSystemEntry { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemFileEntry/file) */ + file(successCallback: FileCallback, errorCallback?: ErrorCallback): void; +} + +declare var FileSystemFileEntry: { + prototype: FileSystemFileEntry; + new(): FileSystemFileEntry; +}; + +/** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemFileHandle) + */ +interface FileSystemFileHandle extends FileSystemHandle { + readonly kind: "file"; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemFileHandle/createWritable) */ + createWritable(options?: FileSystemCreateWritableOptions): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemFileHandle/getFile) */ + getFile(): Promise; +} + +declare var FileSystemFileHandle: { + prototype: FileSystemFileHandle; + new(): FileSystemFileHandle; +}; + +/** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemHandle) + */ +interface FileSystemHandle { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemHandle/kind) */ + readonly kind: FileSystemHandleKind; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemHandle/name) */ + readonly name: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemHandle/isSameEntry) */ + isSameEntry(other: FileSystemHandle): Promise; +} + +declare var FileSystemHandle: { + prototype: FileSystemHandle; + new(): FileSystemHandle; +}; + +/** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemWritableFileStream) + */ +interface FileSystemWritableFileStream extends WritableStream { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemWritableFileStream/seek) */ + seek(position: number): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemWritableFileStream/truncate) */ + truncate(size: number): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemWritableFileStream/write) */ + write(data: FileSystemWriteChunkType): Promise; +} + +declare var FileSystemWritableFileStream: { + prototype: FileSystemWritableFileStream; + new(): FileSystemWritableFileStream; +}; + +/** + * Focus-related events like focus, blur, focusin, or focusout. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FocusEvent) + */ +interface FocusEvent extends UIEvent { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FocusEvent/relatedTarget) */ + readonly relatedTarget: EventTarget | null; +} + +declare var FocusEvent: { + prototype: FocusEvent; + new(type: string, eventInitDict?: FocusEventInit): FocusEvent; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFace) */ +interface FontFace { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFace/ascentOverride) */ + ascentOverride: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFace/descentOverride) */ + descentOverride: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFace/display) */ + display: FontDisplay; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFace/family) */ + family: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFace/featureSettings) */ + featureSettings: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFace/lineGapOverride) */ + lineGapOverride: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFace/loaded) */ + readonly loaded: Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFace/status) */ + readonly status: FontFaceLoadStatus; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFace/stretch) */ + stretch: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFace/style) */ + style: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFace/unicodeRange) */ + unicodeRange: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFace/weight) */ + weight: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFace/load) */ + load(): Promise; +} + +declare var FontFace: { + prototype: FontFace; + new(family: string, source: string | BinaryData, descriptors?: FontFaceDescriptors): FontFace; +}; + +interface FontFaceSetEventMap { + "loading": Event; + "loadingdone": Event; + "loadingerror": Event; +} + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFaceSet) */ +interface FontFaceSet extends EventTarget { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFaceSet/loading_event) */ + onloading: ((this: FontFaceSet, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFaceSet/loadingdone_event) */ + onloadingdone: ((this: FontFaceSet, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFaceSet/loadingerror_event) */ + onloadingerror: ((this: FontFaceSet, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFaceSet/ready) */ + readonly ready: Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFaceSet/status) */ + readonly status: FontFaceSetLoadStatus; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFaceSet/check) */ + check(font: string, text?: string): boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFaceSet/load) */ + load(font: string, text?: string): Promise; + forEach(callbackfn: (value: FontFace, key: FontFace, parent: FontFaceSet) => void, thisArg?: any): void; + addEventListener(type: K, listener: (this: FontFaceSet, ev: FontFaceSetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: FontFaceSet, ev: FontFaceSetEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var FontFaceSet: { + prototype: FontFaceSet; + new(initialFaces: FontFace[]): FontFaceSet; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFaceSetLoadEvent) */ +interface FontFaceSetLoadEvent extends Event { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFaceSetLoadEvent/fontfaces) */ + readonly fontfaces: ReadonlyArray; +} + +declare var FontFaceSetLoadEvent: { + prototype: FontFaceSetLoadEvent; + new(type: string, eventInitDict?: FontFaceSetLoadEventInit): FontFaceSetLoadEvent; +}; + +interface FontFaceSource { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/fonts) */ + readonly fonts: FontFaceSet; +} + +/** + * Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the XMLHttpRequest.send() method. It uses the same format a form would use if the encoding type were set to "multipart/form-data". + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData) + */ +interface FormData { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append) */ + append(name: string, value: string | Blob): void; + append(name: string, value: string): void; + append(name: string, blobValue: Blob, filename?: string): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/delete) */ + delete(name: string): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/get) */ + get(name: string): FormDataEntryValue | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/getAll) */ + getAll(name: string): FormDataEntryValue[]; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/has) */ + has(name: string): boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set) */ + set(name: string, value: string | Blob): void; + set(name: string, value: string): void; + set(name: string, blobValue: Blob, filename?: string): void; + forEach(callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any): void; +} + +declare var FormData: { + prototype: FormData; + new(form?: HTMLFormElement, submitter?: HTMLElement | null): FormData; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormDataEvent) */ +interface FormDataEvent extends Event { + /** + * Returns a FormData object representing names and values of elements associated to the target form. Operations on the FormData object will affect form data to be submitted. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormDataEvent/formData) + */ + readonly formData: FormData; +} + +declare var FormDataEvent: { + prototype: FormDataEvent; + new(type: string, eventInitDict: FormDataEventInit): FormDataEvent; +}; + +/** + * A change in volume. It is an AudioNode audio-processing module that causes a given gain to be applied to the input data before its propagation to the output. A GainNode always has exactly one input and one output, both with the same number of channels. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GainNode) + */ +interface GainNode extends AudioNode { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GainNode/gain) */ + readonly gain: AudioParam; +} + +declare var GainNode: { + prototype: GainNode; + new(context: BaseAudioContext, options?: GainOptions): GainNode; +}; + +/** + * This Gamepad API interface defines an individual gamepad or other controller, allowing access to information such as button presses, axis positions, and id. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Gamepad) + */ +interface Gamepad { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Gamepad/axes) */ + readonly axes: ReadonlyArray; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Gamepad/buttons) */ + readonly buttons: ReadonlyArray; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Gamepad/connected) */ + readonly connected: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Gamepad/id) */ + readonly id: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Gamepad/index) */ + readonly index: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Gamepad/mapping) */ + readonly mapping: GamepadMappingType; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Gamepad/timestamp) */ + readonly timestamp: DOMHighResTimeStamp; + readonly vibrationActuator: GamepadHapticActuator; +} + +declare var Gamepad: { + prototype: Gamepad; + new(): Gamepad; +}; + +/** + * An individual button of a gamepad or other controller, allowing access to the current state of different types of buttons available on the control device. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GamepadButton) + */ +interface GamepadButton { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GamepadButton/pressed) */ + readonly pressed: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GamepadButton/touched) */ + readonly touched: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GamepadButton/value) */ + readonly value: number; +} + +declare var GamepadButton: { + prototype: GamepadButton; + new(): GamepadButton; +}; + +/** + * This Gamepad API interface contains references to gamepads connected to the system, which is what the gamepad events Window.gamepadconnected and Window.gamepaddisconnected are fired in response to. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GamepadEvent) + */ +interface GamepadEvent extends Event { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GamepadEvent/gamepad) */ + readonly gamepad: Gamepad; +} + +declare var GamepadEvent: { + prototype: GamepadEvent; + new(type: string, eventInitDict: GamepadEventInit): GamepadEvent; +}; + +/** + * This Gamepad API interface represents hardware in the controller designed to provide haptic feedback to the user (if available), most commonly vibration hardware. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GamepadHapticActuator) + */ +interface GamepadHapticActuator { + playEffect(type: GamepadHapticEffectType, params?: GamepadEffectParameters): Promise; + reset(): Promise; +} + +declare var GamepadHapticActuator: { + prototype: GamepadHapticActuator; + new(): GamepadHapticActuator; +}; + +interface GenericTransformStream { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream/readable) */ + readonly readable: ReadableStream; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream/writable) */ + readonly writable: WritableStream; +} + +/** + * An object able to programmatically obtain the position of the device. It gives Web content access to the location of the device. This allows a Web site or app to offer customized results based on the user's location. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Geolocation) + */ +interface Geolocation { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Geolocation/clearWatch) */ + clearWatch(watchId: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Geolocation/getCurrentPosition) */ + getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback | null, options?: PositionOptions): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Geolocation/watchPosition) */ + watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback | null, options?: PositionOptions): number; +} + +declare var Geolocation: { + prototype: Geolocation; + new(): Geolocation; +}; + +/** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GeolocationCoordinates) + */ +interface GeolocationCoordinates { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GeolocationCoordinates/accuracy) */ + readonly accuracy: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GeolocationCoordinates/altitude) */ + readonly altitude: number | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GeolocationCoordinates/altitudeAccuracy) */ + readonly altitudeAccuracy: number | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GeolocationCoordinates/heading) */ + readonly heading: number | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GeolocationCoordinates/latitude) */ + readonly latitude: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GeolocationCoordinates/longitude) */ + readonly longitude: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GeolocationCoordinates/speed) */ + readonly speed: number | null; +} + +declare var GeolocationCoordinates: { + prototype: GeolocationCoordinates; + new(): GeolocationCoordinates; +}; + +/** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GeolocationPosition) + */ +interface GeolocationPosition { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GeolocationPosition/coords) */ + readonly coords: GeolocationCoordinates; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GeolocationPosition/timestamp) */ + readonly timestamp: EpochTimeStamp; +} + +declare var GeolocationPosition: { + prototype: GeolocationPosition; + new(): GeolocationPosition; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GeolocationPositionError) */ +interface GeolocationPositionError { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GeolocationPositionError/code) */ + readonly code: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GeolocationPositionError/message) */ + readonly message: string; + readonly PERMISSION_DENIED: 1; + readonly POSITION_UNAVAILABLE: 2; + readonly TIMEOUT: 3; +} + +declare var GeolocationPositionError: { + prototype: GeolocationPositionError; + new(): GeolocationPositionError; + readonly PERMISSION_DENIED: 1; + readonly POSITION_UNAVAILABLE: 2; + readonly TIMEOUT: 3; +}; + +interface GlobalEventHandlersEventMap { + "abort": UIEvent; + "animationcancel": AnimationEvent; + "animationend": AnimationEvent; + "animationiteration": AnimationEvent; + "animationstart": AnimationEvent; + "auxclick": MouseEvent; + "beforeinput": InputEvent; + "beforetoggle": Event; + "blur": FocusEvent; + "cancel": Event; + "canplay": Event; + "canplaythrough": Event; + "change": Event; + "click": MouseEvent; + "close": Event; + "compositionend": CompositionEvent; + "compositionstart": CompositionEvent; + "compositionupdate": CompositionEvent; + "contextmenu": MouseEvent; + "copy": ClipboardEvent; + "cuechange": Event; + "cut": ClipboardEvent; + "dblclick": MouseEvent; + "drag": DragEvent; + "dragend": DragEvent; + "dragenter": DragEvent; + "dragleave": DragEvent; + "dragover": DragEvent; + "dragstart": DragEvent; + "drop": DragEvent; + "durationchange": Event; + "emptied": Event; + "ended": Event; + "error": ErrorEvent; + "focus": FocusEvent; + "focusin": FocusEvent; + "focusout": FocusEvent; + "formdata": FormDataEvent; + "gotpointercapture": PointerEvent; + "input": Event; + "invalid": Event; + "keydown": KeyboardEvent; + "keypress": KeyboardEvent; + "keyup": KeyboardEvent; + "load": Event; + "loadeddata": Event; + "loadedmetadata": Event; + "loadstart": Event; + "lostpointercapture": PointerEvent; + "mousedown": MouseEvent; + "mouseenter": MouseEvent; + "mouseleave": MouseEvent; + "mousemove": MouseEvent; + "mouseout": MouseEvent; + "mouseover": MouseEvent; + "mouseup": MouseEvent; + "paste": ClipboardEvent; + "pause": Event; + "play": Event; + "playing": Event; + "pointercancel": PointerEvent; + "pointerdown": PointerEvent; + "pointerenter": PointerEvent; + "pointerleave": PointerEvent; + "pointermove": PointerEvent; + "pointerout": PointerEvent; + "pointerover": PointerEvent; + "pointerup": PointerEvent; + "progress": ProgressEvent; + "ratechange": Event; + "reset": Event; + "resize": UIEvent; + "scroll": Event; + "scrollend": Event; + "securitypolicyviolation": SecurityPolicyViolationEvent; + "seeked": Event; + "seeking": Event; + "select": Event; + "selectionchange": Event; + "selectstart": Event; + "slotchange": Event; + "stalled": Event; + "submit": SubmitEvent; + "suspend": Event; + "timeupdate": Event; + "toggle": Event; + "touchcancel": TouchEvent; + "touchend": TouchEvent; + "touchmove": TouchEvent; + "touchstart": TouchEvent; + "transitioncancel": TransitionEvent; + "transitionend": TransitionEvent; + "transitionrun": TransitionEvent; + "transitionstart": TransitionEvent; + "volumechange": Event; + "waiting": Event; + "webkitanimationend": Event; + "webkitanimationiteration": Event; + "webkitanimationstart": Event; + "webkittransitionend": Event; + "wheel": WheelEvent; +} + +interface GlobalEventHandlers { + /** + * Fires when the user aborts the download. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/abort_event) + */ + onabort: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/animationcancel_event) */ + onanimationcancel: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/animationend_event) */ + onanimationend: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/animationiteration_event) */ + onanimationiteration: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/animationstart_event) */ + onanimationstart: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/auxclick_event) */ + onauxclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/beforeinput_event) */ + onbeforeinput: ((this: GlobalEventHandlers, ev: InputEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/beforetoggle_event) */ + onbeforetoggle: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Fires when the object loses the input focus. + * @param ev The focus event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/blur_event) + */ + onblur: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLDialogElement/cancel_event) */ + oncancel: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when playback is possible, but would require further buffering. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/canplay_event) + */ + oncanplay: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/canplaythrough_event) */ + oncanplaythrough: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Fires when the contents of the object or selection have changed. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/change_event) + */ + onchange: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Fires when the user clicks the left mouse button on the object + * @param ev The mouse event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/click_event) + */ + onclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLDialogElement/close_event) */ + onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Fires when the user clicks the right mouse button in the client area, opening the context menu. + * @param ev The mouse event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/contextmenu_event) + */ + oncontextmenu: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/copy_event) */ + oncopy: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLTrackElement/cuechange_event) */ + oncuechange: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/cut_event) */ + oncut: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null; + /** + * Fires when the user double-clicks the object. + * @param ev The mouse event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/dblclick_event) + */ + ondblclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + /** + * Fires on the source object continuously during a drag operation. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/drag_event) + */ + ondrag: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; + /** + * Fires on the source object when the user releases the mouse at the close of a drag operation. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/dragend_event) + */ + ondragend: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; + /** + * Fires on the target element when the user drags the object to a valid drop target. + * @param ev The drag event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/dragenter_event) + */ + ondragenter: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; + /** + * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation. + * @param ev The drag event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/dragleave_event) + */ + ondragleave: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; + /** + * Fires on the target element continuously while the user drags the object over a valid drop target. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/dragover_event) + */ + ondragover: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; + /** + * Fires on the source object when the user starts to drag a text selection or selected object. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/dragstart_event) + */ + ondragstart: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/drop_event) */ + ondrop: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; + /** + * Occurs when the duration attribute is updated. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/durationchange_event) + */ + ondurationchange: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when the media element is reset to its initial state. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/emptied_event) + */ + onemptied: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when the end of playback is reached. + * @param ev The event + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/ended_event) + */ + onended: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Fires when an error occurs during object loading. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/error_event) + */ + onerror: OnErrorEventHandler; + /** + * Fires when the object receives focus. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/focus_event) + */ + onfocus: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLFormElement/formdata_event) */ + onformdata: ((this: GlobalEventHandlers, ev: FormDataEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/gotpointercapture_event) */ + ongotpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/input_event) */ + oninput: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLInputElement/invalid_event) */ + oninvalid: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Fires when the user presses a key. + * @param ev The keyboard event + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/keydown_event) + */ + onkeydown: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null; + /** + * Fires when the user presses an alphanumeric key. + * @param ev The event. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/keypress_event) + */ + onkeypress: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null; + /** + * Fires when the user releases a key. + * @param ev The keyboard event + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/keyup_event) + */ + onkeyup: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null; + /** + * Fires immediately after the browser loads the object. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGElement/load_event) + */ + onload: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when media data is loaded at the current playback position. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/loadeddata_event) + */ + onloadeddata: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when the duration and dimensions of the media have been determined. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/loadedmetadata_event) + */ + onloadedmetadata: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when Internet Explorer begins looking for media data. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/loadstart_event) + */ + onloadstart: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/lostpointercapture_event) */ + onlostpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; + /** + * Fires when the user clicks the object with either mouse button. + * @param ev The mouse event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/mousedown_event) + */ + onmousedown: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/mouseenter_event) */ + onmouseenter: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/mouseleave_event) */ + onmouseleave: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + /** + * Fires when the user moves the mouse over the object. + * @param ev The mouse event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/mousemove_event) + */ + onmousemove: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + /** + * Fires when the user moves the mouse pointer outside the boundaries of the object. + * @param ev The mouse event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/mouseout_event) + */ + onmouseout: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + /** + * Fires when the user moves the mouse pointer into the object. + * @param ev The mouse event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/mouseover_event) + */ + onmouseover: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + /** + * Fires when the user releases a mouse button while the mouse is over the object. + * @param ev The mouse event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/mouseup_event) + */ + onmouseup: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/paste_event) */ + onpaste: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null; + /** + * Occurs when playback is paused. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/pause_event) + */ + onpause: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when the play method is requested. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/play_event) + */ + onplay: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when the audio or video has started playing. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/playing_event) + */ + onplaying: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/pointercancel_event) */ + onpointercancel: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/pointerdown_event) */ + onpointerdown: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/pointerenter_event) */ + onpointerenter: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/pointerleave_event) */ + onpointerleave: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/pointermove_event) */ + onpointermove: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/pointerout_event) */ + onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/pointerover_event) */ + onpointerover: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/pointerup_event) */ + onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; + /** + * Occurs to indicate progress while downloading media data. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/progress_event) + */ + onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent) => any) | null; + /** + * Occurs when the playback rate is increased or decreased. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/ratechange_event) + */ + onratechange: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Fires when the user resets a form. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLFormElement/reset_event) + */ + onreset: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLVideoElement/resize_event) */ + onresize: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null; + /** + * Fires when the user repositions the scroll box in the scroll bar on the object. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/scroll_event) + */ + onscroll: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/scrollend_event) */ + onscrollend: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/securitypolicyviolation_event) */ + onsecuritypolicyviolation: ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any) | null; + /** + * Occurs when the seek operation ends. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/seeked_event) + */ + onseeked: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when the current playback position is moved. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/seeking_event) + */ + onseeking: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Fires when the current selection changes. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLInputElement/select_event) + */ + onselect: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/selectionchange_event) */ + onselectionchange: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/selectstart_event) */ + onselectstart: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLSlotElement/slotchange_event) */ + onslotchange: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when the download has stopped. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/stalled_event) + */ + onstalled: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLFormElement/submit_event) */ + onsubmit: ((this: GlobalEventHandlers, ev: SubmitEvent) => any) | null; + /** + * Occurs if the load operation has been intentionally halted. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/suspend_event) + */ + onsuspend: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs to indicate the current playback position. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/timeupdate_event) + */ + ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLDetailsElement/toggle_event) */ + ontoggle: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/touchcancel_event) */ + ontouchcancel?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/touchend_event) */ + ontouchend?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/touchmove_event) */ + ontouchmove?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/touchstart_event) */ + ontouchstart?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/transitioncancel_event) */ + ontransitioncancel: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/transitionend_event) */ + ontransitionend: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/transitionrun_event) */ + ontransitionrun: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/transitionstart_event) */ + ontransitionstart: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null; + /** + * Occurs when the volume is changed, or playback is muted or unmuted. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/volumechange_event) + */ + onvolumechange: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when playback stops because the next frame of a video resource is not available. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/waiting_event) + */ + onwaiting: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * @deprecated This is a legacy alias of `onanimationend`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/animationend_event) + */ + onwebkitanimationend: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * @deprecated This is a legacy alias of `onanimationiteration`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/animationiteration_event) + */ + onwebkitanimationiteration: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * @deprecated This is a legacy alias of `onanimationstart`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/animationstart_event) + */ + onwebkitanimationstart: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * @deprecated This is a legacy alias of `ontransitionend`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/transitionend_event) + */ + onwebkittransitionend: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/wheel_event) */ + onwheel: ((this: GlobalEventHandlers, ev: WheelEvent) => any) | null; + addEventListener(type: K, listener: (this: GlobalEventHandlers, ev: GlobalEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: GlobalEventHandlers, ev: GlobalEventHandlersEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAllCollection) */ +interface HTMLAllCollection { + /** + * Returns the number of elements in the collection. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAllCollection/length) + */ + readonly length: number; + /** + * Returns the item with index index from the collection (determined by tree order). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAllCollection/item) + */ + item(nameOrIndex?: string): HTMLCollection | Element | null; + /** + * Returns the item with ID or name name from the collection. + * + * If there are multiple matching items, then an HTMLCollection object containing all those elements is returned. + * + * Only button, form, iframe, input, map, meta, object, select, and textarea elements can have a name for the purpose of this method; their name is given by the value of their name attribute. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAllCollection/namedItem) + */ + namedItem(name: string): HTMLCollection | Element | null; + [index: number]: Element; +} + +declare var HTMLAllCollection: { + prototype: HTMLAllCollection; + new(): HTMLAllCollection; +}; + +/** + * Hyperlink elements and provides special properties and methods (beyond those of the regular HTMLElement object interface that they inherit from) for manipulating the layout and presentation of such elements. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement) + */ +interface HTMLAnchorElement extends HTMLElement, HTMLHyperlinkElementUtils { + /** + * Sets or retrieves the character set used to encode the object. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/charset) + */ + charset: string; + /** + * Sets or retrieves the coordinates of the object. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/coords) + */ + coords: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/download) */ + download: string; + /** + * Sets or retrieves the language code of the object. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/hreflang) + */ + hreflang: string; + /** + * Sets or retrieves the shape of the object. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/name) + */ + name: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/ping) */ + ping: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/referrerPolicy) */ + referrerPolicy: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/rel) + */ + rel: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/relList) */ + readonly relList: DOMTokenList; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/rev) + */ + rev: string; + /** + * Sets or retrieves the shape of the object. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/shape) + */ + shape: string; + /** + * Sets or retrieves the window or frame at which to target content. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/target) + */ + target: string; + /** + * Retrieves or sets the text of the object as a string. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/text) + */ + text: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/type) */ + type: string; + addEventListener(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var HTMLAnchorElement: { + prototype: HTMLAnchorElement; + new(): HTMLAnchorElement; +}; + +/** + * Provides special properties and methods (beyond those of the regular object HTMLElement interface it also has available to it by inheritance) for manipulating the layout and presentation of elements. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAreaElement) + */ +interface HTMLAreaElement extends HTMLElement, HTMLHyperlinkElementUtils { + /** + * Sets or retrieves a text alternative to the graphic. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAreaElement/alt) + */ + alt: string; + /** + * Sets or retrieves the coordinates of the object. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAreaElement/coords) + */ + coords: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAreaElement/download) */ + download: string; + /** + * Sets or gets whether clicks in this region cause action. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAreaElement/noHref) + */ + noHref: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAreaElement/ping) */ + ping: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAreaElement/referrerPolicy) */ + referrerPolicy: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAreaElement/rel) */ + rel: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAreaElement/relList) */ + readonly relList: DOMTokenList; + /** + * Sets or retrieves the shape of the object. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAreaElement/shape) + */ + shape: string; + /** + * Sets or retrieves the window or frame at which to target content. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAreaElement/target) + */ + target: string; + addEventListener(type: K, listener: (this: HTMLAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: HTMLAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var HTMLAreaElement: { + prototype: HTMLAreaElement; + new(): HTMLAreaElement; +}; + +/** + * Provides access to the properties of