diff --git a/.eslintrc.json b/.eslintrc.json index 6eb16b973f2..2a8eba04bcf 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -26,6 +26,10 @@ "@typescript-eslint/no-inferrable-types": "error", "@typescript-eslint/no-misused-new": "error", "@typescript-eslint/no-this-alias": "error", + + "no-unused-expressions": "off", + "@typescript-eslint/no-unused-expressions": ["error", { "allowTernary": true }], + "@typescript-eslint/prefer-for-of": "error", "@typescript-eslint/prefer-function-type": "error", "@typescript-eslint/prefer-namespace-keyword": "error", @@ -36,6 +40,13 @@ "semi": "off", "@typescript-eslint/semi": "error", + "space-before-function-paren": "off", + "@typescript-eslint/space-before-function-paren": ["error", { + "asyncArrow": "always", + "anonymous": "always", + "named": "never" + }], + "@typescript-eslint/triple-slash-reference": "error", "@typescript-eslint/type-annotation-spacing": "error", "@typescript-eslint/unified-signatures": "error", @@ -97,7 +108,6 @@ "no-trailing-spaces": "error", "no-undef-init": "error", "no-unsafe-finally": "error", - "no-unused-expressions": ["error", { "allowTernary": true }], "no-unused-labels": "error", "no-var": "error", "object-shorthand": "error", diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index c89ea9fc1bc..b5bf7ad4a26 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,11 +1,19 @@ +--- blank_issues_enabled: false -contact_links: - - name: Question - url: https://stackoverflow.com/questions/tagged/typescript - about: Please ask and answer questions here. - - name: TypeScript FAQ - url: https://github.com/microsoft/TypeScript/wiki/FAQ - about: Please check the FAQ before filing new issues -- name: Website - url: https://github.com/microsoft/TypeScript-Website/issues/new - about: Please raise issues about the site on it's own repo. +contact_links: + - + about: "Please ask and answer usage questions on Stack Overflow." + name: Question + url: "https://stackoverflow.com/questions/tagged/typescript" + - + about: "Alternatively, you can use the TypeScript Community Discord." + name: Chat + url: "https://discord.gg/typescript" + - + about: "Please check the FAQ before filing new issues" + name: "TypeScript FAQ" + url: "https://github.com/microsoft/TypeScript/wiki/FAQ" + - + about: "Please raise issues about the site on it's own repo." + name: Website + url: "https://github.com/microsoft/TypeScript-Website/issues/new" diff --git a/.github/pr_owners.txt b/.github/pr_owners.txt new file mode 100644 index 00000000000..0d0dab4f3e0 --- /dev/null +++ b/.github/pr_owners.txt @@ -0,0 +1,8 @@ +sandersn +elibarzilay +weswigham +andrewbranch +RyanCavanaugh +sheetalkamat +orta +rbuckton diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 69f2bf06f8b..927e62c4f3d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,3 +35,6 @@ jobs: npm install npm update npm test + - name: Validate the browser can import TypeScript + run: gulp test-browser-integration + \ No newline at end of file diff --git a/.github/workflows/new-release-branch.yaml b/.github/workflows/new-release-branch.yaml new file mode 100644 index 00000000000..1e145a0932f --- /dev/null +++ b/.github/workflows/new-release-branch.yaml @@ -0,0 +1,38 @@ +name: New Release Branch + +on: + repository_dispatch: + types: new-release-branch + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Use node version 12.x + uses: actions/setup-node@v1 + with: + node-version: 12.x + - uses: actions/checkout@v2 + with: + fetch-depth: 5 + - run: | + git checkout -b ${{ github.event.client_payload.branch_name }} + sed -i -e 's/"version": ".*"/"version": "${{ github.event.client_payload.package_version }}"/g' package.json + sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' src/compiler/corePublic.ts + sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' tests/baselines/reference/api/typescript.d.ts + sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' tests/baselines/reference/api/tsserverlibrary.d.ts + sed -i -e 's/const version = `${versionMajorMinor}.0-.*`/const version = `${versionMajorMinor}.0-${{ github.event.client_payload.core_tag || 'dev' }}`/g' src/compiler/corePublic.ts + npm install + gulp LKG + npm test + git diff + git add package.json + git add src/compiler/corePublic.ts + git add tests/baselines/reference/api/typescript.d.ts + git add tests/baselines/reference/api/tsserverlibrary.d.ts + git add ./lib + git config user.email "ts_bot@rcavanaugh.com" + git config user.name "TypeScript Bot" + git commit -m 'Bump version to ${{ github.event.client_payload.package_version }} and LKG' + git push --set-upstream origin ${{ github.event.client_payload.branch_name }} diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml new file mode 100644 index 00000000000..99a8a007ac3 --- /dev/null +++ b/.github/workflows/nightly.yaml @@ -0,0 +1,32 @@ +name: Publish Nightly + +on: + schedule: + - cron: '0 7 * * *' + repository_dispatch: + types: publish-nightly + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Use node version 12 + uses: actions/setup-node@v1 + with: + node-version: 12 + registry-url: https://registry.npmjs.org/ + - name: Setup and publish nightly + run: | + npm whoami + npm i + gulp configure-nightly + gulp LKG + gulp runtests-parallel + gulp clean + npm publish --tag next + env: + NODE_AUTH_TOKEN: ${{secrets.npm_token}} + CI: true + diff --git a/.github/workflows/release-branch-artifact.yaml b/.github/workflows/release-branch-artifact.yaml new file mode 100644 index 00000000000..ed50cfeb646 --- /dev/null +++ b/.github/workflows/release-branch-artifact.yaml @@ -0,0 +1,44 @@ +name: Create Releasable Package Drop + +on: + push: + branches: + - release-* + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Use node version 12 + uses: actions/setup-node@v1 + with: + node-version: 12 + - name: Remove existing TypeScript + run: | + npm uninstall typescript --no-save + npm uninstall tslint --no-save + - name: npm install and test + run: | + npm install + npm update + npm test + env: + CI: true + - name: Validate the browser can import TypeScript + run: gulp test-browser-integration + - name: LKG, clean, and pack + run: | + gulp LKG + gulp clean + npm pack ./ + mv typescript-*.tgz typescript.tgz + env: + CI: true + - name: Upload built tarfile + uses: actions/upload-artifact@v1 + with: + name: tgz + path: typescript.tgz + \ No newline at end of file diff --git a/.github/workflows/set-version.yaml b/.github/workflows/set-version.yaml new file mode 100644 index 00000000000..a31d849cb41 --- /dev/null +++ b/.github/workflows/set-version.yaml @@ -0,0 +1,44 @@ +name: Set branch version + +on: + repository_dispatch: + types: set-version + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Use node version 12.x + uses: actions/setup-node@v1 + with: + node-version: 12.x + - uses: actions/checkout@v2 + with: + ref: ${{ github.event.client_payload.branch_name }} + # notably, this is essentially the same script as `new-release-branch.yaml` (with fewer inputs), but it assumes the branch already exists + # do note that executing the transform below will prevent the `configurePrerelease` script from running on the source, as it makes the + # `version` identifier no longer match the regex it uses + # required client_payload members: + # branch_name - the target branch + # package_version - the full version string (eg, `3.9.1-rc` or `3.9.2`) + # core_major_minor - the major.minor pair associated with the desired package_version (eg, `3.9` for `3.9.3`) + - run: | + sed -i -e 's/"version": ".*"/"version": "${{ github.event.client_payload.package_version }}"/g' package.json + sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' src/compiler/corePublic.ts + sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' tests/baselines/reference/api/typescript.d.ts + sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' tests/baselines/reference/api/tsserverlibrary.d.ts + sed -i -e 's/const version = .*;/const version = "${{ github.event.client_payload.package_version }}" as string;/g' src/compiler/corePublic.ts + npm install + gulp LKG + npm test + git diff + git add package.json + git add src/compiler/corePublic.ts + git add tests/baselines/reference/api/typescript.d.ts + git add tests/baselines/reference/api/tsserverlibrary.d.ts + git add ./lib + git config user.email "ts_bot@rcavanaugh.com" + git config user.name "TypeScript Bot" + git commit -m 'Bump version to ${{ github.event.client_payload.package_version }} and LKG' + git push diff --git a/.github/workflows/sync-branch.yaml b/.github/workflows/sync-branch.yaml new file mode 100644 index 00000000000..642a353aa3c --- /dev/null +++ b/.github/workflows/sync-branch.yaml @@ -0,0 +1,29 @@ +name: Sync branch with master + +on: + repository_dispatch: + types: sync-branch + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Use node version 12.x + uses: actions/setup-node@v1 + with: + node-version: 12.x + - uses: actions/checkout@v2 + with: + ref: ${{ github.event.client_payload.branch_name }} + # This does a test post-merge and only pushes the result if the test succeeds + # required client_payload members: + # branch_name - the target branch + - run: | + git config user.email "ts_bot@rcavanaugh.com" + git config user.name "TypeScript Bot" + git fetch origin master + git merge master --no-ff + npm install + npm test + git push diff --git a/.vscode/extensions.json b/.vscode/extensions.json index bae8c12d07c..c3ea200176d 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,6 +1,7 @@ { "recommendations": [ - "dbaeumer.vscode-eslint" + "dbaeumer.vscode-eslint", + "rbuckton.tsserver-live-reload" ], "unwantedRecommendations": [ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 785f4474e33..d6ecd1d66ae 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -69,9 +69,7 @@ Design changes will not be accepted at this time. If you have a design change pr ## Legal -You will need to complete a Contributor License Agreement (CLA). Briefly, this agreement testifies that you are granting us permission to use the submitted change according to the terms of the project's license, and that the work being submitted is under appropriate copyright. - -Please submit a Contributor License Agreement (CLA) before submitting a pull request. You may visit https://cla.microsoft.com to sign digitally. Alternatively, download the agreement ([Microsoft Contribution License Agreement.pdf](https://opensource.microsoft.com/pdf/microsoft-contribution-license-agreement.pdf)), sign, scan, and email it back to . Be sure to include your GitHub user name along with the agreement. Once we have received the signed CLA, we'll review the request. +You will need to complete a Contributor License Agreement (CLA). Briefly, this agreement testifies that you are granting us permission to use the submitted change according to the terms of the project's license, and that the work being submitted is under appropriate copyright. Upon submitting a pull request, you will automatically be given instructions on how to sign the CLA. ## Housekeeping diff --git a/CopyrightNotice.txt b/CopyrightNotice.txt index 884a031325b..fee4889c83f 100644 --- a/CopyrightNotice.txt +++ b/CopyrightNotice.txt @@ -1,14 +1,14 @@ /*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. +Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - +License at http://www.apache.org/licenses/LICENSE-2.0 + THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ diff --git a/Gulpfile.js b/Gulpfile.js index d033ee33c96..94212344d38 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -346,8 +346,6 @@ const lintFoldEnd = async () => { if (fold.isTravis()) console.log(fold.end("lin /** @type { (folder: string) => { (): Promise; displayName?: string } } */ const eslint = (folder) => async () => { - const ESLINTRC_CI = ".eslintrc.ci.json"; - const isCIEnv = cmdLineOptions.ci || process.env.CI === "true"; const args = [ "node_modules/eslint/bin/eslint", @@ -358,13 +356,6 @@ const eslint = (folder) => async () => { "--ext", ".ts", ]; - if ( - isCIEnv && - fs.existsSync(path.resolve(folder, ESLINTRC_CI)) - ) { - args.push("--config", path.resolve(folder, ESLINTRC_CI)); - } - if (cmdLineOptions.fix) { args.push("--fix"); } @@ -417,7 +408,18 @@ task("generate-types-map", generateTypesMap); const cleanTypesMap = () => del("built/local/typesMap.json"); cleanTasks.push(cleanTypesMap); -const buildOtherOutputs = parallel(buildCancellationToken, buildTypingsInstaller, buildWatchGuard, generateTypesMap); +// Drop a copy of diagnosticMessages.generated.json into the built/local folder. This allows +// it to be synced to the Azure DevOps repo, so that it can get picked up by the build +// pipeline that generates the localization artifacts that are then fed into the translation process. +const builtLocalDiagnosticMessagesGeneratedJson = "built/local/diagnosticMessages.generated.json"; +const copyBuiltLocalDiagnosticMessages = () => src(diagnosticMessagesGeneratedJson) + .pipe(newer(builtLocalDiagnosticMessagesGeneratedJson)) + .pipe(dest("built/local")); + +const cleanBuiltLocalDiagnosticMessages = () => del(builtLocalDiagnosticMessagesGeneratedJson); +cleanTasks.push(cleanBuiltLocalDiagnosticMessages); + +const buildOtherOutputs = parallel(buildCancellationToken, buildTypingsInstaller, buildWatchGuard, generateTypesMap, copyBuiltLocalDiagnosticMessages); task("other-outputs", series(preBuild, buildOtherOutputs)); task("other-outputs").description = "Builds miscelaneous scripts and documents distributed with the LKG"; @@ -439,7 +441,7 @@ const generateCodeCoverage = () => exec("istanbul", ["cover", "node_modules/moch task("generate-code-coverage", series(preBuild, buildTests, generateCodeCoverage)); task("generate-code-coverage").description = "Generates code coverage data via istanbul"; -const preTest = parallel(buildTests, buildServices, buildLssl); +const preTest = parallel(buildTsc, buildTests, buildServices, buildLssl); preTest.displayName = "preTest"; const postTest = (done) => cmdLineOptions.lint ? lint(done) : done(); @@ -465,7 +467,7 @@ task("runtests").flags = { " --shardId": "1-based ID of this shard (default: 1)", }; -const runTestsParallel = () => runConsoleTests("built/local/run.js", "min", /*runInParallel*/ true, /*watchMode*/ false); +const runTestsParallel = () => runConsoleTests("built/local/run.js", "min", /*runInParallel*/ cmdLineOptions.workers > 1, /*watchMode*/ false); task("runtests-parallel", series(preBuild, preTest, runTestsParallel, postTest)); task("runtests-parallel").description = "Runs all the tests in parallel using the built run.js file."; task("runtests-parallel").flags = { @@ -481,6 +483,11 @@ task("runtests-parallel").flags = { " --shardId": "1-based ID of this shard (default: 1)", }; + +task("test-browser-integration", () => exec(process.execPath, ["scripts/browserIntegrationTest.js"])); +task("test-browser-integration").description = "Runs scripts/browserIntegrationTest.ts which tests that typescript.js loads in a browser"; + + task("diff", () => exec(getDiffTool(), [refBaseline, localBaseline], { ignoreExitCode: true, waitForExit: false })); task("diff").description = "Diffs the compiler baselines using the diff tool specified by the 'DIFF' environment variable"; diff --git a/lib/cancellationToken.js b/lib/cancellationToken.js index d63145f3fc5..12a1e5b265b 100644 --- a/lib/cancellationToken.js +++ b/lib/cancellationToken.js @@ -17,13 +17,7 @@ and limitations under the License. "use strict"; var fs = require("fs"); function pipeExists(name) { - try { - fs.statSync(name); - return true; - } - catch (e) { - return false; - } + return fs.existsSync(name); } function createCancellationToken(args) { var cancellationPipeName; diff --git a/lib/ja/diagnosticMessages.generated.json b/lib/ja/diagnosticMessages.generated.json index 751357dbc01..a05d953fe14 100644 --- a/lib/ja/diagnosticMessages.generated.json +++ b/lib/ja/diagnosticMessages.generated.json @@ -454,7 +454,7 @@ "Generic_type_0_requires_1_type_argument_s_2314": "ジェネリック型 '{0}' には {1} 個の型引数が必要です。", "Generic_type_0_requires_between_1_and_2_type_arguments_2707": "ジェネリック型 '{0}' には、{1} 個から {2} 個までの型引数が必要です。", "Generic_type_instantiation_is_excessively_deep_and_possibly_infinite_2550": "ジェネリック型のインスタンス化は非常に深く、無限である可能性があります。", - "Getter_and_setter_accessors_do_not_agree_in_visibility_2379": "ゲッターおよびセッターで表示が許可されていません。", + "Getter_and_setter_accessors_do_not_agree_in_visibility_2379": "ゲッターおよびセッターでの表示が許可されていません。", "Global_module_exports_may_only_appear_at_top_level_1316": "グローバル モジュールのエクスポートは最上位レベルにのみ出現可能です。", "Global_module_exports_may_only_appear_in_declaration_files_1315": "グローバル モジュールのエクスポートは宣言ファイルにのみ出現可能です。", "Global_module_exports_may_only_appear_in_module_files_1314": "グローバル モジュールのエクスポートはモジュール ファイルにのみ出現可能です。", diff --git a/lib/lib.dom.d.ts b/lib/lib.dom.d.ts index 4217884bca4..1665e95c9c9 100644 --- a/lib/lib.dom.d.ts +++ b/lib/lib.dom.d.ts @@ -932,6 +932,10 @@ interface OscillatorOptions extends AudioNodeOptions { type?: OscillatorType; } +interface PageTransitionEventInit extends EventInit { + persisted?: boolean; +} + interface PannerOptions extends AudioNodeOptions { coneInnerAngle?: number; coneOuterAngle?: number; @@ -1197,7 +1201,16 @@ interface RTCDtlsParameters { } interface RTCErrorEventInit extends EventInit { - error?: RTCError | null; + error: RTCError; +} + +interface RTCErrorInit { + errorDetail: RTCErrorDetailType; + httpRequestStatusCode?: number; + receivedAlert?: number; + sctpCauseCode?: number; + sdpLineNumber?: number; + sentAlert?: number; } interface RTCIceCandidateAttributes extends RTCStats { @@ -1229,7 +1242,7 @@ interface RTCIceCandidateInit { candidate?: string; sdpMLineIndex?: number | null; sdpMid?: string | null; - usernameFragment?: string; + usernameFragment?: string | null; } interface RTCIceCandidatePair { @@ -1385,6 +1398,7 @@ interface RTCRtpCodingParameters { interface RTCRtpContributingSource { audioLevel?: number; + rtpTimestamp: number; source: number; timestamp: number; } @@ -1398,7 +1412,6 @@ interface RTCRtpEncodingParameters extends RTCRtpCodingParameters { dtx?: RTCDtxStatus; maxBitrate?: number; maxFramerate?: number; - priority?: RTCPriorityType; ptime?: number; scaleResolutionDownBy?: number; } @@ -1442,6 +1455,7 @@ interface RTCRtpRtxParameters { interface RTCRtpSendParameters extends RTCRtpParameters { degradationPreference?: RTCDegradationPreference; encodings: RTCRtpEncodingParameters[]; + priority?: RTCPriorityType; transactionId: string; } @@ -1463,7 +1477,7 @@ interface RTCRtpUnhandled { interface RTCSessionDescriptionInit { sdp?: string; - type: RTCSdpType; + type?: RTCSdpType; } interface RTCSrtpKeyParam { @@ -1516,6 +1530,16 @@ interface RTCTransportStats extends RTCStats { selectedCandidatePairId?: string; } +interface ReadableStreamReadDoneResult { + done: true; + value?: T; +} + +interface ReadableStreamReadValueResult { + done: false; + value: T; +} + interface RegistrationOptions { scope?: string; type?: WorkerType; @@ -1684,6 +1708,25 @@ interface ShadowRootInit { mode: ShadowRootMode; } +interface SpeechSynthesisErrorEventInit extends SpeechSynthesisEventInit { + error: SpeechSynthesisErrorCode; +} + +interface SpeechSynthesisEventInit extends EventInit { + charIndex?: number; + charLength?: number; + elapsedTime?: number; + name?: string; + utterance: SpeechSynthesisUtterance; +} + +interface StaticRangeInit { + endContainer: Node; + endOffset: number; + startContainer: Node; + startOffset: number; +} + interface StereoPannerOptions extends AudioNodeOptions { pan?: number; } @@ -2150,8 +2193,8 @@ interface AudioBuffer { readonly length: number; readonly numberOfChannels: number; readonly sampleRate: number; - copyFromChannel(destination: Float32Array, channelNumber: number, startInChannel?: number): void; - copyToChannel(source: Float32Array, channelNumber: number, startInChannel?: number): void; + copyFromChannel(destination: Float32Array, channelNumber: number, bufferOffset?: number): void; + copyToChannel(source: Float32Array, channelNumber: number, bufferOffset?: number): void; getChannelData(channel: number): Float32Array; } @@ -2519,7 +2562,10 @@ declare var BiquadFilterNode: { interface Blob { readonly size: number; readonly type: string; + arrayBuffer(): Promise; slice(start?: number, end?: number, contentType?: string): Blob; + stream(): ReadableStream; + text(): Promise; } declare var Blob: { @@ -2835,7 +2881,7 @@ interface CSSStyleDeclaration { clip: string; clipPath: string; clipRule: string; - color: string | null; + color: string; colorInterpolation: string; colorInterpolationFilters: string; columnCount: string; @@ -3012,7 +3058,7 @@ interface CSSStyleDeclaration { msWrapThrough: string; objectFit: string; objectPosition: string; - opacity: string | null; + opacity: string; order: string; orphans: string; outline: string; @@ -3052,14 +3098,14 @@ interface CSSStyleDeclaration { right: string; rotate: string; rowGap: string; - rubyAlign: string | null; + rubyAlign: string; rubyOverhang: string | null; - rubyPosition: string | null; + rubyPosition: string; scale: string; scrollBehavior: string; shapeRendering: string; - stopColor: string | null; - stopOpacity: string | null; + stopColor: string; + stopOpacity: string; stroke: string; strokeDasharray: string; strokeDashoffset: string; @@ -3072,7 +3118,7 @@ interface CSSStyleDeclaration { tableLayout: string; textAlign: string; textAlignLast: string; - textAnchor: string | null; + textAnchor: string; textCombineUpright: string; textDecoration: string; textDecorationColor: string; @@ -3160,7 +3206,8 @@ interface CSSStyleDeclaration { webkitBoxFlex: string; /** @deprecated */ webkitBoxOrdinalGroup: string; - webkitBoxOrient: string | null; + /** @deprecated */ + webkitBoxOrient: string; /** @deprecated */ webkitBoxPack: string; /** @deprecated */ @@ -3364,7 +3411,7 @@ interface CacheStorage { delete(cacheName: string): Promise; has(cacheName: string): Promise; keys(): Promise; - match(request: RequestInfo, options?: CacheQueryOptions): Promise; + match(request: RequestInfo, options?: MultiCacheQueryOptions): Promise; open(cacheName: string): Promise; } @@ -3649,11 +3696,18 @@ declare var ClipboardEvent: { /** A CloseEvent is sent to clients using WebSockets when the connection is closed. This is delivered to the listener indicated by the WebSocket object's onclose attribute. */ interface CloseEvent extends Event { + /** + * Returns the WebSocket connection close code provided by the server. + */ readonly code: number; + /** + * Returns the WebSocket connection close reason provided by the server. + */ readonly reason: string; + /** + * Returns true if the connection closed cleanly; false otherwise. + */ readonly wasClean: boolean; - /** @deprecated */ - initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void; } declare var CloseEvent: { @@ -3827,7 +3881,7 @@ declare var CryptoKeyPair: { }; interface CustomElementRegistry { - define(name: string, constructor: Function, options?: ElementDefinitionOptions): void; + define(name: string, constructor: CustomElementConstructor, options?: ElementDefinitionOptions): void; get(name: string): any; upgrade(root: Node): void; whenDefined(name: string): Promise; @@ -4036,6 +4090,7 @@ interface DOMMatrixReadOnly { toJSON(): any; transformPoint(point?: DOMPointInit): DOMPoint; translate(tx?: number, ty?: number, tz?: number): DOMMatrix; + toString(): string; } declare var DOMMatrixReadOnly: { @@ -4044,6 +4099,7 @@ declare var DOMMatrixReadOnly: { fromFloat32Array(array32: Float32Array): DOMMatrixReadOnly; fromFloat64Array(array64: Float64Array): DOMMatrixReadOnly; fromMatrix(other?: DOMMatrixInit): DOMMatrixReadOnly; + toString(): string; }; /** Provides the ability to parse XML or HTML source code from a string into a DOM Document. */ @@ -4201,6 +4257,7 @@ interface DOMTokenList { * Can be set, to change the associated attribute. */ value: string; + toString(): string; /** * Adds all arguments passed, except those already present. * @@ -4341,7 +4398,7 @@ interface DataTransferItem { */ getAsFile(): File | null; /** - * Invokes the callback with the string data as the argument, if the drag data item kind is Plain Unicode string. + * Invokes the callback with the string data as the argument, if the drag data item kind is text. */ getAsString(callback: FunctionStringCallback | null): void; webkitGetAsEntry(): any; @@ -4436,6 +4493,7 @@ interface DeviceMotionEvent extends Event { declare var DeviceMotionEvent: { prototype: DeviceMotionEvent; new(type: string, eventInitDict?: DeviceMotionEventInit): DeviceMotionEvent; + requestPermission(): Promise; }; interface DeviceMotionEventAcceleration { @@ -4461,6 +4519,7 @@ interface DeviceOrientationEvent extends Event { declare var DeviceOrientationEvent: { prototype: DeviceOrientationEvent; new(type: string, eventInitDict?: DeviceOrientationEventInit): DeviceOrientationEvent; + requestPermission(): Promise; }; /** Provides information about the rate at which the device is rotating around all three axes. */ @@ -4499,7 +4558,7 @@ interface DocumentEventMap extends GlobalEventHandlersEventMap, DocumentAndEleme "fullscreenerror": Event; "pointerlockchange": Event; "pointerlockerror": Event; - "readystatechange": ProgressEvent; + "readystatechange": Event; "visibilitychange": Event; } @@ -4509,10 +4568,6 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad * Sets or gets the URL for the current document. */ readonly URL: string; - /** - * Gets the object that has the focus when the parent document has focus. - */ - readonly activeElement: Element | null; /** * Sets or gets the color of all active links in the document. */ @@ -4658,7 +4713,7 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad * Fires when the state of the object has changed. * @param ev The event */ - onreadystatechange: ((this: Document, ev: ProgressEvent) => any) | null; + onreadystatechange: ((this: Document, ev: Event) => any) | null; onvisibilitychange: ((this: Document, ev: Event) => any) | null; /** * Returns document's origin. @@ -4819,7 +4874,6 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad createEvent(eventInterface: "SVGZoomEvents"): SVGZoomEvent; createEvent(eventInterface: "SecurityPolicyViolationEvent"): SecurityPolicyViolationEvent; createEvent(eventInterface: "ServiceWorkerMessageEvent"): ServiceWorkerMessageEvent; - createEvent(eventInterface: "SpeechRecognitionError"): SpeechRecognitionError; createEvent(eventInterface: "SpeechRecognitionEvent"): SpeechRecognitionEvent; createEvent(eventInterface: "SpeechSynthesisErrorEvent"): SpeechSynthesisErrorEvent; createEvent(eventInterface: "SpeechSynthesisEvent"): SpeechSynthesisEvent; @@ -5069,7 +5123,6 @@ interface DocumentEvent { createEvent(eventInterface: "SVGZoomEvents"): SVGZoomEvent; createEvent(eventInterface: "SecurityPolicyViolationEvent"): SecurityPolicyViolationEvent; createEvent(eventInterface: "ServiceWorkerMessageEvent"): ServiceWorkerMessageEvent; - createEvent(eventInterface: "SpeechRecognitionError"): SpeechRecognitionError; createEvent(eventInterface: "SpeechRecognitionEvent"): SpeechRecognitionEvent; createEvent(eventInterface: "SpeechSynthesisErrorEvent"): SpeechSynthesisErrorEvent; createEvent(eventInterface: "SpeechSynthesisEvent"): SpeechSynthesisEvent; @@ -5513,7 +5566,7 @@ interface EventTarget { * * When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET. * - * When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in §2.8 Observing event listeners. + * When set to true, options's 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. * @@ -5754,7 +5807,7 @@ interface GenericTransformStream { */ readonly readable: ReadableStream; /** - * Returns a writable stream which accepts BufferSource chunks and runs them through encoding's decoder before making them available to readable. + * Returns a writable stream which accepts [AllowShared] BufferSource chunks and runs them through encoding's decoder before making them available to readable. * * Typically this will be used via the pipeThrough() method on a ReadableStream source. * @@ -5818,7 +5871,6 @@ interface GlobalEventHandlersEventMap { "load": Event; "loadeddata": Event; "loadedmetadata": Event; - "loadend": ProgressEvent; "loadstart": Event; "lostpointercapture": PointerEvent; "mousedown": MouseEvent; @@ -6003,7 +6055,6 @@ interface GlobalEventHandlers { * @param ev The event. */ onloadedmetadata: ((this: GlobalEventHandlers, ev: Event) => any) | null; - onloadend: ((this: GlobalEventHandlers, ev: ProgressEvent) => any) | null; /** * Occurs when Internet Explorer begins looking for media data. * @param ev The event. @@ -6116,10 +6167,10 @@ interface GlobalEventHandlers { */ ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null; ontoggle: ((this: GlobalEventHandlers, ev: Event) => any) | null; - ontouchcancel: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null; - ontouchend: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null; - ontouchmove: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null; - ontouchstart: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null; + ontouchcancel?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null; + ontouchend?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null; + ontouchmove?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null; + ontouchstart?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null; ontransitioncancel: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null; ontransitionend: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null; ontransitionrun: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null; @@ -6401,12 +6452,9 @@ interface HTMLBodyElement extends HTMLElement, WindowEventHandlers { background: string; /** @deprecated */ bgColor: string; - bgProperties: string; /** @deprecated */ link: string; /** @deprecated */ - noWrap: boolean; - /** @deprecated */ onorientationchange: ((this: HTMLBodyElement, ev: Event) => any) | null; /** @deprecated */ text: string; @@ -6425,10 +6473,6 @@ declare var HTMLBodyElement: { /** Provides properties and methods (beyond the regular HTMLElement interface it also has available to it by inheritance) for manipulating