diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index 694acf1ef..000000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,20 +0,0 @@ -module.exports = { - root: true, - env: { - node: true, - browser: true, - }, - parser: "@typescript-eslint/parser", - plugins: ["@typescript-eslint"], - extends: [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "plugin:prettier/recommended", - ], - rules: { - "no-prototype-builtins": 0, - "@typescript-eslint/no-explicit-any": 0, - "@typescript-eslint/no-non-null-assertion": 0, - "@typescript-eslint/no-var-requires": 0, - }, -}; diff --git a/.gitattributes b/.gitattributes index 1ff0c4230..a96eb6095 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,7 +1,7 @@ ############################################################################### # Set default behavior to automatically normalize line endings. ############################################################################### -* text=auto +* text=auto eol=lf ############################################################################### # Set default behavior for command prompt diff. @@ -61,3 +61,9 @@ #*.PDF diff=astextplain #*.rtf diff=astextplain #*.RTF diff=astextplain + +############################################################################### +# Show manual patches in the language stats +############################################################################### +*.jsonc linguist-detectable +*.kdl linguist-detectable diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 394e627a2..52bc70233 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,5 +1,6 @@ src/**/*.ts @saschanaz baselines/* @saschanaz inputfiles/**/* @saschanaz +unittests/**/* @saschanaz README.md @saschanaz -package-lock.json @saschanaz \ No newline at end of file +package-lock.json @saschanaz diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..bbac19427 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,6 @@ +blank_issues_enabled: true +issue_templates: + - name: Web API type definition issue + description: Report inconsistencies between TypeScript's web API typings and browser behavior. + labels: [lib.d.ts bug] + file: web_api_type_definition_issue.yml diff --git a/.github/ISSUE_TEMPLATE/web_api_type_definition_issue.yml b/.github/ISSUE_TEMPLATE/web_api_type_definition_issue.yml new file mode 100644 index 000000000..7e73193ab --- /dev/null +++ b/.github/ISSUE_TEMPLATE/web_api_type_definition_issue.yml @@ -0,0 +1,57 @@ +name: "Web API type definition issue" +title: "[Web API type definition issue] " +labels: [lib.d.ts bug] +assignees: [] +description: "Report inconsistencies between TypeScript's web API typings and browser behavior." +body: + - type: markdown + attributes: + value: | + ## Web API Type Definition Issue + Provide details of the issue. + - type: input + id: issue_summary + attributes: + label: "Summary" + description: "Brief summary of the issue" + placeholder: "e.g., Mismatch in event handling..." + validations: + required: true + - type: textarea + id: expected_vs_actual + attributes: + label: "Expected vs. Actual Behavior" + description: "Describe what you expected and what actually happened" + placeholder: "Expected: ...\nActual: ..." + validations: + required: true + - type: input + id: playground_link + attributes: + label: "Playground Link" + description: "Paste the TypeScript playground link" + placeholder: "https://www.typescriptlang.org/play/..." + - type: checkboxes + id: browser_support + attributes: + label: "Browser Support" + description: "Ensure that the API is supported in at least two major browser engines (not two Chromium-based browsers)." + options: + - label: "This API is supported in at least two major browser engines (not two Chromium-based browsers)." + required: true + - type: checkboxes + id: tried_latest_releases + attributes: + label: "Have Tried The Latest Releases" + description: "Make sure your problem is still reproducible on the latest releases." + options: + - label: "This issue applies to the latest release of TypeScript." + required: true + - label: "This issue applies to the latest release of `@types/web`." + required: true + - type: textarea + id: additional_context + attributes: + label: "Additional Context" + description: "Any extra information, logs, or references." + placeholder: "Optional details..." diff --git a/.github/codeql/codeql-configuration.yml b/.github/codeql/codeql-configuration.yml new file mode 100644 index 000000000..402799f89 --- /dev/null +++ b/.github/codeql/codeql-configuration.yml @@ -0,0 +1,4 @@ +name : CodeQL Configuration + +paths: + - './src' diff --git a/.github/dependabot.yml b/.github/dependabot.yml index df68c0122..897047b8d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -10,5 +10,28 @@ updates: # Check the npm registry for updates every month schedule: interval: "monthly" - # Bump versions only in package-lock.json - versioning-strategy: "lockfile-only" + # Usually only bump versions in package-lock.json, but update package.json for major version updates + versioning-strategy: "increase-if-necessary" + # Update all dependencies in a single PR + groups: + # ESLint usually requires updating together for major updates + eslint: + patterns: + - "eslint*" + - "@eslint/*" + - "@typescript-eslint/*" + - "typescript-eslint" + # Other updates should be okay all at once + dev-dependencies: + patterns: + - "*" + exclude-patterns: + - "@mdn/*" + - "@webref/*" + # Enable version updates for GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" + cooldown: + default-days: 7 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 751faed10..b3e2c00ce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,12 +6,13 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 + - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 with: - node-version: "15" + node-version: "lts/*" cache: npm - run: npm ci - run: npm run build - run: npm test + - run: npx tsgo diff --git a/.github/workflows/codeowners-merge.yml b/.github/workflows/codeowners-merge.yml index 53ad9e8e0..e2002aa18 100644 --- a/.github/workflows/codeowners-merge.yml +++ b/.github/workflows/codeowners-merge.yml @@ -4,18 +4,23 @@ on: issue_comment: { types: [created] } pull_request_review: { types: [submitted] } +permissions: + contents: write + issues: write + pull-requests: write + jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - name: Run Codeowners merge check - uses: OSS-Docs-Tools/code-owner-self-merge@1.5.4 + uses: OSS-Docs-Tools/code-owner-self-merge@35e0f55671d1cebd7c0a53e199cb3a3a03678c2b # 1.6.8 if: github.repository == 'microsoft/TypeScript-DOM-lib-generator' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: merge_method: 'squash' if_no_maintainers_add_label: 'maintainers' - if_no_maintainers_assign: '@orta @sandersn' + if_no_maintainers_assign: '@sandersn @jakebailey' diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 000000000..23d65eab0 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,100 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL Advanced" + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + schedule: + - cron: '19 8 * * 6' + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + # Runner size impacts CodeQL analysis time. To learn more, please see: + # - https://gh.io/recommended-hardware-resources-for-running-codeql + # - https://gh.io/supported-runners-and-hardware-resources + # - https://gh.io/using-larger-runners (GitHub.com only) + # Consider using larger runners or machines with greater resources for possible analysis time improvements. + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} + permissions: + # required for all workflows + security-events: write + + # required to fetch internal or private CodeQL packs + packages: read + + # only required for workflows in private repositories + actions: read + contents: read + + strategy: + fail-fast: false + matrix: + include: + - language: actions + build-mode: none + - language: javascript-typescript + build-mode: none + # CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift' + # Use `c-cpp` to analyze code written in C, C++ or both + # Use 'java-kotlin' to analyze code written in Java, Kotlin or both + # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both + # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis, + # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning. + # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how + # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages + steps: + - name: Checkout repository + uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 + + # Add any setup steps before running the `github/codeql-action/init` action. + # This includes steps like installing compilers or runtimes (`actions/setup-node` + # or others). This is typically only required for manual builds. + # - name: Setup runtime (example) + # uses: actions/setup-example@v1 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + # If the analyze step fails for one of the languages you are analyzing with + # "We were unable to automatically build your code", modify the matrix above + # to set the build mode to "manual" for that language. Then modify this step + # to build your code. + # ℹ️ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + - if: matrix.build-mode == 'manual' + shell: bash + run: | + echo 'If you are using a "manual" build mode for one or more of the' \ + 'languages you are analyzing, replace this with the commands to build' \ + 'your code, for example:' + echo ' make bootstrap' + echo ' make release' + exit 1 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 3c6423a72..9dcaa0691 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,21 +1,27 @@ name: Deploy to npm on: - push: - branches: - - main - + schedule: + # Daily run + - cron: "0 4 * * *" workflow_dispatch: null + +permissions: + contents: write + jobs: deploy: + if: github.repository == 'microsoft/TypeScript-DOM-lib-generator' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 + with: + submodules: true # Ensures submodules are cloned + + - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 with: - node-version: "15.x" - registry-url: "https://registry.npmjs.org" + node-version: "lts/*" cache: npm - run: git pull --tags @@ -26,9 +32,12 @@ jobs: - name: Create packages for .d.ts files run: node deploy/createTypesPackages.js - # Deploy anything which differs from the npm version of a tsconfig - name: "Deploy built packages to NPM" - run: node deploy/deployChangedPackages.js + run: | + echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc + npm i -g npm@latest + npm whoami + node deploy/deployChangedPackages.js env: - NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} + NPM_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test_typescript.yml b/.github/workflows/test_typescript.yml index 9e75c34df..3fa39cc3c 100644 --- a/.github/workflows/test_typescript.yml +++ b/.github/workflows/test_typescript.yml @@ -13,10 +13,11 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 + + - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 with: - node-version: "15" + node-version: "lts/*" cache: npm - name: Run TypeScript Compiler Tests with new dom.d.ts diff --git a/.github/workflows/update-core-deps.yml b/.github/workflows/update-core-deps.yml index 187cd9ee0..206a65e71 100644 --- a/.github/workflows/update-core-deps.yml +++ b/.github/workflows/update-core-deps.yml @@ -5,31 +5,71 @@ on: # https://crontab.guru/#5_8_*_*_* - cron: "5 8 * * *" +permissions: + contents: read + id-token: write + # Conditional runs # https://stackoverflow.com/a/61832535/2460034 jobs: update-webref: runs-on: ubuntu-latest + environment: + name: azure + deployment: false steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + with: + persist-credentials: false + + - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 with: - node-version: "15" + node-version: "lts/*" cache: npm # Use ncu to detect major version changes - run: npm i -g npm-check-updates - - run: ncu -u + - run: ncu -u @mdn* @webref* - run: npm i - run: git restore package.json - - run: npm run build && npm run baseline-accept + # package-lock wants to remember the original version numbers of package.json + # This prevents annoying change when contributors run `npm i` on their local machine. + # Example: https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1463 + - run: npm i + - name: Update MDN Data + run: node scripts/fetch-mdn.js + - id: build + run: npm run generate + continue-on-error: true + - uses: azure/login@532459ea530d8321f2fb9bb10d1e0bcf23869a43 # v3.0.0 + with: + client-id: ${{ vars.AZURE_CLIENT_ID }} + tenant-id: ${{ vars.AZURE_TENANT_ID }} + subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }} + - name: Create GitHub App token + id: app-token + uses: microsoft/create-github-app-token-via-key-vault@5ba0d436e9c3cac52feff4d1f2f66f9698ce4a2d # v1 + with: + client-id: ${{ vars.TYPESCRIPT_AUTOMATION_GITHUB_APP_CLIENT_ID }} + key-id: ${{ vars.TYPESCRIPT_AUTOMATION_GITHUB_APP_KEY_ID }} + owner: microsoft + repositories: TypeScript-DOM-lib-generator + permission-contents: write + permission-issues: write + permission-pull-requests: write + - if: ${{ steps.build.outcome == 'failure' }} + run: node deploy/onUpdateFailure.js + env: + GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} - id: git-diff run: git diff --quiet HEAD baselines continue-on-error: true - - uses: peter-evans/create-pull-request@v3 + - uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 if: ${{ steps.git-diff.outcome == 'failure' }} with: - commit-message: "chore(package): update core dependencies" - title: "chore(package): update core dependencies" + commit-message: "🤖 Update core dependencies" + title: "Update core dependencies" + author: "typescript-automation[bot] <290192711+typescript-automation[bot]@users.noreply.github.com>" + committer: "typescript-automation[bot] <290192711+typescript-automation[bot]@users.noreply.github.com>" branch: update-core-deps - token: ${{ secrets.TS_GITHUB_BOT_AUTH }} + token: ${{ steps.app-token.outputs.token }} diff --git a/.gitignore b/.gitignore index bb63c80db..1ab4d9d63 100644 --- a/.gitignore +++ b/.gitignore @@ -279,10 +279,9 @@ __pycache__/ # !tools/packages.config generated/ -lib/ inputfiles/browser.webidl.json .vscode/* !.vscode/launch.template.json yarn.lock TypeScript -deploy/generated \ No newline at end of file +deploy/generated diff --git a/.mailMap b/.mailMap deleted file mode 100644 index 0722bb9f5..000000000 --- a/.mailMap +++ /dev/null @@ -1,97 +0,0 @@ -Aaron Holmes Aaron Holmes -Akshar Patel -Ali Sabzevari -Aliaksandr Radzivanovich -BuildTools # Franklin Tse -ChogyDan # Daniel Hollocher -Daniel Rosenwasser Daniel Rosenwasser Daniel Rosenwasser -David Kmenta -E020873 # Nicolas Henry -Elisée Maurer -Emilio García-Pumarino dashaus -Guilherme Oenning -Herrington Darkholme -Ivo Gabe de Wolff -Joey Wilson -Jonathon Smith -Juan Luis Boya García -Kagami Sascha Rosylight -Lucien Greathouse -Martin Vseticka -Mattias Buelens -Michael Bromley -Mohamed Hegazy -Nathan Shively-Sanders -Paul Jolly -Perry Jiang -Peter Burns -Robert Coie -Ryan Cavanaugh -Thomas Loubiou -Tim Perry -Vidar Tonaas Fauske -Viktor Zozulyak -York Yao york yao yaoyao york yao -Yuichi Nukiyama YuichiNukiyama -Zhengbo Li Zhengbo Li zhengbli tinza123 -falsandtru # @falsandtru -rix # Richard Sentino -rohitverma007 # Rohit Verma -Akinmade Bond -alfaslash # Artem Roshko -Andy Hanson -Argelius Andreas -arjunyel # @arjunyel -Christian Silver -cronon # @cronon -Diullei Gomes -Gabriel Pena Calero -Logan Mzz -Luc-Edmond Gaspard -Nico Kemnitz -Stanislav Vasilev -Tuure Savuoja -VincentBel # Vincent Bel - -Adam Hines Adam J. Hines -Alex Eagle -alexlur -Carlos Galarza -Diogo Franco (Kovensky) -Eugene Timokhov -Heejong Ahn -Marco Aurélio Marco Buono -Michael James -Pablo Rodríguez -Pedro Ferreira -Philip Bulley -Sid Raval -Tanguy Krotoff -Tudor Gergely -Wesley Wigham - -Vincent -Simon -t_ -yokomotod - -1000ch # Shogo Sensui -Andrei Volchenko -Benjamin Solum -Cheung Chifung -Ciro k1r0s -Dylan Cutler -Elliott Marquez -Jiří Pudil -John Patterson -Josh Thomas Josh Thomas -Kakeru Ishii -Marius Schulz -Mihal Malostanidis qm3ster # Mihal Malostanidis -muj-beg Muj.Beg Muj.Beg # Muj Beg -Oussama Ben Brahim -Robert Hill Pappa # Robert Hill -Priyantha Lankapura -vvakame # Masahiro Wakame -Yin Zhikai -薛定谔的猫 # Aladdin ADD \ No newline at end of file diff --git a/.npmrc b/.npmrc deleted file mode 100644 index 6a53f1de4..000000000 --- a/.npmrc +++ /dev/null @@ -1 +0,0 @@ -message="chore(package): bump version number to v%s" diff --git a/AUTHORS.md b/AUTHORS.md deleted file mode 100644 index e6ad42dfb..000000000 --- a/AUTHORS.md +++ /dev/null @@ -1,57 +0,0 @@ -TypeScript library is authored by: - -* Aaron Holmes -* Akinmade Bond -* Akshar Patel -* Ali Sabzevari -* Aliaksandr Radzivanovich -* Andy Hanson -* Argelius Andreas -* @arjunyel -* Artem Roshko -* Christian Silver -* @cronon -* Daniel Hollocher -* Daniel Rosenwasser -* David Kmenta -* Diullei Gomes -* Elisée Maurer -* Emilio García-Pumarino -* @falsandtru -* Franklin Tse -* Gabriel Pena Calero -* Guilherme Oenning -* Herrington Darkholme -* Ivo Gabe de Wolff -* Joey Wilson -* Jonathon Smith -* Juan Luis Boya García -* Kagami Sascha Rosylight -* Logan Mzz -* Luc-Edmond Gaspard -* Lucien Greathouse -* Martin Vseticka -* Mattias Buelens -* Michael Bromley -* Mohamed Hegazy -* Natalie Coley -* Nathan Shively-Sanders -* Nico Kemnitz -* Nicolas Henry -* Paul Jolly -* Perry Jiang -* Peter Burns -* Richard Sentino -* Robert Coie -* Rohit Verma -* Ryan Cavanaugh -* Stanislav Vasilev -* Thomas Loubiou -* Tim Perry -* Tuure Savuoja -* Vidar Tonaas Fauske -* Viktor Zozulyak -* Vincent Bel -* York Yao -* Yuichi Nukiyama -* Zhengbo Li \ No newline at end of file diff --git a/README.md b/README.md index aee8d4ec5..78ef2b4de 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This tool is used to generate the web-based `lib.dom.d.ts` file which is include A feature needs to be supported by two or more major browser engines to be included here, to make sure there is a good consensus among vendors: __Gecko__ (Firefox), __Blink__ (Chrome/Edge), and __WebKit__ (Safari). -If the condition is met but still is not available here, first check the [contribution guidelines](#contribution-guidelines) below and then please [file an issue](hthttps://github.com/microsoft/TypeScript-DOM-lib-generator/issues/new). +If the condition is met but still is not available here, first check the [contribution guidelines](#contribution-guidelines) below and then please [file an issue](https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/new). ## Build Instructions @@ -32,9 +32,23 @@ npm run test ## `@types/[lib]` to TypeScript Versions | `@types/[lib]` version | TypeScript Version | Minimum TypeScript Support | -| ---------------------------------------------------------------------- | ----------- | -------------- | -| `@types/web` [0.0.1](https://www.npmjs.com/package/@types/web/v/0.0.1) | ~4.3 | 4.4 | -| `@types/web` [0.0.2](https://www.npmjs.com/package/@types/web/v/0.0.2) | ~4.4 beta | 4.4 | +| ------------------------------------------------------------------------- | ----------- | -------------- | +| `@types/web` [0.0.1](https://www.npmjs.com/package/@types/web/v/0.0.1) | ~4.3 | 4.4 | +| `@types/web` [0.0.2](https://www.npmjs.com/package/@types/web/v/0.0.2) | ~4.4 beta | 4.4 | +| `@types/web` [0.0.25](https://www.npmjs.com/package/@types/web/v/0.0.25) | 4.4 | 4.4 | +| `@types/web` [0.0.28](https://www.npmjs.com/package/@types/web/v/0.0.28) | 4.5 beta | 4.4 | +| `@types/web` [0.0.37](https://www.npmjs.com/package/@types/web/v/0.0.37) | 4.5 rc | 4.4 | +| `@types/web` [0.0.37](https://www.npmjs.com/package/@types/web/v/0.0.37) | 4.5 | 4.4 | +| `@types/web` [0.0.50](https://www.npmjs.com/package/@types/web/v/0.0.50) | 4.6 beta | 4.4 | +| `@types/web` [0.0.51](https://www.npmjs.com/package/@types/web/v/0.0.51) | 4.6 rc | 4.4 | +| `@types/web` [0.0.51](https://www.npmjs.com/package/@types/web/v/0.0.51) | 4.6 | 4.4 | +| `@types/web` [0.0.61](https://www.npmjs.com/package/@types/web/v/0.0.61) | 4.7 beta | 4.4 | +| `@types/web` [0.0.61](https://www.npmjs.com/package/@types/web/v/0.0.61) | 4.7 rc | 4.4 | +| `@types/web` [0.0.61](https://www.npmjs.com/package/@types/web/v/0.0.61) | 4.7 | 4.4 | +| `@types/web` [0.0.68](https://www.npmjs.com/package/@types/web/v/0.0.68) | 4.8 beta | 4.4 | +| `@types/web` [0.0.69](https://www.npmjs.com/package/@types/web/v/0.0.69) | 4.8 rc | 4.4 | +| `@types/web` [0.0.69](https://www.npmjs.com/package/@types/web/v/0.0.69) | 4.8 | 4.4 | +| `@types/web` [0.0.76](https://www.npmjs.com/package/@types/web/v/0.0.76) | 4.9 | 4.4 | ## `@types/[lib]` Minimum Target @@ -50,13 +64,13 @@ In order to make the tests pass, please update the baseline as well in any pull It's possible that the automated algorithm decided that it's not well supported by browsers and thus removed it. Say we want to add a new interface named `Foo`. Check if there is a document about that interface in [MDN](https://developer.mozilla.org/). If there is, see the browser compatibility section and check whether it's supported by two or more browser engines. (Note that Chromium-based browsers use the same browser engine and thus support from them counts as a single support.) -If all the conditions are fulfilled, it could be that the type is incorrectly removed by `inputfiles/removedTypes.jsonc`. Try finding and removing the relevant item there and run `npm run build && npm run baseline-accept`. +If all the conditions are fulfilled, it could be that the type is incorrectly removed by `inputfiles/removedTypes.jsonc`. Try finding and removing the relevant item there and run `npm run generate`. If conditions are not fulfilled but you think MDN is wrong, please file an issue at https://github.com/mdn/browser-compat-data/issues/. The type will be automatically added in a few weeks when MDN fixes their data. ### When the type exists but is wrong -It's possible that the type is too specific or too general. First you need to check whether `inputfiles/overridingTypes.jsonc` or `inputfiles/addedTypes.jsonc` have a relevant item, which can be fixed if exists. If they don't, add one in `overridingTypes.jsonc`. Run `npm run build && npm run baseline-accept` to make sure the resulting changes are what you want. +It's possible that the type is too specific or too general. First you need to check whether `inputfiles/overridingTypes.jsonc` or `inputfiles/addedTypes.jsonc` have a relevant item, which can be fixed if exists. If they don't, add one in `overridingTypes.jsonc`. Run `npm run generate` to make sure the resulting changes are what you want. If you are familiar with Web IDL, you may also want to check whether the upstream IDL itself can be made more specific. Doing so will reduce the need for manual overrides in this repository and thus can be more helpful. @@ -69,32 +83,9 @@ If you are familiar with Web IDL, you may also want to check whether the upstrea ## Input Files -- `mdn/apiDescriptions.json`: a JSON file generated by fetching API descriptions from [MDN](https://developer.mozilla.org/en-US/docs/Web/API). **Do not edit this file**. - `addedTypes.jsonc`: types that should exist but are missing from the spec data. - `overridingTypes.jsonc`: types that are defined in the spec but have TypeScript-friendly modifications in the json files. - `removedTypes.jsonc`: types that are defined in the spec but should be removed. -- `comments.json`: comment strings to be embedded in the generated .js files. -- `deprecatedMessage.json`: the reason why one type is deprecated. The reason why it is a separate file rather than merge in comment.json is mdn/apiDescriptions.json would also possibly be deprecated. - -## Deployment to TypeScript - -To migrate the *.d.ts files into TypeScript: - -1. Run: - - ```sh - npm run migrate -- [previous_types_web_version] - ``` - - The script will look in for a clone of the TypeScript repo in "../TypeScript", or "./TypeScript" to move the generated files in. Or migrate the files manually, you do you. - -1. Update the README table with the mappings for versions in the `@types/[lib]`. E.g. TS 4.5 -> `@types/web` `0.0.23`. - -1. Generate a CHANGELOG for the releases: - - ```sh - # lib from to - npm run ts-changelog -- @types/web 0.0.2 0.0.23 - ``` - -1. Add the CHANGELOG to the release issue +- `patches/*.kdl`: KDL types +- `comments.json`: comment strings to be embedded in the generated .d.ts files. +- `deprecatedMessage.json`: the reason why one type is deprecated. diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 000000000..e138ec5d6 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,41 @@ + + +## Security + +Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). + +If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below. + +## Reporting Security Issues + +**Please do not report security vulnerabilities through public GitHub issues.** + +Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report). + +If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey). + +You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). + +Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: + + * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) + * Full paths of source file(s) related to the manifestation of the issue + * The location of the affected source code (tag/branch/commit or direct URL) + * Any special configuration required to reproduce the issue + * Step-by-step instructions to reproduce the issue + * Proof-of-concept or exploit code (if possible) + * Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs. + +## Preferred Languages + +We prefer all communications to be in English. + +## Policy + +Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd). + + diff --git a/baselines/audioworklet.asynciterable.generated.d.ts b/baselines/audioworklet.asynciterable.generated.d.ts new file mode 100644 index 000000000..3b3e55b7a --- /dev/null +++ b/baselines/audioworklet.asynciterable.generated.d.ts @@ -0,0 +1,2 @@ +// This file's contents are now included in the main types file. +// The file has been left for backward compatibility. diff --git a/baselines/audioworklet.generated.d.ts b/baselines/audioworklet.generated.d.ts index 9963a2b8e..dc7ea4402 100644 --- a/baselines/audioworklet.generated.d.ts +++ b/baselines/audioworklet.generated.d.ts @@ -1,3 +1,6 @@ +/// +/// + ///////////////////////////// /// AudioWorklet APIs ///////////////////////////// @@ -5,6 +8,19 @@ interface AddEventListenerOptions extends EventListenerOptions { once?: boolean; passive?: boolean; + signal?: AbortSignal; +} + +interface CustomEventInit extends EventInit { + detail?: T; +} + +interface ErrorEventInit extends EventInit { + colno?: number; + error?: any; + filename?: string; + lineno?: number; + message?: string; } interface EventInit { @@ -25,8 +41,9 @@ interface MessageEventInit extends EventInit { source?: MessageEventSource | null; } -interface PostMessageOptions { - transfer?: any[]; +interface PromiseRejectionEventInit extends EventInit { + promise: Promise; + reason?: any; } interface QueuingStrategy { @@ -43,12 +60,36 @@ interface QueuingStrategyInit { highWaterMark: number; } -interface ReadableStreamDefaultReadDoneResult { +interface ReadableStreamBYOBReaderReadOptions { + min?: number; +} + +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?: undefined; + value: T | undefined; } -interface ReadableStreamDefaultReadValueResult { +interface ReadableStreamReadValueResult { done: false; value: T; } @@ -84,6 +125,25 @@ interface StreamPipeOptions { * 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 TextDecodeOptions { + stream?: boolean; +} + +interface TextDecoderOptions { + fatal?: boolean; + ignoreBOM?: boolean; +} + +interface TextEncoderEncodeIntoResult { + read: number; + written: number; } interface Transformer { @@ -94,6 +154,21 @@ interface Transformer { writableType?: undefined; } +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; @@ -103,16 +178,120 @@ interface UnderlyingSink { } interface UnderlyingSource { + autoAllocateChunkSize?: number; cancel?: UnderlyingSourceCancelCallback; pull?: UnderlyingSourcePullCallback; start?: UnderlyingSourceStartCallback; - type?: undefined; + type?: ReadableStreamType; +} + +/** + * The **`AbortController`** interface represents a controller object that allows you to abort one or more Web requests as and when desired. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController) + */ +interface AbortController { + /** + * The **`signal`** read-only property of the AbortController interface returns an AbortSignal object instance, which can be used to communicate with/abort an asynchronous operation as desired. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/signal) + */ + readonly signal: AbortSignal; + /** + * The **`abort()`** method of the AbortController interface aborts an asynchronous operation before it has completed. This is able to abort fetch requests, the consumption of any response bodies, or streams. + * + * [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; +} + +/** + * The **`AbortSignal`** interface represents a signal object that allows you to communicate with an asynchronous operation (such as a fetch request) and abort it if required via an AbortController object. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal) + */ +interface AbortSignal extends EventTarget { + /** + * The **`aborted`** read-only property returns a value that indicates whether the asynchronous operations the signal is communicating with are aborted (true) or not (false). + * + * [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; + /** + * The **`reason`** read-only property returns a JavaScript value that indicates the abort reason. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/reason) + */ + readonly reason: any; + /** + * The **`throwIfAborted()`** method throws the signal's abort reason if the signal has been aborted; otherwise it does nothing. + * + * [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; + /** + * The **`AbortSignal.abort()`** static method returns an AbortSignal that is already set as aborted (and which does not trigger an abort event). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static) + */ + abort(reason?: any): AbortSignal; + /** + * The **`AbortSignal.any()`** static method takes an iterable of abort signals and returns an AbortSignal. The returned abort signal is aborted when any of the input iterable abort signals are aborted. The abort reason will be set to the reason of the first signal that is aborted. If any of the given abort signals are already aborted then so will be the returned AbortSignal. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static) + */ + any(signals: AbortSignal[]): AbortSignal; +}; + +/** + * The **`AudioWorkletGlobalScope`** interface of the Web Audio API represents a global execution context for user-supplied code, which defines custom AudioWorkletProcessor-derived classes. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioWorkletGlobalScope) + */ interface AudioWorkletGlobalScope extends WorkletGlobalScope { + /** + * The read-only **`currentFrame`** property of the AudioWorkletGlobalScope interface returns an integer that represents the ever-increasing current sample-frame of the audio block being processed. It is incremented by 128 (the size of a render quantum) after the processing of each audio block. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioWorkletGlobalScope/currentFrame) + */ readonly currentFrame: number; + /** + * The read-only **`currentTime`** property of the AudioWorkletGlobalScope interface returns a double that represents the ever-increasing context time of the audio block being processed. It is equal to the currentTime property of the BaseAudioContext the worklet belongs to. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioWorkletGlobalScope/currentTime) + */ readonly currentTime: number; + /** + * The read-only **`sampleRate`** property of the AudioWorkletGlobalScope interface returns a float that represents the sample rate of the associated BaseAudioContext the worklet belongs to. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioWorkletGlobalScope/sampleRate) + */ readonly sampleRate: number; + /** + * The **`registerProcessor`** method of the AudioWorkletGlobalScope interface registers a class constructor derived from AudioWorkletProcessor interface under a specified name. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioWorkletGlobalScope/registerProcessor) + */ registerProcessor(name: string, processorCtor: AudioWorkletProcessorConstructor): void; } @@ -121,7 +300,17 @@ declare var AudioWorkletGlobalScope: { new(): AudioWorkletGlobalScope; }; +/** + * The **`AudioWorkletProcessor`** interface of the Web Audio API represents an audio processing code behind a custom AudioWorkletNode. It lives in the AudioWorkletGlobalScope and runs on the Web Audio rendering thread. In turn, an AudioWorkletNode based on it runs on the main thread. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioWorkletProcessor) + */ interface AudioWorkletProcessor { + /** + * The read-only **`port`** property of the AudioWorkletProcessor interface returns the associated MessagePort. It can be used to communicate between the processor and the AudioWorkletNode to which it belongs. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioWorkletProcessor/port) + */ readonly port: MessagePort; } @@ -130,9 +319,23 @@ declare var AudioWorkletProcessor: { new(): AudioWorkletProcessor; }; -/** This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams. */ +interface AudioWorkletProcessorImpl extends AudioWorkletProcessor { + process(inputs: Float32Array[][], outputs: Float32Array[][], parameters: Record): boolean; +} + +/** + * The **`ByteLengthQueuingStrategy`** interface of the Streams API 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 { + /** + * The read-only **`ByteLengthQueuingStrategy.highWaterMark`** property returns the total number of bytes that can be contained in the internal queue before backpressure is applied. + * + * [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; } @@ -141,9 +344,36 @@ declare var ByteLengthQueuingStrategy: { new(init: QueuingStrategyInit): ByteLengthQueuingStrategy; }; -/** This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams. */ +/** + * The **`CompressionStream`** interface of the Compression Streams API compresses a stream of data. It implements the same shape as a TransformStream, allowing it to be used in ReadableStream.pipeThrough() and similar methods. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream) + */ +interface CompressionStream extends GenericTransformStream { + /** The **`readable`** read-only property of the CompressionStream interface returns a ReadableStream that emits compressed data as Uint8Array chunks. */ + readonly readable: ReadableStream>; + /** The **`writable`** read-only property of the CompressionStream interface returns a WritableStream that accepts uncompressed data to be compressed, in the form of ArrayBuffer, TypedArray, or DataView chunks. */ + readonly writable: WritableStream; +} + +declare var CompressionStream: { + prototype: CompressionStream; + new(format: CompressionFormat): CompressionStream; +}; + +/** + * The **`CountQueuingStrategy`** interface of the Streams API provides a built-in chunk counting queuing strategy that can be used when constructing streams. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy) + */ interface CountQueuingStrategy extends QueuingStrategy { + /** + * The read-only **`CountQueuingStrategy.highWaterMark`** property returns the total number of chunks that can be contained in the internal queue before backpressure is applied. + * + * [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; } @@ -152,84 +382,305 @@ declare var CountQueuingStrategy: { new(init: QueuingStrategyInit): CountQueuingStrategy; }; -/** An event which takes place in the DOM. */ +/** + * The **`CustomEvent`** interface can be used to attach custom data to an event generated by an application. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent) + */ +interface CustomEvent extends Event { + /** + * The read-only **`detail`** property of the CustomEvent interface returns any data passed when initializing the event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent/detail) + */ + readonly detail: T; + /** + * The **`CustomEvent.initCustomEvent()`** method initializes a CustomEvent object. If the event has already been dispatched, this method does nothing. + * @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; +}; + +/** + * The **`DOMException`** interface represents an abnormal event (called an exception) that occurs as a result of calling a method or accessing a property of a web API. This is how error conditions are described in web APIs. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException) + */ +interface DOMException extends Error { + /** + * The **`code`** read-only property of the DOMException interface returns one of the legacy error code constants, or 0 if none match. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code) + */ + readonly code: number; + /** + * The **`message`** read-only property of the DOMException interface returns a string representing a message or description associated with the given error name. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message) + */ + readonly message: string; + /** + * The **`name`** read-only property of the DOMException interface returns a string that contains one of the strings associated with an error name. + * + * [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; +}; + +/** + * The **`DecompressionStream`** interface of the Compression Streams API decompresses a stream of data. It implements the same shape as a TransformStream, allowing it to be used in ReadableStream.pipeThrough() and similar methods. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream) + */ +interface DecompressionStream extends GenericTransformStream { + /** The **`readable`** read-only property of the DecompressionStream interface returns a ReadableStream that emits decompressed data as Uint8Array chunks. */ + readonly readable: ReadableStream>; + /** The **`writable`** read-only property of the DecompressionStream interface returns a WritableStream that accepts compressed data to be decompressed, in the form of ArrayBuffer, TypedArray, or DataView chunks. */ + readonly writable: WritableStream; +} + +declare var DecompressionStream: { + prototype: DecompressionStream; + new(format: CompressionFormat): DecompressionStream; +}; + +/** + * The **`ErrorEvent`** interface represents 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 { + /** + * The **`colno`** read-only property of the ErrorEvent interface returns an integer containing the column number of the script file on which the error occurred. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/colno) + */ + readonly colno: number; + /** + * The **`error`** read-only property of the ErrorEvent interface returns a JavaScript value, such as an Error or DOMException, representing the error associated with this event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/error) + */ + readonly error: any; + /** + * The **`filename`** read-only property of the ErrorEvent interface returns a string containing the name of the script file in which the error occurred. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/filename) + */ + readonly filename: string; + /** + * The **`lineno`** read-only property of the ErrorEvent interface returns an integer containing the line number of the script file on which the error occurred. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/lineno) + */ + readonly lineno: number; + /** + * The **`message`** read-only property of the ErrorEvent interface returns a string containing a human-readable error message describing the problem. + * + * [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; +}; + +/** + * The **`Event`** interface represents an event which takes place on an EventTarget. + * + * [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. + * The **`bubbles`** read-only property of the Event interface indicates whether the event bubbles up through the DOM tree or not. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/bubbles) */ readonly bubbles: boolean; + /** + * The **`cancelBubble`** property of the Event interface is deprecated. Use Event.stopPropagation() instead. Setting its value to true before returning from an event handler prevents propagation of the event. In later implementations, setting this to false does nothing. See Browser compatibility for details. + * @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. + * The **`cancelable`** read-only property of the Event interface indicates whether the event can be canceled, and therefore prevented as if the event never happened. + * + * [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. + * The read-only **`composed`** property of the Event interface returns a boolean value which indicates whether or not the event will propagate across the shadow DOM boundary into the standard DOM. + * + * [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. + * The **`currentTarget`** read-only property of the Event interface identifies the element to which the event handler has been attached. + * + * [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. + * The **`defaultPrevented`** read-only property of the Event interface returns a boolean value indicating whether or not the call to Event.preventDefault() canceled the event. + * + * [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. + * The **`eventPhase`** read-only property of the Event interface indicates which phase of the event flow is currently being evaluated. + * + * [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. + * The **`isTrusted`** read-only property of the Event interface is a boolean value that is true when the event was generated by the user agent (including via user actions and programmatic methods such as HTMLElement.focus()), and false when the event was dispatched via EventTarget.dispatchEvent(). The click event fired through HTMLElement.click() sets the isTrusted property to false. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/isTrusted) */ readonly isTrusted: boolean; - /** @deprecated */ + /** + * The Event property **`returnValue`** indicates whether the default action for this event has been prevented or not. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/returnValue) + */ returnValue: boolean; - /** @deprecated */ + /** + * The deprecated **`Event.srcElement`** is an alias for the Event.target property. Use Event.target instead. + * @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). + * The read-only **`target`** property of the Event interface is a reference to the object onto which the event was dispatched. It is different from Event.currentTarget when the event handler is called during the bubbling or capturing phase of the event. + * + * [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. + * The **`timeStamp`** read-only property of the Event interface returns the time (in milliseconds) at which the event was created. + * + * [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". + * The **`type`** read-only property of the Event interface returns a string containing the event's type. It is set when the event is constructed and is the name commonly used to refer to the specific event, such as click, load, or error. + * + * [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. + * The **`composedPath()`** method of the Event interface returns the event's path which is an array of the objects on which listeners will be invoked. This does not include nodes in shadow trees if the shadow root was created with its ShadowRoot.mode closed. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composedPath) */ composedPath(): EventTarget[]; - /** @deprecated */ + /** + * The **`Event.initEvent()`** method is used to initialize the value of an event created using Document.createEvent(). + * @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. + * The **`preventDefault()`** method of the Event interface tells the user agent that the event is being explicitly handled, so its default action, such as page scrolling, link navigation, or pasting text, should not be taken. + * + * [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. + * The **`stopImmediatePropagation()`** method of the Event interface prevents other listeners of the same event from being called. + * + * [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. + * The **`stopPropagation()`** method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases. It does not, however, prevent any default behaviors from occurring; for instance, clicks on links are still processed. If you want to stop those behaviors, see the preventDefault() method. It also does not prevent propagation to other event-handlers of the current element. If you want to stop those, see stopImmediatePropagation(). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation) */ stopPropagation(): void; - readonly AT_TARGET: number; - readonly BUBBLING_PHASE: number; - readonly CAPTURING_PHASE: number; - readonly NONE: number; + 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 AT_TARGET: number; - readonly BUBBLING_PHASE: number; - readonly CAPTURING_PHASE: number; - readonly NONE: number; + readonly NONE: 0; + readonly CAPTURING_PHASE: 1; + readonly AT_TARGET: 2; + readonly BUBBLING_PHASE: 3; }; interface EventListener { @@ -240,30 +691,28 @@ interface EventListenerObject { handleEvent(object: Event): void; } -/** EventTarget is a DOM interface implemented by objects that can receive events and may have listeners for them. */ +/** + * The **`EventTarget`** interface is implemented by objects that can receive events and may have listeners for them. In other words, any target of events implements the three methods associated with this interface. + * + * [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. + * The **`addEventListener()`** method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the 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. + * The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent(). + * + * [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. + * The **`removeEventListener()`** method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) */ removeEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void; } @@ -273,26 +722,47 @@ declare var EventTarget: { new(): EventTarget; }; -/** A message received by a target object. */ +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; +} + +/** + * The **`MessageEvent`** interface represents a message received by a target object. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent) + */ interface MessageEvent extends Event { /** - * Returns the data of the message. + * The **`data`** read-only property of the MessageEvent interface represents the data sent by the message emitter. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/data) */ readonly data: T; /** - * Returns the last event ID string, for server-sent events. + * The **`lastEventId`** read-only property of the MessageEvent interface is a string representing a unique ID for the event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/lastEventId) */ readonly lastEventId: string; /** - * Returns the origin of the message, for server-sent events and cross-document messaging. + * The **`origin`** read-only property of the MessageEvent interface is a string representing the origin of the message emitter. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/origin) */ readonly origin: string; /** - * Returns the MessagePort array sent with the message, for cross-document messaging and channel messaging. + * The **`ports`** read-only property of the MessageEvent interface is an array of MessagePort objects containing all MessagePort objects sent with the message, in order. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/ports) */ readonly ports: ReadonlyArray; /** - * Returns the WindowProxy of the source window, for cross-document messaging, and the MessagePort being attached, in the connect event fired at SharedWorkerGlobalScope objects. + * The **`source`** read-only property of the MessageEvent interface is a MessageEventSource (which can be a WindowProxy, MessagePort, or ServiceWorker object) representing the message emitter. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/source) */ readonly source: MessageEventSource | null; /** @deprecated */ @@ -304,28 +774,50 @@ declare var MessageEvent: { new(type: string, eventInitDict?: MessageEventInit): MessageEvent; }; -interface MessagePortEventMap { +interface MessageEventTargetEventMap { + "message": MessageEvent; + "messageerror": MessageEvent; +} + +interface MessageEventTarget { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/message_event) */ + onmessage: ((this: T, ev: MessageEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/messageerror_event) */ + onmessageerror: ((this: T, ev: MessageEvent) => any) | null; + addEventListener(type: K, listener: (this: T, ev: MessageEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: T, ev: MessageEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +interface MessagePortEventMap extends MessageEventTargetEventMap { "message": MessageEvent; "messageerror": MessageEvent; } -/** This Channel Messaging API interface represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other. */ -interface MessagePort extends EventTarget { - onmessage: ((this: MessagePort, ev: MessageEvent) => any) | null; - onmessageerror: ((this: MessagePort, ev: MessageEvent) => any) | null; +/** + * The **`MessagePort`** interface of the Channel Messaging API represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort) + */ +interface MessagePort extends EventTarget, MessageEventTarget { /** - * Disconnects the port, so that it is no longer active. + * The **`close()`** method of the MessagePort interface disconnects the port, so it is no longer active. This stops the flow of messages to that port. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/close) */ close(): void; /** - * Posts a message through the channel. Objects listed in transfer are transferred, not just cloned, meaning that they are no longer usable on the sending side. + * The **`postMessage()`** method of the MessagePort interface sends a message from the port, and optionally, transfers ownership of objects to other browsing contexts. * - * Throws a "DataCloneError" DOMException if transfer contains duplicate objects or port, or if message could not be cloned. + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/postMessage) */ postMessage(message: any, transfer: Transferable[]): void; - postMessage(message: any, options?: PostMessageOptions): void; + postMessage(message: any, options?: StructuredSerializeOptions): void; /** - * Begins dispatching messages received on the port. + * The **`start()`** method of the MessagePort interface starts the sending of messages queued on the port. This method is only needed when using EventTarget.addEventListener; it is implied when using onmessage. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/start) */ start(): void; addEventListener(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; @@ -339,36 +831,249 @@ declare var MessagePort: { new(): MessagePort; }; -/** This Streams API interface represents a readable stream of byte data. The Fetch API offers a concrete instance of a ReadableStream through the body property of a Response object. */ +interface Origin { + readonly opaque: boolean; + isSameOrigin(other: Origin): boolean; + isSameSite(other: Origin): boolean; +} + +declare var Origin: { + prototype: Origin; + new(): Origin; + from(value: any): Origin; +}; + +/** + * The **`PromiseRejectionEvent`** interface represents events which are sent to the global script context when JavaScript Promises are rejected. These events are particularly useful for telemetry and debugging purposes. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent) + */ +interface PromiseRejectionEvent extends Event { + /** + * The PromiseRejectionEvent interface's **`promise`** read-only property indicates the JavaScript Promise which was rejected. You can examine the event's PromiseRejectionEvent.reason property to learn why the promise was rejected. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/promise) + */ + readonly promise: Promise; + /** + * The PromiseRejectionEvent **`reason`** read-only property is any JavaScript value or Object which provides the reason passed into Promise.reject(). This in theory provides information about why the promise was rejected. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason) + */ + readonly reason: any; +} + +declare var PromiseRejectionEvent: { + prototype: PromiseRejectionEvent; + new(type: string, eventInitDict: PromiseRejectionEventInit): PromiseRejectionEvent; +}; + +/** + * The **`ReadableByteStreamController`** interface of the Streams API represents a controller for a readable byte stream. It allows control of the state and internal queue of a ReadableStream with an underlying byte source, and enables efficient zero-copy transfer of data from the underlying source to a consumer when the stream's internal queue is empty. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController) + */ +interface ReadableByteStreamController { + /** + * The **`byobRequest`** read-only property of the ReadableByteStreamController interface returns the current BYOB request, or null if there are no pending requests. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest) + */ + readonly byobRequest: ReadableStreamBYOBRequest | null; + /** + * The **`desiredSize`** read-only property of the ReadableByteStreamController interface returns the number of bytes required to fill the stream's internal queue to its "desired size". + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize) + */ + readonly desiredSize: number | null; + /** + * The **`close()`** method of the ReadableByteStreamController interface closes the associated stream. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/close) + */ + close(): void; + /** + * The **`enqueue()`** method of the ReadableByteStreamController interface enqueues a given chunk on the associated readable byte stream (the chunk is transferred into the stream's internal queues). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue) + */ + enqueue(chunk: ArrayBufferView): void; + /** + * The **`error()`** method of the ReadableByteStreamController interface causes any future interactions with the associated stream to error with the specified reason. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/error) + */ + error(e?: any): void; +} + +declare var ReadableByteStreamController: { + prototype: ReadableByteStreamController; + new(): ReadableByteStreamController; +}; + +/** + * The **`ReadableStream`** interface of the Streams API represents a readable stream of byte data. The Fetch API offers a concrete instance of a ReadableStream through the body property of a Response object. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream) + */ interface ReadableStream { + /** + * The **`locked`** read-only property of the ReadableStream interface returns whether or not the readable stream is locked to a reader. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/locked) + */ readonly locked: boolean; + /** + * The **`cancel()`** method of the ReadableStream interface returns a Promise that resolves when the stream is canceled. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/cancel) + */ cancel(reason?: any): Promise; + /** + * The **`getReader()`** method of the ReadableStream interface creates a reader and locks the stream to it. While the stream is locked, no other reader can be acquired until this one is released. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) + */ + getReader(options: { mode: "byob" }): ReadableStreamBYOBReader; getReader(): ReadableStreamDefaultReader; + getReader(options?: ReadableStreamGetReaderOptions): ReadableStreamReader; + /** + * The **`pipeThrough()`** method of the ReadableStream interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeThrough) + */ pipeThrough(transform: ReadableWritablePair, options?: StreamPipeOptions): ReadableStream; + /** + * The **`pipeTo()`** method of the ReadableStream interface pipes the current ReadableStream to a given WritableStream and returns a Promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo) + */ pipeTo(destination: WritableStream, options?: StreamPipeOptions): Promise; + /** + * The **`tee()`** method of the ReadableStream interface tees the current readable stream, returning a two-element array containing the two resulting branches as new ReadableStream instances. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee) + */ tee(): [ReadableStream, ReadableStream]; - forEach(callbackfn: (value: any, key: number, parent: ReadableStream) => void, thisArg?: any): void; } declare var ReadableStream: { prototype: ReadableStream; + new(underlyingSource: UnderlyingByteSource, strategy?: { highWaterMark?: number }): ReadableStream>; + new(underlyingSource: UnderlyingDefaultSource, strategy?: QueuingStrategy): ReadableStream; new(underlyingSource?: UnderlyingSource, strategy?: QueuingStrategy): ReadableStream; }; -interface ReadableStreamDefaultController { - readonly desiredSize: number | null; - close(): void; - enqueue(chunk?: R): void; - error(e?: any): void; -} - -declare var ReadableStreamDefaultController: { - prototype: ReadableStreamDefaultController; +/** + * The **`ReadableStreamBYOBReader`** interface of the Streams API defines a reader for a ReadableStream that supports zero-copy reading from an underlying byte source. It is used for efficient copying from underlying sources where the data is delivered as an "anonymous" sequence of bytes, such as files. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader) + */ +interface ReadableStreamBYOBReader extends ReadableStreamGenericReader { + /** + * The **`read()`** method of the ReadableStreamBYOBReader interface is used to read data into a view on a user-supplied buffer from an associated readable byte stream. A request for data will be satisfied from the stream's internal queues if there is any data present. If the stream queues are empty, the request may be supplied as a zero-copy transfer from the underlying byte source. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) + */ + read>(view: T, options?: ReadableStreamBYOBReaderReadOptions): Promise>; + /** + * The **`releaseLock()`** method of the ReadableStreamBYOBReader interface releases the reader's lock on the stream. After the lock is released, the reader is no longer active. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) + */ + releaseLock(): void; +} + +declare var ReadableStreamBYOBReader: { + prototype: ReadableStreamBYOBReader; + new(stream: ReadableStream>): ReadableStreamBYOBReader; +}; + +/** + * The **`ReadableStreamBYOBRequest`** interface of the Streams API represents a "pull request" for data from an underlying source that will made as a zero-copy transfer to a consumer (bypassing the stream's internal queues). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) + */ +interface ReadableStreamBYOBRequest { + /** + * The **`view`** getter property of the ReadableStreamBYOBRequest interface returns the current view. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view) + */ + readonly view: Uint8Array | null; + /** + * The **`respond()`** method of the ReadableStreamBYOBRequest interface is used to signal to the associated readable byte stream that the specified number of bytes were written into the ReadableStreamBYOBRequest.view. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond) + */ + respond(bytesWritten: number): void; + /** + * The **`respondWithNewView()`** method of the ReadableStreamBYOBRequest interface specifies a new view that the consumer of the associated readable byte stream should write to instead of ReadableStreamBYOBRequest.view. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView) + */ + respondWithNewView(view: ArrayBufferView): void; +} + +declare var ReadableStreamBYOBRequest: { + prototype: ReadableStreamBYOBRequest; + new(): ReadableStreamBYOBRequest; +}; + +/** + * The **`ReadableStreamDefaultController`** interface of the Streams API represents a controller allowing control of a ReadableStream's state and internal queue. Default controllers are for streams that are not byte streams. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController) + */ +interface ReadableStreamDefaultController { + /** + * The **`desiredSize`** read-only property of the ReadableStreamDefaultController interface returns the desired size required to fill the stream's internal queue. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize) + */ + readonly desiredSize: number | null; + /** + * The **`close()`** method of the ReadableStreamDefaultController interface closes the associated stream. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/close) + */ + close(): void; + /** + * The **`enqueue()`** method of the ReadableStreamDefaultController interface enqueues a given chunk in the associated stream. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue) + */ + enqueue(chunk: R): void; + /** + * The **`error()`** method of the ReadableStreamDefaultController interface causes any future interactions with the associated stream to error. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error) + */ + error(e?: any): void; +} + +declare var ReadableStreamDefaultController: { + prototype: ReadableStreamDefaultController; new(): ReadableStreamDefaultController; }; +/** + * The **`ReadableStreamDefaultReader`** interface of the Streams API represents a default reader that can be used to read stream data supplied from a network (such as a fetch request). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader) + */ interface ReadableStreamDefaultReader extends ReadableStreamGenericReader { - read(): Promise>; + /** + * The **`read()`** method of the ReadableStreamDefaultReader interface returns a Promise providing access to the next chunk in the stream's internal queue. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/read) + */ + read(): Promise>; + /** + * The **`releaseLock()`** method of the ReadableStreamDefaultReader interface releases the reader's lock on the stream. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/releaseLock) + */ releaseLock(): void; } @@ -378,12 +1083,137 @@ declare var ReadableStreamDefaultReader: { }; interface ReadableStreamGenericReader { - readonly closed: Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/closed) */ + readonly closed: Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/cancel) */ cancel(reason?: any): Promise; } +/** + * The **`TextDecoder`** interface represents a decoder for a specific text encoding, such as UTF-8, ISO-8859-2, or GBK. A decoder takes an array of bytes as input and returns a JavaScript string. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder) + */ +interface TextDecoder extends TextDecoderCommon { + /** + * The **`TextDecoder.decode()`** method returns a string containing text decoded from the buffer passed as a parameter. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder/decode) + */ + decode(input?: AllowSharedBufferSource, options?: TextDecodeOptions): string; +} + +declare var TextDecoder: { + prototype: TextDecoder; + new(label?: string, options?: TextDecoderOptions): TextDecoder; +}; + +interface TextDecoderCommon { + /** + * Returns encoding's name, lowercased. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder/encoding) + */ + readonly encoding: string; + /** + * Returns true if error mode is "fatal", otherwise false. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder/fatal) + */ + readonly fatal: boolean; + /** + * Returns the value of ignore BOM. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder/ignoreBOM) + */ + readonly ignoreBOM: boolean; +} + +/** + * The **`TextDecoderStream`** interface of the Encoding API converts a stream of text in a binary encoding, such as UTF-8 etc., to a stream of strings. It is the streaming equivalent of TextDecoder. It implements the same shape as a TransformStream, allowing it to be used in ReadableStream.pipeThrough() and similar methods. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoderStream) + */ +interface TextDecoderStream extends GenericTransformStream, TextDecoderCommon { + /** The **`readable`** read-only property of the TextDecoderStream interface returns a ReadableStream that emits decoded strings. */ + readonly readable: ReadableStream; + /** The **`writable`** read-only property of the TextDecoderStream interface returns a WritableStream that accepts binary data, in the form of ArrayBuffer, TypedArray, or DataView chunks (SharedArrayBuffer and its views are also allowed), to be decoded into strings. */ + readonly writable: WritableStream; +} + +declare var TextDecoderStream: { + prototype: TextDecoderStream; + new(label?: string, options?: TextDecoderOptions): TextDecoderStream; +}; + +/** + * The **`TextEncoder`** interface enables you to encode a JavaScript string using UTF-8. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder) + */ +interface TextEncoder extends TextEncoderCommon { + /** + * The **`TextEncoder.encode()`** method takes a string as input, and returns a Uint8Array containing the string encoded using UTF-8. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode) + */ + encode(input?: string): Uint8Array; + /** + * The **`TextEncoder.encodeInto()`** method takes a string to encode and a destination Uint8Array to put resulting UTF-8 encoded text into, and returns an object indicating the progress of the encoding. This is potentially more performant than the encode() method — especially when the target buffer is a view into a Wasm heap. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encodeInto) + */ + encodeInto(source: string, destination: Uint8Array): TextEncoderEncodeIntoResult; +} + +declare var TextEncoder: { + prototype: TextEncoder; + new(): TextEncoder; +}; + +interface TextEncoderCommon { + /** + * Returns "utf-8". + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encoding) + */ + readonly encoding: string; +} + +/** + * The **`TextEncoderStream`** interface of the Encoding API converts a stream of strings into bytes in the UTF-8 encoding. It is the streaming equivalent of TextEncoder. It implements the same shape as a TransformStream, allowing it to be used in ReadableStream.pipeThrough() and similar methods. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoderStream) + */ +interface TextEncoderStream extends GenericTransformStream, TextEncoderCommon { + /** The **`readable`** read-only property of the TextEncoderStream interface returns a ReadableStream that emits encoded binary data as Uint8Array chunks. */ + readonly readable: ReadableStream>; + /** The **`writable`** read-only property of the TextEncoderStream interface returns a WritableStream that accepts strings to be encoded into binary data. */ + readonly writable: WritableStream; +} + +declare var TextEncoderStream: { + prototype: TextEncoderStream; + new(): TextEncoderStream; +}; + +/** + * The **`TransformStream`** interface of the Streams API represents a concrete implementation of the pipe chain transform stream concept. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream) + */ interface TransformStream { + /** + * The **`readable`** read-only property of the TransformStream interface returns the ReadableStream instance controlled by this TransformStream. This stream emits the transformed output data. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable) + */ readonly readable: ReadableStream; + /** + * The **`writable`** read-only property of the TransformStream interface returns the WritableStream instance controlled by this TransformStream. This stream accepts input data that will be transformed and emitted to the readable stream. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable) + */ readonly writable: WritableStream; } @@ -392,10 +1222,35 @@ declare var TransformStream: { new(transformer?: Transformer, writableStrategy?: QueuingStrategy, readableStrategy?: QueuingStrategy): TransformStream; }; +/** + * The **`TransformStreamDefaultController`** interface of the Streams API provides methods to manipulate the associated ReadableStream and WritableStream. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController) + */ interface TransformStreamDefaultController { + /** + * The **`desiredSize`** read-only property of the TransformStreamDefaultController interface returns the desired size to fill the queue of the associated ReadableStream. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/desiredSize) + */ readonly desiredSize: number | null; - enqueue(chunk?: O): void; + /** + * The **`enqueue()`** method of the TransformStreamDefaultController interface enqueues the given chunk in the readable side of the stream. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/enqueue) + */ + enqueue(chunk: O): void; + /** + * The **`error()`** method of the TransformStreamDefaultController interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error) + */ error(reason?: any): void; + /** + * The **`terminate()`** method of the TransformStreamDefaultController interface closes the readable side and errors the writable side of the stream. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/terminate) + */ terminate(): void; } @@ -404,6 +1259,179 @@ declare var TransformStreamDefaultController: { new(): TransformStreamDefaultController; }; +/** + * The **`URL`** interface is used to parse, construct, normalize, and encode URLs. It works by providing properties which allow you to easily read and modify the components of a URL. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL) + */ +interface URL { + /** + * The **`hash`** property of the URL interface is a string containing a "#" followed by the fragment identifier of the URL. If the URL does not have a fragment identifier, this property contains an empty string, "". + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) + */ + hash: string; + /** + * The **`host`** property of the URL interface is a string containing the host, which is the hostname, and then, if the port of the URL is nonempty, a ":", followed by the port of the URL. If the URL does not have a hostname, this property contains an empty string, "". + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) + */ + host: string; + /** + * The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL. If the URL does not have a hostname, this property contains an empty string, "". IPv4 and IPv6 addresses are normalized, such as stripping leading zeros, and domain names are converted to IDN. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) + */ + hostname: string; + /** + * The **`href`** property of the URL interface is a string containing the whole URL. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) + */ + href: string; + toString(): string; + /** + * The **`origin`** read-only property of the URL interface returns a string containing the Unicode serialization of the origin of the represented URL. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/origin) + */ + readonly origin: string; + /** + * The **`password`** property of the URL interface is a string containing the password component of the URL. If the URL does not have a password, this property contains an empty string, "". + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) + */ + password: string; + /** + * The **`pathname`** property of the URL interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a / character. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) + */ + pathname: string; + /** + * The **`port`** property of the URL interface is a string containing the port number of the URL. If the port is the default for the protocol (80 for ws: and http:, 443 for wss: and https:, and 21 for ftp:), this property contains an empty string, "". + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) + */ + port: string; + /** + * The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final ":". + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) + */ + protocol: string; + /** + * The **`search`** property of the URL interface is a search string, also called a query string, that is a string containing a "?" followed by the parameters of the URL. If the URL does not have a search query, this property contains an empty string, "". + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) + */ + search: string; + /** + * The **`searchParams`** read-only property of the URL interface returns a URLSearchParams object allowing access to the GET decoded query arguments contained in the URL. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams) + */ + readonly searchParams: URLSearchParams; + /** + * The **`username`** property of the URL interface is a string containing the username component of the URL. If the URL does not have a username, this property contains an empty string, "". + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) + */ + username: string; + /** + * The **`toJSON()`** method of the URL interface returns a string containing a serialized version of the URL, although in practice it seems to have the same effect as URL.toString(). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON) + */ + toJSON(): string; +} + +declare var URL: { + prototype: URL; + new(url: string | URL, base?: string | URL): URL; + /** + * The **`URL.canParse()`** static method of the URL interface returns a boolean indicating whether or not an absolute URL, or a relative URL combined with a base URL, are parsable and valid. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/canParse_static) + */ + canParse(url: string | URL, base?: string | URL): boolean; + /** + * The **`URL.parse()`** static method of the URL interface returns a newly created URL object representing the URL defined by the parameters. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/parse_static) + */ + parse(url: string | URL, base?: string | URL): URL | null; +}; + +/** + * The **`URLSearchParams`** interface defines utility methods to work with the query string of a URL. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams) + */ +interface URLSearchParams { + /** + * The **`size`** read-only property of the URLSearchParams interface indicates the total number of search parameter entries. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/size) + */ + readonly size: number; + /** + * The **`append()`** method of the URLSearchParams interface appends a specified key/value pair as a new search parameter. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/append) + */ + append(name: string, value: string): void; + /** + * The **`delete()`** method of the URLSearchParams interface deletes specified parameters and their associated value(s) from the list of all search parameters. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/delete) + */ + delete(name: string, value?: string): void; + /** + * The **`get()`** method of the URLSearchParams interface returns the first value associated to the given search parameter. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/get) + */ + get(name: string): string | null; + /** + * The **`getAll()`** method of the URLSearchParams interface returns all the values associated with a given search parameter as an array. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/getAll) + */ + getAll(name: string): string[]; + /** + * The **`has()`** method of the URLSearchParams interface returns a boolean value that indicates whether the specified parameter is in the search parameters. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/has) + */ + has(name: string, value?: string): boolean; + /** + * The **`set()`** method of the URLSearchParams interface sets the value associated with a given search parameter to the given value. If there were several matching values, this method deletes the others. If the search parameter doesn't exist, this method creates it. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set) + */ + set(name: string, value: string): void; + /** + * The **`URLSearchParams.sort()`** method sorts all key/value pairs contained in this object in place and returns undefined. Key/value pairs are sorted by the values of the UTF-16 code units of the keys. This method uses a stable sorting algorithm (i.e., the relative order between key/value pairs with equal keys will be preserved). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort) + */ + sort(): void; + toString(): string; + forEach(callbackfn: (value: string, key: string, parent: URLSearchParams) => void, thisArg?: any): void; +} + +declare var URLSearchParams: { + prototype: URLSearchParams; + new(init?: string[][] | Record | string | URLSearchParams): URLSearchParams; +}; + +/** + * The **`WorkletGlobalScope`** interface is an abstract class that specific worklet scope classes inherit from. Each WorkletGlobalScope defines a new global environment. + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WorkletGlobalScope) + */ interface WorkletGlobalScope { } @@ -412,11 +1440,35 @@ declare var WorkletGlobalScope: { new(): WorkletGlobalScope; }; -/** This Streams API interface provides a standard abstraction for writing streaming data to a destination, known as a sink. This object comes with built-in backpressure and queuing. */ +/** + * The **`WritableStream`** interface of the Streams API provides a standard abstraction for writing streaming data to a destination, known as a sink. This object comes with built-in backpressure and queuing. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream) + */ interface WritableStream { + /** + * The **`locked`** read-only property of the WritableStream interface returns a boolean indicating whether the WritableStream is locked to a writer. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked) + */ readonly locked: boolean; + /** + * The **`abort()`** method of the WritableStream interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/abort) + */ abort(reason?: any): Promise; + /** + * The **`close()`** method of the WritableStream interface closes the associated stream. All chunks written before this method is called are sent before the returned promise is fulfilled. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close) + */ close(): Promise; + /** + * The **`getWriter()`** method of the WritableStream interface returns a new instance of WritableStreamDefaultWriter and locks the stream to that instance. While the stream is locked, no other writer can be acquired until this one is released. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter) + */ getWriter(): WritableStreamDefaultWriter; } @@ -425,8 +1477,23 @@ declare var WritableStream: { new(underlyingSink?: UnderlyingSink, strategy?: QueuingStrategy): WritableStream; }; -/** This Streams API interface represents a controller allowing control of a WritableStream's state. When constructing a WritableStream, the underlying sink is given a corresponding WritableStreamDefaultController instance to manipulate. */ +/** + * The **`WritableStreamDefaultController`** interface of the Streams API represents a controller allowing control of a WritableStream's state. When constructing a WritableStream, the underlying sink is given a corresponding WritableStreamDefaultController instance to manipulate. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController) + */ interface WritableStreamDefaultController { + /** + * The read-only **`signal`** property of the WritableStreamDefaultController interface returns the AbortSignal associated with the controller. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/signal) + */ + readonly signal: AbortSignal; + /** + * The **`error()`** method of the WritableStreamDefaultController interface causes any future interactions with the associated stream to error. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error) + */ error(e?: any): void; } @@ -435,15 +1502,54 @@ declare var WritableStreamDefaultController: { new(): WritableStreamDefaultController; }; -/** This Streams API interface is the object returned by WritableStream.getWriter() and once created locks the < writer to the WritableStream ensuring that no other streams can write to the underlying sink. */ +/** + * The **`WritableStreamDefaultWriter`** interface of the Streams API is the object returned by WritableStream.getWriter() and once created locks the writer to the WritableStream ensuring that no other streams can write to the underlying sink. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter) + */ interface WritableStreamDefaultWriter { - readonly closed: Promise; + /** + * The **`closed`** read-only property of the WritableStreamDefaultWriter interface returns a Promise that fulfills if the stream becomes closed, or rejects if the stream errors or the writer's lock is released. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed) + */ + readonly closed: Promise; + /** + * The **`desiredSize`** read-only property of the WritableStreamDefaultWriter interface returns the desired size required to fill the stream's internal queue. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize) + */ readonly desiredSize: number | null; - readonly ready: Promise; + /** + * The **`ready`** read-only property of the WritableStreamDefaultWriter interface returns a Promise that resolves when the desired size of the stream's internal queue transitions from non-positive to positive, signaling that it is no longer applying backpressure. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready) + */ + readonly ready: Promise; + /** + * The **`abort()`** method of the WritableStreamDefaultWriter interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort) + */ abort(reason?: any): Promise; + /** + * The **`close()`** method of the WritableStreamDefaultWriter interface closes the associated writable stream. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close) + */ close(): Promise; + /** + * The **`releaseLock()`** method of the WritableStreamDefaultWriter interface releases the writer's lock on the corresponding stream. After the lock is released, the writer is no longer active. If the associated stream is errored when the lock is released, the writer will appear errored in the same way from now on; otherwise, the writer will appear closed. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock) + */ releaseLock(): void; - write(chunk?: W): Promise; + /** + * The **`write()`** method of the WritableStreamDefaultWriter interface writes a passed chunk of data to a WritableStream and its underlying sink, then returns a Promise that resolves to indicate the success or failure of the write operation. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write) + */ + write(chunk: W): Promise; } declare var WritableStreamDefaultWriter: { @@ -451,51 +1557,80 @@ declare var WritableStreamDefaultWriter: { new(stream: WritableStream): WritableStreamDefaultWriter; }; -interface Console { - assert(condition?: boolean, ...data: any[]): void; - clear(): void; - count(label?: string): void; - countReset(label?: string): void; - debug(...data: any[]): void; - dir(item?: any, options?: any): void; - dirxml(...data: any[]): void; - error(...data: any[]): void; - group(...data: any[]): void; - groupCollapsed(...data: any[]): void; - groupEnd(): void; - info(...data: any[]): void; - log(...data: any[]): void; - table(tabularData?: any, properties?: string[]): void; - time(label?: string): void; - timeEnd(label?: string): void; - timeLog(label?: string, ...data: any[]): void; - timeStamp(label?: string): void; - trace(...data: any[]): void; - warn(...data: any[]): void; -} - -declare var console: Console; - declare namespace WebAssembly { + /** The **`WebAssembly.CompileError`** object indicates an error during WebAssembly decoding or validation. */ interface CompileError extends Error { } var CompileError: { prototype: CompileError; - new(): CompileError; + new(message?: string): CompileError; + (message?: string): CompileError; }; - interface Global { - value: any; - valueOf(): any; + /** + * The **`WebAssembly.Exception`** object represents a runtime exception thrown from WebAssembly to JavaScript, or thrown from JavaScript to a WebAssembly exception handler. + * + * [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Exception) + */ + interface Exception { + /** + * The read-only **`stack`** property of an object instance of type WebAssembly.Exception may contain a stack trace. + * + * [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Exception/stack) + */ + readonly stack: string | undefined; + /** + * The **`getArg()`** prototype method of the Exception object can be used to get the value of a specified item in the exception's data arguments. + * + * [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Exception/getArg) + */ + getArg(exceptionTag: Tag, index: number): any; + /** + * The **`is()`** prototype method of the Exception object can be used to test if the Exception matches a given tag. + * + * [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Exception/is) + */ + is(exceptionTag: Tag): boolean; + } + + var Exception: { + prototype: Exception; + new(exceptionTag: Tag, payload: any[], options?: ExceptionOptions): Exception; + }; + + /** + * A **`WebAssembly.Global`** object represents a global variable instance, accessible from both JavaScript and importable/exportable across one or more WebAssembly.Module instances. This allows dynamic linking of multiple modules. + * + * [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Global) + */ + interface Global { + /** + * The **`value`** property of the WebAssembly.Global object prototype returns the value contained inside the global variable. + * + * [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Global/value) + */ + value: ValueTypeMap[T]; + /** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Global/valueOf) */ + valueOf(): ValueTypeMap[T]; } var Global: { prototype: Global; - new(descriptor: GlobalDescriptor, v?: any): Global; + new(descriptor: GlobalDescriptor, v?: ValueTypeMap[T]): Global; }; + /** + * A **`WebAssembly.Instance`** object is a stateful, executable instance of a WebAssembly.Module. Instance objects contain all the Exported WebAssembly functions that allow calling into WebAssembly code from JavaScript. + * + * [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Instance) + */ interface Instance { + /** + * The **`exports`** read-only property of the WebAssembly.Instance object prototype returns an object containing as its members all the functions exported from the WebAssembly module instance, to allow them to be accessed and used by JavaScript. + * + * [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Instance/exports) + */ readonly exports: Exports; } @@ -504,17 +1639,36 @@ declare namespace WebAssembly { new(module: Module, importObject?: Imports): Instance; }; + /** The **`WebAssembly.LinkError`** object indicates an error during module instantiation (besides traps from the start function). */ interface LinkError extends Error { } var LinkError: { prototype: LinkError; - new(): LinkError; + new(message?: string): LinkError; + (message?: string): LinkError; }; + /** + * The **`WebAssembly.Memory`** object is a resizable ArrayBuffer or SharedArrayBuffer that holds raw bytes of memory accessed by a WebAssembly.Instance. + * + * [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Memory) + */ interface Memory { + /** + * The read-only **`buffer`** prototype property of the WebAssembly.Memory object returns the buffer contained in the memory. Depending on whether or not the memory was constructed with shared: true, the buffer is either an ArrayBuffer or a SharedArrayBuffer. + * + * [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Memory/buffer) + */ readonly buffer: ArrayBuffer; - grow(delta: number): number; + /** + * The **`grow()`** prototype method of the WebAssembly.Memory object increases the size of the memory instance by a specified number of WebAssembly pages. + * + * [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Memory/grow) + */ + grow(delta: AddressValue): AddressValue; + toFixedLengthBuffer(): ArrayBuffer; + toResizableBuffer(): ArrayBuffer; } var Memory: { @@ -522,30 +1676,77 @@ declare namespace WebAssembly { new(descriptor: MemoryDescriptor): Memory; }; + /** + * A **`WebAssembly.Module`** object contains stateless WebAssembly code that has already been compiled by the browser — this can be efficiently shared with Workers, and instantiated multiple times. + * + * [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Module) + */ interface Module { } var Module: { prototype: Module; - new(bytes: BufferSource): Module; + new(bytes: AllowSharedBufferSource, options?: WebAssemblyCompileOptions): Module; + /** + * The WebAssembly.**`Module.customSections()`** static method returns a copy of the contents of all custom sections in the given module with the given string name. + * + * [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Module/customSections_static) + */ customSections(moduleObject: Module, sectionName: string): ArrayBuffer[]; + /** + * The WebAssembly.**`Module.exports()`** static method returns an array containing descriptions of all the declared exports of the given Module. + * + * [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Module/exports_static) + */ exports(moduleObject: Module): ModuleExportDescriptor[]; + /** + * The WebAssembly.**`Module.imports()`** static method returns an array containing descriptions of all the declared imports of the given Module. + * + * [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Module/imports_static) + */ imports(moduleObject: Module): ModuleImportDescriptor[]; }; + /** The **`WebAssembly.RuntimeError`** object is the error type that is thrown whenever WebAssembly specifies a trap. */ interface RuntimeError extends Error { } var RuntimeError: { prototype: RuntimeError; - new(): RuntimeError; + new(message?: string): RuntimeError; + (message?: string): RuntimeError; }; + /** + * The **`WebAssembly.Table`** object is a JavaScript wrapper object — an array-like structure representing a WebAssembly table, which stores homogeneous references. A table created by JavaScript or in WebAssembly code will be accessible and mutable from both JavaScript and WebAssembly. + * + * [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table) + */ interface Table { - readonly length: number; - get(index: number): any; - grow(delta: number, value?: any): number; - set(index: number, value?: any): void; + /** + * The read-only **`length`** prototype property of the WebAssembly.Table object returns the length of the table, i.e., the number of elements in the table. + * + * [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table/length) + */ + readonly length: AddressValue; + /** + * The **`get()`** prototype method of the WebAssembly.Table() object retrieves the element stored at a given index. + * + * [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table/get) + */ + get(index: AddressValue): any; + /** + * The **`grow()`** prototype method of the WebAssembly.Table object increases the size of the Table instance by a specified number of elements, filled with the provided value. + * + * [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table/grow) + */ + grow(delta: AddressValue, value?: any): AddressValue; + /** + * The **`set()`** prototype method of the WebAssembly.Table object mutates a reference stored at a given index to a different value. + * + * [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table/set) + */ + set(index: AddressValue, value?: any): void; } var Table: { @@ -553,14 +1754,32 @@ declare namespace WebAssembly { new(descriptor: TableDescriptor, value?: any): Table; }; - interface GlobalDescriptor { + /** + * The **`WebAssembly.Tag`** object defines a type of a WebAssembly exception that can be thrown to/from WebAssembly code. + * + * [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Tag) + */ + interface Tag { + } + + var Tag: { + prototype: Tag; + new(type: TagType): Tag; + }; + + interface ExceptionOptions { + traceStack?: boolean; + } + + interface GlobalDescriptor { mutable?: boolean; - value: ValueType; + value: T; } interface MemoryDescriptor { - initial: number; - maximum?: number; + address?: AddressType; + initial: AddressValue; + maximum?: AddressValue; shared?: boolean; } @@ -576,9 +1795,29 @@ declare namespace WebAssembly { } interface TableDescriptor { + address?: AddressType; element: TableKind; - initial: number; - maximum?: number; + initial: AddressValue; + maximum?: AddressValue; + } + + interface TagType { + parameters: ValueType[]; + } + + interface ValueTypeMap { + anyfunc: Function; + externref: any; + f32: number; + f64: number; + i32: number; + i64: bigint; + v128: never; + } + + interface WebAssemblyCompileOptions { + builtins?: string[]; + importedStringConstants?: string | null; } interface WebAssemblyInstantiatedSource { @@ -586,26 +1825,159 @@ declare namespace WebAssembly { module: Module; } - type ImportExportKind = "function" | "global" | "memory" | "table"; + type AddressType = "i32" | "i64"; + type ImportExportKind = "function" | "global" | "memory" | "table" | "tag"; type TableKind = "anyfunc" | "externref"; - type ValueType = "anyfunc" | "externref" | "f32" | "f64" | "i32" | "i64"; + type AddressValue = number; type ExportValue = Function | Global | Memory | Table; type Exports = Record; type ImportValue = ExportValue | number; type Imports = Record; type ModuleImports = Record; - function compile(bytes: BufferSource): Promise; - function instantiate(bytes: BufferSource, importObject?: Imports): Promise; + type ValueType = keyof ValueTypeMap; + var JSTag: Tag; + /** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/compile_static) */ + function compile(bytes: AllowSharedBufferSource, options?: WebAssemblyCompileOptions): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/instantiate_static) */ + function instantiate(bytes: AllowSharedBufferSource, importObject?: Imports, options?: WebAssemblyCompileOptions): Promise; function instantiate(moduleObject: Module, importObject?: Imports): Promise; - function validate(bytes: BufferSource): boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/validate_static) */ + function validate(bytes: AllowSharedBufferSource, options?: WebAssemblyCompileOptions): boolean; } +/** The **`console`** object provides access to the debugging console (e.g., the Web console in Firefox). */ +/** + * The **`console`** object provides access to the debugging console (e.g., the Web console in Firefox). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console) + */ +interface Console { + /** + * The **`console.assert()`** static method writes an error message to the console if the assertion is false. If the assertion is true, nothing happens. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/assert_static) + */ + assert(condition?: boolean, ...data: any[]): void; + /** + * The **`console.clear()`** static method clears the console if possible. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/clear_static) + */ + clear(): void; + /** + * The **`console.count()`** static method logs the number of times that this particular call to count() has been called. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static) + */ + count(label?: string): void; + /** + * The **`console.countReset()`** static method resets counter used with console.count(). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countReset_static) + */ + countReset(label?: string): void; + /** + * The **`console.debug()`** static method outputs a message to the console at the "debug" log level. The message is only displayed to the user if the console is configured to display debug output. In most cases, the log level is configured within the console UI. This log level might correspond to the Debug or Verbose log level. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static) + */ + debug(...data: any[]): void; + /** + * The **`console.dir()`** static method displays a list of the properties of the specified JavaScript object. In browser consoles, the output is presented as a hierarchical listing with disclosure triangles that let you see the contents of child objects. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dir_static) + */ + dir(item?: any, options?: any): void; + /** + * The **`console.dirxml()`** static method displays an interactive tree of the descendant elements of the specified XML/HTML element. If it is not possible to display as an element the JavaScript Object view is shown instead. The output is presented as a hierarchical listing of expandable nodes that let you see the contents of child nodes. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dirxml_static) + */ + dirxml(...data: any[]): void; + /** + * The **`console.error()`** static method outputs a message to the console at the "error" log level. The message is only displayed to the user if the console is configured to display error output. In most cases, the log level is configured within the console UI. The message may be formatted as an error, with red colors and call stack information. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/error_static) + */ + error(...data: any[]): void; + /** + * The **`console.group()`** static method creates a new inline group in the Web console log, causing any subsequent console messages to be indented by an additional level, until console.groupEnd() is called. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static) + */ + group(...data: any[]): void; + /** + * The **`console.groupCollapsed()`** static method creates a new inline group in the console. Unlike console.group(), however, the new group is created collapsed. The user will need to use the disclosure button next to it to expand it, revealing the entries created in the group. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static) + */ + groupCollapsed(...data: any[]): void; + /** + * The **`console.groupEnd()`** static method exits the current inline group in the console. See Using groups in the console in the console documentation for details and examples. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupEnd_static) + */ + groupEnd(): void; + /** + * The **`console.info()`** static method outputs a message to the console at the "info" log level. The message is only displayed to the user if the console is configured to display info output. In most cases, the log level is configured within the console UI. The message may receive special formatting, such as a small "i" icon next to it. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static) + */ + info(...data: any[]): void; + /** + * The **`console.log()`** static method outputs a message to the console. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static) + */ + log(...data: any[]): void; + /** + * The **`console.table()`** static method displays tabular data as a table. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/table_static) + */ + table(tabularData?: any, properties?: string[]): void; + /** + * The **`console.time()`** static method starts a timer you can use to track how long an operation takes. You give each timer a unique name, and may have up to 10,000 timers running on a given page. When you call console.timeEnd() with the same name, the browser will output the time, in milliseconds, that elapsed since the timer was started. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static) + */ + time(label?: string): void; + /** + * The **`console.timeEnd()`** static method stops a timer that was previously started by calling console.time(). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeEnd_static) + */ + timeEnd(label?: string): void; + /** + * The **`console.timeLog()`** static method logs the current value of a timer that was previously started by calling console.time(). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeLog_static) + */ + timeLog(label?: string, ...data: any[]): void; + /** The **`console.timeStamp()`** static method adds a single marker to the browser's Performance tool (Firefox bug 1387528, Chrome). This lets you correlate a point in your code with the other events recorded in the timeline, such as layout and paint events. */ + timeStamp(label?: string): void; + /** + * The **`console.trace()`** static method outputs a stack trace to the console. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/trace_static) + */ + trace(...data: any[]): void; + /** + * The **`console.warn()`** static method outputs a warning message to the console at the "warning" log level. The message is only displayed to the user if the console is configured to display warning output. In most cases, the log level is configured within the console UI. The message may receive special formatting, such as yellow colors and a warning icon. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/warn_static) + */ + warn(...data: any[]): void; +} + +declare var console: Console; + interface AudioWorkletProcessorConstructor { - (options: any): AudioWorkletProcessor; + new (options: any): AudioWorkletProcessorImpl; } interface QueuingStrategySize { - (chunk?: T): number; + (chunk: T): number; } interface TransformerFlushCallback { @@ -648,15 +2020,77 @@ interface UnderlyingSourceStartCallback { (controller: ReadableStreamController): any; } +/** + * The read-only **`currentFrame`** property of the AudioWorkletGlobalScope interface returns an integer that represents the ever-increasing current sample-frame of the audio block being processed. It is incremented by 128 (the size of a render quantum) after the processing of each audio block. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioWorkletGlobalScope/currentFrame) + */ declare var currentFrame: number; +/** + * The read-only **`currentTime`** property of the AudioWorkletGlobalScope interface returns a double that represents the ever-increasing context time of the audio block being processed. It is equal to the currentTime property of the BaseAudioContext the worklet belongs to. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioWorkletGlobalScope/currentTime) + */ declare var currentTime: number; +/** + * The read-only **`sampleRate`** property of the AudioWorkletGlobalScope interface returns a float that represents the sample rate of the associated BaseAudioContext the worklet belongs to. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioWorkletGlobalScope/sampleRate) + */ declare var sampleRate: number; +/** + * The **`registerProcessor`** method of the AudioWorkletGlobalScope interface registers a class constructor derived from AudioWorkletProcessor interface under a specified name. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioWorkletGlobalScope/registerProcessor) + */ declare function registerProcessor(name: string, processorCtor: AudioWorkletProcessorConstructor): void; -type BufferSource = ArrayBufferView | ArrayBuffer; +type AllowSharedBufferSource = ArrayBufferLike | ArrayBufferView; +type BufferSource = ArrayBufferView | ArrayBuffer; type DOMHighResTimeStamp = number; type EventListenerOrEventListenerObject = EventListener | EventListenerObject; type MessageEventSource = MessagePort; -type ReadableStreamController = ReadableStreamDefaultController; -type ReadableStreamDefaultReadResult = ReadableStreamDefaultReadValueResult | ReadableStreamDefaultReadDoneResult; -type ReadableStreamReader = ReadableStreamDefaultReader; -type Transferable = ArrayBuffer | MessagePort; +type ReadableStreamController = ReadableStreamDefaultController | ReadableByteStreamController; +type ReadableStreamReadResult = ReadableStreamReadValueResult | ReadableStreamReadDoneResult; +type ReadableStreamReader = ReadableStreamDefaultReader | ReadableStreamBYOBReader; +type Transferable = MessagePort | ReadableStream | WritableStream | TransformStream | ArrayBuffer; +type CompressionFormat = "brotli" | "deflate" | "deflate-raw" | "gzip"; +type ReadableStreamReaderMode = "byob"; +type ReadableStreamType = "bytes"; + + +///////////////////////////// +/// AudioWorklet Iterable APIs +///////////////////////////// + +interface MessageEvent { + /** @deprecated */ + initMessageEvent(type: string, bubbles?: boolean, cancelable?: boolean, data?: any, origin?: string, lastEventId?: string, source?: MessageEventSource | null, ports?: Iterable): void; +} + +interface URLSearchParamsIterator extends IteratorObject { + [Symbol.iterator](): URLSearchParamsIterator; +} + +interface URLSearchParams { + [Symbol.iterator](): URLSearchParamsIterator<[string, string]>; + /** Returns an array of key, value pairs for every entry in the search params. */ + entries(): URLSearchParamsIterator<[string, string]>; + /** Returns a list of keys in the search params. */ + keys(): URLSearchParamsIterator; + /** Returns a list of values in the search params. */ + values(): URLSearchParamsIterator; +} + + +///////////////////////////// +/// AudioWorklet Async Iterable APIs +///////////////////////////// + +interface ReadableStreamAsyncIterator extends AsyncIteratorObject { + [Symbol.asyncIterator](): ReadableStreamAsyncIterator; +} + +interface ReadableStream { + [Symbol.asyncIterator](options?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterator; + values(options?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterator; +} diff --git a/baselines/audioworklet.iterable.generated.d.ts b/baselines/audioworklet.iterable.generated.d.ts index c807fd845..3b3e55b7a 100644 --- a/baselines/audioworklet.iterable.generated.d.ts +++ b/baselines/audioworklet.iterable.generated.d.ts @@ -1,15 +1,2 @@ -///////////////////////////// -/// AudioWorklet Iterable APIs -///////////////////////////// - -interface MessageEvent { - /** @deprecated */ - initMessageEvent(type: string, bubbles?: boolean, cancelable?: boolean, data?: any, origin?: string, lastEventId?: string, source?: MessageEventSource | null, ports?: Iterable): void; -} - -interface ReadableStream { - [Symbol.iterator](): IterableIterator; - entries(): IterableIterator<[number, any]>; - keys(): IterableIterator; - values(): IterableIterator; -} +// This file's contents are now included in the main types file. +// The file has been left for backward compatibility. diff --git a/baselines/dom.asynciterable.generated.d.ts b/baselines/dom.asynciterable.generated.d.ts new file mode 100644 index 000000000..3b3e55b7a --- /dev/null +++ b/baselines/dom.asynciterable.generated.d.ts @@ -0,0 +1,2 @@ +// This file's contents are now included in the main types file. +// The file has been left for backward compatibility. diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index ea0ab055f..dfcfcd2cf 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -1,13 +1,33 @@ +/// +/// + ///////////////////////////// /// Window APIs ///////////////////////////// +interface AacEncoderConfig { + format?: AacBitstreamFormat; +} + interface AddEventListenerOptions extends EventListenerOptions { once?: boolean; passive?: boolean; signal?: AbortSignal; } +interface AddressErrors { + addressLine?: string; + city?: string; + country?: string; + dependentLocality?: string; + organization?: string; + phone?: string; + postalCode?: string; + recipient?: string; + region?: string; + sortingCode?: string; +} + interface AesCbcParams extends Algorithm { iv: BufferSource; } @@ -39,6 +59,12 @@ interface Algorithm { name: string; } +interface AllAcceptedCredentialsOptions { + allAcceptedCredentialIds: Base64URLString[]; + rpId: string; + userId: Base64URLString; +} + interface AnalyserOptions extends AudioNodeOptions { fftSize?: number; maxDecibels?: number; @@ -47,14 +73,15 @@ interface AnalyserOptions extends AudioNodeOptions { } interface AnimationEventInit extends EventInit { + animation?: CSSAnimation | null; animationName?: string; elapsedTime?: number; pseudoElement?: string; } interface AnimationPlaybackEventInit extends EventInit { - currentTime?: number | null; - timelineTime?: number | null; + currentTime?: CSSNumberish | null; + timelineTime?: CSSNumberish | null; } interface AssignedNodesOptions { @@ -89,6 +116,60 @@ interface AudioContextOptions { sampleRate?: number; } +interface AudioDataCopyToOptions { + format?: AudioSampleFormat; + frameCount?: number; + frameOffset?: number; + planeIndex: number; +} + +interface AudioDataInit { + data: BufferSource; + format: AudioSampleFormat; + numberOfChannels: number; + numberOfFrames: number; + sampleRate: number; + timestamp: number; + transfer?: ArrayBuffer[]; +} + +interface AudioDecoderConfig { + codec: string; + description?: AllowSharedBufferSource; + numberOfChannels: number; + sampleRate: number; +} + +interface AudioDecoderInit { + error: WebCodecsErrorCallback; + output: AudioDataOutputCallback; +} + +interface AudioDecoderSupport { + config?: AudioDecoderConfig; + supported?: boolean; +} + +interface AudioEncoderConfig { + aac?: AacEncoderConfig; + bitrate?: number; + bitrateMode?: BitrateMode; + codec: string; + numberOfChannels: number; + opus?: OpusEncoderConfig; + sampleRate: number; +} + +interface AudioEncoderInit { + error: WebCodecsErrorCallback; + output: EncodedAudioChunkOutputCallback; +} + +interface AudioEncoderSupport { + config?: AudioEncoderConfig; + supported?: boolean; +} + interface AudioNodeOptions { channelCount?: number; channelCountMode?: ChannelCountMode; @@ -116,15 +197,114 @@ interface AudioWorkletNodeOptions extends AudioNodeOptions { interface AuthenticationExtensionsClientInputs { appid?: string; - appidExclude?: string; credProps?: boolean; - uvm?: boolean; + credentialProtectionPolicy?: string; + enforceCredentialProtectionPolicy?: boolean; + hmacCreateSecret?: boolean; + largeBlob?: AuthenticationExtensionsLargeBlobInputs; + minPinLength?: boolean; + prf?: AuthenticationExtensionsPRFInputs; +} + +interface AuthenticationExtensionsClientInputsJSON { + appid?: string; + credProps?: boolean; + largeBlob?: AuthenticationExtensionsLargeBlobInputsJSON; + prf?: AuthenticationExtensionsPRFInputsJSON; } interface AuthenticationExtensionsClientOutputs { appid?: boolean; credProps?: CredentialPropertiesOutput; - uvm?: UvmEntries; + hmacCreateSecret?: boolean; + largeBlob?: AuthenticationExtensionsLargeBlobOutputs; + prf?: AuthenticationExtensionsPRFOutputs; +} + +interface AuthenticationExtensionsClientOutputsJSON { + appid?: boolean; + credProps?: CredentialPropertiesOutput; + largeBlob?: AuthenticationExtensionsLargeBlobOutputsJSON; + prf?: AuthenticationExtensionsPRFOutputsJSON; +} + +interface AuthenticationExtensionsLargeBlobInputs { + read?: boolean; + support?: string; + write?: BufferSource; +} + +interface AuthenticationExtensionsLargeBlobInputsJSON { + read?: boolean; + support?: string; + write?: Base64URLString; +} + +interface AuthenticationExtensionsLargeBlobOutputs { + blob?: ArrayBuffer; + supported?: boolean; + written?: boolean; +} + +interface AuthenticationExtensionsLargeBlobOutputsJSON { + blob?: Base64URLString; + supported?: boolean; + written?: boolean; +} + +interface AuthenticationExtensionsPRFInputs { + eval?: AuthenticationExtensionsPRFValues; + evalByCredential?: Record; +} + +interface AuthenticationExtensionsPRFInputsJSON { + eval?: AuthenticationExtensionsPRFValuesJSON; + evalByCredential?: Record; +} + +interface AuthenticationExtensionsPRFOutputs { + enabled?: boolean; + results?: AuthenticationExtensionsPRFValues; +} + +interface AuthenticationExtensionsPRFOutputsJSON { + enabled?: boolean; + results?: AuthenticationExtensionsPRFValuesJSON; +} + +interface AuthenticationExtensionsPRFValues { + first: BufferSource; + second?: BufferSource; +} + +interface AuthenticationExtensionsPRFValuesJSON { + first: Base64URLString; + second?: Base64URLString; +} + +interface AuthenticationResponseJSON { + authenticatorAttachment?: string; + clientExtensionResults: AuthenticationExtensionsClientOutputsJSON; + id: string; + rawId: Base64URLString; + response: AuthenticatorAssertionResponseJSON; + type: string; +} + +interface AuthenticatorAssertionResponseJSON { + authenticatorData: Base64URLString; + clientDataJSON: Base64URLString; + signature: Base64URLString; + userHandle?: Base64URLString; +} + +interface AuthenticatorAttestationResponseJSON { + attestationObject: Base64URLString; + authenticatorData: Base64URLString; + clientDataJSON: Base64URLString; + publicKey?: Base64URLString; + publicKeyAlgorithm: COSEAlgorithmIdentifier; + transports: string[]; } interface AuthenticatorSelectionCriteria { @@ -134,6 +314,10 @@ interface AuthenticatorSelectionCriteria { userVerification?: UserVerificationRequirement; } +interface AvcEncoderConfig { + format?: AvcBitstreamFormat; +} + interface BiquadFilterOptions extends AudioNodeOptions { Q?: number; detune?: number; @@ -142,7 +326,7 @@ interface BiquadFilterOptions extends AudioNodeOptions { type?: BiquadFilterType; } -interface BlobEventInit { +interface BlobEventInit extends EventInit { data: Blob; timecode?: DOMHighResTimeStamp; } @@ -152,8 +336,23 @@ interface BlobPropertyBag { 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; + baseURL?: string | null; disabled?: boolean; media?: MediaList | string; } @@ -171,6 +370,10 @@ interface CanvasRenderingContext2DSettings { willReadFrequently?: boolean; } +interface CaretPositionFromPointOptions { + shadowRoots?: ShadowRoot[]; +} + interface ChannelMergerOptions extends AudioNodeOptions { numberOfInputs?: number; } @@ -179,6 +382,14 @@ interface ChannelSplitterOptions extends AudioNodeOptions { numberOfOutputs?: number; } +interface CheckVisibilityOptions { + checkOpacity?: boolean; + checkVisibilityCSS?: boolean; + contentVisibilityAuto?: boolean; + opacityProperty?: boolean; + visibilityProperty?: boolean; +} + interface ClientQueryOptions { includeUncontrolled?: boolean; type?: ClientTypes; @@ -198,6 +409,15 @@ interface CloseEventInit extends EventInit { wasClean?: boolean; } +interface CloseWatcherOptions { + signal?: AbortSignal; +} + +interface CommandEventInit extends EventInit { + command?: string; + source?: Element | null; +} + interface CompositionEventInit extends UIEventInit { data?: string; } @@ -207,7 +427,7 @@ interface ComputedEffectTiming extends EffectTiming { currentIteration?: number | null; endTime?: CSSNumberish; localTime?: CSSNumberish | null; - progress?: CSSNumberish | null; + progress?: number | null; startTime?: CSSNumberish; } @@ -223,6 +443,11 @@ interface ConstantSourceOptions { offset?: number; } +interface ConstrainBooleanOrDOMStringParameters { + exact?: boolean | string; + ideal?: boolean | string; +} + interface ConstrainBooleanParameters { exact?: boolean; ideal?: boolean; @@ -243,11 +468,47 @@ interface ConstrainULongRange extends ULongRange { ideal?: number; } +interface ContentVisibilityAutoStateChangeEventInit extends EventInit { + skipped?: boolean; +} + interface ConvolverOptions extends AudioNodeOptions { buffer?: AudioBuffer | null; disableNormalization?: boolean; } +interface CookieChangeEventInit extends EventInit { + changed?: CookieList; + deleted?: CookieList; +} + +interface CookieInit { + domain?: string | null; + expires?: DOMHighResTimeStamp | null; + name: string; + partitioned?: boolean; + path?: string; + sameSite?: CookieSameSite; + value: string; +} + +interface CookieListItem { + name?: string; + value?: string; +} + +interface CookieStoreDeleteOptions { + domain?: string | null; + name: string; + partitioned?: boolean; + path?: string; +} + +interface CookieStoreGetOptions { + name?: string; + url?: string; +} + interface CredentialCreationOptions { publicKey?: PublicKeyCredentialCreationOptions; signal?: AbortSignal; @@ -264,8 +525,15 @@ interface CredentialRequestOptions { } interface CryptoKeyPair { - privateKey?: CryptoKey; - publicKey?: CryptoKey; + privateKey: CryptoKey; + publicKey: CryptoKey; +} + +interface CurrentUserDetailsOptions { + displayName: string; + name: string; + rpId: string; + userId: Base64URLString; } interface CustomEventInit extends EventInit { @@ -353,11 +621,22 @@ interface DeviceOrientationEventInit extends EventInit { gamma?: number | null; } -interface DisplayMediaStreamConstraints { +interface DisplayMediaStreamOptions { audio?: boolean | MediaTrackConstraints; video?: boolean | MediaTrackConstraints; } +interface DocumentPictureInPictureEventInit extends EventInit { + window: Window; +} + +interface DocumentPictureInPictureOptions { + disallowReturnToOpener?: boolean; + height?: number; + preferInitialWindowPlacement?: boolean; + width?: number; +} + interface DocumentTimelineOptions { originTime?: DOMHighResTimeStamp; } @@ -402,7 +681,7 @@ interface EcdsaParams extends Algorithm { interface EffectTiming { delay?: number; direction?: PlaybackDirection; - duration?: number | string; + duration?: number | CSSNumericValue | string; easing?: string; endDelay?: number; fill?: FillMode; @@ -412,6 +691,7 @@ interface EffectTiming { } interface ElementCreationOptions { + customElementRegistry?: CustomElementRegistry | null; is?: string; } @@ -419,6 +699,30 @@ interface ElementDefinitionOptions { extends?: string; } +interface EncodedAudioChunkInit { + data: AllowSharedBufferSource; + duration?: number; + timestamp: number; + transfer?: ArrayBuffer[]; + type: EncodedAudioChunkType; +} + +interface EncodedAudioChunkMetadata { + decoderConfig?: AudioDecoderConfig; +} + +interface EncodedVideoChunkInit { + data: AllowSharedBufferSource; + duration?: number; + timestamp: number; + type: EncodedVideoChunkType; +} + +interface EncodedVideoChunkMetadata { + decoderConfig?: VideoDecoderConfig; + svc?: SvcOutputMetadata; +} + interface ErrorEventInit extends EventInit { colno?: number; error?: any; @@ -462,26 +766,46 @@ 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 { + focusVisible?: boolean; preventScroll?: boolean; } interface FontFaceDescriptors { - display?: string; + ascentOverride?: string; + descentOverride?: string; + display?: FontDisplay; featureSettings?: string; + lineGapOverride?: string; stretch?: string; style?: string; unicodeRange?: string; - variant?: string; + variationSettings?: string; weight?: string; } @@ -494,14556 +818,38175 @@ interface FormDataEventInit extends EventInit { } interface FullscreenOptions { + keyboardLock?: FullscreenKeyboardLock; navigationUI?: FullscreenNavigationUI; } -interface GainOptions extends AudioNodeOptions { - gain?: number; +interface GPUBindGroupDescriptor extends GPUObjectDescriptorBase { + entries: GPUBindGroupEntry[]; + layout: GPUBindGroupLayout; } -interface GamepadEventInit extends EventInit { - gamepad: Gamepad; +interface GPUBindGroupEntry { + binding: GPUIndex32; + resource: GPUBindingResource; } -interface GetAnimationsOptions { - subtree?: boolean; +interface GPUBindGroupLayoutDescriptor extends GPUObjectDescriptorBase { + entries: GPUBindGroupLayoutEntry[]; } -interface GetNotificationOptions { - tag?: string; +interface GPUBindGroupLayoutEntry { + binding: GPUIndex32; + buffer?: GPUBufferBindingLayout; + externalTexture?: GPUExternalTextureBindingLayout; + sampler?: GPUSamplerBindingLayout; + storageTexture?: GPUStorageTextureBindingLayout; + texture?: GPUTextureBindingLayout; + visibility: GPUShaderStageFlags; } -interface GetRootNodeOptions { - composed?: boolean; +interface GPUBlendComponent { + dstFactor?: GPUBlendFactor; + operation?: GPUBlendOperation; + srcFactor?: GPUBlendFactor; } -interface HashChangeEventInit extends EventInit { - newURL?: string; - oldURL?: string; +interface GPUBlendState { + alpha: GPUBlendComponent; + color: GPUBlendComponent; } -interface HkdfParams extends Algorithm { - hash: HashAlgorithmIdentifier; - info: BufferSource; - salt: BufferSource; +interface GPUBufferBinding { + buffer: GPUBuffer; + offset?: GPUSize64; + size?: GPUSize64; } -interface HmacImportParams extends Algorithm { - hash: HashAlgorithmIdentifier; - length?: number; +interface GPUBufferBindingLayout { + hasDynamicOffset?: boolean; + minBindingSize?: GPUSize64; + type?: GPUBufferBindingType; } -interface HmacKeyAlgorithm extends KeyAlgorithm { - hash: KeyAlgorithm; - length: number; +interface GPUBufferDescriptor extends GPUObjectDescriptorBase { + mappedAtCreation?: boolean; + size: GPUSize64; + usage: GPUBufferUsageFlags; } -interface HmacKeyGenParams extends Algorithm { - hash: HashAlgorithmIdentifier; - length?: number; +interface GPUCanvasConfiguration { + alphaMode?: GPUCanvasAlphaMode; + colorSpace?: PredefinedColorSpace; + device: GPUDevice; + format: GPUTextureFormat; + toneMapping?: GPUCanvasToneMapping; + usage?: GPUTextureUsageFlags; + viewFormats?: GPUTextureFormat[]; } -interface IDBDatabaseInfo { - name?: string; - version?: number; +interface GPUCanvasToneMapping { + mode?: GPUCanvasToneMappingMode; } -interface IDBIndexParameters { - multiEntry?: boolean; - unique?: boolean; +interface GPUColorDict { + a: number; + b: number; + g: number; + r: number; } -interface IDBObjectStoreParameters { - autoIncrement?: boolean; - keyPath?: string | string[] | null; +interface GPUColorTargetState { + blend?: GPUBlendState; + format: GPUTextureFormat; + writeMask?: GPUColorWriteFlags; } -interface IDBVersionChangeEventInit extends EventInit { - newVersion?: number | null; - oldVersion?: number; +interface GPUCommandBufferDescriptor extends GPUObjectDescriptorBase { } -interface IIRFilterOptions extends AudioNodeOptions { - feedback: number[]; - feedforward: number[]; +interface GPUCommandEncoderDescriptor extends GPUObjectDescriptorBase { } -interface IdleRequestOptions { - timeout?: number; +interface GPUComputePassDescriptor extends GPUObjectDescriptorBase { + timestampWrites?: GPUComputePassTimestampWrites; } -interface ImageBitmapOptions { - colorSpaceConversion?: ColorSpaceConversion; - imageOrientation?: ImageOrientation; - premultiplyAlpha?: PremultiplyAlpha; - resizeHeight?: number; - resizeQuality?: ResizeQuality; - resizeWidth?: number; +interface GPUComputePassTimestampWrites { + beginningOfPassWriteIndex?: GPUSize32; + endOfPassWriteIndex?: GPUSize32; + querySet: GPUQuerySet; } -interface ImageBitmapRenderingContextSettings { - alpha?: boolean; +interface GPUComputePipelineDescriptor extends GPUPipelineDescriptorBase { + compute: GPUProgrammableStage; } -interface ImageDataSettings { +interface GPUCopyExternalImageDestInfo extends GPUTexelCopyTextureInfo { colorSpace?: PredefinedColorSpace; + premultipliedAlpha?: boolean; } -interface ImportMeta { - url: string; +interface GPUCopyExternalImageSourceInfo { + flipY?: boolean; + origin?: GPUOrigin2D; + source: GPUCopyExternalImageSource; } -interface InputEventInit extends UIEventInit { - data?: string | null; - dataTransfer?: DataTransfer | null; - inputType?: string; - isComposing?: boolean; - targetRanges?: StaticRange[]; +interface GPUDepthStencilState { + depthBias?: GPUDepthBias; + depthBiasClamp?: number; + depthBiasSlopeScale?: number; + depthCompare?: GPUCompareFunction; + depthWriteEnabled?: boolean; + format: GPUTextureFormat; + stencilBack?: GPUStencilFaceState; + stencilFront?: GPUStencilFaceState; + stencilReadMask?: GPUStencilValue; + stencilWriteMask?: GPUStencilValue; } -interface IntersectionObserverEntryInit { - boundingClientRect: DOMRectInit; - intersectionRatio: number; - intersectionRect: DOMRectInit; - isIntersecting: boolean; - rootBounds: DOMRectInit | null; - target: Element; - time: DOMHighResTimeStamp; +interface GPUDeviceDescriptor extends GPUObjectDescriptorBase { + defaultQueue?: GPUQueueDescriptor; + requiredFeatures?: GPUFeatureName[]; + requiredLimits?: Record; } -interface IntersectionObserverInit { - root?: Element | Document | null; - rootMargin?: string; - threshold?: number | number[]; +interface GPUExtent3DDict { + depthOrArrayLayers?: GPUIntegerCoordinate; + height?: GPUIntegerCoordinate; + width: GPUIntegerCoordinate; } -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 GPUExternalTextureBindingLayout { } -interface KeyAlgorithm { - name: string; +interface GPUExternalTextureDescriptor extends GPUObjectDescriptorBase { + colorSpace?: PredefinedColorSpace; + source: HTMLVideoElement | VideoFrame; } -interface KeyboardEventInit extends EventModifierInit { - /** @deprecated */ - charCode?: number; - code?: string; - isComposing?: boolean; - key?: string; - /** @deprecated */ - keyCode?: number; - location?: number; - repeat?: boolean; +interface GPUFragmentState extends GPUProgrammableStage { + targets: (GPUColorTargetState | null)[]; } -interface Keyframe { - composite?: CompositeOperationOrAuto; - easing?: string; - offset?: number | null; - [property: string]: string | number | null | undefined; +interface GPUMultisampleState { + alphaToCoverageEnabled?: boolean; + count?: GPUSize32; + mask?: GPUSampleMask; } -interface KeyframeAnimationOptions extends KeyframeEffectOptions { - id?: string; +interface GPUObjectDescriptorBase { + label?: string; } -interface KeyframeEffectOptions extends EffectTiming { - composite?: CompositeOperation; - iterationComposite?: IterationCompositeOperation; - pseudoElement?: string | null; +interface GPUOrigin2DDict { + x?: GPUIntegerCoordinate; + y?: GPUIntegerCoordinate; } -interface MediaCapabilitiesDecodingInfo extends MediaCapabilitiesInfo { - configuration?: MediaDecodingConfiguration; +interface GPUOrigin3DDict { + x?: GPUIntegerCoordinate; + y?: GPUIntegerCoordinate; + z?: GPUIntegerCoordinate; } -interface MediaCapabilitiesEncodingInfo extends MediaCapabilitiesInfo { - configuration?: MediaEncodingConfiguration; +interface GPUPipelineDescriptorBase extends GPUObjectDescriptorBase { + layout: GPUPipelineLayout | GPUAutoLayoutMode; } -interface MediaCapabilitiesInfo { - powerEfficient: boolean; - smooth: boolean; - supported: boolean; +interface GPUPipelineErrorInit { + reason: GPUPipelineErrorReason; } -interface MediaConfiguration { - audio?: AudioConfiguration; - video?: VideoConfiguration; +interface GPUPipelineLayoutDescriptor extends GPUObjectDescriptorBase { + bindGroupLayouts: (GPUBindGroupLayout | null)[]; + immediateSize?: GPUSize32; } -interface MediaDecodingConfiguration extends MediaConfiguration { - type: MediaDecodingType; +interface GPUPrimitiveState { + cullMode?: GPUCullMode; + frontFace?: GPUFrontFace; + stripIndexFormat?: GPUIndexFormat; + topology?: GPUPrimitiveTopology; + unclippedDepth?: boolean; } -interface MediaElementAudioSourceOptions { - mediaElement: HTMLMediaElement; +interface GPUProgrammableStage { + constants?: Record; + entryPoint?: string; + module: GPUShaderModule; } -interface MediaEncodingConfiguration extends MediaConfiguration { - type: MediaEncodingType; +interface GPUQuerySetDescriptor extends GPUObjectDescriptorBase { + count: GPUSize32; + type: GPUQueryType; } -interface MediaEncryptedEventInit extends EventInit { - initData?: ArrayBuffer | null; - initDataType?: string; +interface GPUQueueDescriptor extends GPUObjectDescriptorBase { } -interface MediaImage { - sizes?: string; - src: string; - type?: string; +interface GPURenderBundleDescriptor extends GPUObjectDescriptorBase { } -interface MediaKeyMessageEventInit extends EventInit { - message: ArrayBuffer; - messageType: MediaKeyMessageType; +interface GPURenderBundleEncoderDescriptor extends GPURenderPassLayout { + depthReadOnly?: boolean; + stencilReadOnly?: boolean; } -interface MediaKeySystemConfiguration { - audioCapabilities?: MediaKeySystemMediaCapability[]; - distinctiveIdentifier?: MediaKeysRequirement; - initDataTypes?: string[]; - label?: string; - persistentState?: MediaKeysRequirement; - sessionTypes?: string[]; - videoCapabilities?: MediaKeySystemMediaCapability[]; +interface GPURenderPassColorAttachment { + clearValue?: GPUColor; + depthSlice?: GPUIntegerCoordinate; + loadOp: GPULoadOp; + resolveTarget?: GPUTexture | GPUTextureView; + storeOp: GPUStoreOp; + view: GPUTexture | GPUTextureView; } -interface MediaKeySystemMediaCapability { - contentType?: string; - encryptionScheme?: string | null; - robustness?: string; +interface GPURenderPassDepthStencilAttachment { + depthClearValue?: number; + depthLoadOp?: GPULoadOp; + depthReadOnly?: boolean; + depthStoreOp?: GPUStoreOp; + stencilClearValue?: GPUStencilValue; + stencilLoadOp?: GPULoadOp; + stencilReadOnly?: boolean; + stencilStoreOp?: GPUStoreOp; + view: GPUTexture | GPUTextureView; } -interface MediaMetadataInit { - album?: string; - artist?: string; - artwork?: MediaImage[]; - title?: string; +interface GPURenderPassDescriptor extends GPUObjectDescriptorBase { + colorAttachments: (GPURenderPassColorAttachment | null)[]; + depthStencilAttachment?: GPURenderPassDepthStencilAttachment; + maxDrawCount?: GPUSize64; + occlusionQuerySet?: GPUQuerySet; + timestampWrites?: GPURenderPassTimestampWrites; } -interface MediaPositionState { - duration?: number; - playbackRate?: number; - position?: number; +interface GPURenderPassLayout extends GPUObjectDescriptorBase { + colorFormats: (GPUTextureFormat | null)[]; + depthStencilFormat?: GPUTextureFormat; + sampleCount?: GPUSize32; } -interface MediaQueryListEventInit extends EventInit { - matches?: boolean; - media?: string; +interface GPURenderPassTimestampWrites { + beginningOfPassWriteIndex?: GPUSize32; + endOfPassWriteIndex?: GPUSize32; + querySet: GPUQuerySet; } -interface MediaRecorderErrorEventInit extends EventInit { - error: DOMException; +interface GPURenderPipelineDescriptor extends GPUPipelineDescriptorBase { + depthStencil?: GPUDepthStencilState; + fragment?: GPUFragmentState; + multisample?: GPUMultisampleState; + primitive?: GPUPrimitiveState; + vertex: GPUVertexState; } -interface MediaRecorderOptions { - audioBitsPerSecond?: number; - bitsPerSecond?: number; - mimeType?: string; - videoBitsPerSecond?: number; +interface GPURequestAdapterOptions { + forceFallbackAdapter?: boolean; + powerPreference?: GPUPowerPreference; } -interface MediaSessionActionDetails { - action: MediaSessionAction; - fastSeek?: boolean | null; - seekOffset?: number | null; - seekTime?: number | null; +interface GPUSamplerBindingLayout { + type?: GPUSamplerBindingType; } -interface MediaStreamAudioSourceOptions { - mediaStream: MediaStream; +interface GPUSamplerDescriptor extends GPUObjectDescriptorBase { + addressModeU?: GPUAddressMode; + addressModeV?: GPUAddressMode; + addressModeW?: GPUAddressMode; + compare?: GPUCompareFunction; + lodMaxClamp?: number; + lodMinClamp?: number; + magFilter?: GPUFilterMode; + maxAnisotropy?: number; + minFilter?: GPUFilterMode; + mipmapFilter?: GPUMipmapFilterMode; } -interface MediaStreamConstraints { - audio?: boolean | MediaTrackConstraints; - peerIdentity?: string; - video?: boolean | MediaTrackConstraints; +interface GPUShaderModuleDescriptor extends GPUObjectDescriptorBase { + code: string; } -interface MediaStreamTrackEventInit extends EventInit { - track: MediaStreamTrack; +interface GPUStencilFaceState { + compare?: GPUCompareFunction; + depthFailOp?: GPUStencilOperation; + failOp?: GPUStencilOperation; + passOp?: GPUStencilOperation; } -interface MediaTrackCapabilities { - aspectRatio?: DoubleRange; - autoGainControl?: boolean[]; - channelCount?: ULongRange; - cursor?: string[]; - deviceId?: string; - displaySurface?: string; - echoCancellation?: boolean[]; - facingMode?: string[]; - frameRate?: DoubleRange; - groupId?: string; - height?: ULongRange; - latency?: DoubleRange; - logicalSurface?: boolean; - noiseSuppression?: boolean[]; - resizeMode?: string[]; - sampleRate?: ULongRange; - sampleSize?: ULongRange; - width?: ULongRange; +interface GPUStorageTextureBindingLayout { + access?: GPUStorageTextureAccess; + format: GPUTextureFormat; + viewDimension?: GPUTextureViewDimension; } -interface MediaTrackConstraintSet { - aspectRatio?: ConstrainDouble; - channelCount?: ConstrainULong; - deviceId?: ConstrainDOMString; - echoCancellation?: ConstrainBoolean; - facingMode?: ConstrainDOMString; - frameRate?: ConstrainDouble; - groupId?: ConstrainDOMString; - height?: ConstrainULong; - latency?: ConstrainDouble; - sampleRate?: ConstrainULong; - sampleSize?: ConstrainULong; - suppressLocalAudioPlayback?: ConstrainBoolean; - width?: ConstrainULong; +interface GPUTexelCopyBufferInfo extends GPUTexelCopyBufferLayout { + buffer: GPUBuffer; } -interface MediaTrackConstraints extends MediaTrackConstraintSet { - advanced?: MediaTrackConstraintSet[]; +interface GPUTexelCopyBufferLayout { + bytesPerRow?: GPUSize32; + offset?: GPUSize64; + rowsPerImage?: GPUSize32; } -interface MediaTrackSettings { - aspectRatio?: number; - deviceId?: string; - echoCancellation?: boolean; - facingMode?: string; - frameRate?: number; - groupId?: string; - height?: number; - restrictOwnAudio?: boolean; - sampleRate?: number; - sampleSize?: number; - width?: number; +interface GPUTexelCopyTextureInfo { + aspect?: GPUTextureAspect; + mipLevel?: GPUIntegerCoordinate; + origin?: GPUOrigin3D; + texture: GPUTexture; } -interface MediaTrackSupportedConstraints { - aspectRatio?: boolean; - deviceId?: boolean; - echoCancellation?: boolean; - facingMode?: boolean; - frameRate?: boolean; - groupId?: boolean; - height?: boolean; - sampleRate?: boolean; - sampleSize?: boolean; - suppressLocalAudioPlayback?: boolean; - width?: boolean; +interface GPUTextureBindingLayout { + multisampled?: boolean; + sampleType?: GPUTextureSampleType; + viewDimension?: GPUTextureViewDimension; } -interface MessageEventInit extends EventInit { - data?: T; - lastEventId?: string; - origin?: string; - ports?: MessagePort[]; - source?: MessageEventSource | null; +interface GPUTextureDescriptor extends GPUObjectDescriptorBase { + dimension?: GPUTextureDimension; + format: GPUTextureFormat; + mipLevelCount?: GPUIntegerCoordinate; + sampleCount?: GPUSize32; + size: GPUExtent3D; + usage: GPUTextureUsageFlags; + viewFormats?: GPUTextureFormat[]; } -interface MouseEventInit extends EventModifierInit { - button?: number; - buttons?: number; - clientX?: number; - clientY?: number; - movementX?: number; - movementY?: number; - relatedTarget?: EventTarget | null; - screenX?: number; - screenY?: number; +interface GPUTextureViewDescriptor extends GPUObjectDescriptorBase { + arrayLayerCount?: GPUIntegerCoordinate; + aspect?: GPUTextureAspect; + baseArrayLayer?: GPUIntegerCoordinate; + baseMipLevel?: GPUIntegerCoordinate; + dimension?: GPUTextureViewDimension; + format?: GPUTextureFormat; + mipLevelCount?: GPUIntegerCoordinate; + usage?: GPUTextureUsageFlags; } -interface MultiCacheQueryOptions extends CacheQueryOptions { - cacheName?: string; +interface GPUUncapturedErrorEventInit extends EventInit { + error: GPUError; } -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 GPUVertexAttribute { + format: GPUVertexFormat; + offset: GPUSize64; + shaderLocation: GPUIndex32; } -interface NotificationAction { - action: string; - icon?: string; - title: string; +interface GPUVertexBufferLayout { + arrayStride: GPUSize64; + attributes: GPUVertexAttribute[]; + stepMode?: GPUVertexStepMode; } -interface NotificationOptions { - actions?: NotificationAction[]; - badge?: string; - body?: string; - data?: any; - dir?: NotificationDirection; - icon?: string; - image?: string; - lang?: string; - renotify?: boolean; - requireInteraction?: boolean; - silent?: boolean; - tag?: string; - timestamp?: DOMTimeStamp; - vibrate?: VibratePattern; +interface GPUVertexState extends GPUProgrammableStage { + buffers?: (GPUVertexBufferLayout | null)[]; } -interface OfflineAudioCompletionEventInit extends EventInit { - renderedBuffer: AudioBuffer; +interface GainOptions extends AudioNodeOptions { + gain?: number; } -interface OfflineAudioContextOptions { - length: number; - numberOfChannels?: number; - sampleRate: number; +interface GamepadEffectParameters { + duration?: number; + leftTrigger?: number; + rightTrigger?: number; + startDelay?: number; + strongMagnitude?: number; + weakMagnitude?: number; } -interface OptionalEffectTiming { - delay?: number; - direction?: PlaybackDirection; - duration?: number | string; - easing?: string; - endDelay?: number; - fill?: FillMode; - iterationStart?: number; - iterations?: number; - playbackRate?: number; +interface GamepadEventInit extends EventInit { + gamepad?: Gamepad | null; } -interface OscillatorOptions extends AudioNodeOptions { - detune?: number; - frequency?: number; - periodicWave?: PeriodicWave; - type?: OscillatorType; +interface GetAnimationsOptions { + subtree?: boolean; } -interface PageTransitionEventInit extends EventInit { - persisted?: boolean; +interface GetComposedRangesOptions { + shadowRoots?: ShadowRoot[]; } -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 GetHTMLOptions { + serializableShadowRoots?: boolean; + shadowRoots?: ShadowRoot[]; } -interface PaymentCurrencyAmount { - currency: string; - value: string; +interface GetNotificationOptions { + tag?: string; } -interface PaymentDetailsBase { - displayItems?: PaymentItem[]; - modifiers?: PaymentDetailsModifier[]; +interface GetRootNodeOptions { + composed?: boolean; } -interface PaymentDetailsInit extends PaymentDetailsBase { - id?: string; - total: PaymentItem; +interface HashChangeEventInit extends EventInit { + newURL?: string; + oldURL?: string; } -interface PaymentDetailsModifier { - additionalDisplayItems?: PaymentItem[]; - data?: any; - supportedMethods: string; - total?: PaymentItem; +interface HighlightHitResult { + highlight?: Highlight; + ranges?: AbstractRange[]; } -interface PaymentDetailsUpdate extends PaymentDetailsBase { - paymentMethodErrors?: any; - total?: PaymentItem; +interface HighlightsFromPointOptions { + shadowRoots?: ShadowRoot[]; } -interface PaymentItem { - amount: PaymentCurrencyAmount; - label: string; - pending?: boolean; +interface HkdfParams extends Algorithm { + hash: HashAlgorithmIdentifier; + info: BufferSource; + salt: BufferSource; } -interface PaymentMethodChangeEventInit extends PaymentRequestUpdateEventInit { - methodDetails?: any; - methodName?: string; +interface HmacImportParams extends Algorithm { + hash: HashAlgorithmIdentifier; + length?: number; } -interface PaymentMethodData { - data?: any; - supportedMethods: string; +interface HmacKeyAlgorithm extends KeyAlgorithm { + hash: KeyAlgorithm; + length: number; } -interface PaymentRequestUpdateEventInit extends EventInit { +interface HmacKeyGenParams extends Algorithm { + hash: HashAlgorithmIdentifier; + length?: number; } -interface PaymentValidationErrors { - error?: string; - paymentMethod?: any; +interface IDBDatabaseInfo { + name?: string; + version?: number; } -interface Pbkdf2Params extends Algorithm { - hash: HashAlgorithmIdentifier; - iterations: number; - salt: BufferSource; +interface IDBIndexParameters { + multiEntry?: boolean; + unique?: boolean; } -interface PerformanceMarkOptions { - detail?: any; - startTime?: DOMHighResTimeStamp; +interface IDBObjectStoreParameters { + autoIncrement?: boolean; + keyPath?: string | string[] | null; } -interface PerformanceMeasureOptions { - detail?: any; - duration?: DOMHighResTimeStamp; - end?: string | DOMHighResTimeStamp; - start?: string | DOMHighResTimeStamp; +interface IDBTransactionOptions { + durability?: IDBTransactionDurability; } -interface PerformanceObserverInit { - buffered?: boolean; - entryTypes?: string[]; - type?: string; +interface IDBVersionChangeEventInit extends EventInit { + newVersion?: number | null; + oldVersion?: number; } -interface PeriodicWaveConstraints { - disableNormalization?: boolean; +interface IIRFilterOptions extends AudioNodeOptions { + feedback: number[]; + feedforward: number[]; } -interface PeriodicWaveOptions extends PeriodicWaveConstraints { - imag?: number[] | Float32Array; - real?: number[] | Float32Array; +interface IdleRequestOptions { + timeout?: number; } -interface PermissionDescriptor { - name: PermissionName; +interface ImageBitmapOptions { + colorSpaceConversion?: ColorSpaceConversion; + imageOrientation?: ImageOrientation; + premultiplyAlpha?: PremultiplyAlpha; + resizeHeight?: number; + resizeQuality?: ResizeQuality; + resizeWidth?: 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 ImageBitmapRenderingContextSettings { + alpha?: boolean; } -interface PopStateEventInit extends EventInit { - state?: any; +interface ImageDataSettings { + colorSpace?: PredefinedColorSpace; + pixelFormat?: ImageDataPixelFormat; } -interface PositionOptions { - enableHighAccuracy?: boolean; - maximumAge?: number; - timeout?: number; +interface ImageDecodeOptions { + completeFramesOnly?: boolean; + frameIndex?: number; } -interface PostMessageOptions { - transfer?: any[]; +interface ImageDecodeResult { + complete: boolean; + image: VideoFrame; } -interface ProgressEventInit extends EventInit { - lengthComputable?: boolean; - loaded?: number; - total?: number; +interface ImageDecoderInit { + colorSpaceConversion?: ColorSpaceConversion; + data: ImageBufferSource; + desiredHeight?: number; + desiredWidth?: number; + preferAnimation?: boolean; + transfer?: ArrayBuffer[]; + type: string; } -interface PromiseRejectionEventInit extends EventInit { - promise: Promise; - reason?: any; +interface ImageEncodeOptions { + quality?: number; + type?: string; } -interface PropertyIndexedKeyframes { - composite?: CompositeOperationOrAuto | CompositeOperationOrAuto[]; - easing?: string | string[]; - offset?: number | (number | null)[]; - [property: string]: string | string[] | number | null | (number | null)[] | undefined; +interface ImportNodeOptions { + customElementRegistry?: CustomElementRegistry; + selfOnly?: boolean; } -interface PublicKeyCredentialCreationOptions { - attestation?: AttestationConveyancePreference; - authenticatorSelection?: AuthenticatorSelectionCriteria; - challenge: BufferSource; - excludeCredentials?: PublicKeyCredentialDescriptor[]; - extensions?: AuthenticationExtensionsClientInputs; - pubKeyCredParams: PublicKeyCredentialParameters[]; - rp: PublicKeyCredentialRpEntity; - timeout?: number; - user: PublicKeyCredentialUserEntity; +interface InputEventInit extends UIEventInit { + data?: string | null; + dataTransfer?: DataTransfer | null; + inputType?: string; + isComposing?: boolean; + targetRanges?: StaticRange[]; } -interface PublicKeyCredentialDescriptor { - id: BufferSource; - transports?: AuthenticatorTransport[]; - type: PublicKeyCredentialType; +interface IntersectionObserverInit { + root?: Element | Document | null; + rootMargin?: string; + scrollMargin?: string; + threshold?: number | number[]; } -interface PublicKeyCredentialEntity { +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 PublicKeyCredentialParameters { - alg: COSEAlgorithmIdentifier; - type: PublicKeyCredentialType; +interface KeySystemTrackConfiguration { + robustness?: string; } -interface PublicKeyCredentialRequestOptions { - allowCredentials?: PublicKeyCredentialDescriptor[]; - challenge: BufferSource; - extensions?: AuthenticationExtensionsClientInputs; - rpId?: string; - timeout?: number; - userVerification?: UserVerificationRequirement; +interface KeyboardEventInit extends EventModifierInit { + /** @deprecated `charCode` is inconsistent across environments, consider using `key` instead. */ + charCode?: number; + code?: string; + isComposing?: boolean; + key?: string; + /** @deprecated `keyCode` is inconsistent across environments, consider using `key` instead. */ + keyCode?: number; + location?: number; + repeat?: boolean; } -interface PublicKeyCredentialRpEntity extends PublicKeyCredentialEntity { - id?: string; +interface Keyframe { + composite?: CompositeOperationOrAuto; + easing?: string; + offset?: number | null; + [property: string]: string | number | null | undefined; } -interface PublicKeyCredentialUserEntity extends PublicKeyCredentialEntity { - displayName: string; - id: BufferSource; +interface KeyframeAnimationOptions extends KeyframeEffectOptions { + id?: string; + rangeEnd?: TimelineRangeOffset | CSSNumericValue | CSSKeywordValue | string; + rangeStart?: TimelineRangeOffset | CSSNumericValue | CSSKeywordValue | string; + timeline?: AnimationTimeline | null; } -interface PushSubscriptionJSON { - endpoint?: string; - expirationTime?: DOMTimeStamp | null; - keys?: Record; +interface KeyframeEffectOptions extends EffectTiming { + composite?: CompositeOperation; + iterationComposite?: IterationCompositeOperation; + pseudoElement?: string | null; } -interface PushSubscriptionOptionsInit { - applicationServerKey?: BufferSource | string | null; - userVisibleOnly?: boolean; +interface LockInfo { + clientId?: string; + mode?: LockMode; + name?: string; } -interface QueuingStrategy { - highWaterMark?: number; - size?: QueuingStrategySize; +interface LockManagerSnapshot { + held?: LockInfo[]; + pending?: LockInfo[]; } -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 LockOptions { + ifAvailable?: boolean; + mode?: LockMode; + signal?: AbortSignal; + steal?: boolean; } -interface RTCAnswerOptions extends RTCOfferAnswerOptions { +interface MIDIConnectionEventInit extends EventInit { + port?: MIDIPort; } -interface RTCCertificateExpiration { - expires?: DOMTimeStamp; +interface MIDIMessageEventInit extends EventInit { + data?: Uint8Array; } -interface RTCConfiguration { - bundlePolicy?: RTCBundlePolicy; - certificates?: RTCCertificate[]; - iceCandidatePoolSize?: number; - iceServers?: RTCIceServer[]; - iceTransportPolicy?: RTCIceTransportPolicy; - rtcpMuxPolicy?: RTCRtcpMuxPolicy; +interface MIDIOptions { + software?: boolean; + sysex?: boolean; } -interface RTCDTMFToneChangeEventInit extends EventInit { - tone?: string; +interface MediaCapabilitiesDecodingInfo extends MediaCapabilitiesInfo { + keySystemAccess: MediaKeySystemAccess | null; } -interface RTCDataChannelEventInit extends EventInit { - channel: RTCDataChannel; +interface MediaCapabilitiesEncodingInfo extends MediaCapabilitiesInfo { } -interface RTCDataChannelInit { - id?: number; - maxPacketLifeTime?: number; - maxRetransmits?: number; - negotiated?: boolean; - ordered?: boolean; - protocol?: string; +interface MediaCapabilitiesInfo { + powerEfficient: boolean; + smooth: boolean; + supported: boolean; } -interface RTCDtlsFingerprint { - algorithm?: string; - value?: string; +interface MediaCapabilitiesKeySystemConfiguration { + audio?: KeySystemTrackConfiguration; + distinctiveIdentifier?: MediaKeysRequirement; + initDataType?: string; + keySystem: string; + persistentState?: MediaKeysRequirement; + sessionTypes?: string[]; + video?: KeySystemTrackConfiguration; } -interface RTCIceCandidateInit { - candidate?: string; - sdpMLineIndex?: number | null; - sdpMid?: string | null; - usernameFragment?: string | null; +interface MediaConfiguration { + audio?: AudioConfiguration; + video?: VideoConfiguration; } -interface RTCIceCandidatePairStats extends RTCStats { - availableIncomingBitrate?: number; - availableOutgoingBitrate?: number; - bytesReceived?: number; - bytesSent?: number; - currentRoundTripTime?: number; - localCandidateId: string; - nominated?: boolean; - remoteCandidateId: string; - requestsReceived?: number; - requestsSent?: number; - responsesReceived?: number; - responsesSent?: number; - state: RTCStatsIceCandidatePairState; - totalRoundTripTime?: number; - transportId: string; +interface MediaDecodingConfiguration extends MediaConfiguration { + keySystemConfiguration?: MediaCapabilitiesKeySystemConfiguration; + type: MediaDecodingType; } -interface RTCIceServer { - credential?: string; - credentialType?: RTCIceCredentialType; - urls: string | string[]; - username?: string; +interface MediaElementAudioSourceOptions { + mediaElement: HTMLMediaElement; } -interface RTCInboundRtpStreamStats extends RTCReceivedRtpStreamStats { - firCount?: number; - framesDecoded?: number; - nackCount?: number; - pliCount?: number; - qpSum?: number; - remoteId?: string; +interface MediaEncodingConfiguration extends MediaConfiguration { + type: MediaEncodingType; } -interface RTCLocalSessionDescriptionInit { - sdp?: string; - type?: RTCSdpType; +interface MediaEncryptedEventInit extends EventInit { + initData?: ArrayBuffer | null; + initDataType?: string; } -interface RTCOfferAnswerOptions { +interface MediaImage { + sizes?: string; + src: string; + type?: string; } -interface RTCOfferOptions extends RTCOfferAnswerOptions { - iceRestart?: boolean; - offerToReceiveAudio?: boolean; - offerToReceiveVideo?: boolean; +interface MediaKeyMessageEventInit extends EventInit { + message: ArrayBuffer; + messageType: MediaKeyMessageType; } -interface RTCOutboundRtpStreamStats extends RTCSentRtpStreamStats { - firCount?: number; - framesEncoded?: number; - nackCount?: number; - pliCount?: number; - qpSum?: number; - remoteId?: string; +interface MediaKeySystemConfiguration { + audioCapabilities?: MediaKeySystemMediaCapability[]; + distinctiveIdentifier?: MediaKeysRequirement; + initDataTypes?: string[]; + label?: string; + persistentState?: MediaKeysRequirement; + sessionTypes?: string[]; + videoCapabilities?: MediaKeySystemMediaCapability[]; } -interface RTCPeerConnectionIceErrorEventInit extends EventInit { - address?: string | null; - errorCode: number; - errorText?: string; - port?: number | null; - url?: string; +interface MediaKeySystemMediaCapability { + contentType?: string; + encryptionScheme?: string | null; + robustness?: string; } -interface RTCPeerConnectionIceEventInit extends EventInit { - candidate?: RTCIceCandidate | null; - url?: string | null; +interface MediaKeysPolicy { + minHdcpVersion?: string; } -interface RTCReceivedRtpStreamStats extends RTCRtpStreamStats { - jitter?: number; - packetsDiscarded?: number; - packetsLost?: number; - packetsReceived?: number; +interface MediaMetadataInit { + album?: string; + artist?: string; + artwork?: MediaImage[]; + title?: string; } -interface RTCRtcpParameters { - cname?: string; - reducedSize?: boolean; +interface MediaPositionState { + duration?: number; + playbackRate?: number; + position?: number; } -interface RTCRtpCapabilities { - codecs: RTCRtpCodecCapability[]; - headerExtensions: RTCRtpHeaderExtensionCapability[]; +interface MediaQueryListEventInit extends EventInit { + matches?: boolean; + media?: string; } -interface RTCRtpCodecCapability { - channels?: number; - clockRate: number; - mimeType: string; - sdpFmtpLine?: string; +interface MediaRecorderOptions { + audioBitsPerSecond?: number; + bitsPerSecond?: number; + mimeType?: string; + videoBitsPerSecond?: number; } -interface RTCRtpCodecParameters { - channels?: number; - clockRate: number; - mimeType: string; - payloadType: number; - sdpFmtpLine?: string; +interface MediaSessionActionDetails { + action: MediaSessionAction; + fastSeek?: boolean; + seekOffset?: number; + seekTime?: number; } -interface RTCRtpCodingParameters { - rid?: string; +interface MediaSettingsRange { + max?: number; + min?: number; + step?: number; } -interface RTCRtpContributingSource { - audioLevel?: number; - rtpTimestamp: number; - source: number; - timestamp: DOMHighResTimeStamp; +interface MediaStreamAudioSourceOptions { + mediaStream: MediaStream; } -interface RTCRtpEncodingParameters extends RTCRtpCodingParameters { - active?: boolean; - maxBitrate?: number; - priority?: RTCPriorityType; - scaleResolutionDownBy?: number; +interface MediaStreamConstraints { + audio?: boolean | MediaTrackConstraints; + peerIdentity?: string; + preferCurrentTab?: boolean; + video?: boolean | MediaTrackConstraints; } -interface RTCRtpHeaderExtensionCapability { - uri?: string; +interface MediaStreamTrackEventInit extends EventInit { + track: MediaStreamTrack; } -interface RTCRtpHeaderExtensionParameters { - encrypted?: boolean; - id: number; - uri: string; +interface MediaTrackCapabilities { + aspectRatio?: DoubleRange; + autoGainControl?: boolean[]; + backgroundBlur?: boolean[]; + channelCount?: ULongRange; + deviceId?: string; + displaySurface?: string; + echoCancellation?: (boolean | string)[]; + facingMode?: string[]; + frameRate?: DoubleRange; + groupId?: string; + height?: ULongRange; + noiseSuppression?: boolean[]; + sampleRate?: ULongRange; + sampleSize?: ULongRange; + width?: ULongRange; } -interface RTCRtpParameters { - codecs: RTCRtpCodecParameters[]; - headerExtensions: RTCRtpHeaderExtensionParameters[]; - rtcp: RTCRtcpParameters; +interface MediaTrackConstraintSet { + aspectRatio?: ConstrainDouble; + autoGainControl?: ConstrainBoolean; + backgroundBlur?: ConstrainBoolean; + channelCount?: ConstrainULong; + deviceId?: ConstrainDOMString; + displaySurface?: ConstrainDOMString; + echoCancellation?: ConstrainBooleanOrDOMString; + facingMode?: ConstrainDOMString; + frameRate?: ConstrainDouble; + groupId?: ConstrainDOMString; + height?: ConstrainULong; + noiseSuppression?: ConstrainBoolean; + sampleRate?: ConstrainULong; + sampleSize?: ConstrainULong; + width?: ConstrainULong; } -interface RTCRtpReceiveParameters extends RTCRtpParameters { +interface MediaTrackConstraints extends MediaTrackConstraintSet { + advanced?: MediaTrackConstraintSet[]; } -interface RTCRtpSendParameters extends RTCRtpParameters { - degradationPreference?: RTCDegradationPreference; - encodings: RTCRtpEncodingParameters[]; - transactionId: string; +interface MediaTrackSettings { + aspectRatio?: number; + autoGainControl?: boolean; + backgroundBlur?: boolean; + channelCount?: number; + deviceId?: string; + displaySurface?: string; + echoCancellation?: boolean | string; + facingMode?: string; + frameRate?: number; + groupId?: string; + height?: number; + noiseSuppression?: boolean; + sampleRate?: number; + sampleSize?: number; + torch?: boolean; + whiteBalanceMode?: string; + width?: number; + zoom?: number; } -interface RTCRtpStreamStats extends RTCStats { - codecId?: string; - kind: string; - ssrc: number; - transportId?: string; +interface MediaTrackSupportedConstraints { + aspectRatio?: boolean; + autoGainControl?: boolean; + backgroundBlur?: 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 RTCRtpSynchronizationSource extends RTCRtpContributingSource { +interface MessageEventInit extends EventInit { + data?: T; + lastEventId?: string; + origin?: string; + ports?: MessagePort[]; + source?: MessageEventSource | null; } -interface RTCRtpTransceiverInit { - direction?: RTCRtpTransceiverDirection; - sendEncodings?: RTCRtpEncodingParameters[]; - streams?: MediaStream[]; +interface MouseEventInit extends EventModifierInit { + button?: number; + buttons?: number; + clientX?: number; + clientY?: number; + movementX?: number; + movementY?: number; + relatedTarget?: EventTarget | null; + screenX?: number; + screenY?: number; } -interface RTCSentRtpStreamStats extends RTCRtpStreamStats { - bytesSent?: number; - packetsSent?: number; +interface MultiCacheQueryOptions extends CacheQueryOptions { + cacheName?: string; } -interface RTCSessionDescriptionInit { - sdp?: string; - type: RTCSdpType; +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 RTCStats { - id: string; - timestamp: DOMHighResTimeStamp; - type: RTCStatsType; +interface NavigateEventInit extends EventInit { + canIntercept?: boolean; + destination: NavigationDestination; + downloadRequest?: string | null; + formData?: FormData | null; + hasUAVisualTransition?: boolean; + hashChange?: boolean; + info?: any; + navigationType?: NavigationType; + signal: AbortSignal; + sourceElement?: Element | null; + userInitiated?: boolean; } -interface RTCTrackEventInit extends EventInit { - receiver: RTCRtpReceiver; - streams?: MediaStream[]; - track: MediaStreamTrack; - transceiver: RTCRtpTransceiver; +interface NavigationCurrentEntryChangeEventInit extends EventInit { + from: NavigationHistoryEntry; + navigationType?: NavigationType | null; } -interface RTCTransportStats extends RTCStats { - bytesReceived?: number; - bytesSent?: number; - dtlsCipher?: string; - dtlsState: RTCDtlsTransportState; - localCertificateId?: string; - remoteCertificateId?: string; - rtcpTransportStatsId?: string; - selectedCandidatePairId?: string; - srtpCipher?: string; - tlsVersion?: string; +interface NavigationInterceptOptions { + focusReset?: NavigationFocusReset; + handler?: NavigationInterceptHandler; + precommitHandler?: NavigationPrecommitHandler; + scroll?: NavigationScrollBehavior; } -interface ReadableStreamDefaultReadDoneResult { - done: true; - value?: undefined; +interface NavigationNavigateOptions extends NavigationOptions { + history?: NavigationHistoryBehavior; + state?: any; } -interface ReadableStreamDefaultReadValueResult { - done: false; - value: T; +interface NavigationOptions { + info?: any; } -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 NavigationPreloadState { + enabled?: boolean; + headerValue?: string; } -interface RegistrationOptions { - scope?: string; - type?: WorkerType; - updateViaCache?: ServiceWorkerUpdateViaCache; +interface NavigationReloadOptions extends NavigationOptions { + state?: any; } -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; - /** - * 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?: any; -} - -interface ResizeObserverOptions { - box?: ResizeObserverBoxOptions; +interface NavigationResult { + committed?: Promise; + finished?: Promise; } -interface ResponseInit { - headers?: HeadersInit; - status?: number; - statusText?: string; +interface NavigationUpdateCurrentEntryOptions { + state: any; } -interface RsaHashedImportParams extends Algorithm { - hash: HashAlgorithmIdentifier; +interface NotificationAction { + action: string; + title: string; } -interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm { - hash: KeyAlgorithm; +interface NotificationOptions { + badge?: string; + body?: string; + data?: any; + dir?: NotificationDirection; + icon?: string; + lang?: string; + requireInteraction?: boolean; + silent?: boolean | null; + tag?: string; } -interface RsaHashedKeyGenParams extends RsaKeyGenParams { - hash: HashAlgorithmIdentifier; +interface OfflineAudioCompletionEventInit extends EventInit { + renderedBuffer: AudioBuffer; } -interface RsaKeyAlgorithm extends KeyAlgorithm { - modulusLength: number; - publicExponent: BigInteger; +interface OfflineAudioContextOptions { + length: number; + numberOfChannels?: number; + sampleRate: number; } -interface RsaKeyGenParams extends Algorithm { - modulusLength: number; - publicExponent: BigInteger; +interface OptionalEffectTiming { + delay?: number; + direction?: PlaybackDirection; + duration?: number | string; + easing?: string; + endDelay?: number; + fill?: FillMode; + iterationStart?: number; + iterations?: number; + playbackRate?: number; } -interface RsaOaepParams extends Algorithm { - label?: BufferSource; +interface OpusEncoderConfig { + complexity?: number; + format?: OpusBitstreamFormat; + frameDuration?: number; + packetlossperc?: number; + usedtx?: boolean; + useinbandfec?: boolean; } -interface RsaOtherPrimesInfo { - d?: string; - r?: string; - t?: string; +interface OscillatorOptions extends AudioNodeOptions { + detune?: number; + frequency?: number; + periodicWave?: PeriodicWave; + type?: OscillatorType; } -interface RsaPssParams extends Algorithm { - saltLength: number; +interface PageRevealEventInit extends EventInit { + viewTransition?: ViewTransition | null; } -interface SVGBoundingBoxOptions { - clipped?: boolean; - fill?: boolean; - markers?: boolean; - stroke?: boolean; +interface PageSwapEventInit extends EventInit { + activation?: NavigationActivation | null; + viewTransition?: ViewTransition | null; } -interface ScrollIntoViewOptions extends ScrollOptions { - block?: ScrollLogicalPosition; - inline?: ScrollLogicalPosition; +interface PageTransitionEventInit extends EventInit { + persisted?: boolean; } -interface ScrollOptions { - behavior?: ScrollBehavior; +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 ScrollToOptions extends ScrollOptions { - left?: number; - top?: number; +interface ParseHTMLUnsafeOptions { + sanitizer?: Sanitizer | SanitizerConfig | SanitizerPresets; } -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 PayerErrors { + email?: string; + name?: string; + phone?: string; } -interface ShadowRootInit { - delegatesFocus?: boolean; - mode: ShadowRootMode; - slotAssignment?: SlotAssignmentMode; +interface PaymentCurrencyAmount { + currency: string; + value: string; } -interface ShareData { - files?: File[]; - text?: string; - title?: string; - url?: string; +interface PaymentDetailsBase { + displayItems?: PaymentItem[]; + modifiers?: PaymentDetailsModifier[]; + shippingOptions?: PaymentShippingOption[]; } -interface SpeechSynthesisErrorEventInit extends SpeechSynthesisEventInit { - error: SpeechSynthesisErrorCode; +interface PaymentDetailsInit extends PaymentDetailsBase { + id?: string; + total: PaymentItem; } -interface SpeechSynthesisEventInit extends EventInit { - charIndex?: number; - charLength?: number; - elapsedTime?: number; - name?: string; - utterance: SpeechSynthesisUtterance; +interface PaymentDetailsModifier { + additionalDisplayItems?: PaymentItem[]; + data?: any; + supportedMethods: string; + total?: PaymentItem; } -interface StaticRangeInit { - endContainer: Node; - endOffset: number; - startContainer: Node; - startOffset: number; +interface PaymentDetailsUpdate extends PaymentDetailsBase { + error?: string; + paymentMethodErrors?: any; + shippingAddressErrors?: AddressErrors; + total?: PaymentItem; } -interface StereoPannerOptions extends AudioNodeOptions { - pan?: number; +interface PaymentItem { + amount: PaymentCurrencyAmount; + label: string; + pending?: boolean; } -interface StorageEstimate { - quota?: number; - usage?: number; +interface PaymentMethodChangeEventInit extends PaymentRequestUpdateEventInit { + methodDetails?: any; + methodName?: string; } -interface StorageEventInit extends EventInit { - key?: string | null; - newValue?: string | null; - oldValue?: string | null; - storageArea?: Storage | null; - url?: string; +interface PaymentMethodData { + data?: any; + supportedMethods: 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 PaymentOptions { + requestPayerEmail?: boolean; + requestPayerName?: boolean; + requestPayerPhone?: boolean; + requestShipping?: boolean; + shippingType?: PaymentShippingType; } -interface SubmitEventInit extends EventInit { - submitter?: HTMLElement | null; +interface PaymentRequestUpdateEventInit extends EventInit { } -interface TextDecodeOptions { - stream?: boolean; +interface PaymentShippingOption { + amount: PaymentCurrencyAmount; + id: string; + label: string; + selected?: boolean; } -interface TextDecoderOptions { - fatal?: boolean; - ignoreBOM?: boolean; +interface PaymentValidationErrors { + error?: string; + payer?: PayerErrors; + shippingAddress?: AddressErrors; } -interface TextEncoderEncodeIntoResult { - read?: number; - written?: number; +interface Pbkdf2Params extends Algorithm { + hash: HashAlgorithmIdentifier; + iterations: number; + salt: BufferSource; } -interface TouchEventInit extends EventModifierInit { - changedTouches?: Touch[]; - targetTouches?: Touch[]; - touches?: Touch[]; +interface PerformanceMarkOptions { + detail?: any; + startTime?: DOMHighResTimeStamp; } -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 PerformanceMeasureOptions { + detail?: any; + duration?: DOMHighResTimeStamp; + end?: string | DOMHighResTimeStamp; + start?: string | DOMHighResTimeStamp; } -interface TrackEventInit extends EventInit { - track?: TextTrack | null; +interface PerformanceObserverInit { + buffered?: boolean; + entryTypes?: string[]; + type?: string; } -interface Transformer { - flush?: TransformerFlushCallback; - readableType?: undefined; - start?: TransformerStartCallback; - transform?: TransformerTransformCallback; - writableType?: undefined; +interface PeriodicWaveConstraints { + disableNormalization?: boolean; } -interface TransitionEventInit extends EventInit { - elapsedTime?: number; - propertyName?: string; - pseudoElement?: string; +interface PeriodicWaveOptions extends PeriodicWaveConstraints { + imag?: number[] | Float32Array; + real?: number[] | Float32Array; } -interface UIEventInit extends EventInit { - detail?: number; - view?: Window | null; - /** @deprecated */ - which?: number; +interface PermissionDescriptor { + name: PermissionName; } -interface ULongRange { - max?: number; - min?: number; +interface PhotoCapabilities { + fillLightMode?: FillLightMode[]; + imageHeight?: MediaSettingsRange; + imageWidth?: MediaSettingsRange; + redEyeReduction?: RedEyeReduction; } -interface UnderlyingSink { - abort?: UnderlyingSinkAbortCallback; - close?: UnderlyingSinkCloseCallback; - start?: UnderlyingSinkStartCallback; - type?: undefined; - write?: UnderlyingSinkWriteCallback; +interface PhotoSettings { + fillLightMode?: FillLightMode; + imageHeight?: number; + imageWidth?: number; + redEyeReduction?: boolean; } -interface UnderlyingSource { - cancel?: UnderlyingSourceCancelCallback; - pull?: UnderlyingSourcePullCallback; - start?: UnderlyingSourceStartCallback; - type?: undefined; +interface PictureInPictureEventInit extends EventInit { + pictureInPictureWindow: PictureInPictureWindow; } -interface VideoConfiguration { - bitrate: number; - colorGamut?: ColorGamut; - contentType: string; - framerate: number; - hdrMetadataType?: HdrMetadataType; - height: number; - scalabilityMode?: string; - transferFunction?: TransferFunction; - width: number; +interface PlaneLayout { + offset: number; + stride: number; } -interface WaveShaperOptions extends AudioNodeOptions { - curve?: number[] | Float32Array; - oversample?: OverSampleType; +interface PointerEventInit extends MouseEventInit { + altitudeAngle?: number; + azimuthAngle?: number; + 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 WebGLContextAttributes { - alpha?: boolean; - antialias?: boolean; - depth?: boolean; - desynchronized?: boolean; - failIfMajorPerformanceCaveat?: boolean; - powerPreference?: WebGLPowerPreference; - premultipliedAlpha?: boolean; - preserveDrawingBuffer?: boolean; - stencil?: boolean; +interface PointerLockOptions { + unadjustedMovement?: boolean; } -interface WebGLContextEventInit extends EventInit { - statusMessage?: string; +interface PopStateEventInit extends EventInit { + hasUAVisualTransition?: boolean; + state?: any; } -interface WheelEventInit extends MouseEventInit { - deltaMode?: number; - deltaX?: number; - deltaY?: number; - deltaZ?: number; +interface PositionOptions { + enableHighAccuracy?: boolean; + maximumAge?: number; + timeout?: number; } -interface WindowPostMessageOptions extends PostMessageOptions { - targetOrigin?: string; +interface ProgressEventInit extends EventInit { + lengthComputable?: boolean; + loaded?: number; + total?: number; } -interface WorkerOptions { - credentials?: RequestCredentials; - name?: string; - type?: WorkerType; +interface PromiseRejectionEventInit extends EventInit { + promise: Promise; + reason?: any; } -interface WorkletOptions { - credentials?: RequestCredentials; +interface PropertyDefinition { + inherits: boolean; + initialValue?: string; + name: string; + syntax?: string; } -type NodeFilter = ((node: Node) => number) | { acceptNode(node: Node): number; }; +interface PropertyIndexedKeyframes { + composite?: CompositeOperationOrAuto | CompositeOperationOrAuto[]; + easing?: string | string[]; + offset?: number | (number | null)[]; + [property: string]: string | string[] | number | null | (number | null)[] | undefined; +} -declare var NodeFilter: { - readonly FILTER_ACCEPT: number; - readonly FILTER_REJECT: number; - readonly FILTER_SKIP: number; - readonly SHOW_ALL: number; - readonly SHOW_ATTRIBUTE: number; - readonly SHOW_CDATA_SECTION: number; - readonly SHOW_COMMENT: number; - readonly SHOW_DOCUMENT: number; - readonly SHOW_DOCUMENT_FRAGMENT: number; - readonly SHOW_DOCUMENT_TYPE: number; - readonly SHOW_ELEMENT: number; - readonly SHOW_ENTITY: number; - readonly SHOW_ENTITY_REFERENCE: number; - readonly SHOW_NOTATION: number; - readonly SHOW_PROCESSING_INSTRUCTION: number; - readonly SHOW_TEXT: number; -}; +interface PublicKeyCredentialCreationOptions { + attestation?: AttestationConveyancePreference; + authenticatorSelection?: AuthenticatorSelectionCriteria; + challenge: BufferSource; + excludeCredentials?: PublicKeyCredentialDescriptor[]; + extensions?: AuthenticationExtensionsClientInputs; + pubKeyCredParams: PublicKeyCredentialParameters[]; + rp: PublicKeyCredentialRpEntity; + timeout?: number; + user: PublicKeyCredentialUserEntity; +} -type XPathNSResolver = ((prefix: string | null) => string | null) | { lookupNamespaceURI(prefix: string | null): string | null; }; +interface PublicKeyCredentialCreationOptionsJSON { + attestation?: string; + authenticatorSelection?: AuthenticatorSelectionCriteria; + challenge: Base64URLString; + excludeCredentials?: PublicKeyCredentialDescriptorJSON[]; + extensions?: AuthenticationExtensionsClientInputsJSON; + hints?: string[]; + pubKeyCredParams: PublicKeyCredentialParameters[]; + rp: PublicKeyCredentialRpEntity; + timeout?: number; + user: PublicKeyCredentialUserEntityJSON; +} -/** 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. */ -interface ANGLE_instanced_arrays { - drawArraysInstancedANGLE(mode: GLenum, first: GLint, count: GLsizei, primcount: GLsizei): void; - drawElementsInstancedANGLE(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, primcount: GLsizei): void; - vertexAttribDivisorANGLE(index: GLuint, divisor: GLuint): void; - readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: GLenum; +interface PublicKeyCredentialDescriptor { + id: BufferSource; + transports?: AuthenticatorTransport[]; + type: PublicKeyCredentialType; } -interface ARIAMixin { - ariaAtomic: string; - ariaAutoComplete: string; - ariaBusy: string; - ariaChecked: string; - ariaColCount: string; - ariaColIndex: string; - ariaColSpan: string; - ariaCurrent: string; - ariaDisabled: string; - ariaExpanded: string; - ariaHasPopup: string; - ariaHidden: string; - ariaKeyShortcuts: string; - ariaLabel: string; - ariaLevel: string; - ariaLive: string; - ariaModal: string; - ariaMultiLine: string; - ariaMultiSelectable: string; - ariaOrientation: string; - ariaPlaceholder: string; - ariaPosInSet: string; - ariaPressed: string; - ariaReadOnly: string; - ariaRequired: string; - ariaRoleDescription: string; - ariaRowCount: string; - ariaRowIndex: string; - ariaRowSpan: string; - ariaSelected: string; - ariaSetSize: string; - ariaSort: string; - ariaValueMax: string; - ariaValueMin: string; - ariaValueNow: string; - ariaValueText: string; -} - -/** A controller object that allows you to abort one or more DOM requests as and when desired. */ -interface AbortController { - /** - * Returns the AbortSignal object associated with this object. - */ - 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. - */ - abort(): void; +interface PublicKeyCredentialDescriptorJSON { + id: Base64URLString; + transports?: string[]; + type: string; } -declare var AbortController: { - prototype: AbortController; - new(): AbortController; -}; +interface PublicKeyCredentialEntity { + name: string; +} -interface AbortSignalEventMap { - "abort": Event; +interface PublicKeyCredentialParameters { + alg: COSEAlgorithmIdentifier; + type: PublicKeyCredentialType; } -/** 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. */ -interface AbortSignal extends EventTarget { - /** - * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. - */ - readonly aborted: boolean; - onabort: ((this: AbortSignal, ev: Event) => any) | null; - 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; +interface PublicKeyCredentialRequestOptions { + allowCredentials?: PublicKeyCredentialDescriptor[]; + challenge: BufferSource; + extensions?: AuthenticationExtensionsClientInputs; + rpId?: string; + timeout?: number; + userVerification?: UserVerificationRequirement; } -declare var AbortSignal: { - prototype: AbortSignal; - new(): AbortSignal; - abort(): AbortSignal; -}; +interface PublicKeyCredentialRequestOptionsJSON { + allowCredentials?: PublicKeyCredentialDescriptorJSON[]; + challenge: Base64URLString; + extensions?: AuthenticationExtensionsClientInputsJSON; + hints?: string[]; + rpId?: string; + timeout?: number; + userVerification?: string; +} -interface AbstractRange { - /** - * Returns true if range is collapsed, and false otherwise. - */ - readonly collapsed: boolean; - /** - * Returns range's end node. - */ - readonly endContainer: Node; - /** - * Returns range's end offset. - */ - readonly endOffset: number; - /** - * Returns range's start node. - */ - readonly startContainer: Node; - /** - * Returns range's start offset. - */ - readonly startOffset: number; +interface PublicKeyCredentialRpEntity extends PublicKeyCredentialEntity { + id?: string; } -declare var AbstractRange: { - prototype: AbstractRange; - new(): AbstractRange; -}; +interface PublicKeyCredentialUserEntity extends PublicKeyCredentialEntity { + displayName: string; + id: BufferSource; +} -interface AbstractWorkerEventMap { - "error": ErrorEvent; +interface PublicKeyCredentialUserEntityJSON { + displayName: string; + id: Base64URLString; + name: string; } -interface AbstractWorker { - 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; +interface PushSubscriptionJSON { + endpoint?: string; + expirationTime?: EpochTimeStamp | null; + keys?: Record; } -/** 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. */ -interface AnalyserNode extends AudioNode { - fftSize: number; - readonly frequencyBinCount: number; - maxDecibels: number; - minDecibels: number; - smoothingTimeConstant: number; - getByteFrequencyData(array: Uint8Array): void; - getByteTimeDomainData(array: Uint8Array): void; - getFloatFrequencyData(array: Float32Array): void; - getFloatTimeDomainData(array: Float32Array): void; +interface PushSubscriptionOptionsInit { + applicationServerKey?: BufferSource | string | null; + userVisibleOnly?: boolean; } -declare var AnalyserNode: { - prototype: AnalyserNode; - new(context: BaseAudioContext, options?: AnalyserOptions): AnalyserNode; -}; +interface QueuingStrategy { + highWaterMark?: number; + size?: QueuingStrategySize; +} -interface Animatable { - animate(keyframes: Keyframe[] | PropertyIndexedKeyframes | null, options?: number | KeyframeAnimationOptions): Animation; - getAnimations(options?: GetAnimationsOptions): Animation[]; +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 AnimationEventMap { - "cancel": AnimationPlaybackEvent; - "finish": AnimationPlaybackEvent; - "remove": Event; +interface RTCAnswerOptions extends RTCOfferAnswerOptions { } -interface Animation extends EventTarget { - currentTime: number | null; - effect: AnimationEffect | null; - readonly finished: Promise; - id: string; - oncancel: ((this: Animation, ev: AnimationPlaybackEvent) => any) | null; - onfinish: ((this: Animation, ev: AnimationPlaybackEvent) => any) | null; - onremove: ((this: Animation, ev: Event) => any) | null; - readonly pending: boolean; - readonly playState: AnimationPlayState; - playbackRate: number; - readonly ready: Promise; - readonly replaceState: AnimationReplaceState; - startTime: number | null; - timeline: AnimationTimeline | null; - cancel(): void; - commitStyles(): void; - finish(): void; - pause(): void; - persist(): void; - play(): void; - reverse(): void; - 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; +interface RTCCertificateExpiration { + expires?: number; } -declare var Animation: { - prototype: Animation; - new(effect?: AnimationEffect | null, timeline?: AnimationTimeline | null): Animation; -}; - -interface AnimationEffect { - getComputedTiming(): ComputedEffectTiming; - getTiming(): EffectTiming; - updateTiming(timing?: OptionalEffectTiming): void; +interface RTCConfiguration { + bundlePolicy?: RTCBundlePolicy; + certificates?: RTCCertificate[]; + iceCandidatePoolSize?: number; + iceServers?: RTCIceServer[]; + iceTransportPolicy?: RTCIceTransportPolicy; + rtcpMuxPolicy?: RTCRtcpMuxPolicy; } -declare var AnimationEffect: { - prototype: AnimationEffect; - new(): AnimationEffect; -}; - -/** Events providing information related to animations. */ -interface AnimationEvent extends Event { - readonly animationName: string; - readonly elapsedTime: number; - readonly pseudoElement: string; +interface RTCDTMFToneChangeEventInit extends EventInit { + tone?: string; } -declare var AnimationEvent: { - prototype: AnimationEvent; - new(type: string, animationEventInitDict?: AnimationEventInit): AnimationEvent; -}; +interface RTCDataChannelEventInit extends EventInit { + channel: RTCDataChannel; +} -interface AnimationFrameProvider { - cancelAnimationFrame(handle: number): void; - requestAnimationFrame(callback: FrameRequestCallback): number; +interface RTCDataChannelInit { + id?: number; + maxPacketLifeTime?: number; + maxRetransmits?: number; + negotiated?: boolean; + ordered?: boolean; + protocol?: string; } -interface AnimationPlaybackEvent extends Event { - readonly currentTime: number | null; - readonly timelineTime: number | null; +interface RTCDtlsFingerprint { + algorithm?: string; + value?: string; } -declare var AnimationPlaybackEvent: { - prototype: AnimationPlaybackEvent; - new(type: string, eventInitDict?: AnimationPlaybackEventInit): AnimationPlaybackEvent; -}; +interface RTCEncodedAudioFrameMetadata extends RTCEncodedFrameMetadata { + sequenceNumber?: number; +} -interface AnimationTimeline { - readonly currentTime: number | null; +interface RTCEncodedFrameMetadata { + contributingSources?: number[]; + mimeType?: string; + payloadType?: number; + rtpTimestamp?: number; + synchronizationSource?: number; } -declare var AnimationTimeline: { - prototype: AnimationTimeline; - new(): AnimationTimeline; -}; +interface RTCEncodedVideoFrameMetadata extends RTCEncodedFrameMetadata { + dependencies?: number[]; + frameId?: number; + height?: number; + spatialIndex?: number; + temporalIndex?: number; + timestamp?: number; + width?: number; +} -/** 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. */ -interface Attr extends Node { - readonly localName: string; - readonly name: string; - readonly namespaceURI: string | null; - readonly ownerDocument: Document; - readonly ownerElement: Element | null; - readonly prefix: string | null; - readonly specified: boolean; - value: string; +interface RTCErrorEventInit extends EventInit { + error: RTCError; } -declare var Attr: { - prototype: Attr; - new(): Attr; -}; +interface RTCErrorInit { + errorDetail: RTCErrorDetailType; + httpRequestStatusCode?: number; + receivedAlert?: number; + sctpCauseCode?: number; + sdpLineNumber?: number; + sentAlert?: number; +} -/** 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. */ -interface AudioBuffer { - readonly duration: number; - readonly length: number; - readonly numberOfChannels: number; - readonly sampleRate: number; - copyFromChannel(destination: Float32Array, channelNumber: number, bufferOffset?: number): void; - copyToChannel(source: Float32Array, channelNumber: number, bufferOffset?: number): void; - getChannelData(channel: number): Float32Array; +interface RTCIceCandidateInit { + candidate?: string; + sdpMLineIndex?: number | null; + sdpMid?: string | null; + usernameFragment?: string | null; } -declare var AudioBuffer: { - prototype: AudioBuffer; - new(options: AudioBufferOptions): AudioBuffer; -}; +interface RTCIceCandidatePairStats extends RTCStats { + availableIncomingBitrate?: number; + availableOutgoingBitrate?: number; + bytesDiscardedOnSend?: number; + bytesReceived?: number; + bytesSent?: number; + consentRequestsSent?: number; + currentRoundTripTime?: number; + lastPacketReceivedTimestamp?: DOMHighResTimeStamp; + lastPacketSentTimestamp?: DOMHighResTimeStamp; + localCandidateId: string; + nominated?: boolean; + packetsDiscardedOnSend?: number; + packetsReceived?: number; + packetsSent?: number; + remoteCandidateId: string; + requestsReceived?: number; + requestsSent?: number; + responsesReceived?: number; + responsesSent?: number; + state: RTCStatsIceCandidatePairState; + totalRoundTripTime?: number; + transportId: string; +} -/** 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. */ -interface AudioBufferSourceNode extends AudioScheduledSourceNode { - buffer: AudioBuffer | null; - readonly detune: AudioParam; - loop: boolean; - loopEnd: number; - loopStart: number; - readonly playbackRate: AudioParam; - 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; +interface RTCIceServer { + credential?: string; + urls: string | string[]; + username?: string; } -declare var AudioBufferSourceNode: { - prototype: AudioBufferSourceNode; - new(context: BaseAudioContext, options?: AudioBufferSourceOptions): AudioBufferSourceNode; -}; +interface RTCInboundRtpStreamStats extends RTCReceivedRtpStreamStats { + audioLevel?: number; + bytesReceived?: number; + concealedSamples?: number; + concealmentEvents?: number; + decoderImplementation?: string; + estimatedPlayoutTimestamp?: DOMHighResTimeStamp; + fecBytesReceived?: number; + fecPacketsDiscarded?: number; + fecPacketsReceived?: number; + fecSsrc?: number; + firCount?: number; + frameHeight?: number; + frameWidth?: number; + framesAssembledFromMultiplePackets?: number; + framesDecoded?: number; + framesDropped?: number; + framesPerSecond?: number; + framesReceived?: number; + framesRendered?: number; + freezeCount?: number; + headerBytesReceived?: number; + insertedSamplesForDeceleration?: number; + jitterBufferDelay?: number; + jitterBufferEmittedCount?: number; + jitterBufferMinimumDelay?: number; + jitterBufferTargetDelay?: number; + keyFramesDecoded?: number; + lastPacketReceivedTimestamp?: DOMHighResTimeStamp; + mid?: string; + nackCount?: number; + packetsDiscarded?: number; + pauseCount?: number; + playoutId?: string; + pliCount?: number; + qpSum?: number; + remoteId?: string; + removedSamplesForAcceleration?: number; + retransmittedBytesReceived?: number; + retransmittedPacketsReceived?: number; + rtxSsrc?: number; + silentConcealedSamples?: number; + totalAssemblyTime?: number; + totalAudioEnergy?: number; + totalDecodeTime?: number; + totalFreezesDuration?: number; + totalInterFrameDelay?: number; + totalPausesDuration?: number; + totalProcessingDelay?: number; + totalSamplesDuration?: number; + totalSamplesReceived?: number; + totalSquaredInterFrameDelay?: number; + trackIdentifier: string; +} + +interface RTCLocalIceCandidateInit extends RTCIceCandidateInit { +} -/** An audio-processing graph built from audio modules linked together, each represented by an AudioNode. */ -interface AudioContext extends BaseAudioContext { - readonly baseLatency: number; - close(): Promise; - createMediaElementSource(mediaElement: HTMLMediaElement): MediaElementAudioSourceNode; - createMediaStreamDestination(): MediaStreamAudioDestinationNode; - createMediaStreamSource(mediaStream: MediaStream): MediaStreamAudioSourceNode; - getOutputTimestamp(): AudioTimestamp; - resume(): Promise; - 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; +interface RTCLocalSessionDescriptionInit { + sdp?: string; + type?: RTCSdpType; } -declare var AudioContext: { - prototype: AudioContext; - new(contextOptions?: AudioContextOptions): AudioContext; -}; +interface RTCOfferAnswerOptions { +} -/** 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. */ -interface AudioDestinationNode extends AudioNode { - readonly maxChannelCount: number; +interface RTCOfferOptions extends RTCOfferAnswerOptions { + iceRestart?: boolean; + offerToReceiveAudio?: boolean; + offerToReceiveVideo?: boolean; } -declare var AudioDestinationNode: { - prototype: AudioDestinationNode; - new(): AudioDestinationNode; -}; +interface RTCOutboundRtpStreamStats extends RTCSentRtpStreamStats { + active?: boolean; + firCount?: number; + frameHeight?: number; + frameWidth?: number; + framesEncoded?: number; + framesPerSecond?: number; + framesSent?: number; + headerBytesSent?: number; + hugeFramesSent?: number; + keyFramesEncoded?: number; + mediaSourceId?: string; + mid?: string; + nackCount?: number; + pliCount?: number; + qpSum?: number; + qualityLimitationDurations?: Record; + qualityLimitationReason?: RTCQualityLimitationReason; + qualityLimitationResolutionChanges?: number; + remoteId?: string; + retransmittedBytesSent?: number; + retransmittedPacketsSent?: number; + rid?: string; + rtxSsrc?: number; + scalabilityMode?: string; + targetBitrate?: number; + totalEncodeTime?: number; + totalEncodedBytesTarget?: number; + totalPacketSendDelay?: number; +} -/** 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. */ -interface AudioListener { - readonly forwardX: AudioParam; - readonly forwardY: AudioParam; - readonly forwardZ: AudioParam; - readonly positionX: AudioParam; - readonly positionY: AudioParam; - readonly positionZ: AudioParam; - readonly upX: AudioParam; - readonly upY: AudioParam; - readonly upZ: AudioParam; - /** @deprecated */ - setOrientation(x: number, y: number, z: number, xUp: number, yUp: number, zUp: number): void; - /** @deprecated */ - setPosition(x: number, y: number, z: number): void; +interface RTCPeerConnectionIceErrorEventInit extends EventInit { + address?: string | null; + errorCode: number; + errorText?: string; + port?: number | null; + url?: string; } -declare var AudioListener: { - prototype: AudioListener; - new(): AudioListener; -}; +interface RTCPeerConnectionIceEventInit extends EventInit { + candidate?: RTCIceCandidate | null; +} -/** A generic interface for representing an audio processing module. Examples include: */ -interface AudioNode extends EventTarget { - channelCount: number; - channelCountMode: ChannelCountMode; - channelInterpretation: ChannelInterpretation; - readonly context: BaseAudioContext; - readonly numberOfInputs: number; - readonly numberOfOutputs: number; - connect(destinationNode: AudioNode, output?: number, input?: number): AudioNode; - connect(destinationParam: AudioParam, output?: number): void; - 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; +interface RTCReceivedRtpStreamStats extends RTCRtpStreamStats { + jitter?: number; + packetsLost?: number; + packetsReceived?: number; } -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). */ -interface AudioParam { - automationRate: AutomationRate; - readonly defaultValue: number; - readonly maxValue: number; - readonly minValue: number; - value: number; - cancelAndHoldAtTime(cancelTime: number): AudioParam; - cancelScheduledValues(cancelTime: number): AudioParam; - exponentialRampToValueAtTime(value: number, endTime: number): AudioParam; - linearRampToValueAtTime(value: number, endTime: number): AudioParam; - setTargetAtTime(target: number, startTime: number, timeConstant: number): AudioParam; - setValueAtTime(value: number, startTime: number): AudioParam; - setValueCurveAtTime(values: number[] | Float32Array, startTime: number, duration: number): AudioParam; +interface RTCRtcpParameters { + cname?: string; + reducedSize?: boolean; } -declare var AudioParam: { - prototype: AudioParam; - new(): AudioParam; -}; - -interface AudioParamMap { - forEach(callbackfn: (value: AudioParam, key: string, parent: AudioParamMap) => void, thisArg?: any): void; +interface RTCRtpCapabilities { + codecs: RTCRtpCodec[]; + headerExtensions: RTCRtpHeaderExtensionCapability[]; } -declare var AudioParamMap: { - prototype: AudioParamMap; - new(): AudioParamMap; -}; +interface RTCRtpCodec { + channels?: number; + clockRate: number; + mimeType: string; + sdpFmtpLine?: string; +} -/** - * 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. - */ -interface AudioProcessingEvent extends Event { - /** @deprecated */ - readonly inputBuffer: AudioBuffer; - /** @deprecated */ - readonly outputBuffer: AudioBuffer; - /** @deprecated */ - readonly playbackTime: number; +interface RTCRtpCodecParameters extends RTCRtpCodec { + payloadType: number; } -/** @deprecated */ -declare var AudioProcessingEvent: { - prototype: AudioProcessingEvent; - new(type: string, eventInitDict: AudioProcessingEventInit): AudioProcessingEvent; -}; +interface RTCRtpCodingParameters { + rid?: string; +} -interface AudioScheduledSourceNodeEventMap { - "ended": Event; +interface RTCRtpContributingSource { + audioLevel?: number; + rtpTimestamp: number; + source: number; + timestamp: DOMHighResTimeStamp; } -interface AudioScheduledSourceNode extends AudioNode { - onended: ((this: AudioScheduledSourceNode, ev: Event) => any) | null; - start(when?: number): void; - 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; +interface RTCRtpEncodingParameters extends RTCRtpCodingParameters { + active?: boolean; + maxBitrate?: number; + maxFramerate?: number; + networkPriority?: RTCPriorityType; + priority?: RTCPriorityType; + scaleResolutionDownBy?: number; } -declare var AudioScheduledSourceNode: { - prototype: AudioScheduledSourceNode; - new(): AudioScheduledSourceNode; -}; +interface RTCRtpHeaderExtensionCapability { + uri: string; +} -interface AudioWorklet extends Worklet { +interface RTCRtpHeaderExtensionParameters { + encrypted?: boolean; + id: number; + uri: string; } -declare var AudioWorklet: { - prototype: AudioWorklet; - new(): AudioWorklet; -}; +interface RTCRtpParameters { + codecs: RTCRtpCodecParameters[]; + headerExtensions: RTCRtpHeaderExtensionParameters[]; + rtcp: RTCRtcpParameters; +} -interface AudioWorkletNodeEventMap { - "processorerror": Event; +interface RTCRtpReceiveParameters extends RTCRtpParameters { } -interface AudioWorkletNode extends AudioNode { - onprocessorerror: ((this: AudioWorkletNode, ev: Event) => any) | null; - readonly parameters: AudioParamMap; - 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; +interface RTCRtpSendParameters extends RTCRtpParameters { + degradationPreference?: RTCDegradationPreference; + encodings: RTCRtpEncodingParameters[]; + transactionId: string; } -declare var AudioWorkletNode: { - prototype: AudioWorkletNode; - new(context: BaseAudioContext, name: string, options?: AudioWorkletNodeOptions): AudioWorkletNode; -}; +interface RTCRtpStreamStats extends RTCStats { + codecId?: string; + kind: string; + ssrc: number; + transportId?: string; +} -interface AuthenticatorAssertionResponse extends AuthenticatorResponse { - readonly authenticatorData: ArrayBuffer; - readonly signature: ArrayBuffer; - readonly userHandle: ArrayBuffer | null; +interface RTCRtpSynchronizationSource extends RTCRtpContributingSource { } -declare var AuthenticatorAssertionResponse: { - prototype: AuthenticatorAssertionResponse; - new(): AuthenticatorAssertionResponse; -}; +interface RTCRtpTransceiverInit { + direction?: RTCRtpTransceiverDirection; + sendEncodings?: RTCRtpEncodingParameters[]; + streams?: MediaStream[]; +} -interface AuthenticatorAttestationResponse extends AuthenticatorResponse { - readonly attestationObject: ArrayBuffer; +interface RTCSentRtpStreamStats extends RTCRtpStreamStats { + bytesSent?: number; + packetsSent?: number; } -declare var AuthenticatorAttestationResponse: { - prototype: AuthenticatorAttestationResponse; - new(): AuthenticatorAttestationResponse; -}; +interface RTCSessionDescriptionInit { + sdp?: string; + type: RTCSdpType; +} -interface AuthenticatorResponse { - readonly clientDataJSON: ArrayBuffer; +interface RTCSetParameterOptions { } -declare var AuthenticatorResponse: { - prototype: AuthenticatorResponse; - new(): AuthenticatorResponse; -}; +interface RTCStats { + id: string; + timestamp: DOMHighResTimeStamp; + type: RTCStatsType; +} -interface BarProp { - readonly visible: boolean; +interface RTCTrackEventInit extends EventInit { + receiver: RTCRtpReceiver; + streams?: MediaStream[]; + track: MediaStreamTrack; + transceiver: RTCRtpTransceiver; } -declare var BarProp: { - prototype: BarProp; - new(): BarProp; -}; +interface RTCTransportStats extends RTCStats { + bytesReceived?: number; + bytesSent?: number; + dtlsCipher?: string; + dtlsRole?: RTCDtlsRole; + dtlsState: RTCDtlsTransportState; + iceLocalUsernameFragment?: string; + iceRole?: RTCIceRole; + iceState?: RTCIceTransportState; + localCertificateId?: string; + packetsReceived?: number; + packetsSent?: number; + remoteCertificateId?: string; + selectedCandidatePairChanges?: number; + selectedCandidatePairId?: string; + srtpCipher?: string; + tlsVersion?: string; +} -interface BaseAudioContextEventMap { - "statechange": Event; +interface ReadableStreamBYOBReaderReadOptions { + min?: number; } -interface BaseAudioContext extends EventTarget { - readonly audioWorklet: AudioWorklet; - readonly currentTime: number; - readonly destination: AudioDestinationNode; - readonly listener: AudioListener; - onstatechange: ((this: BaseAudioContext, ev: Event) => any) | null; - readonly sampleRate: number; - readonly state: AudioContextState; - createAnalyser(): AnalyserNode; - createBiquadFilter(): BiquadFilterNode; - createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer; - createBufferSource(): AudioBufferSourceNode; - createChannelMerger(numberOfInputs?: number): ChannelMergerNode; - createChannelSplitter(numberOfOutputs?: number): ChannelSplitterNode; - createConstantSource(): ConstantSourceNode; - createConvolver(): ConvolverNode; - createDelay(maxDelayTime?: number): DelayNode; - createDynamicsCompressor(): DynamicsCompressorNode; - createGain(): GainNode; - createIIRFilter(feedforward: number[], feedback: number[]): IIRFilterNode; - createOscillator(): OscillatorNode; - createPanner(): PannerNode; - createPeriodicWave(real: number[] | Float32Array, imag: number[] | Float32Array, constraints?: PeriodicWaveConstraints): PeriodicWave; - /** @deprecated */ - createScriptProcessor(bufferSize?: number, numberOfInputChannels?: number, numberOfOutputChannels?: number): ScriptProcessorNode; - createStereoPanner(): StereoPannerNode; - createWaveShaper(): WaveShaperNode; - 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; +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; } -declare var BaseAudioContext: { - prototype: BaseAudioContext; - new(): BaseAudioContext; -}; +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; +} -/** The beforeunload event is fired when the window, the document and its resources are about to be unloaded. */ -interface BeforeUnloadEvent extends Event { - returnValue: any; +interface ReadableStreamReadDoneResult { + done: true; + value: T | undefined; } -declare var BeforeUnloadEvent: { - prototype: BeforeUnloadEvent; - new(): BeforeUnloadEvent; -}; +interface ReadableStreamReadValueResult { + done: false; + value: T; +} -/** 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. */ -interface BiquadFilterNode extends AudioNode { - readonly Q: AudioParam; - readonly detune: AudioParam; - readonly frequency: AudioParam; - readonly gain: AudioParam; - type: BiquadFilterType; - getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void; +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; } -declare var BiquadFilterNode: { - prototype: BiquadFilterNode; - new(context: BaseAudioContext, options?: BiquadFilterOptions): BiquadFilterNode; -}; +interface RegistrationOptions { + scope?: string; + type?: WorkerType; + updateViaCache?: ServiceWorkerUpdateViaCache; +} -/** 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. */ -interface Blob { - readonly size: number; - readonly type: string; - arrayBuffer(): Promise; - slice(start?: number, end?: number, contentType?: string): Blob; - stream(): ReadableStream; - text(): Promise; +interface RegistrationResponseJSON { + authenticatorAttachment?: string; + clientExtensionResults: AuthenticationExtensionsClientOutputsJSON; + id: string; + rawId: Base64URLString; + response: AuthenticatorAttestationResponseJSON; + type: string; } -declare var Blob: { - prototype: Blob; - new(blobParts?: BlobPart[], options?: BlobPropertyBag): Blob; -}; +interface Report { + body?: ReportBody | null; + type?: string; + url?: string; +} -interface BlobEvent extends Event { - readonly data: Blob; - readonly timecode: DOMHighResTimeStamp; +interface ReportBody { } -declare var BlobEvent: { - prototype: BlobEvent; - new(type: string, eventInitDict: BlobEventInit): BlobEvent; -}; +interface ReportingObserverOptions { + buffered?: boolean; + types?: string[]; +} -interface Body { - readonly body: ReadableStream | null; - readonly bodyUsed: boolean; - arrayBuffer(): Promise; - blob(): Promise; - formData(): Promise; - json(): Promise; - text(): Promise; +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 BroadcastChannelEventMap { - "message": MessageEvent; - "messageerror": MessageEvent; +interface ResizeObserverOptions { + box?: ResizeObserverBoxOptions; } -interface BroadcastChannel extends EventTarget { - /** - * Returns the channel name (as passed to the constructor). - */ - readonly name: string; - onmessage: ((this: BroadcastChannel, ev: MessageEvent) => any) | null; - onmessageerror: ((this: BroadcastChannel, ev: MessageEvent) => any) | null; - /** - * Closes the BroadcastChannel object, opening it up to garbage collection. - */ - 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. - */ - 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; +interface ResponseInit { + headers?: HeadersInit; + status?: number; + statusText?: string; } -declare var BroadcastChannel: { - prototype: BroadcastChannel; - new(name: string): BroadcastChannel; -}; +interface RsaHashedImportParams extends Algorithm { + hash: HashAlgorithmIdentifier; +} -/** This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams. */ -interface ByteLengthQueuingStrategy extends QueuingStrategy { - readonly highWaterMark: number; - readonly size: QueuingStrategySize; +interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm { + hash: KeyAlgorithm; } -declare var ByteLengthQueuingStrategy: { - prototype: ByteLengthQueuingStrategy; - new(init: QueuingStrategyInit): ByteLengthQueuingStrategy; -}; +interface RsaHashedKeyGenParams extends RsaKeyGenParams { + hash: HashAlgorithmIdentifier; +} -/** 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. */ -interface CDATASection extends Text { +interface RsaKeyAlgorithm extends KeyAlgorithm { + modulusLength: number; + publicExponent: BigInteger; } -declare var CDATASection: { - prototype: CDATASection; - new(): CDATASection; -}; +interface RsaKeyGenParams extends Algorithm { + modulusLength: number; + publicExponent: BigInteger; +} -interface CSSAnimation extends Animation { - 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; +interface RsaOaepParams extends Algorithm { + label?: BufferSource; } -declare var CSSAnimation: { - prototype: CSSAnimation; - new(): CSSAnimation; -}; +interface RsaOtherPrimesInfo { + d?: string; + r?: string; + t?: string; +} -/** A single condition CSS at-rule, which consists of a condition and a statement block. It is a child of CSSGroupingRule. */ -interface CSSConditionRule extends CSSGroupingRule { - conditionText: string; +interface RsaPssParams extends Algorithm { + saltLength: number; } -declare var CSSConditionRule: { - prototype: CSSConditionRule; - new(): CSSConditionRule; -}; +interface SVGBoundingBoxOptions { + clipped?: boolean; + fill?: boolean; + markers?: boolean; + stroke?: boolean; +} -interface CSSCounterStyleRule extends CSSRule { - additiveSymbols: string; - fallback: string; +interface SanitizerAttributeNamespace { name: string; - negative: string; - pad: string; - prefix: string; - range: string; - speakAs: string; - suffix: string; - symbols: string; - system: string; + namespace?: string | null; } -declare var CSSCounterStyleRule: { - prototype: CSSCounterStyleRule; - new(): CSSCounterStyleRule; -}; - -interface CSSFontFaceRule extends CSSRule { - readonly style: CSSStyleDeclaration; +interface SanitizerConfig { + attributes?: SanitizerAttribute[]; + comments?: boolean; + dataAttributes?: boolean; + elements?: SanitizerElementWithAttributes[]; + processingInstructions?: SanitizerPI[]; + removeAttributes?: SanitizerAttribute[]; + removeElements?: SanitizerElement[]; + removeProcessingInstructions?: SanitizerPI[]; + replaceWithChildrenElements?: SanitizerElement[]; } -declare var CSSFontFaceRule: { - prototype: CSSFontFaceRule; - new(): CSSFontFaceRule; -}; +interface SanitizerElementNamespace { + name: string; + namespace?: string | null; +} -/** Any CSS at-rule that contains other rules nested within it. */ -interface CSSGroupingRule extends CSSRule { - readonly cssRules: CSSRuleList; - deleteRule(index: number): void; - insertRule(rule: string, index?: number): number; +interface SanitizerElementNamespaceWithAttributes extends SanitizerElementNamespace { + attributes?: SanitizerAttribute[]; + removeAttributes?: SanitizerAttribute[]; } -declare var CSSGroupingRule: { - prototype: CSSGroupingRule; - new(): CSSGroupingRule; -}; +interface SanitizerProcessingInstruction { + target: string; +} -interface CSSImportRule extends CSSRule { - readonly href: string; - readonly media: MediaList; - readonly styleSheet: CSSStyleSheet; +interface SchedulerPostTaskOptions { + delay?: number; + priority?: TaskPriority; + signal?: AbortSignal; } -declare var CSSImportRule: { - prototype: CSSImportRule; - new(): CSSImportRule; -}; +interface ScrollIntoViewOptions extends ScrollOptions { + block?: ScrollLogicalPosition; + inline?: ScrollLogicalPosition; +} -/** 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). */ -interface CSSKeyframeRule extends CSSRule { - keyText: string; - readonly style: CSSStyleDeclaration; +interface ScrollOptions { + behavior?: ScrollBehavior; } -declare var CSSKeyframeRule: { - prototype: CSSKeyframeRule; - new(): CSSKeyframeRule; -}; +interface ScrollTimelineOptions { + axis?: ScrollAxis; + source?: Element | null; +} -/** 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). */ -interface CSSKeyframesRule extends CSSRule { - readonly cssRules: CSSRuleList; - name: string; - appendRule(rule: string): void; - deleteRule(select: string): void; - findRule(select: string): CSSKeyframeRule | null; +interface ScrollToOptions extends ScrollOptions { + left?: number; + top?: number; } -declare var CSSKeyframesRule: { - prototype: CSSKeyframesRule; - new(): CSSKeyframesRule; -}; +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; +} -/** 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). */ -interface CSSMediaRule extends CSSConditionRule { - readonly media: MediaList; +interface SerialInputSignals { + clearToSend: boolean; + dataCarrierDetect: boolean; + dataSetReady: boolean; + ringIndicator: boolean; } -declare var CSSMediaRule: { - prototype: CSSMediaRule; - new(): CSSMediaRule; -}; +interface SerialOptions { + baudRate: number; + bufferSize?: number; + dataBits?: number; + flowControl?: FlowControlType; + parity?: ParityType; + stopBits?: number; +} -/** An object representing a single CSS @namespace at-rule. It implements the CSSRule interface, with a type value of 10 (CSSRule.NAMESPACE_RULE). */ -interface CSSNamespaceRule extends CSSRule { - readonly namespaceURI: string; - readonly prefix: string; +interface SerialOutputSignals { + break?: boolean; + dataTerminalReady?: boolean; + requestToSend?: boolean; } -declare var CSSNamespaceRule: { - prototype: CSSNamespaceRule; - new(): CSSNamespaceRule; -}; +interface SerialPortFilter { + bluetoothServiceClassId?: BluetoothServiceUUID; + usbProductId?: number; + usbVendorId?: number; +} -/** CSSPageRule is an interface representing a single CSS @page rule. It implements the CSSRule interface with a type value of 6 (CSSRule.PAGE_RULE). */ -interface CSSPageRule extends CSSGroupingRule { - selectorText: string; - readonly style: CSSStyleDeclaration; +interface SerialPortInfo { + bluetoothServiceClassId?: BluetoothServiceUUID; + usbProductId?: number; + usbVendorId?: number; } -declare var CSSPageRule: { - prototype: CSSPageRule; - new(): CSSPageRule; -}; +interface SerialPortRequestOptions { + allowedBluetoothServiceClassIds?: BluetoothServiceUUID[]; + filters?: SerialPortFilter[]; +} -/** A single CSS rule. There are several types of rules, listed in the Type constants section below. */ -interface CSSRule { - cssText: string; - readonly parentRule: CSSRule | null; - readonly parentStyleSheet: CSSStyleSheet | null; - /** @deprecated */ - readonly type: number; - readonly CHARSET_RULE: number; - readonly FONT_FACE_RULE: number; - readonly IMPORT_RULE: number; - readonly KEYFRAMES_RULE: number; - readonly KEYFRAME_RULE: number; - readonly MEDIA_RULE: number; - readonly NAMESPACE_RULE: number; - readonly PAGE_RULE: number; - readonly STYLE_RULE: number; - readonly SUPPORTS_RULE: number; +interface SetHTMLOptions { + sanitizer?: Sanitizer | SanitizerConfig | SanitizerPresets; } -declare var CSSRule: { - prototype: CSSRule; - new(): CSSRule; - readonly CHARSET_RULE: number; - readonly FONT_FACE_RULE: number; - readonly IMPORT_RULE: number; - readonly KEYFRAMES_RULE: number; - readonly KEYFRAME_RULE: number; - readonly MEDIA_RULE: number; - readonly NAMESPACE_RULE: number; - readonly PAGE_RULE: number; - readonly STYLE_RULE: number; - readonly SUPPORTS_RULE: number; -}; - -/** A CSSRuleList is an (indirect-modify only) array-like object containing an ordered collection of CSSRule objects. */ -interface CSSRuleList { - readonly length: number; - item(index: number): CSSRule | null; - [index: number]: CSSRule; +interface SetHTMLUnsafeOptions { + sanitizer?: Sanitizer | SanitizerConfig | SanitizerPresets; } -declare var CSSRuleList: { - prototype: CSSRuleList; - new(): CSSRuleList; -}; +interface ShadowRootInit { + clonable?: boolean; + customElementRegistry?: CustomElementRegistry | null; + delegatesFocus?: boolean; + mode: ShadowRootMode; + serializable?: boolean; + slotAssignment?: SlotAssignmentMode; +} -/** An object that is a CSS declaration block, and exposes style information and various style-related methods and properties. */ -interface CSSStyleDeclaration { - alignContent: string; - alignItems: string; - alignSelf: string; - alignmentBaseline: string; - all: string; - animation: string; - animationDelay: string; - animationDirection: string; - animationDuration: string; - animationFillMode: string; - animationIterationCount: string; - animationName: string; - animationPlayState: string; - animationTimingFunction: string; - appearance: string; - aspectRatio: string; - backfaceVisibility: string; - background: string; - backgroundAttachment: string; - backgroundBlendMode: string; - backgroundClip: string; - backgroundColor: string; - backgroundImage: string; - backgroundOrigin: string; - backgroundPosition: string; - backgroundPositionX: string; - backgroundPositionY: string; - backgroundRepeat: string; - backgroundSize: string; - baselineShift: string; - blockSize: string; - border: string; - borderBlock: string; - borderBlockColor: string; - borderBlockEnd: string; - borderBlockEndColor: string; - borderBlockEndStyle: string; - borderBlockEndWidth: string; - borderBlockStart: string; - borderBlockStartColor: string; - borderBlockStartStyle: string; - borderBlockStartWidth: string; - borderBlockStyle: string; - borderBlockWidth: string; - borderBottom: string; - borderBottomColor: string; - borderBottomLeftRadius: string; - borderBottomRightRadius: string; - borderBottomStyle: string; - borderBottomWidth: string; - borderCollapse: string; - borderColor: string; - borderEndEndRadius: string; - borderEndStartRadius: string; - borderImage: string; - borderImageOutset: string; - borderImageRepeat: string; - borderImageSlice: string; - borderImageSource: string; - borderImageWidth: string; - borderInline: string; - borderInlineColor: string; - borderInlineEnd: string; - borderInlineEndColor: string; - borderInlineEndStyle: string; - borderInlineEndWidth: string; - borderInlineStart: string; - borderInlineStartColor: string; - borderInlineStartStyle: string; - borderInlineStartWidth: string; - borderInlineStyle: string; - borderInlineWidth: string; - borderLeft: string; - borderLeftColor: string; - borderLeftStyle: string; - borderLeftWidth: string; - borderRadius: string; - borderRight: string; - borderRightColor: string; - borderRightStyle: string; - borderRightWidth: string; - borderSpacing: string; - borderStartEndRadius: string; - borderStartStartRadius: string; - borderStyle: string; - borderTop: string; - borderTopColor: string; - borderTopLeftRadius: string; - borderTopRightRadius: string; - borderTopStyle: string; - borderTopWidth: string; - borderWidth: string; - bottom: string; - boxShadow: string; - boxSizing: string; - breakAfter: string; - breakBefore: string; - breakInside: string; - captionSide: string; - caretColor: string; - clear: string; +interface ShareData { + files?: File[]; + text?: string; + title?: string; + url?: string; +} + +interface ShowPopoverOptions { + source?: HTMLElement; +} + +interface SpeechRecognitionErrorEventInit extends EventInit { + error: SpeechRecognitionErrorCode; + message?: string; +} + +interface SpeechRecognitionEventInit extends EventInit { + resultIndex?: number; + results: SpeechRecognitionResultList; +} + +interface SpeechSynthesisErrorEventInit extends SpeechSynthesisEventInit { + error: SpeechSynthesisErrorCode; +} + +interface SpeechSynthesisEventInit extends EventInit { + charIndex?: number; + charLength?: number; + elapsedTime?: number; + name?: string; + utterance: SpeechSynthesisUtterance; +} + +interface StartViewTransitionOptions { + types?: string[] | null; + update?: ViewTransitionUpdateCallback | null; +} + +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 SvcOutputMetadata { + temporalLayerId?: number; +} + +interface TaskControllerInit { + priority?: TaskPriority; +} + +interface TaskPriorityChangeEventInit extends EventInit { + previousPriority: TaskPriority; +} + +interface TaskSignalAnyInit { + priority?: TaskPriority | TaskSignal; +} + +interface TextDecodeOptions { + stream?: boolean; +} + +interface TextDecoderOptions { + fatal?: boolean; + ignoreBOM?: boolean; +} + +interface TextEncoderEncodeIntoResult { + read: number; + written: number; +} + +interface TimelineRangeOffset { + offset?: CSSNumericValue; + rangeName?: string | null; +} + +interface ToggleEventInit extends EventInit { + newState?: string; + oldState?: string; + source?: Element | null; +} + +interface TogglePopoverOptions extends ShowPopoverOptions { + force?: boolean; +} + +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 { + animation?: CSSTransition | null; + elapsedTime?: number; + propertyName?: string; + pseudoElement?: string; +} + +interface UIEventInit extends EventInit { + detail?: number; + view?: Window | null; /** @deprecated */ - clip: string; + which?: number; +} + +interface ULongRange { + max?: number; + min?: number; +} + +interface URLPatternComponentResult { + groups: Record; + input: string; +} + +interface URLPatternInit { + baseURL?: string; + hash?: string; + hostname?: string; + password?: string; + pathname?: string; + port?: string; + protocol?: string; + search?: string; + username?: string; +} + +interface URLPatternOptions { + ignoreCase?: boolean; +} + +interface URLPatternResult { + hash: URLPatternComponentResult; + hostname: URLPatternComponentResult; + inputs: URLPatternInput[]; + password: URLPatternComponentResult; + pathname: URLPatternComponentResult; + port: URLPatternComponentResult; + protocol: URLPatternComponentResult; + search: URLPatternComponentResult; + username: URLPatternComponentResult; +} + +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 UnknownCredentialOptions { + credentialId: Base64URLString; + rpId: string; +} + +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; + hasAlphaChannel?: boolean; + 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; + contentHint?: string; + displayHeight?: number; + displayWidth?: number; + framerate?: number; + hardwareAcceleration?: HardwareAcceleration; + height: number; + latencyMode?: LatencyMode; + scalabilityMode?: string; + width: number; +} + +interface VideoEncoderEncodeOptions { + avc?: VideoEncoderEncodeOptionsForAvc; + keyFrame?: boolean; +} + +interface VideoEncoderEncodeOptionsForAvc { + quantizer?: number | null; +} + +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 { + colorSpace?: PredefinedColorSpace; + format?: VideoPixelFormat; + layout?: PlaneLayout[]; + rect?: DOMRectInit; +} + +interface VideoFrameInit { + alpha?: AlphaOption; + displayHeight?: number; + displayWidth?: number; + duration?: number; + timestamp?: number; + visibleRect?: DOMRectInit; +} + +interface ViewTimelineOptions { + axis?: ScrollAxis; + inset?: string | (CSSNumericValue | CSSKeywordValue)[]; + subject?: Element; +} + +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; + xrCompatible?: boolean; +} + +interface WebGLContextEventInit extends EventInit { + statusMessage?: string; +} + +interface WebTransportCloseInfo { + closeCode?: number; + reason?: string; +} + +interface WebTransportConnectionStats { + bytesReceived?: number; + datagrams: WebTransportDatagramStats; + minRtt?: DOMHighResTimeStamp; + packetsLost?: number; + packetsReceived?: number; + packetsSent?: number; + rttVariation?: DOMHighResTimeStamp; + smoothedRtt?: DOMHighResTimeStamp; +} + +interface WebTransportDatagramStats { + droppedIncoming?: number; + expiredOutgoing?: number; + lostOutgoing?: number; +} + +interface WebTransportErrorOptions { + source?: WebTransportErrorSource; + streamErrorCode?: number | null; +} + +interface WebTransportHash { + algorithm: string; + value: BufferSource; +} + +interface WebTransportOptions { + allowPooling?: boolean; + congestionControl?: WebTransportCongestionControl; + protocols?: string[]; + requireUnreliable?: boolean; + serverCertificateHashes?: WebTransportHash[]; +} + +interface WebTransportReceiveStreamStats { + bytesRead?: number; + bytesReceived?: number; +} + +interface WebTransportSendOptions { + sendOrder?: number; +} + +interface WebTransportSendStreamOptions extends WebTransportSendOptions { +} + +interface WebTransportSendStreamStats { + bytesAcknowledged?: number; + bytesSent?: number; + bytesWritten?: 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 { + /** + * The **`ANGLE_instanced_arrays.drawArraysInstancedANGLE()`** method of the WebGL API renders primitives from array data like the gl.drawArrays() method. In addition, it can execute multiple instances of the range of elements. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ANGLE_instanced_arrays/drawArraysInstancedANGLE) + */ + drawArraysInstancedANGLE(mode: GLenum, first: GLint, count: GLsizei, primcount: GLsizei): void; + /** + * The **`ANGLE_instanced_arrays.drawElementsInstancedANGLE()`** method of the WebGL API renders primitives from array data like the gl.drawElements() method. In addition, it can execute multiple instances of a set of elements. + * + * [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; + /** + * The **`ANGLE_instanced_arrays.vertexAttribDivisorANGLE()`** method of the WebGL API modifies the rate at which generic vertex attributes advance when rendering multiple instances of primitives with ext.drawArraysInstancedANGLE() and ext.drawElementsInstancedANGLE(). + * + * [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 { + /** + * The **`ariaActiveDescendantElement`** property of the Element interface represents the current active element when focus is on a composite widget, combobox, textbox, group, or application. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaActiveDescendantElement) + */ + ariaActiveDescendantElement: Element | null; + /** + * The **`ariaAtomic`** property of the Element interface reflects the value of the aria-atomic attribute, which indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaAtomic) + */ + ariaAtomic: string | null; + /** + * The **`ariaAutoComplete`** property of the Element interface reflects the value of the aria-autocomplete attribute, which indicates whether inputting text could trigger display of one or more predictions of the user's intended value for a combobox, searchbox, or textbox and specifies how predictions would be presented if they were made. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaAutoComplete) + */ + ariaAutoComplete: string | null; + /** + * The **`ariaBrailleLabel`** property of the Element interface reflects the value of the aria-braillelabel attribute, which defines the ARIA braille label of the element. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaBrailleLabel) + */ + ariaBrailleLabel: string | null; + /** + * The **`ariaBrailleRoleDescription`** property of the Element interface reflects the value of the aria-brailleroledescription attribute, which defines the ARIA braille role description of the element. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaBrailleRoleDescription) + */ + ariaBrailleRoleDescription: string | null; + /** + * The **`ariaBusy`** property of the Element interface reflects the value of the aria-busy attribute, which indicates whether an element is being modified, as assistive technologies may want to wait until the modifications are complete before exposing them to the user. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaBusy) + */ + ariaBusy: string | null; + /** + * The **`ariaChecked`** property of the Element interface reflects the value of the aria-checked attribute, which indicates the current "checked" state of checkboxes, radio buttons, and other widgets that have a checked state. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaChecked) + */ + ariaChecked: string | null; + /** + * The **`ariaColCount`** property of the Element interface reflects the value of the aria-colcount attribute, which defines the number of columns in a table, grid, or treegrid. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaColCount) + */ + ariaColCount: string | null; + /** + * The **`ariaColIndex`** property of the Element interface reflects the value of the aria-colindex attribute, which defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaColIndex) + */ + ariaColIndex: string | null; + /** + * The **`ariaColIndexText`** property of the Element interface reflects the value of the aria-colindextext attribute, which defines a human readable text alternative of aria-colindex. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaColIndexText) + */ + ariaColIndexText: string | null; + /** + * The **`ariaColSpan`** property of the Element interface reflects the value of the aria-colspan attribute, which defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaColSpan) + */ + ariaColSpan: string | null; + /** + * The **`ariaControlsElements`** property of the Element interface is an array containing the elements that are controlled by the element it is applied to. For example, this might be set on a combobox to indicate the element that it pops up, or on a scrollbar to indicate the ID of the element it controls. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaControlsElements) + */ + ariaControlsElements: ReadonlyArray | null; + /** + * The **`ariaCurrent`** property of the Element interface reflects the value of the aria-current attribute, which indicates the element that represents the current item within a container or set of related elements. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaCurrent) + */ + ariaCurrent: string | null; + /** + * The **`ariaDescribedByElements`** property of the Element interface is an array containing the element (or elements) that provide an accessible description for the element it is applied to. The accessible description is similar to the accessible label (see ariaLabelledByElements), but provides more verbose information. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaDescribedByElements) + */ + ariaDescribedByElements: ReadonlyArray | null; + /** + * The **`ariaDescription`** property of the Element interface reflects the value of the aria-description attribute, which defines a string value that describes or annotates the current element. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaDescription) + */ + ariaDescription: string | null; + /** + * The **`ariaDetailsElements`** property of the Element interface is an array containing the element (or elements) that provide an accessible details for the element it is applied to. The accessible details are similar to the accessible description (see ariaDescribedByElements), but provides more verbose information. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaDetailsElements) + */ + ariaDetailsElements: ReadonlyArray | null; + /** + * The **`ariaDisabled`** property of the Element interface reflects the value of the aria-disabled attribute, which indicates that the element is perceivable but disabled, so it is not editable or otherwise operable. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaDisabled) + */ + ariaDisabled: string | null; + /** + * The **`ariaErrorMessageElements`** property of the Element interface is an array containing the element (or elements) that provide an error message for the element it is applied to. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaErrorMessageElements) + */ + ariaErrorMessageElements: ReadonlyArray | null; + /** + * The **`ariaExpanded`** property of the Element interface reflects the value of the aria-expanded attribute, which indicates whether a grouping element owned or controlled by this element is expanded or collapsed. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaExpanded) + */ + ariaExpanded: string | null; + /** + * The **`ariaFlowToElements`** property of the Element interface is an array containing the element (or elements) that provide an alternate reading order of content, overriding the general default reading order at the user's discretion. If just one element is provided this is the next element in the reading order. If multiple elements are provided, then each element represents a possible path that should be offered to the user for selection. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaFlowToElements) + */ + ariaFlowToElements: ReadonlyArray | null; + /** + * The **`ariaHasPopup`** property of the Element interface reflects the value of the aria-haspopup attribute, which indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaHasPopup) + */ + ariaHasPopup: string | null; + /** + * The **`ariaHidden`** property of the Element interface reflects the value of the aria-hidden) attribute, which indicates whether the element is exposed to an accessibility API. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaHidden) + */ + ariaHidden: string | null; + /** + * The **`ariaInvalid`** property of the Element interface reflects the value of the aria-invalid attribute. Relevant for the application, checkbox, combobox, gridcell, listbox, radiogroup, slider, spinbutton, textbox, and tree roles, it indicates to the accessibility API whether the entered value does not conform to the format expected by the application. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaInvalid) + */ + ariaInvalid: string | null; + /** + * The **`ariaKeyShortcuts`** property of the Element interface reflects the value of the aria-keyshortcuts attribute, which indicates keyboard shortcuts that an author has implemented to activate or give focus to an element. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaKeyShortcuts) + */ + ariaKeyShortcuts: string | null; + /** + * The **`ariaLabel`** property of the Element interface reflects the value of the aria-label attribute, which defines a string value that labels the current element. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaLabel) + */ + ariaLabel: string | null; + /** + * The **`ariaLabelledByElements`** property of the Element interface is an array containing the element (or elements) that provide an accessible name for the element it is applied to. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaLabelledByElements) + */ + ariaLabelledByElements: ReadonlyArray | null; + /** + * The **`ariaLevel`** property of the Element interface reflects the value of the aria-level attribute, which defines the hierarchical level of an element within a structure. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaLevel) + */ + ariaLevel: string | null; + /** + * The **`ariaLive`** property of the Element interface reflects the value of the aria-live attribute, which indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaLive) + */ + ariaLive: string | null; + /** + * The **`ariaModal`** property of the Element interface reflects the value of the aria-modal attribute, which indicates whether an element is modal when displayed. Applying the aria-modal property to an element with role="dialog" replaces the technique of using aria-hidden on the background for informing assistive technologies that content outside a dialog is inert. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaModal) + */ + ariaModal: string | null; + /** + * The **`ariaMultiLine`** property of the Element interface reflects the value of the aria-multiline attribute, which indicates whether a text box accepts multiple lines of input or only a single line. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaMultiLine) + */ + ariaMultiLine: string | null; + /** + * The **`ariaMultiSelectable`** property of the Element interface reflects the value of the aria-multiselectable attribute, which indicates that the user may select more than one item from the current selectable descendants. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaMultiSelectable) + */ + ariaMultiSelectable: string | null; + /** + * The **`ariaOrientation`** property of the Element interface reflects the value of the aria-orientation attribute, which indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaOrientation) + */ + ariaOrientation: string | null; + /** + * The **`ariaOwnsElements`** property of the Element interface is an array containing the element (or elements) that define a visual, functional, or contextual relationship between a parent element that it is applied to, and its child elements. This is used when the DOM hierarchy cannot be used to represent the relationship, and it would not otherwise be available to assistive technology, + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaOwnsElements) + */ + ariaOwnsElements: ReadonlyArray | null; + /** + * The **`ariaPlaceholder`** property of the Element interface reflects the value of the aria-placeholder attribute, which defines a short hint intended to aid the user with data entry when the control has no value. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaPlaceholder) + */ + ariaPlaceholder: string | null; + /** + * The **`ariaPosInSet`** property of the Element interface reflects the value of the aria-posinset attribute, which defines an element's number or position in the current set of listitems or treeitems. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaPosInSet) + */ + ariaPosInSet: string | null; + /** + * The **`ariaPressed`** property of the Element interface reflects the value of the aria-pressed attribute, which indicates the current "pressed" state of toggle buttons. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaPressed) + */ + ariaPressed: string | null; + /** + * The **`ariaReadOnly`** property of the Element interface reflects the value of the aria-readonly attribute, which indicates that the element is not editable, but is otherwise operable. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaReadOnly) + */ + ariaReadOnly: string | null; + /** + * The **`ariaRelevant`** property of the Element interface reflects the value of the aria-relevant attribute, which indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified. This is used to describe what changes in an aria-live region are relevant and should be announced. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaRelevant) + */ + ariaRelevant: string | null; + /** + * The **`ariaRequired`** property of the Element interface reflects the value of the aria-required attribute, which indicates that user input is required on the element before a form may be submitted. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaRequired) + */ + ariaRequired: string | null; + /** + * The **`ariaRoleDescription`** property of the Element interface reflects the value of the aria-roledescription attribute, which defines a human-readable, author-localized description for the role of an element. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaRoleDescription) + */ + ariaRoleDescription: string | null; + /** + * The **`ariaRowCount`** property of the Element interface reflects the value of the aria-rowcount attribute, which defines the total number of rows in a table, grid, or treegrid. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaRowCount) + */ + ariaRowCount: string | null; + /** + * The **`ariaRowIndex`** property of the Element interface reflects the value of the aria-rowindex attribute, which defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaRowIndex) + */ + ariaRowIndex: string | null; + /** + * The **`ariaRowIndexText`** property of the Element interface reflects the value of the aria-rowindextext attribute, which defines a human readable text alternative of aria-rowindex. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaRowIndexText) + */ + ariaRowIndexText: string | null; + /** + * The **`ariaRowSpan`** property of the Element interface reflects the value of the aria-rowspan attribute, which defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaRowSpan) + */ + ariaRowSpan: string | null; + /** + * The **`ariaSelected`** property of the Element interface reflects the value of the aria-selected attribute, which indicates the current "selected" state of elements that have a selected state. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaSelected) + */ + ariaSelected: string | null; + /** + * The **`ariaSetSize`** property of the Element interface reflects the value of the aria-setsize attribute, which defines the number of items in the current set of listitems or treeitems. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaSetSize) + */ + ariaSetSize: string | null; + /** + * The **`ariaSort`** property of the Element interface reflects the value of the aria-sort attribute, which indicates if items in a table or grid are sorted in ascending or descending order. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaSort) + */ + ariaSort: string | null; + /** + * The **`ariaValueMax`** property of the Element interface reflects the value of the aria-valuemax attribute, which defines the maximum allowed value for a range widget. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaValueMax) + */ + ariaValueMax: string | null; + /** + * The **`ariaValueMin`** property of the Element interface reflects the value of the aria-valuemin attribute, which defines the minimum allowed value for a range widget. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaValueMin) + */ + ariaValueMin: string | null; + /** + * The **`ariaValueNow`** property of the Element interface reflects the value of the aria-valuenow attribute, which defines the current value for a range widget. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaValueNow) + */ + ariaValueNow: string | null; + /** + * The **`ariaValueText`** property of the Element interface reflects the value of the aria-valuetext attribute, which defines the human-readable text alternative of aria-valuenow for a range widget. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaValueText) + */ + ariaValueText: string | null; + /** + * The **`role`** property of the Element interface returns the explicitly set WAI-ARIA role for the element. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/role) + */ + role: string | null; +} + +/** + * The **`AbortController`** interface represents a controller object that allows you to abort one or more Web requests as and when desired. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController) + */ +interface AbortController { + /** + * The **`signal`** read-only property of the AbortController interface returns an AbortSignal object instance, which can be used to communicate with/abort an asynchronous operation as desired. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/signal) + */ + readonly signal: AbortSignal; + /** + * The **`abort()`** method of the AbortController interface aborts an asynchronous operation before it has completed. This is able to abort fetch requests, the consumption of any response bodies, or streams. + * + * [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; +} + +/** + * The **`AbortSignal`** interface represents a signal object that allows you to communicate with an asynchronous operation (such as a fetch request) and abort it if required via an AbortController object. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal) + */ +interface AbortSignal extends EventTarget { + /** + * The **`aborted`** read-only property returns a value that indicates whether the asynchronous operations the signal is communicating with are aborted (true) or not (false). + * + * [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; + /** + * The **`reason`** read-only property returns a JavaScript value that indicates the abort reason. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/reason) + */ + readonly reason: any; + /** + * The **`throwIfAborted()`** method throws the signal's abort reason if the signal has been aborted; otherwise it does nothing. + * + * [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; + /** + * The **`AbortSignal.abort()`** static method returns an AbortSignal that is already set as aborted (and which does not trigger an abort event). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static) + */ + abort(reason?: any): AbortSignal; + /** + * The **`AbortSignal.any()`** static method takes an iterable of abort signals and returns an AbortSignal. The returned abort signal is aborted when any of the input iterable abort signals are aborted. The abort reason will be set to the reason of the first signal that is aborted. If any of the given abort signals are already aborted then so will be the returned AbortSignal. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static) + */ + any(signals: AbortSignal[]): AbortSignal; + /** + * The **`AbortSignal.timeout()`** static method returns an AbortSignal that will automatically abort after a specified time. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/timeout_static) + */ + timeout(milliseconds: number): AbortSignal; +}; + +/** + * The **`AbstractRange`** abstract interface is the base class upon which all DOM range types are defined. A range is an object that indicates the start and end points of a section of content within the document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbstractRange) + */ +interface AbstractRange { + /** + * The read-only **`collapsed`** property of the AbstractRange interface returns true if the range's start position and end position are the same. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbstractRange/collapsed) + */ + readonly collapsed: boolean; + /** + * The read-only **`endContainer`** property of the AbstractRange interface returns the Node in which the end of the range is located. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbstractRange/endContainer) + */ + readonly endContainer: Node; + /** + * The **`endOffset`** property of the AbstractRange interface returns the offset into the end node of the range's end position. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbstractRange/endOffset) + */ + readonly endOffset: number; + /** + * The read-only **`startContainer`** property of the AbstractRange interface returns the Node in which the start of the range is located. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbstractRange/startContainer) + */ + readonly startContainer: Node; + /** + * The read-only **`startOffset`** property of the AbstractRange interface returns the offset into the start node of the range's start position. + * + * [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; +} + +/** + * The **`AnalyserNode`** interface represents 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 { + /** + * The **`fftSize`** property of the AnalyserNode interface is an unsigned long value and represents the window size in samples that is used when performing a Fast Fourier Transform (FFT) to get frequency domain data. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnalyserNode/fftSize) + */ + fftSize: number; + /** + * The **`frequencyBinCount`** read-only property of the AnalyserNode interface contains the total number of data points available to AudioContext sampleRate. This is half of the value of the AnalyserNode.fftSize. The two methods' indices have a linear relationship with the frequencies they represent, between 0 and the Nyquist frequency. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnalyserNode/frequencyBinCount) + */ + readonly frequencyBinCount: number; + /** + * The **`maxDecibels`** property of the AnalyserNode interface is a double value representing the maximum power value in the scaling range for the FFT analysis data, for conversion to unsigned byte values — basically, this specifies the maximum value for the range of results when using getByteFrequencyData(). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnalyserNode/maxDecibels) + */ + maxDecibels: number; + /** + * The **`minDecibels`** property of the AnalyserNode interface is a double value representing the minimum power value in the scaling range for the FFT analysis data, for conversion to unsigned byte values — basically, this specifies the minimum value for the range of results when using getByteFrequencyData(). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnalyserNode/minDecibels) + */ + minDecibels: number; + /** + * The **`smoothingTimeConstant`** property of the AnalyserNode interface is a double value representing the averaging constant with the last analysis frame. It's basically an average between the current buffer and the last buffer the AnalyserNode processed, and results in a much smoother set of value changes over time. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnalyserNode/smoothingTimeConstant) + */ + smoothingTimeConstant: number; + /** + * The **`getByteFrequencyData()`** method of the AnalyserNode interface copies the current frequency data into a Uint8Array (unsigned byte array) passed into it. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnalyserNode/getByteFrequencyData) + */ + getByteFrequencyData(array: Uint8Array): void; + /** + * The **`getByteTimeDomainData()`** method of the AnalyserNode Interface copies the current waveform, or time-domain, data into a Uint8Array (unsigned byte array) passed into it. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnalyserNode/getByteTimeDomainData) + */ + getByteTimeDomainData(array: Uint8Array): void; + /** + * The **`getFloatFrequencyData()`** method of the AnalyserNode Interface copies the current frequency data into a Float32Array array passed into it. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnalyserNode/getFloatFrequencyData) + */ + getFloatFrequencyData(array: Float32Array): void; + /** + * The **`getFloatTimeDomainData()`** method of the AnalyserNode Interface copies the current waveform, or time-domain, data into a Float32Array array passed into it. Each array value is a sample, the magnitude of the signal at a particular time. + * + * [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": AnimationPlaybackEvent; +} + +/** + * The **`Animation`** interface of the Web Animations API represents a single animation player and provides playback controls and a timeline for an animation node or source. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation) + */ +interface Animation extends EventTarget { + /** + * The **`Animation.currentTime`** property of the Web Animations API returns and sets the current time value of the animation in milliseconds, whether running or paused. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/currentTime) + */ + currentTime: CSSNumberish | null; + /** + * The **`Animation.effect`** property of the Web Animations API gets and sets the target effect of an animation. The target effect may be either an effect object of a type based on AnimationEffect, such as KeyframeEffect, or null. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/effect) + */ + effect: AnimationEffect | null; + /** + * The **`Animation.finished`** read-only property of the Web Animations API returns a Promise which resolves once the animation has finished playing. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/finished) + */ + readonly finished: Promise; + /** + * The **`Animation.id`** property of the Web Animations API returns or sets a string used to identify the animation. + * + * [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: AnimationPlaybackEvent) => any) | null; + /** + * The **`overallProgress`** read-only property of the Animation interface returns a number between 0 and 1 indicating the animation's overall progress towards its finished state. This is the overall progress across all of the animation's iterations, not each individual iteration. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/overallProgress) + */ + readonly overallProgress: number | null; + /** + * The read-only **`Animation.pending`** property of the Web Animations API indicates whether the animation is currently waiting for an asynchronous operation such as initiating playback or pausing a running animation. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/pending) + */ + readonly pending: boolean; + /** + * The read-only **`Animation.playState`** property of the Web Animations API returns an enumerated value describing the playback state of an animation. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/playState) + */ + readonly playState: AnimationPlayState; + /** + * The **`Animation.playbackRate`** property of the Web Animations API returns or sets the playback rate of the animation. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/playbackRate) + */ + playbackRate: number; + /** + * The read-only **`Animation.ready`** property of the Web Animations API returns a Promise which resolves when the animation is ready to play. A new promise is created every time the animation enters the "pending" play state as well as when the animation is canceled, since in both of those scenarios, the animation is ready to be started again. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/ready) + */ + readonly ready: Promise; + /** + * The read-only **`Animation.replaceState`** property of the Web Animations API indicates whether the animation has been removed by the browser automatically after being replaced by another animation. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/replaceState) + */ + readonly replaceState: AnimationReplaceState; + /** + * The **`Animation.startTime`** property of the Animation interface is a double-precision floating-point value which indicates the scheduled time when an animation's playback should begin. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/startTime) + */ + startTime: CSSNumberish | null; + /** + * The **`Animation.timeline`** property of the Animation interface returns or sets the timeline associated with this animation. A timeline is a source of time values for synchronization purposes, and is an AnimationTimeline-based object. By default, the animation's timeline and the Document's timeline are the same. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/timeline) + */ + timeline: AnimationTimeline | null; + /** + * The Web Animations API's **`cancel()`** method of the Animation interface clears all KeyframeEffects caused by this animation and aborts its playback. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/cancel) + */ + cancel(): void; + /** + * The **`commitStyles()`** method of the Web Animations API's Animation interface writes the computed values of the animation's current styles into its target element's style attribute. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/commitStyles) + */ + commitStyles(): void; + /** + * The **`finish()`** method of the Web Animations API's Animation Interface sets the current playback time to the end of the animation corresponding to the current playback direction. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/finish) + */ + finish(): void; + /** + * The **`pause()`** method of the Web Animations API's Animation interface suspends playback of the animation. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/pause) + */ + pause(): void; + /** + * The **`persist()`** method of the Web Animations API's Animation interface explicitly persists an animation, preventing it from being automatically removed when it is replaced by another animation. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/persist) + */ + persist(): void; + /** + * The **`play()`** method of the Web Animations API's Animation Interface starts or resumes playing of an animation. If the animation is finished, calling play() restarts the animation, playing it from the beginning. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/play) + */ + play(): void; + /** + * The **`Animation.reverse()`** method of the Animation Interface reverses the playback direction, meaning the animation ends at its beginning. If called on an unplayed animation, the whole animation is played backwards. If called on a paused animation, the animation will continue in reverse. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/reverse) + */ + reverse(): void; + /** + * The **`updatePlaybackRate()`** method of the Web Animations API's Animation Interface sets the speed of an animation after first synchronizing its playback position. + * + * [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; +}; + +/** + * The **`AnimationEffect`** interface of the Web Animations API is an interface representing animation effects. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationEffect) + */ +interface AnimationEffect { + /** + * The **`getComputedTiming()`** method of the AnimationEffect interface returns the calculated timing properties for this animation effect. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationEffect/getComputedTiming) + */ + getComputedTiming(): ComputedEffectTiming; + /** + * The **`AnimationEffect.getTiming()`** method of the AnimationEffect interface returns an object containing the timing properties for the Animation Effect. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationEffect/getTiming) + */ + getTiming(): EffectTiming; + /** + * The **`updateTiming()`** method of the AnimationEffect interface updates the specified timing properties for an animation effect. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationEffect/updateTiming) + */ + updateTiming(timing?: OptionalEffectTiming): void; +} + +declare var AnimationEffect: { + prototype: AnimationEffect; + new(): AnimationEffect; +}; + +/** + * The **`AnimationEvent`** interface represents events providing information related to animations. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationEvent) + */ +interface AnimationEvent extends Event { + /** + * The **`AnimationEvent.animationName`** read-only property is a string containing the value of the animation-name CSS property associated with the transition. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationEvent/animationName) + */ + readonly animationName: string; + /** + * The **`AnimationEvent.elapsedTime`** read-only property is a float giving the amount of time the animation has been running, in seconds, when this event fired, excluding any time the animation was paused. For an animationstart event, elapsedTime is 0.0 unless there was a negative value for animation-delay, in which case the event will be fired with elapsedTime containing (-1 * delay). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationEvent/elapsedTime) + */ + readonly elapsedTime: number; + /** + * The **`AnimationEvent.pseudoElement`** read-only property is a string, starting with '::', containing the name of the pseudo-element the animation runs on. If the animation doesn't run on a pseudo-element but on the element, an empty string: ''. + * + * [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; +} + +/** + * The **`AnimationPlaybackEvent`** interface of the Web Animations API represents animation events. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationPlaybackEvent) + */ +interface AnimationPlaybackEvent extends Event { + /** + * The **`currentTime`** read-only property of the AnimationPlaybackEvent interface represents the current time of the animation that generated the event at the moment the event is queued. This will be unresolved if the animation was idle at the time the event was generated. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationPlaybackEvent/currentTime) + */ + readonly currentTime: CSSNumberish | null; + /** + * The **`timelineTime`** read-only property of the AnimationPlaybackEvent interface represents the time value of the animation's timeline at the moment the event is queued. This will be unresolved if the animation was not associated with a timeline at the time the event was generated or if the associated timeline was inactive. + * + * [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; +}; + +/** + * The **`AnimationTimeline`** interface of the Web Animations API represents the timeline of an animation. This interface exists to define timeline features, inherited by other timeline types: + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationTimeline) + */ +interface AnimationTimeline { + /** + * The **`currentTime`** read-only property of the Web Animations API's AnimationTimeline interface returns the timeline's current time in milliseconds, or null if the timeline is inactive. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationTimeline/currentTime) + */ + readonly currentTime: CSSNumberish | null; + /** + * The **`duration`** read-only property of the Web Animations API's AnimationTimeline interface returns the maximum value for this timeline or null. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationTimeline/duration) + */ + readonly duration: CSSNumberish | null; +} + +declare var AnimationTimeline: { + prototype: AnimationTimeline; + new(): AnimationTimeline; +}; + +/** + * The **`Attr`** interface represents one of an element's attributes as an object. In most situations, you will directly retrieve the attribute value as a string (e.g., Element.getAttribute()), but some cases may require interacting with Attr instances (e.g., Element.getAttributeNode()). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Attr) + */ +interface Attr extends Node { + /** + * The read-only **`localName`** property of the Attr interface returns the local part of the qualified name of an attribute, that is the name of the attribute, stripped from any namespace in front of it. For example, if the qualified name is xml:lang, the returned local name is lang, if the element supports that namespace. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Attr/localName) + */ + readonly localName: string; + /** + * The read-only **`name`** property of the Attr interface returns the qualified name of an attribute, that is the name of the attribute, with the namespace prefix, if any, in front of it. For example, if the local name is lang and the namespace prefix is xml, the returned qualified name is xml:lang. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Attr/name) + */ + readonly name: string; + /** + * The read-only **`namespaceURI`** property of the Attr interface returns the namespace URI of the attribute, or null if the element is not in a namespace. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Attr/namespaceURI) + */ + readonly namespaceURI: string | null; + readonly ownerDocument: Document; + /** + * The read-only **`ownerElement`** property of the Attr interface returns the Element the attribute belongs to. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Attr/ownerElement) + */ + readonly ownerElement: Element | null; + /** + * The read-only **`prefix`** property of the Attr returns the namespace prefix of the attribute, or null if no prefix is specified. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Attr/prefix) + */ + readonly prefix: string | null; + /** + * The read-only **`specified`** property of the Attr interface always returns true. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Attr/specified) + */ + readonly specified: boolean; + /** + * The **`value`** property of the Attr interface contains the value of the attribute. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Attr/value) + */ + value: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/textContent) */ + get textContent(): string; + set textContent(value: string | null); +} + +declare var Attr: { + prototype: Attr; + new(): Attr; +}; + +/** + * The **`AudioBuffer`** interface represents 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 { + /** + * The **`duration`** property of the AudioBuffer interface returns a double representing the duration, in seconds, of the PCM data stored in the buffer. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBuffer/duration) + */ + readonly duration: number; + /** + * The **`length`** property of the AudioBuffer interface returns an integer representing the length, in sample-frames, of the PCM data stored in the buffer. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBuffer/length) + */ + readonly length: number; + /** + * The **`numberOfChannels`** property of the AudioBuffer interface returns an integer representing the number of discrete audio channels described by the PCM data stored in the buffer. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBuffer/numberOfChannels) + */ + readonly numberOfChannels: number; + /** + * The **`sampleRate`** property of the AudioBuffer interface returns a float representing the sample rate, in samples per second, of the PCM data stored in the buffer. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBuffer/sampleRate) + */ + readonly sampleRate: number; + /** + * The **`copyFromChannel()`** method of the AudioBuffer interface copies the audio sample data from the specified channel of the AudioBuffer to a specified Float32Array. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBuffer/copyFromChannel) + */ + copyFromChannel(destination: Float32Array, channelNumber: number, bufferOffset?: number): void; + /** + * The **`copyToChannel()`** method of the AudioBuffer interface copies the samples to the specified channel of the AudioBuffer, from the source array. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBuffer/copyToChannel) + */ + copyToChannel(source: Float32Array, channelNumber: number, bufferOffset?: number): void; + /** + * The **`getChannelData()`** method of the AudioBuffer Interface returns a Float32Array containing the PCM data associated with the channel, defined by the channel parameter (with 0 representing the first channel). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBuffer/getChannelData) + */ + getChannelData(channel: number): Float32Array; +} + +declare var AudioBuffer: { + prototype: AudioBuffer; + new(options: AudioBufferOptions): AudioBuffer; +}; + +/** + * The **`AudioBufferSourceNode`** interface is an AudioScheduledSourceNode which represents an audio source consisting of in-memory audio data, stored in an AudioBuffer. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBufferSourceNode) + */ +interface AudioBufferSourceNode extends AudioScheduledSourceNode { + /** + * The **`buffer`** property of the AudioBufferSourceNode interface provides the ability to play back audio using an AudioBuffer as the source of the sound data. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBufferSourceNode/buffer) + */ + buffer: AudioBuffer | null; + /** + * The **`detune`** property of the AudioBufferSourceNode interface is a k-rate AudioParam representing detuning of oscillation in cents. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBufferSourceNode/detune) + */ + readonly detune: AudioParam; + /** + * The **`loop`** property of the AudioBufferSourceNode interface is a Boolean indicating if the audio asset must be replayed when the end of the AudioBuffer is reached. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBufferSourceNode/loop) + */ + loop: boolean; + /** + * The **`loopEnd`** property of the AudioBufferSourceNode interface specifies is a floating point number specifying, in seconds, at what offset into playing the AudioBuffer playback should loop back to the time indicated by the loopStart property. This is only used if the loop property is true. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBufferSourceNode/loopEnd) + */ + loopEnd: number; + /** + * The **`loopStart`** property of the AudioBufferSourceNode interface is a floating-point value indicating, in seconds, where in the AudioBuffer the restart of the play must happen. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBufferSourceNode/loopStart) + */ + loopStart: number; + /** + * The **`playbackRate`** property of the AudioBufferSourceNode interface Is a k-rate AudioParam that defines the speed at which the audio asset will be played. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBufferSourceNode/playbackRate) + */ + readonly playbackRate: AudioParam; + /** + * The **`start()`** method of the AudioBufferSourceNode Interface is used to schedule playback of the audio data contained in the buffer, or to begin playback immediately. + * + * [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; +}; + +/** + * The **`AudioContext`** interface represents 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 { + /** + * The **`baseLatency`** read-only property of the AudioContext interface returns a double that represents the number of seconds of processing latency incurred by the AudioContext passing an audio buffer from the AudioDestinationNode — i.e., the end of the audio graph — into the host system's audio subsystem ready for playing. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioContext/baseLatency) + */ + readonly baseLatency: number; + /** + * The **`outputLatency`** read-only property of the AudioContext Interface provides an estimation of the output latency of the current audio context. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioContext/outputLatency) + */ + readonly outputLatency: number; + /** + * The **`close()`** method of the AudioContext Interface closes the audio context, releasing any system audio resources that it uses. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioContext/close) + */ + close(): Promise; + /** + * The **`createMediaElementSource()`** method of the AudioContext Interface is used to create a new MediaElementAudioSourceNode object, given an existing HTML