diff --git a/.vscode/tasks.json b/.vscode/tasks.json
index 9cf1c9d8f3f..f3c59a61717 100644
--- a/.vscode/tasks.json
+++ b/.vscode/tasks.json
@@ -7,7 +7,7 @@
// ${cwd}: the current working directory of the spawned process
{
"version": "0.1.0",
- "command": "jake",
+ "command": "gulp",
"isShellCommand": true,
"showOutput": "silent",
"tasks": [
@@ -18,25 +18,6 @@
"problemMatcher": [
"$tsc"
]
- },
- {
- "taskName": "lint-server",
- "args": [],
- "problemMatcher": {
- "owner": "typescript",
- "fileLocation": ["relative", "${workspaceRoot}"],
- "pattern": {
- "regexp": "^(warning|error)\\s+([^(]+)\\s+\\((\\d+|\\d+,\\d+|\\d+,\\d+,\\d+,\\d+)\\):\\s+(.*)$",
- "severity": 1,
- "file": 2,
- "location": 3,
- "message": 4
- },
- "watchedTaskBeginsRegExp": "^\\*\\*\\*Lint failure\\*\\*\\*$",
- "watchedTaskEndsRegExp": "^\\*\\*\\* Total \\d+ failures\\.$"
- },
- "showOutput": "always",
- "isWatching": true
}
]
}
\ No newline at end of file
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 1c242022979..5cde901a576 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -40,6 +40,10 @@ In general, things we find useful when reviewing suggestions are:
# Instructions for Contributing Code
+## Code of Conduct
+
+This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
+
## Contributing bug fixes
TypeScript is currently accepting contributions in the form of bug fixes. A bug must have an issue tracking it in the issue tracker that has been approved ("Milestone == Community") by the TypeScript team. Your pull request should include a link to the bug that you are fixing. If you've submitted a PR for a bug, please post a comment in the bug to avoid duplication of effort.
diff --git a/Gulpfile.ts b/Gulpfile.ts
new file mode 100644
index 00000000000..74113b4b0c7
--- /dev/null
+++ b/Gulpfile.ts
@@ -0,0 +1,1047 @@
+///
+///
+
+import * as cp from "child_process";
+import * as path from "path";
+import * as fs from "fs";
+import originalGulp = require("gulp");
+import helpMaker = require("gulp-help");
+import runSequence = require("run-sequence");
+import concat = require("gulp-concat");
+import clone = require("gulp-clone");
+import newer = require("gulp-newer");
+import tsc = require("gulp-typescript");
+declare module "gulp-typescript" {
+ interface Settings {
+ stripInternal?: boolean;
+ newLine?: string;
+ }
+ interface CompileStream extends NodeJS.ReadWriteStream {} // Either gulp or gulp-typescript has some odd typings which don't reflect reality, making this required
+}
+import * as insert from "gulp-insert";
+import * as sourcemaps from "gulp-sourcemaps";
+declare global {
+ // This is silly. We include Q because orchestrator (a part of gulp) depends on it, but its not included.
+ // `del` further depends on `Promise` (and is also not included), so we just, patch the global scope's Promise to Q's
+ type Promise = Q.Promise;
+}
+import del = require("del");
+import mkdirP = require("mkdirp");
+import minimist = require("minimist");
+import browserify = require("browserify");
+import through2 = require("through2");
+import merge2 = require("merge2");
+import intoStream = require("into-stream");
+import * as os from "os";
+import Linter = require("tslint");
+const gulp = helpMaker(originalGulp);
+const mochaParallel = require("./scripts/mocha-parallel.js");
+const {runTestsInParallel} = mochaParallel;
+
+const cmdLineOptions = minimist(process.argv.slice(2), {
+ boolean: ["debug", "light", "colors", "lint", "soft"],
+ string: ["browser", "tests", "host", "reporter"],
+ alias: {
+ d: "debug",
+ t: "tests",
+ test: "tests",
+ r: "reporter",
+ color: "colors",
+ f: "files",
+ file: "files"
+ },
+ default: {
+ soft: false,
+ colors: process.env.colors || process.env.color || true,
+ debug: process.env.debug || process.env.d,
+ host: process.env.TYPESCRIPT_HOST || process.env.host || "node",
+ browser: process.env.browser || process.env.b || "IE",
+ tests: process.env.test || process.env.tests || process.env.t,
+ light: process.env.light || false,
+ port: process.env.port || process.env.p || "8888",
+ reporter: process.env.reporter || process.env.r,
+ lint: process.env.lint || true,
+ files: process.env.f || process.env.file || process.env.files || "",
+ }
+});
+
+function exec(cmd: string, args: string[], complete: () => void = (() => {}), error: (e: any, status: number) => void = (() => {})) {
+ console.log(`${cmd} ${args.join(" ")}`);
+ // TODO (weswig): Update child_process types to add windowsVerbatimArguments to the type definition
+ const subshellFlag = isWin ? "/c" : "-c";
+ const command = isWin ? [possiblyQuote(cmd), ...args] : [`${cmd} ${args.join(" ")}`];
+ const ex = cp.spawn(isWin ? "cmd" : "/bin/sh", [subshellFlag, ...command], { stdio: "inherit", windowsVerbatimArguments: true } as any);
+ ex.on("exit", (code) => code === 0 ? complete() : error(/*e*/ undefined, code));
+ ex.on("error", error);
+}
+
+function possiblyQuote(cmd: string) {
+ return cmd.indexOf(" ") >= 0 ? `"${cmd}"` : cmd;
+}
+
+let useDebugMode = true;
+let host = cmdLineOptions["host"];
+
+// Constants
+const compilerDirectory = "src/compiler/";
+const servicesDirectory = "src/services/";
+const serverDirectory = "src/server/";
+const harnessDirectory = "src/harness/";
+const libraryDirectory = "src/lib/";
+const scriptsDirectory = "scripts/";
+const unittestsDirectory = "tests/cases/unittests/";
+const docDirectory = "doc/";
+
+const builtDirectory = "built/";
+const builtLocalDirectory = "built/local/";
+const LKGDirectory = "lib/";
+
+const copyright = "CopyrightNotice.txt";
+
+const compilerFilename = "tsc.js";
+const LKGCompiler = path.join(LKGDirectory, compilerFilename);
+const builtLocalCompiler = path.join(builtLocalDirectory, compilerFilename);
+
+const nodeModulesPathPrefix = path.resolve("./node_modules/.bin/");
+const isWin = /^win/.test(process.platform);
+const mocha = path.join(nodeModulesPathPrefix, "mocha") + (isWin ? ".cmd" : "");
+
+const compilerSources = require("./src/compiler/tsconfig.json").files.map((file) => path.join(compilerDirectory, file));
+
+const servicesSources = require("./src/services/tsconfig.json").files.map((file) => path.join(servicesDirectory, file));
+
+const serverCoreSources = require("./src/server/tsconfig.json").files.map((file) => path.join(serverDirectory, file));
+
+const languageServiceLibrarySources = [
+ "editorServices.ts",
+ "protocol.d.ts",
+ "session.ts"
+].map(function (f) {
+ return path.join(serverDirectory, f);
+}).concat(servicesSources);
+
+const harnessCoreSources = [
+ "harness.ts",
+ "sourceMapRecorder.ts",
+ "harnessLanguageService.ts",
+ "fourslash.ts",
+ "runnerbase.ts",
+ "compilerRunner.ts",
+ "typeWriter.ts",
+ "fourslashRunner.ts",
+ "projectsRunner.ts",
+ "loggedIO.ts",
+ "rwcRunner.ts",
+ "test262Runner.ts",
+ "runner.ts"
+].map(function (f) {
+ return path.join(harnessDirectory, f);
+});
+
+const harnessSources = harnessCoreSources.concat([
+ "incrementalParser.ts",
+ "jsDocParsing.ts",
+ "services/colorization.ts",
+ "services/documentRegistry.ts",
+ "services/preProcessFile.ts",
+ "services/patternMatcher.ts",
+ "session.ts",
+ "versionCache.ts",
+ "convertToBase64.ts",
+ "transpile.ts",
+ "reuseProgramStructure.ts",
+ "cachingInServerLSHost.ts",
+ "moduleResolution.ts",
+ "tsconfigParsing.ts",
+ "commandLineParsing.ts",
+ "convertCompilerOptionsFromJson.ts",
+ "convertTypingOptionsFromJson.ts",
+ "tsserverProjectSystem.ts",
+ "matchFiles.ts",
+].map(function (f) {
+ return path.join(unittestsDirectory, f);
+})).concat([
+ "protocol.d.ts",
+ "session.ts",
+ "client.ts",
+ "editorServices.ts"
+].map(function (f) {
+ return path.join(serverDirectory, f);
+}));
+
+const es2015LibrarySources = [
+ "es2015.core.d.ts",
+ "es2015.collection.d.ts",
+ "es2015.generator.d.ts",
+ "es2015.iterable.d.ts",
+ "es2015.promise.d.ts",
+ "es2015.proxy.d.ts",
+ "es2015.reflect.d.ts",
+ "es2015.symbol.d.ts",
+ "es2015.symbol.wellknown.d.ts"
+];
+
+const es2015LibrarySourceMap = es2015LibrarySources.map(function(source) {
+ return { target: "lib." + source, sources: ["header.d.ts", source] };
+});
+
+const es2016LibrarySource = [ "es2016.array.include.d.ts" ];
+
+const es2016LibrarySourceMap = es2016LibrarySource.map(function (source) {
+ return { target: "lib." + source, sources: ["header.d.ts", source] };
+});
+
+const es2017LibrarySource = [
+ "es2017.object.d.ts",
+ "es2017.sharedmemory.d.ts"
+];
+
+const es2017LibrarySourceMap = es2017LibrarySource.map(function (source) {
+ return { target: "lib." + source, sources: ["header.d.ts", source] };
+});
+
+const hostsLibrarySources = ["dom.generated.d.ts", "webworker.importscripts.d.ts", "scripthost.d.ts"];
+
+const librarySourceMap = [
+ // Host library
+ { target: "lib.dom.d.ts", sources: ["header.d.ts", "dom.generated.d.ts"] },
+ { target: "lib.dom.iterable.d.ts", sources: ["header.d.ts", "dom.iterable.d.ts"] },
+ { target: "lib.webworker.d.ts", sources: ["header.d.ts", "webworker.generated.d.ts"] },
+ { target: "lib.scripthost.d.ts", sources: ["header.d.ts", "scripthost.d.ts"] },
+
+ // JavaScript library
+ { target: "lib.es5.d.ts", sources: ["header.d.ts", "es5.d.ts"] },
+ { target: "lib.es2015.d.ts", sources: ["header.d.ts", "es2015.d.ts"] },
+ { target: "lib.es2016.d.ts", sources: ["header.d.ts", "es2016.d.ts"] },
+ { target: "lib.es2017.d.ts", sources: ["header.d.ts", "es2017.d.ts"] },
+
+ // JavaScript + all host library
+ { target: "lib.d.ts", sources: ["header.d.ts", "es5.d.ts"].concat(hostsLibrarySources) },
+ { target: "lib.es6.d.ts", sources: ["header.d.ts", "es5.d.ts"].concat(es2015LibrarySources, hostsLibrarySources, "dom.iterable.d.ts") }
+].concat(es2015LibrarySourceMap, es2016LibrarySourceMap, es2017LibrarySourceMap);
+
+const libraryTargets = librarySourceMap.map(function (f) {
+ return path.join(builtLocalDirectory, f.target);
+});
+
+for (const i in libraryTargets) {
+ const entry = librarySourceMap[i];
+ const target = libraryTargets[i];
+ const sources = [copyright].concat(entry.sources.map(function (s) {
+ return path.join(libraryDirectory, s);
+ }));
+ gulp.task(target, false, [], function() {
+ return gulp.src(sources)
+ .pipe(newer(target))
+ .pipe(concat(target, { newLine: "" }))
+ .pipe(gulp.dest("."));
+ });
+}
+
+const configureNightlyJs = path.join(scriptsDirectory, "configureNightly.js");
+const configureNightlyTs = path.join(scriptsDirectory, "configureNightly.ts");
+const packageJson = "package.json";
+const programTs = path.join(compilerDirectory, "program.ts");
+
+function needsUpdate(source: string | string[], dest: string | string[]): boolean {
+ if (typeof source === "string" && typeof dest === "string") {
+ if (fs.existsSync(dest)) {
+ const {mtime: outTime} = fs.statSync(dest);
+ const {mtime: inTime} = fs.statSync(source);
+ if (+inTime <= +outTime) {
+ return false;
+ }
+ }
+ }
+ else if (typeof source === "string" && typeof dest !== "string") {
+ const {mtime: inTime} = fs.statSync(source);
+ for (const filepath of dest) {
+ if (fs.existsSync(filepath)) {
+ const {mtime: outTime} = fs.statSync(filepath);
+ if (+inTime > +outTime) {
+ return true;
+ }
+ }
+ else {
+ return true;
+ }
+ }
+ return false;
+ }
+ else if (typeof source !== "string" && typeof dest === "string") {
+ if (fs.existsSync(dest)) {
+ const {mtime: outTime} = fs.statSync(dest);
+ for (const filepath of source) {
+ if (fs.existsSync(filepath)) {
+ const {mtime: inTime} = fs.statSync(filepath);
+ if (+inTime > +outTime) {
+ return true;
+ }
+ }
+ else {
+ return true;
+ }
+ }
+ return false;
+ }
+ }
+ else if (typeof source !== "string" && typeof dest !== "string") {
+ for (let i = 0; i < source.length; i++) {
+ if (!dest[i]) {
+ continue;
+ }
+ if (fs.existsSync(dest[i])) {
+ const {mtime: outTime} = fs.statSync(dest[i]);
+ const {mtime: inTime} = fs.statSync(source[i]);
+ if (+inTime > +outTime) {
+ return true;
+ }
+ }
+ else {
+ return true;
+ }
+ }
+ return false;
+ }
+ return true;
+}
+
+function getCompilerSettings(base: tsc.Settings, useBuiltCompiler?: boolean): tsc.Settings {
+ const copy: tsc.Settings = {};
+ for (const key in base) {
+ copy[key] = base[key];
+ }
+ if (!useDebugMode) {
+ if (copy.removeComments === undefined) copy.removeComments = true;
+ copy.newLine = "lf";
+ }
+ else {
+ copy.preserveConstEnums = true;
+ }
+ if (useBuiltCompiler === true) {
+ copy.typescript = require("./built/local/typescript.js");
+ }
+ else if (useBuiltCompiler === false) {
+ copy.typescript = require("./lib/typescript.js");
+ }
+ return copy;
+}
+
+gulp.task(configureNightlyJs, false, [], () => {
+ const settings: tsc.Settings = {
+ declaration: false,
+ removeComments: true,
+ noResolve: false,
+ stripInternal: false,
+ };
+ return gulp.src(configureNightlyTs)
+ .pipe(sourcemaps.init())
+ .pipe(tsc(settings))
+ .pipe(sourcemaps.write(path.dirname(configureNightlyJs)))
+ .pipe(gulp.dest(path.dirname(configureNightlyJs)));
+});
+
+
+// Nightly management tasks
+gulp.task("configure-nightly", "Runs scripts/configureNightly.ts to prepare a build for nightly publishing", [configureNightlyJs], (done) => {
+ exec(host, [configureNightlyJs, packageJson, programTs], done, done);
+});
+gulp.task("publish-nightly", "Runs `npm publish --tag next` to create a new nightly build on npm", ["LKG"], () => {
+ return runSequence("clean", "useDebugMode", "runtests", (done) => {
+ exec("npm", ["publish", "--tag", "next"], done, done);
+ });
+});
+
+const importDefinitelyTypedTestsDirectory = path.join(scriptsDirectory, "importDefinitelyTypedTests");
+const importDefinitelyTypedTestsJs = path.join(importDefinitelyTypedTestsDirectory, "importDefinitelyTypedTests.js");
+const importDefinitelyTypedTestsTs = path.join(importDefinitelyTypedTestsDirectory, "importDefinitelyTypedTests.ts");
+
+gulp.task(importDefinitelyTypedTestsJs, false, [], () => {
+ const settings: tsc.Settings = getCompilerSettings({
+ declaration: false,
+ removeComments: true,
+ noResolve: false,
+ stripInternal: false,
+ outFile: importDefinitelyTypedTestsJs
+ }, /*useBuiltCompiler*/ false);
+ return gulp.src(importDefinitelyTypedTestsTs)
+ .pipe(sourcemaps.init())
+ .pipe(tsc(settings))
+ .pipe(sourcemaps.write("."))
+ .pipe(gulp.dest("."));
+});
+
+gulp.task("importDefinitelyTypedTests", "Runs scripts/importDefinitelyTypedTests/importDefinitelyTypedTests.ts to copy DT's tests to the TS-internal RWC tests", [importDefinitelyTypedTestsJs], (done) => {
+ exec(host, [importDefinitelyTypedTestsJs, "./", "../DefinitelyTyped"], done, done);
+});
+
+gulp.task("lib", "Builds the library targets", libraryTargets);
+
+
+// Generate diagnostics
+const processDiagnosticMessagesJs = path.join(scriptsDirectory, "processDiagnosticMessages.js");
+const processDiagnosticMessagesTs = path.join(scriptsDirectory, "processDiagnosticMessages.ts");
+const diagnosticMessagesJson = path.join(compilerDirectory, "diagnosticMessages.json");
+const diagnosticInfoMapTs = path.join(compilerDirectory, "diagnosticInformationMap.generated.ts");
+const generatedDiagnosticMessagesJSON = path.join(compilerDirectory, "diagnosticMessages.generated.json");
+const builtGeneratedDiagnosticMessagesJSON = path.join(builtLocalDirectory, "diagnosticMessages.generated.json");
+
+// processDiagnosticMessages script
+gulp.task(processDiagnosticMessagesJs, false, [], () => {
+ const settings: tsc.Settings = getCompilerSettings({
+ declaration: false,
+ removeComments: true,
+ noResolve: false,
+ stripInternal: false,
+ outFile: processDiagnosticMessagesJs
+ }, /*useBuiltCompiler*/ false);
+ return gulp.src(processDiagnosticMessagesTs)
+ .pipe(newer(processDiagnosticMessagesJs))
+ .pipe(sourcemaps.init())
+ .pipe(tsc(settings))
+ .pipe(sourcemaps.write("."))
+ .pipe(gulp.dest("."));
+});
+
+// The generated diagnostics map; built for the compiler and for the "generate-diagnostics" task
+gulp.task(diagnosticInfoMapTs, [processDiagnosticMessagesJs], (done) => {
+ if (needsUpdate(diagnosticMessagesJson, [generatedDiagnosticMessagesJSON, diagnosticInfoMapTs])) {
+ exec(host, [processDiagnosticMessagesJs, diagnosticMessagesJson], done, done);
+ }
+ else {
+ done();
+ }
+});
+
+gulp.task(builtGeneratedDiagnosticMessagesJSON, [diagnosticInfoMapTs], (done) => {
+ if (fs.existsSync(builtLocalDirectory) && needsUpdate(generatedDiagnosticMessagesJSON, builtGeneratedDiagnosticMessagesJSON)) {
+ fs.writeFileSync(builtGeneratedDiagnosticMessagesJSON, fs.readFileSync(generatedDiagnosticMessagesJSON));
+ }
+ done();
+});
+
+gulp.task("generate-diagnostics", "Generates a diagnostic file in TypeScript based on an input JSON file", [diagnosticInfoMapTs]);
+
+
+const servicesFile = path.join(builtLocalDirectory, "typescriptServices.js");
+const standaloneDefinitionsFile = path.join(builtLocalDirectory, "typescriptServices.d.ts");
+const nodePackageFile = path.join(builtLocalDirectory, "typescript.js");
+const nodeDefinitionsFile = path.join(builtLocalDirectory, "typescript.d.ts");
+const nodeStandaloneDefinitionsFile = path.join(builtLocalDirectory, "typescript_standalone.d.ts");
+
+let copyrightContent: string;
+function prependCopyright(outputCopyright: boolean = !useDebugMode) {
+ return insert.prepend(outputCopyright ? (copyrightContent || (copyrightContent = fs.readFileSync(copyright).toString())) : "");
+}
+
+gulp.task(builtLocalCompiler, false, [servicesFile], () => {
+ const localCompilerProject = tsc.createProject("src/compiler/tsconfig.json", getCompilerSettings({}, /*useBuiltCompiler*/true));
+ return localCompilerProject.src()
+ .pipe(newer(builtLocalCompiler))
+ .pipe(sourcemaps.init())
+ .pipe(tsc(localCompilerProject))
+ .pipe(prependCopyright())
+ .pipe(sourcemaps.write("."))
+ .pipe(gulp.dest(builtLocalDirectory));
+});
+
+gulp.task(servicesFile, false, ["lib", "generate-diagnostics"], () => {
+ const servicesProject = tsc.createProject("src/services/tsconfig.json", getCompilerSettings({ removeComments: false }, /*useBuiltCompiler*/false));
+ const {js, dts} = servicesProject.src()
+ .pipe(newer(servicesFile))
+ .pipe(sourcemaps.init())
+ .pipe(tsc(servicesProject));
+ const completedJs = js.pipe(prependCopyright())
+ .pipe(sourcemaps.write("."));
+ const completedDts = dts.pipe(prependCopyright(/*outputCopyright*/true))
+ .pipe(insert.transform((contents, file) => {
+ file.path = standaloneDefinitionsFile;
+ return contents.replace(/^(\s*)(export )?const enum (\S+) {(\s*)$/gm, "$1$2enum $3 {$4");
+ }));
+ return merge2([
+ completedJs,
+ completedJs.pipe(clone())
+ .pipe(insert.transform((content, file) => (file.path = nodePackageFile, content))),
+ completedDts,
+ completedDts.pipe(clone())
+ .pipe(insert.transform((content, file) => {
+ file.path = nodeDefinitionsFile;
+ return content + "\r\nexport = ts;";
+ }))
+ .pipe(gulp.dest(builtLocalDirectory)),
+ completedDts.pipe(clone())
+ .pipe(insert.transform((content, file) => {
+ file.path = nodeStandaloneDefinitionsFile;
+ return content.replace(/declare (namespace|module) ts/g, 'declare module "typescript"');
+ }))
+ ]).pipe(gulp.dest(builtLocalDirectory));
+});
+
+const serverFile = path.join(builtLocalDirectory, "tsserver.js");
+
+gulp.task(serverFile, false, [servicesFile], () => {
+ const serverProject = tsc.createProject("src/server/tsconfig.json", getCompilerSettings({}, /*useBuiltCompiler*/true));
+ return serverProject.src()
+ .pipe(newer(serverFile))
+ .pipe(sourcemaps.init())
+ .pipe(tsc(serverProject))
+ .pipe(prependCopyright())
+ .pipe(sourcemaps.write("."))
+ .pipe(gulp.dest(builtLocalDirectory));
+});
+
+const tsserverLibraryFile = path.join(builtLocalDirectory, "tsserverlibrary.js");
+const tsserverLibraryDefinitionFile = path.join(builtLocalDirectory, "tsserverlibrary.d.ts");
+
+gulp.task(tsserverLibraryFile, false, [servicesFile], (done) => {
+ const settings: tsc.Settings = getCompilerSettings({
+ declaration: true,
+ outFile: tsserverLibraryFile
+ }, /*useBuiltCompiler*/ true);
+ const {js, dts}: {js: NodeJS.ReadableStream, dts: NodeJS.ReadableStream} = gulp.src(languageServiceLibrarySources)
+ .pipe(sourcemaps.init())
+ .pipe(newer(tsserverLibraryFile))
+ .pipe(tsc(settings));
+
+ return merge2([
+ js.pipe(prependCopyright())
+ .pipe(sourcemaps.write("."))
+ .pipe(gulp.dest(".")),
+ dts.pipe(prependCopyright())
+ .pipe(gulp.dest("."))
+ ]);
+});
+
+gulp.task("lssl", "Builds language service server library", [tsserverLibraryFile]);
+gulp.task("local", "Builds the full compiler and services", [builtLocalCompiler, servicesFile, serverFile, builtGeneratedDiagnosticMessagesJSON]);
+gulp.task("tsc", "Builds only the compiler", [builtLocalCompiler]);
+
+
+// Generate Markdown spec
+const word2mdJs = path.join(scriptsDirectory, "word2md.js");
+const word2mdTs = path.join(scriptsDirectory, "word2md.ts");
+const specWord = path.join(docDirectory, "TypeScript Language Specification.docx");
+const specMd = path.join(docDirectory, "spec.md");
+
+gulp.task(word2mdJs, false, [], () => {
+ const settings: tsc.Settings = getCompilerSettings({
+ outFile: word2mdJs
+ }, /*useBuiltCompiler*/ false);
+ return gulp.src(word2mdTs)
+ .pipe(newer(word2mdJs))
+ .pipe(sourcemaps.init())
+ .pipe(tsc(settings))
+ .pipe(sourcemaps.write("."))
+ .pipe(gulp.dest("."));
+});
+
+gulp.task(specMd, false, [word2mdJs], (done) => {
+ const specWordFullPath = path.resolve(specWord);
+ const specMDFullPath = path.resolve(specMd);
+ const cmd = "cscript //nologo " + word2mdJs + " \"" + specWordFullPath + "\" " + "\"" + specMDFullPath + "\"";
+ console.log(cmd);
+ cp.exec(cmd, function () {
+ done();
+ });
+});
+
+gulp.task("generate-spec", "Generates a Markdown version of the Language Specification", [specMd]);
+
+gulp.task("clean", "Cleans the compiler output, declare files, and tests", [], () => {
+ return del([builtDirectory]);
+});
+
+gulp.task("useDebugMode", false, [], (done) => { useDebugMode = true; done(); });
+gulp.task("dontUseDebugMode", false, [], (done) => { useDebugMode = false; done(); });
+
+gulp.task("VerifyLKG", false, [], () => {
+ const expectedFiles = [builtLocalCompiler, servicesFile, serverFile, nodePackageFile, nodeDefinitionsFile, standaloneDefinitionsFile, tsserverLibraryFile, tsserverLibraryDefinitionFile].concat(libraryTargets);
+ const missingFiles = expectedFiles.filter(function (f) {
+ return !fs.existsSync(f);
+ });
+ if (missingFiles.length > 0) {
+ throw new Error("Cannot replace the LKG unless all built targets are present in directory " + builtLocalDirectory +
+ ". The following files are missing:\n" + missingFiles.join("\n"));
+ }
+ // Copy all the targets into the LKG directory
+ return gulp.src(expectedFiles).pipe(gulp.dest(LKGDirectory));
+});
+
+gulp.task("LKGInternal", false, ["lib", "local", "lssl"]);
+
+gulp.task("LKG", "Makes a new LKG out of the built js files", ["clean", "dontUseDebugMode"], () => {
+ return runSequence("LKGInternal", "VerifyLKG");
+});
+
+
+// Task to build the tests infrastructure using the built compiler
+const run = path.join(builtLocalDirectory, "run.js");
+gulp.task(run, false, [servicesFile], () => {
+ const settings: tsc.Settings = getCompilerSettings({
+ outFile: run
+ }, /*useBuiltCompiler*/ true);
+ return gulp.src(harnessSources)
+ .pipe(newer(run))
+ .pipe(sourcemaps.init())
+ .pipe(tsc(settings))
+ .pipe(sourcemaps.write(".", { includeContent: false, sourceRoot: "../../" }))
+ .pipe(gulp.dest("."));
+});
+
+const internalTests = "internal/";
+
+const localBaseline = "tests/baselines/local/";
+const refBaseline = "tests/baselines/reference/";
+
+const localRwcBaseline = path.join(internalTests, "baselines/rwc/local");
+const refRwcBaseline = path.join(internalTests, "baselines/rwc/reference");
+
+const localTest262Baseline = path.join(internalTests, "baselines/test262/local");
+const refTest262Baseline = path.join(internalTests, "baselines/test262/reference");
+
+
+gulp.task("tests", "Builds the test infrastructure using the built compiler", [run]);
+gulp.task("tests-debug", "Builds the test sources and automation in debug mode", () => {
+ return runSequence("useDebugMode", "tests");
+});
+
+function deleteTemporaryProjectOutput() {
+ return del(path.join(localBaseline, "projectOutput/"));
+}
+
+let savedNodeEnv: string;
+function setNodeEnvToDevelopment() {
+ savedNodeEnv = process.env.NODE_ENV;
+ process.env.NODE_ENV = "development";
+}
+
+function restoreSavedNodeEnv() {
+ process.env.NODE_ENV = savedNodeEnv;
+}
+
+let testTimeout = 20000;
+function runConsoleTests(defaultReporter: string, runInParallel: boolean, done: (e?: any) => void) {
+ const lintFlag = cmdLineOptions["lint"];
+ cleanTestDirs((err) => {
+ if (err) { console.error(err); failWithStatus(err, 1); }
+ const debug = cmdLineOptions["debug"];
+ const tests = cmdLineOptions["tests"];
+ const light = cmdLineOptions["light"];
+ const testConfigFile = "test.config";
+ if (fs.existsSync(testConfigFile)) {
+ fs.unlinkSync(testConfigFile);
+ }
+ let workerCount, taskConfigsFolder;
+ if (runInParallel) {
+ // generate name to store task configuration files
+ const prefix = os.tmpdir() + "/ts-tests";
+ let i = 1;
+ do {
+ taskConfigsFolder = prefix + i;
+ i++;
+ } while (fs.existsSync(taskConfigsFolder));
+ fs.mkdirSync(taskConfigsFolder);
+
+ workerCount = process.env.workerCount || os.cpus().length;
+ }
+
+ if (tests || light || taskConfigsFolder) {
+ writeTestConfigFile(tests, light, taskConfigsFolder, workerCount);
+ }
+
+ if (tests && tests.toLocaleLowerCase() === "rwc") {
+ testTimeout = 100000;
+ }
+
+ const colors = cmdLineOptions["colors"];
+ const reporter = cmdLineOptions["reporter"] || defaultReporter;
+
+ // timeout normally isn"t necessary but Travis-CI has been timing out on compiler baselines occasionally
+ // default timeout is 2sec which really should be enough, but maybe we just need a small amount longer
+ if (!runInParallel) {
+ const args = [];
+ if (debug) {
+ args.push("--debug-brk");
+ }
+ args.push("-R", reporter);
+ if (tests) {
+ args.push("-g", `"${tests}"`);
+ }
+ if (colors) {
+ args.push("--colors");
+ }
+ else {
+ args.push("--no-colors");
+ }
+ args.push("-t", testTimeout);
+ args.push(run);
+ setNodeEnvToDevelopment();
+ exec(mocha, args, lintThenFinish, function(e, status) {
+ finish(e, status);
+ });
+
+ }
+ else {
+ // run task to load all tests and partition them between workers
+ const args = [];
+ args.push("-R", "min");
+ if (colors) {
+ args.push("--colors");
+ }
+ else {
+ args.push("--no-colors");
+ }
+ args.push(run);
+ setNodeEnvToDevelopment();
+ runTestsInParallel(taskConfigsFolder, run, { testTimeout: testTimeout, noColors: colors === " --no-colors " }, function (err) {
+ // last worker clean everything and runs linter in case if there were no errors
+ del(taskConfigsFolder).then(() => {
+ if (!err) {
+ lintThenFinish();
+ }
+ else {
+ finish(err);
+ }
+ });
+ });
+ }
+ });
+
+ function failWithStatus(err?: any, status?: number) {
+ if (err) {
+ console.log(err);
+ }
+ done(err || status);
+ process.exit(status);
+ }
+
+ function lintThenFinish() {
+ if (lintFlag) {
+ runSequence("lint", finish);
+ }
+ else {
+ finish();
+ }
+ }
+
+ function finish(error?: any, errorStatus?: number) {
+ restoreSavedNodeEnv();
+ deleteTemporaryProjectOutput().then(() => {
+ if (error !== undefined || errorStatus !== undefined) {
+ failWithStatus(error, errorStatus);
+ }
+ else {
+ done();
+ }
+ });
+ }
+}
+
+gulp.task("runtests-parallel", "Runs all the tests in parallel using the built run.js file. Optional arguments are: --t[ests]=category1|category2|... --d[ebug]=true.", ["build-rules", "tests"], (done) => {
+ runConsoleTests("min", /*runInParallel*/ true, done);
+});
+gulp.task("runtests",
+ "Runs the tests using the built run.js file. Optional arguments are: --t[ests]=regex --r[eporter]=[list|spec|json|] --d[ebug]=true --color[s]=false --lint=true.",
+ ["build-rules", "tests"],
+ (done) => {
+ runConsoleTests("mocha-fivemat-progress-reporter", /*runInParallel*/ false, done);
+});
+
+const nodeServerOutFile = "tests/webTestServer.js";
+const nodeServerInFile = "tests/webTestServer.ts";
+gulp.task(nodeServerOutFile, false, [servicesFile], () => {
+ const settings: tsc.Settings = getCompilerSettings({ module: "commonjs" }, /*useBuiltCompiler*/ true);
+ return gulp.src(nodeServerInFile)
+ .pipe(newer(nodeServerOutFile))
+ .pipe(sourcemaps.init())
+ .pipe(tsc(settings))
+ .pipe(sourcemaps.write("."))
+ .pipe(gulp.dest(path.dirname(nodeServerOutFile)));
+});
+
+gulp.task("browserify", "Runs browserify on run.js to produce a file suitable for running tests in the browser", [servicesFile], (done) => {
+ const settings: tsc.Settings = getCompilerSettings({
+ outFile: "built/local/bundle.js"
+ }, /*useBuiltCompiler*/ true);
+ return gulp.src(harnessSources)
+ .pipe(newer("built/local/bundle.js"))
+ .pipe(sourcemaps.init())
+ .pipe(tsc(settings))
+ .pipe(through2.obj((file, enc, next) => {
+ browserify(intoStream(file.contents))
+ .bundle((err, res) => {
+ // assumes file.contents is a Buffer
+ file.contents = res;
+ next(undefined, file);
+ });
+ }))
+ .pipe(sourcemaps.write(".", { includeContent: false, sourceRoot: "../../" }))
+ .pipe(gulp.dest("."));
+});
+
+
+function cleanTestDirs(done: (e?: any) => void) {
+ // Clean the local baselines & Rwc baselines directories
+ del([
+ localBaseline,
+ localRwcBaseline,
+ ]).then(() => {
+ mkdirP(localRwcBaseline, (err) => {
+ if (err) done(err);
+ mkdirP(localTest262Baseline, () => {
+ if (err) done(err);
+ mkdirP(localBaseline, (err) => done(err));
+ });
+ });
+ });
+}
+
+// used to pass data from jake command line directly to run.js
+function writeTestConfigFile(tests: string, light: boolean, taskConfigsFolder?: string, workerCount?: number) {
+ const testConfigContents = JSON.stringify({ test: tests ? [tests] : undefined, light: light, workerCount: workerCount, taskConfigsFolder: taskConfigsFolder });
+ console.log("Running tests with config: " + testConfigContents);
+ fs.writeFileSync("test.config", testConfigContents);
+}
+
+
+gulp.task("runtests-browser", "Runs the tests using the built run.js file like 'gulp runtests'. Syntax is gulp runtests-browser. Additional optional parameters --tests=[regex], --port=, --browser=[chrome|IE]", ["browserify", nodeServerOutFile], (done) => {
+ cleanTestDirs((err) => {
+ if (err) { console.error(err); done(err); process.exit(1); }
+ host = "node";
+ const tests = cmdLineOptions["tests"];
+ const light = cmdLineOptions["light"];
+ const testConfigFile = "test.config";
+ if (fs.existsSync(testConfigFile)) {
+ fs.unlinkSync(testConfigFile);
+ }
+ if (tests || light) {
+ writeTestConfigFile(tests, light);
+ }
+
+ const args = [nodeServerOutFile];
+ if (cmdLineOptions["port"]) {
+ args.push(cmdLineOptions["port"]);
+ }
+ if (cmdLineOptions["browser"]) {
+ args.push(cmdLineOptions["browser"]);
+ }
+ if (tests) {
+ args.push(JSON.stringify(tests));
+ }
+ exec(host, args, done, done);
+ });
+});
+
+gulp.task("generate-code-coverage", "Generates code coverage data via istanbul", ["tests"], (done) => {
+ exec("istanbul", ["cover", "node_modules/mocha/bin/_mocha", "--", "-R", "min", "-t", testTimeout.toString(), run], done, done);
+});
+
+
+function getDiffTool() {
+ const program = process.env["DIFF"];
+ if (!program) {
+ console.error("Add the 'DIFF' environment variable to the path of the program you want to use.");
+ process.exit(1);
+ }
+ return program;
+}
+
+gulp.task("diff", "Diffs the compiler baselines using the diff tool specified by the 'DIFF' environment variable", (done) => {
+ exec(getDiffTool(), [refBaseline, localBaseline], done, done);
+});
+gulp.task("diff-rwc", "Diffs the RWC baselines using the diff tool specified by the 'DIFF' environment variable", (done) => {
+ exec(getDiffTool(), [refRwcBaseline, localRwcBaseline], done, done);
+});
+
+
+gulp.task("baseline-accept", "Makes the most recent test results the new baseline, overwriting the old baseline", (done) => {
+ const softAccept = cmdLineOptions["soft"];
+ if (!softAccept) {
+ del(refBaseline).then(() => {
+ fs.renameSync(localBaseline, refBaseline);
+ done();
+ }, done);
+ }
+ else {
+ gulp.src(localBaseline)
+ .pipe(gulp.dest(refBaseline))
+ .on("end", () => {
+ del(path.join(refBaseline, "local")).then(() => done(), done);
+ });
+ }
+});
+gulp.task("baseline-accept-rwc", "Makes the most recent rwc test results the new baseline, overwriting the old baseline", () => {
+ return del(refRwcBaseline).then(() => {
+ fs.renameSync(localRwcBaseline, refRwcBaseline);
+ });
+});
+gulp.task("baseline-accept-test262", "Makes the most recent test262 test results the new baseline, overwriting the old baseline", () => {
+ return del(refTest262Baseline).then(() => {
+ fs.renameSync(localTest262Baseline, refTest262Baseline);
+ });
+});
+
+
+// Webhost
+const webhostPath = "tests/webhost/webtsc.ts";
+const webhostJsPath = "tests/webhost/webtsc.js";
+gulp.task(webhostJsPath, false, [servicesFile], () => {
+ const settings: tsc.Settings = getCompilerSettings({
+ outFile: webhostJsPath
+ }, /*useBuiltCompiler*/ true);
+ return gulp.src(webhostPath)
+ .pipe(newer(webhostJsPath))
+ .pipe(sourcemaps.init())
+ .pipe(tsc(settings))
+ .pipe(sourcemaps.write("."))
+ .pipe(gulp.dest(path.dirname(webhostJsPath)));
+});
+
+gulp.task("webhost", "Builds the tsc web host", [webhostJsPath], () => {
+ return gulp.src(path.join(builtLocalDirectory, "lib.d.ts")).pipe(gulp.dest("tests/webhost/"));
+});
+
+
+// Perf compiler
+const perftscPath = "tests/perftsc.ts";
+const perftscJsPath = "built/local/perftsc.js";
+gulp.task(perftscJsPath, false, [servicesFile], () => {
+ const settings: tsc.Settings = getCompilerSettings({
+ outFile: perftscJsPath
+ }, /*useBuiltCompiler*/ true);
+ return gulp.src(perftscPath)
+ .pipe(newer(perftscJsPath))
+ .pipe(sourcemaps.init())
+ .pipe(tsc(settings))
+ .pipe(sourcemaps.write("."))
+ .pipe(gulp.dest("."));
+});
+
+gulp.task("perftsc", "Builds augmented version of the compiler for perf tests", [perftscJsPath]);
+
+
+// Instrumented compiler
+const loggedIOpath = path.join(harnessDirectory, "loggedIO.ts");
+const loggedIOJsPath = path.join(builtLocalDirectory, "loggedIO.js");
+gulp.task(loggedIOJsPath, false, [], (done) => {
+ const temp = path.join(builtLocalDirectory, "temp");
+ mkdirP(temp, (err) => {
+ if (err) { console.error(err); done(err); process.exit(1); };
+ exec(host, [LKGCompiler, "--outdir", temp, loggedIOpath], () => {
+ fs.renameSync(path.join(temp, "/harness/loggedIO.js"), loggedIOJsPath);
+ del(temp).then(() => done(), done);
+ }, done);
+ });
+});
+
+const instrumenterPath = path.join(harnessDirectory, "instrumenter.ts");
+const instrumenterJsPath = path.join(builtLocalDirectory, "instrumenter.js");
+gulp.task(instrumenterJsPath, false, [servicesFile], () => {
+ const settings: tsc.Settings = getCompilerSettings({
+ outFile: instrumenterJsPath
+ }, /*useBuiltCompiler*/ true);
+ return gulp.src(instrumenterPath)
+ .pipe(newer(instrumenterJsPath))
+ .pipe(sourcemaps.init())
+ .pipe(tsc(settings))
+ .pipe(sourcemaps.write("."))
+ .pipe(gulp.dest("."));
+});
+
+gulp.task("tsc-instrumented", "Builds an instrumented tsc.js", [loggedIOJsPath, instrumenterJsPath, servicesFile], (done) => {
+ exec(host, [instrumenterJsPath, "record", "iocapture", builtLocalDirectory, compilerFilename], done, done);
+});
+
+gulp.task("update-sublime", "Updates the sublime plugin's tsserver", ["local", serverFile], () => {
+ return gulp.src([serverFile, serverFile + ".map"]).pipe(gulp.dest("../TypeScript-Sublime-Plugin/tsserver/"));
+});
+
+
+const tslintRuleDir = "scripts/tslint";
+const tslintRules = [
+ "nextLineRule",
+ "preferConstRule",
+ "booleanTriviaRule",
+ "typeOperatorSpacingRule",
+ "noInOperatorRule",
+ "noIncrementDecrementRule",
+ "objectLiteralSurroundingSpaceRule",
+];
+const tslintRulesFiles = tslintRules.map(function(p) {
+ return path.join(tslintRuleDir, p + ".ts");
+});
+const tslintRulesOutFiles = tslintRules.map(function(p, i) {
+ const pathname = path.join(builtLocalDirectory, "tslint", p + ".js");
+ gulp.task(pathname, false, [], () => {
+ const settings: tsc.Settings = getCompilerSettings({ module: "commonjs" }, /*useBuiltCompiler*/ false);
+ return gulp.src(tslintRulesFiles[i])
+ .pipe(newer(pathname))
+ .pipe(sourcemaps.init())
+ .pipe(tsc(settings))
+ .pipe(sourcemaps.write("."))
+ .pipe(gulp.dest(path.join(builtLocalDirectory, "tslint")));
+ });
+ return pathname;
+});
+
+gulp.task("build-rules", "Compiles tslint rules to js", tslintRulesOutFiles);
+
+
+function getLinterOptions() {
+ return {
+ configuration: require("./tslint.json"),
+ formatter: "prose",
+ formattersDirectory: undefined,
+ rulesDirectory: "built/local/tslint"
+ };
+}
+
+function lintFileContents(options, path, contents) {
+ const ll = new Linter(path, contents, options);
+ console.log("Linting '" + path + "'.");
+ return ll.lint();
+}
+
+function lintFile(options, path) {
+ const contents = fs.readFileSync(path, "utf8");
+ return lintFileContents(options, path, contents);
+}
+
+const lintTargets = ["Gulpfile.ts"]
+ .concat(compilerSources)
+ .concat(harnessSources)
+ // Other harness sources
+ .concat(["instrumenter.ts"].map(function(f) { return path.join(harnessDirectory, f); }))
+ .concat(serverCoreSources)
+ .concat(tslintRulesFiles)
+ .concat(servicesSources);
+
+
+gulp.task("lint", "Runs tslint on the compiler sources. Optional arguments are: --f[iles]=regex", ["build-rules"], () => {
+ const lintOptions = getLinterOptions();
+ let failed = 0;
+ const fileMatcher = RegExp(cmdLineOptions["files"]);
+ const done = {};
+ for (const i in lintTargets) {
+ const target = lintTargets[i];
+ if (!done[target] && fileMatcher.test(target)) {
+ const result = lintFile(lintOptions, target);
+ if (result.failureCount > 0) {
+ console.log(result.output);
+ failed += result.failureCount;
+ }
+ done[target] = true;
+ }
+ }
+ if (failed > 0) {
+ console.error("Linter errors.");
+ process.exit(1);
+ }
+});
+
+
+gulp.task("default", "Runs 'local'", ["local"]);
+
+gulp.task("watch", "Watches the src/ directory for changes and executes runtests-parallel.", [], () => {
+ gulp.watch("src/**/*.*", ["runtests-parallel"]);
+});
diff --git a/Jakefile.js b/Jakefile.js
index b7bf34a5f3d..a40fa4215e9 100644
--- a/Jakefile.js
+++ b/Jakefile.js
@@ -307,7 +307,7 @@ var builtLocalCompiler = path.join(builtLocalDirectory, compilerFilename);
function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, opts, callback) {
file(outFile, prereqs, function() {
var compilerPath = useBuiltCompiler ? builtLocalCompiler : LKGCompiler;
- var options = "--noImplicitAny --noEmitOnError --pretty";
+ var options = "--noImplicitAny --noEmitOnError --types --pretty";
opts = opts || {};
// Keep comments when specifically requested
// or when in debug mode.
@@ -1018,7 +1018,8 @@ var tslintRules = [
"booleanTriviaRule",
"typeOperatorSpacingRule",
"noInOperatorRule",
- "noIncrementDecrementRule"
+ "noIncrementDecrementRule",
+ "objectLiteralSurroundingSpaceRule",
];
var tslintRulesFiles = tslintRules.map(function(p) {
return path.join(tslintRuleDir, p + ".ts");
@@ -1069,7 +1070,8 @@ var lintTargets = compilerSources
.concat(["instrumenter.ts"].map(function(f) { return path.join(harnessDirectory, f) }))
.concat(serverCoreSources)
.concat(tslintRulesFiles)
- .concat(servicesSources);
+ .concat(servicesSources)
+ .concat(["Gulpfile.ts"]);
desc("Runs tslint on the compiler sources. Optional arguments are: f[iles]=regex");
diff --git a/README.md b/README.md
index 13e1f3e4786..fca2890bc77 100644
--- a/README.md
+++ b/README.md
@@ -56,29 +56,29 @@ Change to the TypeScript directory:
cd TypeScript
```
-Install Jake tools and dev dependencies:
+Install Gulp tools and dev dependencies:
```
-npm install -g jake
+npm install -g gulp
npm install
```
Use one of the following to build and test:
```
-jake local # Build the compiler into built/local
-jake clean # Delete the built compiler
-jake LKG # Replace the last known good with the built one.
+gulp local # Build the compiler into built/local
+gulp clean # Delete the built compiler
+gulp LKG # Replace the last known good with the built one.
# Bootstrapping step to be executed when the built compiler reaches a stable state.
-jake tests # Build the test infrastructure using the built compiler.
-jake runtests # Run tests using the built compiler and test infrastructure.
+gulp tests # Build the test infrastructure using the built compiler.
+gulp runtests # Run tests using the built compiler and test infrastructure.
# You can override the host or specify a test for this command.
# Use host= or tests=.
-jake runtests-browser # Runs the tests using the built run.js file. Syntax is jake runtests. Optional
+gulp runtests-browser # Runs the tests using the built run.js file. Syntax is gulp runtests. Optional
parameters 'host=', 'tests=[regex], reporter=[list|spec|json|]'.
-jake baseline-accept # This replaces the baseline test results with the results obtained from jake runtests.
-jake lint # Runs tslint on the TypeScript source.
-jake -T # List the above commands.
+gulp baseline-accept # This replaces the baseline test results with the results obtained from gulp runtests.
+gulp lint # Runs tslint on the TypeScript source.
+gulp help # List the above commands.
```
diff --git a/lib/lib.d.ts b/lib/lib.d.ts
index 2881834e678..e25105cc98e 100644
--- a/lib/lib.d.ts
+++ b/lib/lib.d.ts
@@ -1271,13 +1271,33 @@ declare type PromiseConstructorLike = new (executor: (resolve: (value?: T | P
interface PromiseLike {
/**
- * Attaches callbacks for the resolution and/or rejection of the Promise.
- * @param onfulfilled The callback to execute when the Promise is resolved.
- * @param onrejected The callback to execute when the Promise is rejected.
- * @returns A Promise for the completion of which ever callback is executed.
- */
- then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): PromiseLike;
- then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => void): PromiseLike;
+ * Attaches callbacks for the resolution and/or rejection of the Promise.
+ * @param onfulfilled The callback to execute when the Promise is resolved.
+ * @param onrejected The callback to execute when the Promise is rejected.
+ * @returns A Promise for the completion of which ever callback is executed.
+ */
+ then(onfulfilled: (value: T) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): PromiseLike;
+
+ /**
+ * Attaches callbacks for the resolution and/or rejection of the Promise.
+ * @param onfulfilled The callback to execute when the Promise is resolved.
+ * @param onrejected The callback to execute when the Promise is rejected.
+ * @returns A Promise for the completion of which ever callback is executed.
+ */
+ then(onfulfilled: (value: T) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): PromiseLike;
+
+ /**
+ * Attaches callbacks for the resolution and/or rejection of the Promise.
+ * @param onfulfilled The callback to execute when the Promise is resolved.
+ * @returns A Promise for the completion of which ever callback is executed.
+ */
+ then(onfulfilled: (value: T) => TResult | PromiseLike): PromiseLike;
+
+ /**
+ * Creates a new Promise with the same internal state of this Promise.
+ * @returns A Promise.
+ */
+ then(): PromiseLike;
}
interface ArrayLike {
@@ -1540,7 +1560,7 @@ interface Int8Array {
* Returns the index of the first element in the array where predicate is true, and undefined
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
- * order, until it finds one where predicate returns true. If such an element is found,
+ * order, until it finds one where predicate returns true. If such an element is found,
* findIndex immediately returns that element index. Otherwise, findIndex returns -1.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
@@ -1813,7 +1833,7 @@ interface Uint8Array {
* Returns the index of the first element in the array where predicate is true, and undefined
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
- * order, until it finds one where predicate returns true. If such an element is found,
+ * order, until it finds one where predicate returns true. If such an element is found,
* findIndex immediately returns that element index. Otherwise, findIndex returns -1.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
@@ -2087,7 +2107,7 @@ interface Uint8ClampedArray {
* Returns the index of the first element in the array where predicate is true, and undefined
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
- * order, until it finds one where predicate returns true. If such an element is found,
+ * order, until it finds one where predicate returns true. If such an element is found,
* findIndex immediately returns that element index. Otherwise, findIndex returns -1.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
@@ -2360,7 +2380,7 @@ interface Int16Array {
* Returns the index of the first element in the array where predicate is true, and undefined
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
- * order, until it finds one where predicate returns true. If such an element is found,
+ * order, until it finds one where predicate returns true. If such an element is found,
* findIndex immediately returns that element index. Otherwise, findIndex returns -1.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
@@ -2634,7 +2654,7 @@ interface Uint16Array {
* Returns the index of the first element in the array where predicate is true, and undefined
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
- * order, until it finds one where predicate returns true. If such an element is found,
+ * order, until it finds one where predicate returns true. If such an element is found,
* findIndex immediately returns that element index. Otherwise, findIndex returns -1.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
@@ -2907,7 +2927,7 @@ interface Int32Array {
* Returns the index of the first element in the array where predicate is true, and undefined
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
- * order, until it finds one where predicate returns true. If such an element is found,
+ * order, until it finds one where predicate returns true. If such an element is found,
* findIndex immediately returns that element index. Otherwise, findIndex returns -1.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
@@ -3180,7 +3200,7 @@ interface Uint32Array {
* Returns the index of the first element in the array where predicate is true, and undefined
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
- * order, until it finds one where predicate returns true. If such an element is found,
+ * order, until it finds one where predicate returns true. If such an element is found,
* findIndex immediately returns that element index. Otherwise, findIndex returns -1.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
@@ -3453,7 +3473,7 @@ interface Float32Array {
* Returns the index of the first element in the array where predicate is true, and undefined
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
- * order, until it finds one where predicate returns true. If such an element is found,
+ * order, until it finds one where predicate returns true. If such an element is found,
* findIndex immediately returns that element index. Otherwise, findIndex returns -1.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
@@ -3727,7 +3747,7 @@ interface Float64Array {
* Returns the index of the first element in the array where predicate is true, and undefined
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
- * order, until it finds one where predicate returns true. If such an element is found,
+ * order, until it finds one where predicate returns true. If such an element is found,
* findIndex immediately returns that element index. Otherwise, findIndex returns -1.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
@@ -4126,7 +4146,7 @@ interface Date {
/////////////////////////////
interface Algorithm {
- name?: string;
+ name: string;
}
interface AriaRequestEventInit extends EventInit {
@@ -4973,6 +4993,7 @@ interface UIEventInit extends EventInit {
}
interface WebGLContextAttributes {
+ failIfMajorPerformanceCaveat?: boolean;
alpha?: boolean;
depth?: boolean;
stencil?: boolean;
@@ -5041,7 +5062,7 @@ interface ApplicationCache extends EventTarget {
oncached: (ev: Event) => any;
onchecking: (ev: Event) => any;
ondownloading: (ev: Event) => any;
- onerror: (ev: Event) => any;
+ onerror: (ev: ErrorEvent) => any;
onnoupdate: (ev: Event) => any;
onobsolete: (ev: Event) => any;
onprogress: (ev: ProgressEvent) => any;
@@ -6411,7 +6432,7 @@ declare var DeviceRotationRate: {
interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEvent {
/**
- * Sets or gets the URL for the current document.
+ * Sets or gets the URL for the current document.
*/
readonly URL: string;
/**
@@ -6439,7 +6460,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
*/
applets: HTMLCollectionOf;
/**
- * Deprecated. Sets or retrieves a value that indicates the background color behind the object.
+ * Deprecated. Sets or retrieves a value that indicates the background color behind the object.
*/
bgColor: string;
/**
@@ -6467,19 +6488,19 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
*/
designMode: string;
/**
- * Sets or retrieves a value that indicates the reading order of the object.
+ * Sets or retrieves a value that indicates the reading order of the object.
*/
dir: string;
/**
- * Gets an object representing the document type declaration associated with the current document.
+ * Gets an object representing the document type declaration associated with the current document.
*/
readonly doctype: DocumentType;
/**
- * Gets a reference to the root node of the document.
+ * Gets a reference to the root node of the document.
*/
documentElement: HTMLElement;
/**
- * Sets or gets the security domain of the document.
+ * Sets or gets the security domain of the document.
*/
domain: string;
/**
@@ -6503,7 +6524,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
*/
images: HTMLCollectionOf;
/**
- * Gets the implementation object of the current document.
+ * Gets the implementation object of the current document.
*/
readonly implementation: DOMImplementation;
/**
@@ -6511,11 +6532,11 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
*/
readonly inputEncoding: string | null;
/**
- * Gets the date that the page was last modified, if the page supplies one.
+ * Gets the date that the page was last modified, if the page supplies one.
*/
readonly lastModified: string;
/**
- * Sets or gets the color of the document links.
+ * Sets or gets the color of the document links.
*/
linkColor: string;
/**
@@ -6523,7 +6544,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
*/
links: HTMLCollectionOf;
/**
- * Contains information about the current URL.
+ * Contains information about the current URL.
*/
readonly location: Location;
msCSSOMElementFloatMetrics: boolean;
@@ -6532,7 +6553,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
* Fires when the user aborts the download.
* @param ev The event.
*/
- onabort: (ev: Event) => any;
+ onabort: (ev: UIEvent) => any;
/**
* Fires when the object is set as the active element.
* @param ev The event.
@@ -6548,19 +6569,19 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
* @param ev The event.
*/
onbeforedeactivate: (ev: UIEvent) => any;
- /**
- * Fires when the object loses the input focus.
+ /**
+ * Fires when the object loses the input focus.
* @param ev The focus event.
*/
onblur: (ev: FocusEvent) => any;
/**
- * Occurs when playback is possible, but would require further buffering.
+ * Occurs when playback is possible, but would require further buffering.
* @param ev The event.
*/
oncanplay: (ev: Event) => any;
oncanplaythrough: (ev: Event) => any;
/**
- * Fires when the contents of the object or selection have changed.
+ * Fires when the contents of the object or selection have changed.
* @param ev The event.
*/
onchange: (ev: Event) => any;
@@ -6570,7 +6591,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
*/
onclick: (ev: MouseEvent) => any;
/**
- * Fires when the user clicks the right mouse button in the client area, opening the context menu.
+ * Fires when the user clicks the right mouse button in the client area, opening the context menu.
* @param ev The mouse event.
*/
oncontextmenu: (ev: PointerEvent) => any;
@@ -6594,12 +6615,12 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
* @param ev The event.
*/
ondragend: (ev: DragEvent) => any;
- /**
+ /**
* Fires on the target element when the user drags the object to a valid drop target.
* @param ev The drag event.
*/
ondragenter: (ev: DragEvent) => any;
- /**
+ /**
* Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation.
* @param ev The drag event.
*/
@@ -6610,23 +6631,23 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
*/
ondragover: (ev: DragEvent) => any;
/**
- * Fires on the source object when the user starts to drag a text selection or selected object.
+ * Fires on the source object when the user starts to drag a text selection or selected object.
* @param ev The event.
*/
ondragstart: (ev: DragEvent) => any;
ondrop: (ev: DragEvent) => any;
/**
- * Occurs when the duration attribute is updated.
+ * Occurs when the duration attribute is updated.
* @param ev The event.
*/
ondurationchange: (ev: Event) => any;
/**
- * Occurs when the media element is reset to its initial state.
+ * Occurs when the media element is reset to its initial state.
* @param ev The event.
*/
onemptied: (ev: Event) => any;
/**
- * Occurs when the end of playback is reached.
+ * Occurs when the end of playback is reached.
* @param ev The event
*/
onended: (ev: MediaStreamErrorEvent) => any;
@@ -6634,9 +6655,9 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
* Fires when an error occurs during object loading.
* @param ev The event.
*/
- onerror: (ev: Event) => any;
+ onerror: (ev: ErrorEvent) => any;
/**
- * Fires when the object receives focus.
+ * Fires when the object receives focus.
* @param ev The event.
*/
onfocus: (ev: FocusEvent) => any;
@@ -6660,12 +6681,12 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
*/
onkeyup: (ev: KeyboardEvent) => any;
/**
- * Fires immediately after the browser loads the object.
+ * Fires immediately after the browser loads the object.
* @param ev The event.
*/
onload: (ev: Event) => any;
/**
- * Occurs when media data is loaded at the current playback position.
+ * Occurs when media data is loaded at the current playback position.
* @param ev The event.
*/
onloadeddata: (ev: Event) => any;
@@ -6675,22 +6696,22 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
*/
onloadedmetadata: (ev: Event) => any;
/**
- * Occurs when Internet Explorer begins looking for media data.
+ * Occurs when Internet Explorer begins looking for media data.
* @param ev The event.
*/
onloadstart: (ev: Event) => any;
/**
- * Fires when the user clicks the object with either mouse button.
+ * Fires when the user clicks the object with either mouse button.
* @param ev The mouse event.
*/
onmousedown: (ev: MouseEvent) => any;
/**
- * Fires when the user moves the mouse over the object.
+ * Fires when the user moves the mouse over the object.
* @param ev The mouse event.
*/
onmousemove: (ev: MouseEvent) => any;
/**
- * Fires when the user moves the mouse pointer outside the boundaries of the object.
+ * Fires when the user moves the mouse pointer outside the boundaries of the object.
* @param ev The mouse event.
*/
onmouseout: (ev: MouseEvent) => any;
@@ -6700,12 +6721,12 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
*/
onmouseover: (ev: MouseEvent) => any;
/**
- * Fires when the user releases a mouse button while the mouse is over the object.
+ * Fires when the user releases a mouse button while the mouse is over the object.
* @param ev The mouse event.
*/
onmouseup: (ev: MouseEvent) => any;
/**
- * Fires when the wheel button is rotated.
+ * Fires when the wheel button is rotated.
* @param ev The mouse event
*/
onmousewheel: (ev: WheelEvent) => any;
@@ -6727,7 +6748,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
onmspointerover: (ev: MSPointerEvent) => any;
onmspointerup: (ev: MSPointerEvent) => any;
/**
- * Occurs when an item is removed from a Jump List of a webpage running in Site Mode.
+ * Occurs when an item is removed from a Jump List of a webpage running in Site Mode.
* @param ev The event.
*/
onmssitemodejumplistitemremoved: (ev: MSSiteModeEvent) => any;
@@ -6742,24 +6763,24 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
*/
onpause: (ev: Event) => any;
/**
- * Occurs when the play method is requested.
+ * Occurs when the play method is requested.
* @param ev The event.
*/
onplay: (ev: Event) => any;
/**
- * Occurs when the audio or video has started playing.
+ * Occurs when the audio or video has started playing.
* @param ev The event.
*/
onplaying: (ev: Event) => any;
onpointerlockchange: (ev: Event) => any;
onpointerlockerror: (ev: Event) => any;
/**
- * Occurs to indicate progress while downloading media data.
+ * Occurs to indicate progress while downloading media data.
* @param ev The event.
*/
onprogress: (ev: ProgressEvent) => any;
/**
- * Occurs when the playback rate is increased or decreased.
+ * Occurs when the playback rate is increased or decreased.
* @param ev The event.
*/
onratechange: (ev: Event) => any;
@@ -6769,22 +6790,22 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
*/
onreadystatechange: (ev: ProgressEvent) => any;
/**
- * Fires when the user resets a form.
+ * Fires when the user resets a form.
* @param ev The event.
*/
onreset: (ev: Event) => any;
/**
- * Fires when the user repositions the scroll box in the scroll bar on the object.
+ * Fires when the user repositions the scroll box in the scroll bar on the object.
* @param ev The event.
*/
onscroll: (ev: UIEvent) => any;
/**
- * Occurs when the seek operation ends.
+ * Occurs when the seek operation ends.
* @param ev The event.
*/
onseeked: (ev: Event) => any;
/**
- * Occurs when the current playback position is moved.
+ * Occurs when the current playback position is moved.
* @param ev The event.
*/
onseeking: (ev: Event) => any;
@@ -6800,7 +6821,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
onselectionchange: (ev: Event) => any;
onselectstart: (ev: Event) => any;
/**
- * Occurs when the download has stopped.
+ * Occurs when the download has stopped.
* @param ev The event.
*/
onstalled: (ev: Event) => any;
@@ -6811,7 +6832,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
onstop: (ev: Event) => any;
onsubmit: (ev: Event) => any;
/**
- * Occurs if the load operation has been intentionally halted.
+ * Occurs if the load operation has been intentionally halted.
* @param ev The event.
*/
onsuspend: (ev: Event) => any;
@@ -6830,7 +6851,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
*/
onvolumechange: (ev: Event) => any;
/**
- * Occurs when playback stops because the next frame of a video resource is not available.
+ * Occurs when playback stops because the next frame of a video resource is not available.
* @param ev The event.
*/
onwaiting: (ev: Event) => any;
@@ -6864,7 +6885,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
*/
title: string;
readonly visibilityState: string;
- /**
+ /**
* Sets or gets the color of the links that the user has visited.
*/
vlinkColor: string;
@@ -7054,7 +7075,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
createExpression(expression: string, resolver: XPathNSResolver): XPathExpression;
createNSResolver(nodeResolver: Node): XPathNSResolver;
/**
- * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
+ * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
* @param root The root element or node to start traversing on.
* @param whatToShow The type of nodes or elements to appear in the node list
* @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter.
@@ -7063,11 +7084,11 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
createNodeIterator(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): NodeIterator;
createProcessingInstruction(target: string, data: string): ProcessingInstruction;
/**
- * Returns an empty range object that has both of its boundary points positioned at the beginning of the document.
+ * Returns an empty range object that has both of its boundary points positioned at the beginning of the document.
*/
createRange(): Range;
/**
- * Creates a text string from the specified value.
+ * Creates a text string from the specified value.
* @param data String that specifies the nodeValue property of the text node.
*/
createTextNode(data: string): Text;
@@ -7082,7 +7103,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
*/
createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): TreeWalker;
/**
- * Returns the element for the specified x coordinate and the specified y coordinate.
+ * Returns the element for the specified x coordinate and the specified y coordinate.
* @param x The x-offset
* @param y The y-offset
*/
@@ -7110,7 +7131,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
* Returns a reference to the first object with the specified value of the ID or NAME attribute.
* @param elementId String that specifies the ID value. Case-insensitive.
*/
- getElementById(elementId: string): HTMLElement;
+ getElementById(elementId: string): HTMLElement | null;
getElementsByClassName(classNames: string): HTMLCollectionOf;
/**
* Gets a collection of objects based on the value of the NAME or ID attribute.
@@ -7320,7 +7341,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
* @param replace Specifies whether the existing entry for the document is replaced in the history list.
*/
open(url?: string, name?: string, features?: string, replace?: boolean): Document;
- /**
+ /**
* Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document.
* @param commandId Specifies a command identifier.
*/
@@ -7342,7 +7363,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
queryCommandSupported(commandId: string): boolean;
/**
* Retrieves the string associated with a command.
- * @param commandId String that contains the identifier of a command. This can be any command identifier given in the list of Command Identifiers.
+ * @param commandId String that contains the identifier of a command. This can be any command identifier given in the list of Command Identifiers.
*/
queryCommandText(commandId: string): string;
/**
@@ -7358,12 +7379,12 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
webkitCancelFullScreen(): void;
webkitExitFullscreen(): void;
/**
- * Writes one or more HTML expressions to a document in the specified window.
+ * Writes one or more HTML expressions to a document in the specified window.
* @param content Specifies the text and HTML tags to write.
*/
write(...content: string[]): void;
/**
- * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window.
+ * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window.
* @param content The text and HTML tags to write.
*/
writeln(...content: string[]): void;
@@ -7585,7 +7606,7 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelec
readonly scrollWidth: number;
readonly tagName: string;
innerHTML: string;
- getAttribute(name?: string): string | null;
+ getAttribute(name: string): string | null;
getAttributeNS(namespaceURI: string, localName: string): string;
getAttributeNode(name: string): Attr;
getAttributeNodeNS(namespaceURI: string, localName: string): Attr;
@@ -7795,6 +7816,7 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelec
webkitRequestFullscreen(): void;
getElementsByClassName(classNames: string): NodeListOf;
matches(selector: string): boolean;
+ closest(selector: string): Element | null;
addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
@@ -8091,12 +8113,12 @@ interface HTMLAnchorElement extends HTMLElement {
*/
target: string;
/**
- * Retrieves or sets the text of the object as a string.
+ * Retrieves or sets the text of the object as a string.
*/
text: string;
type: string;
urn: string;
- /**
+ /**
* Returns a string representation of an object.
*/
toString(): string;
@@ -8198,7 +8220,7 @@ interface HTMLAreaElement extends HTMLElement {
*/
host: string;
/**
- * Sets or retrieves the host name part of the location or URL.
+ * Sets or retrieves the host name part of the location or URL.
*/
hostname: string;
/**
@@ -8234,7 +8256,7 @@ interface HTMLAreaElement extends HTMLElement {
* Sets or retrieves the window or frame at which to target content.
*/
target: string;
- /**
+ /**
* Returns a string representation of an object.
*/
toString(): string;
@@ -8325,7 +8347,7 @@ interface HTMLBodyElement extends HTMLElement {
onbeforeprint: (ev: Event) => any;
onbeforeunload: (ev: BeforeUnloadEvent) => any;
onblur: (ev: FocusEvent) => any;
- onerror: (ev: Event) => any;
+ onerror: (ev: ErrorEvent) => any;
onfocus: (ev: FocusEvent) => any;
onhashchange: (ev: HashChangeEvent) => any;
onload: (ev: Event) => any;
@@ -8500,7 +8522,7 @@ interface HTMLButtonElement extends HTMLElement {
* Overrides the target attribute on a form element.
*/
formTarget: string;
- /**
+ /**
* Sets or retrieves the name of the object.
*/
name: string;
@@ -8517,7 +8539,7 @@ interface HTMLButtonElement extends HTMLElement {
* Returns a ValidityState object that represents the validity states of an element.
*/
readonly validity: ValidityState;
- /**
+ /**
* Sets or retrieves the default or selected value of the control.
*/
value: string;
@@ -8554,9 +8576,9 @@ interface HTMLCanvasElement extends HTMLElement {
* Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas.
* @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl");
*/
- getContext(contextId: "2d"): CanvasRenderingContext2D;
- getContext(contextId: "experimental-webgl"): WebGLRenderingContext;
- getContext(contextId: string, ...args: any[]): CanvasRenderingContext2D | WebGLRenderingContext;
+ getContext(contextId: "2d", contextAttributes?: Canvas2DContextAttributes): CanvasRenderingContext2D | null;
+ getContext(contextId: "webgl" | "experimental-webgl", contextAttributes?: WebGLContextAttributes): WebGLRenderingContext | null;
+ getContext(contextId: string, contextAttributes?: {}): CanvasRenderingContext2D | WebGLRenderingContext | null;
/**
* Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing.
*/
@@ -8566,7 +8588,7 @@ interface HTMLCanvasElement extends HTMLElement {
* @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image.
*/
toDataURL(type?: string, ...args: any[]): string;
- toBlob(): Blob;
+ toBlob(callback: (result: Blob | null) => void, ... arguments: any[]): void;
}
declare var HTMLCanvasElement: {
@@ -8624,7 +8646,7 @@ declare var HTMLDirectoryElement: {
interface HTMLDivElement extends HTMLElement {
/**
- * Sets or retrieves how the object is aligned with adjacent text.
+ * Sets or retrieves how the object is aligned with adjacent text.
*/
align: string;
/**
@@ -8664,7 +8686,7 @@ interface HTMLElement extends Element {
readonly offsetParent: Element;
readonly offsetTop: number;
readonly offsetWidth: number;
- onabort: (ev: Event) => any;
+ onabort: (ev: UIEvent) => any;
onactivate: (ev: UIEvent) => any;
onbeforeactivate: (ev: UIEvent) => any;
onbeforecopy: (ev: ClipboardEvent) => any;
@@ -8692,7 +8714,7 @@ interface HTMLElement extends Element {
ondurationchange: (ev: Event) => any;
onemptied: (ev: Event) => any;
onended: (ev: MediaStreamErrorEvent) => any;
- onerror: (ev: Event) => any;
+ onerror: (ev: ErrorEvent) => any;
onfocus: (ev: FocusEvent) => any;
oninput: (ev: Event) => any;
oninvalid: (ev: Event) => any;
@@ -9242,7 +9264,7 @@ interface HTMLFrameSetElement extends HTMLElement {
* Fires when the object loses the input focus.
*/
onblur: (ev: FocusEvent) => any;
- onerror: (ev: Event) => any;
+ onerror: (ev: ErrorEvent) => any;
/**
* Fires when the object receives focus.
*/
@@ -9765,9 +9787,9 @@ interface HTMLInputElement extends HTMLElement {
/**
* Returns a FileList object on a file type input object.
*/
- readonly files: FileList;
+ readonly files: FileList | null;
/**
- * Retrieves a reference to the form that the object is embedded in.
+ * Retrieves a reference to the form that the object is embedded in.
*/
readonly form: HTMLFormElement;
/**
@@ -10487,7 +10509,7 @@ interface HTMLMetaElement extends HTMLElement {
*/
scheme: string;
/**
- * Sets or retrieves the URL property that will be loaded after the specified time has elapsed.
+ * Sets or retrieves the URL property that will be loaded after the specified time has elapsed.
*/
url: string;
}
@@ -10736,7 +10758,7 @@ declare var HTMLOptionElement: {
create(): HTMLOptionElement;
}
-interface HTMLOptionsCollection extends HTMLCollection {
+interface HTMLOptionsCollection extends HTMLCollectionOf {
length: number;
selectedIndex: number;
add(element: HTMLOptionElement | HTMLOptGroupElement, before?: HTMLElement | number): void;
@@ -10750,7 +10772,7 @@ declare var HTMLOptionsCollection: {
interface HTMLParagraphElement extends HTMLElement {
/**
- * Sets or retrieves how the object is aligned with adjacent text.
+ * Sets or retrieves how the object is aligned with adjacent text.
*/
align: string;
clear: string;
@@ -10852,10 +10874,10 @@ interface HTMLScriptElement extends HTMLElement {
*/
defer: boolean;
/**
- * Sets or retrieves the event for which the script is written.
+ * Sets or retrieves the event for which the script is written.
*/
event: string;
- /**
+ /**
* Sets or retrieves the object that is bound to the event script.
*/
htmlFor: string;
@@ -10864,7 +10886,7 @@ interface HTMLScriptElement extends HTMLElement {
*/
src: string;
/**
- * Retrieves or sets the text of the object as a string.
+ * Retrieves or sets the text of the object as a string.
*/
text: string;
/**
@@ -10885,7 +10907,7 @@ interface HTMLSelectElement extends HTMLElement {
autofocus: boolean;
disabled: boolean;
/**
- * Retrieves a reference to the form that the object is embedded in.
+ * Retrieves a reference to the form that the object is embedded in.
*/
readonly form: HTMLFormElement;
/**
@@ -10900,7 +10922,7 @@ interface HTMLSelectElement extends HTMLElement {
* Sets or retrieves the name of the object.
*/
name: string;
- options: HTMLCollectionOf;
+ readonly options: HTMLOptionsCollection;
/**
* When present, marks an element that can't be submitted without a value.
*/
@@ -10911,7 +10933,7 @@ interface HTMLSelectElement extends HTMLElement {
selectedIndex: number;
selectedOptions: HTMLCollectionOf;
/**
- * Sets or retrieves the number of rows in the list box.
+ * Sets or retrieves the number of rows in the list box.
*/
size: number;
/**
@@ -10937,7 +10959,7 @@ interface HTMLSelectElement extends HTMLElement {
/**
* Adds an element to the areas, controlRange, or options collection.
* @param element Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection.
- * @param before Variant of type Object that specifies an element to insert before, or null to append the object to the collection.
+ * @param before Variant of type Object that specifies an element to insert before, or null to append the object to the collection.
*/
add(element: HTMLElement, before?: HTMLElement | number): void;
/**
@@ -11132,7 +11154,7 @@ interface HTMLTableElement extends HTMLElement {
*/
border: string;
/**
- * Sets or retrieves the border color of the object.
+ * Sets or retrieves the border color of the object.
*/
borderColor: any;
/**
@@ -11427,7 +11449,7 @@ declare var HTMLTextAreaElement: {
interface HTMLTitleElement extends HTMLElement {
/**
- * Retrieves or sets the text of the object as a string.
+ * Retrieves or sets the text of the object as a string.
*/
text: string;
}
@@ -11696,7 +11718,7 @@ interface IDBDatabase extends EventTarget {
readonly name: string;
readonly objectStoreNames: DOMStringList;
onabort: (ev: Event) => any;
- onerror: (ev: Event) => any;
+ onerror: (ev: ErrorEvent) => any;
version: number;
onversionchange: (ev: IDBVersionChangeEvent) => any;
close(): void;
@@ -11799,7 +11821,7 @@ declare var IDBOpenDBRequest: {
interface IDBRequest extends EventTarget {
readonly error: DOMError;
- onerror: (ev: Event) => any;
+ onerror: (ev: ErrorEvent) => any;
onsuccess: (ev: Event) => any;
readonly readyState: string;
readonly result: any;
@@ -11821,7 +11843,7 @@ interface IDBTransaction extends EventTarget {
readonly mode: string;
onabort: (ev: Event) => any;
oncomplete: (ev: Event) => any;
- onerror: (ev: Event) => any;
+ onerror: (ev: ErrorEvent) => any;
abort(): void;
objectStore(name: string): IDBObjectStore;
readonly READ_ONLY: string;
@@ -11964,7 +11986,7 @@ declare var MSApp: MSApp;
interface MSAppAsyncOperation extends EventTarget {
readonly error: DOMError;
oncomplete: (ev: Event) => any;
- onerror: (ev: Event) => any;
+ onerror: (ev: ErrorEvent) => any;
readonly readyState: number;
readonly result: any;
start(): void;
@@ -12324,7 +12346,7 @@ declare var MSStreamReader: {
interface MSWebViewAsyncOperation extends EventTarget {
readonly error: DOMError;
oncomplete: (ev: Event) => any;
- onerror: (ev: Event) => any;
+ onerror: (ev: ErrorEvent) => any;
readonly readyState: number;
readonly result: any;
readonly target: MSHTMLWebViewElement;
@@ -12860,7 +12882,7 @@ interface Node extends EventTarget {
contains(child: Node): boolean;
hasAttributes(): boolean;
hasChildNodes(): boolean;
- insertBefore(newChild: Node, refChild: Node): Node;
+ insertBefore(newChild: Node, refChild: Node | null): Node;
isDefaultNamespace(namespaceURI: string | null): boolean;
isEqualNode(arg: Node): boolean;
isSameNode(other: Node): boolean;
@@ -12869,7 +12891,6 @@ interface Node extends EventTarget {
normalize(): void;
removeChild(oldChild: Node): Node;
replaceChild(newChild: Node, oldChild: Node): Node;
- contains(node: Node): boolean;
readonly ATTRIBUTE_NODE: number;
readonly CDATA_SECTION_NODE: number;
readonly COMMENT_NODE: number;
@@ -13405,7 +13426,7 @@ declare var RTCDTMFToneChangeEvent: {
interface RTCDtlsTransport extends RTCStatsProvider {
ondtlsstatechange: ((ev: RTCDtlsTransportStateChangedEvent) => any) | null;
- onerror: ((ev: Event) => any) | null;
+ onerror: ((ev: ErrorEvent) => any) | null;
readonly state: string;
readonly transport: RTCIceTransport;
getLocalParameters(): RTCDtlsParameters;
@@ -13460,7 +13481,7 @@ declare var RTCIceCandidatePairChangedEvent: {
interface RTCIceGatherer extends RTCStatsProvider {
readonly component: string;
- onerror: ((ev: Event) => any) | null;
+ onerror: ((ev: ErrorEvent) => any) | null;
onlocalcandidate: ((ev: RTCIceGathererEvent) => any) | null;
createAssociatedGatherer(): RTCIceGatherer;
getLocalCandidates(): RTCIceCandidate[];
@@ -13519,7 +13540,7 @@ declare var RTCIceTransportStateChangedEvent: {
}
interface RTCRtpReceiver extends RTCStatsProvider {
- onerror: ((ev: Event) => any) | null;
+ onerror: ((ev: ErrorEvent) => any) | null;
readonly rtcpTransport: RTCDtlsTransport;
readonly track: MediaStreamTrack | null;
readonly transport: RTCDtlsTransport | RTCSrtpSdesTransport;
@@ -13539,7 +13560,7 @@ declare var RTCRtpReceiver: {
}
interface RTCRtpSender extends RTCStatsProvider {
- onerror: ((ev: Event) => any) | null;
+ onerror: ((ev: ErrorEvent) => any) | null;
onssrcconflict: ((ev: RTCSsrcConflictEvent) => any) | null;
readonly rtcpTransport: RTCDtlsTransport;
readonly track: MediaStreamTrack;
@@ -13560,7 +13581,7 @@ declare var RTCRtpSender: {
}
interface RTCSrtpSdesTransport extends EventTarget {
- onerror: ((ev: Event) => any) | null;
+ onerror: ((ev: ErrorEvent) => any) | null;
readonly transport: RTCIceTransport;
addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
@@ -15600,18 +15621,24 @@ declare var StyleSheetPageList: {
}
interface SubtleCrypto {
- decrypt(algorithm: string | Algorithm, key: CryptoKey, data: ArrayBufferView): PromiseLike;
- deriveBits(algorithm: string | Algorithm, baseKey: CryptoKey, length: number): PromiseLike;
- deriveKey(algorithm: string | Algorithm, baseKey: CryptoKey, derivedKeyType: string | Algorithm, extractable: boolean, keyUsages: string[]): PromiseLike;
- digest(algorithm: string | Algorithm, data: ArrayBufferView): PromiseLike;
- encrypt(algorithm: string | Algorithm, key: CryptoKey, data: ArrayBufferView): PromiseLike;
- exportKey(format: string, key: CryptoKey): PromiseLike;
- generateKey(algorithm: string | Algorithm, extractable: boolean, keyUsages: string[]): PromiseLike;
- importKey(format: string, keyData: ArrayBufferView, algorithm: string | Algorithm | null, extractable: boolean, keyUsages: string[]): PromiseLike;
- sign(algorithm: string | Algorithm, key: CryptoKey, data: ArrayBufferView): PromiseLike;
- unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: string | Algorithm, unwrappedKeyAlgorithm: string | Algorithm | null, extractable: boolean, keyUsages: string[]): PromiseLike;
- verify(algorithm: string | Algorithm, key: CryptoKey, signature: ArrayBufferView, data: ArrayBufferView): PromiseLike;
- wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: string | Algorithm): PromiseLike;
+ decrypt(algorithm: string | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: BufferSource): PromiseLike;
+ deriveBits(algorithm: string | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, length: number): PromiseLike;
+ deriveKey(algorithm: string | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: string | AesDerivedKeyParams | HmacImportParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, extractable: boolean, keyUsages: string[]): PromiseLike;
+ digest(algorithm: AlgorithmIdentifier, data: BufferSource): PromiseLike;
+ encrypt(algorithm: string | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: BufferSource): PromiseLike;
+ exportKey(format: "jwk", key: CryptoKey): PromiseLike;
+ exportKey(format: "raw" | "pkcs8" | "spki", key: CryptoKey): PromiseLike;
+ exportKey(format: string, key: CryptoKey): PromiseLike;
+ generateKey(algorithm: string, extractable: boolean, keyUsages: string[]): PromiseLike;
+ generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams | DhKeyGenParams, extractable: boolean, keyUsages: string[]): PromiseLike;
+ generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: string[]): PromiseLike;
+ importKey(format: "jwk", keyData: JsonWebKey, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable:boolean, keyUsages: string[]): PromiseLike;
+ importKey(format: "raw" | "pkcs8" | "spki", keyData: BufferSource, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable:boolean, keyUsages: string[]): PromiseLike;
+ importKey(format: string, keyData: JsonWebKey | BufferSource, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable:boolean, keyUsages: string[]): PromiseLike;
+ sign(algorithm: string | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, data: BufferSource): PromiseLike;
+ unwrapKey(format: string, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier, unwrappedKeyAlgorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: string[]): PromiseLike;
+ verify(algorithm: string | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, signature: BufferSource, data: BufferSource): PromiseLike;
+ wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier): PromiseLike;
}
declare var SubtleCrypto: {
@@ -15679,7 +15706,7 @@ interface TextTrack extends EventTarget {
readonly language: string;
mode: any;
oncuechange: (ev: Event) => any;
- onerror: (ev: Event) => any;
+ onerror: (ev: ErrorEvent) => any;
onload: (ev: Event) => any;
readonly readyState: number;
addCue(cue: TextTrackCue): void;
@@ -16168,18 +16195,12 @@ interface WebGLRenderingContext {
stencilMaskSeparate(face: number, mask: number): void;
stencilOp(fail: number, zfail: number, zpass: number): void;
stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void;
- texImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, format: number, type: number, pixels: ArrayBufferView): void;
- texImage2D(target: number, level: number, internalformat: number, format: number, type: number, image: HTMLImageElement): void;
- texImage2D(target: number, level: number, internalformat: number, format: number, type: number, canvas: HTMLCanvasElement): void;
- texImage2D(target: number, level: number, internalformat: number, format: number, type: number, video: HTMLVideoElement): void;
- texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels: ImageData): void;
+ texImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, format: number, type: number, pixels?: ArrayBufferView): void;
+ texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels?: ImageData | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement): void;
texParameterf(target: number, pname: number, param: number): void;
texParameteri(target: number, pname: number, param: number): void;
- texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void;
- texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, image: HTMLImageElement): void;
- texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, canvas: HTMLCanvasElement): void;
- texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, video: HTMLVideoElement): void;
- texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageData): void;
+ texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels?: ArrayBufferView): void;
+ texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels?: ImageData | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement): void;
uniform1f(location: WebGLUniformLocation | null, x: number): void;
uniform1fv(location: WebGLUniformLocation, v: Float32Array | number[]): void;
uniform1i(location: WebGLUniformLocation | null, x: number): void;
@@ -16902,7 +16923,7 @@ interface WebSocket extends EventTarget {
readonly bufferedAmount: number;
readonly extensions: string;
onclose: (ev: CloseEvent) => any;
- onerror: (ev: Event) => any;
+ onerror: (ev: ErrorEvent) => any;
onmessage: (ev: MessageEvent) => any;
onopen: (ev: Event) => any;
readonly protocol: string;
@@ -16977,7 +16998,7 @@ interface Window extends EventTarget, WindowTimers, WindowSessionStorage, Window
name: string;
readonly navigator: Navigator;
offscreenBuffering: string | boolean;
- onabort: (ev: Event) => any;
+ onabort: (ev: UIEvent) => any;
onafterprint: (ev: Event) => any;
onbeforeprint: (ev: Event) => any;
onbeforeunload: (ev: BeforeUnloadEvent) => any;
@@ -17093,6 +17114,7 @@ interface Window extends EventTarget, WindowTimers, WindowSessionStorage, Window
readonly top: Window;
readonly window: Window;
URL: typeof URL;
+ Blob: typeof Blob;
alert(message?: any): void;
blur(): void;
cancelAnimationFrame(handle: number): void;
@@ -17249,7 +17271,6 @@ declare var XMLDocument: {
}
interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget {
- msCaching: string;
onreadystatechange: (ev: ProgressEvent) => any;
readonly readyState: number;
readonly response: any;
@@ -17261,6 +17282,7 @@ interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget {
timeout: number;
readonly upload: XMLHttpRequestUpload;
withCredentials: boolean;
+ msCaching?: string;
abort(): void;
getAllResponseHeaders(): string;
getResponseHeader(header: string): string | null;
@@ -17399,7 +17421,7 @@ declare var XSLTProcessor: {
}
interface AbstractWorker {
- onerror: (ev: Event) => any;
+ onerror: (ev: ErrorEvent) => any;
addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
}
@@ -17558,7 +17580,7 @@ interface LinkStyle {
interface MSBaseReader {
onabort: (ev: Event) => any;
- onerror: (ev: Event) => any;
+ onerror: (ev: ErrorEvent) => any;
onload: (ev: Event) => any;
onloadend: (ev: ProgressEvent) => any;
onloadstart: (ev: Event) => any;
@@ -17623,7 +17645,359 @@ interface NavigatorUserMedia {
}
interface NodeSelector {
+ querySelector(selectors: "a"): HTMLAnchorElement;
+ querySelector(selectors: "abbr"): HTMLElement;
+ querySelector(selectors: "acronym"): HTMLElement;
+ querySelector(selectors: "address"): HTMLElement;
+ querySelector(selectors: "applet"): HTMLAppletElement;
+ querySelector(selectors: "area"): HTMLAreaElement;
+ querySelector(selectors: "article"): HTMLElement;
+ querySelector(selectors: "aside"): HTMLElement;
+ querySelector(selectors: "audio"): HTMLAudioElement;
+ querySelector(selectors: "b"): HTMLElement;
+ querySelector(selectors: "base"): HTMLBaseElement;
+ querySelector(selectors: "basefont"): HTMLBaseFontElement;
+ querySelector(selectors: "bdo"): HTMLElement;
+ querySelector(selectors: "big"): HTMLElement;
+ querySelector(selectors: "blockquote"): HTMLQuoteElement;
+ querySelector(selectors: "body"): HTMLBodyElement;
+ querySelector(selectors: "br"): HTMLBRElement;
+ querySelector(selectors: "button"): HTMLButtonElement;
+ querySelector(selectors: "canvas"): HTMLCanvasElement;
+ querySelector(selectors: "caption"): HTMLTableCaptionElement;
+ querySelector(selectors: "center"): HTMLElement;
+ querySelector(selectors: "circle"): SVGCircleElement;
+ querySelector(selectors: "cite"): HTMLElement;
+ querySelector(selectors: "clippath"): SVGClipPathElement;
+ querySelector(selectors: "code"): HTMLElement;
+ querySelector(selectors: "col"): HTMLTableColElement;
+ querySelector(selectors: "colgroup"): HTMLTableColElement;
+ querySelector(selectors: "datalist"): HTMLDataListElement;
+ querySelector(selectors: "dd"): HTMLElement;
+ querySelector(selectors: "defs"): SVGDefsElement;
+ querySelector(selectors: "del"): HTMLModElement;
+ querySelector(selectors: "desc"): SVGDescElement;
+ querySelector(selectors: "dfn"): HTMLElement;
+ querySelector(selectors: "dir"): HTMLDirectoryElement;
+ querySelector(selectors: "div"): HTMLDivElement;
+ querySelector(selectors: "dl"): HTMLDListElement;
+ querySelector(selectors: "dt"): HTMLElement;
+ querySelector(selectors: "ellipse"): SVGEllipseElement;
+ querySelector(selectors: "em"): HTMLElement;
+ querySelector(selectors: "embed"): HTMLEmbedElement;
+ querySelector(selectors: "feblend"): SVGFEBlendElement;
+ querySelector(selectors: "fecolormatrix"): SVGFEColorMatrixElement;
+ querySelector(selectors: "fecomponenttransfer"): SVGFEComponentTransferElement;
+ querySelector(selectors: "fecomposite"): SVGFECompositeElement;
+ querySelector(selectors: "feconvolvematrix"): SVGFEConvolveMatrixElement;
+ querySelector(selectors: "fediffuselighting"): SVGFEDiffuseLightingElement;
+ querySelector(selectors: "fedisplacementmap"): SVGFEDisplacementMapElement;
+ querySelector(selectors: "fedistantlight"): SVGFEDistantLightElement;
+ querySelector(selectors: "feflood"): SVGFEFloodElement;
+ querySelector(selectors: "fefunca"): SVGFEFuncAElement;
+ querySelector(selectors: "fefuncb"): SVGFEFuncBElement;
+ querySelector(selectors: "fefuncg"): SVGFEFuncGElement;
+ querySelector(selectors: "fefuncr"): SVGFEFuncRElement;
+ querySelector(selectors: "fegaussianblur"): SVGFEGaussianBlurElement;
+ querySelector(selectors: "feimage"): SVGFEImageElement;
+ querySelector(selectors: "femerge"): SVGFEMergeElement;
+ querySelector(selectors: "femergenode"): SVGFEMergeNodeElement;
+ querySelector(selectors: "femorphology"): SVGFEMorphologyElement;
+ querySelector(selectors: "feoffset"): SVGFEOffsetElement;
+ querySelector(selectors: "fepointlight"): SVGFEPointLightElement;
+ querySelector(selectors: "fespecularlighting"): SVGFESpecularLightingElement;
+ querySelector(selectors: "fespotlight"): SVGFESpotLightElement;
+ querySelector(selectors: "fetile"): SVGFETileElement;
+ querySelector(selectors: "feturbulence"): SVGFETurbulenceElement;
+ querySelector(selectors: "fieldset"): HTMLFieldSetElement;
+ querySelector(selectors: "figcaption"): HTMLElement;
+ querySelector(selectors: "figure"): HTMLElement;
+ querySelector(selectors: "filter"): SVGFilterElement;
+ querySelector(selectors: "font"): HTMLFontElement;
+ querySelector(selectors: "footer"): HTMLElement;
+ querySelector(selectors: "foreignobject"): SVGForeignObjectElement;
+ querySelector(selectors: "form"): HTMLFormElement;
+ querySelector(selectors: "frame"): HTMLFrameElement;
+ querySelector(selectors: "frameset"): HTMLFrameSetElement;
+ querySelector(selectors: "g"): SVGGElement;
+ querySelector(selectors: "h1"): HTMLHeadingElement;
+ querySelector(selectors: "h2"): HTMLHeadingElement;
+ querySelector(selectors: "h3"): HTMLHeadingElement;
+ querySelector(selectors: "h4"): HTMLHeadingElement;
+ querySelector(selectors: "h5"): HTMLHeadingElement;
+ querySelector(selectors: "h6"): HTMLHeadingElement;
+ querySelector(selectors: "head"): HTMLHeadElement;
+ querySelector(selectors: "header"): HTMLElement;
+ querySelector(selectors: "hgroup"): HTMLElement;
+ querySelector(selectors: "hr"): HTMLHRElement;
+ querySelector(selectors: "html"): HTMLHtmlElement;
+ querySelector(selectors: "i"): HTMLElement;
+ querySelector(selectors: "iframe"): HTMLIFrameElement;
+ querySelector(selectors: "image"): SVGImageElement;
+ querySelector(selectors: "img"): HTMLImageElement;
+ querySelector(selectors: "input"): HTMLInputElement;
+ querySelector(selectors: "ins"): HTMLModElement;
+ querySelector(selectors: "isindex"): HTMLUnknownElement;
+ querySelector(selectors: "kbd"): HTMLElement;
+ querySelector(selectors: "keygen"): HTMLElement;
+ querySelector(selectors: "label"): HTMLLabelElement;
+ querySelector(selectors: "legend"): HTMLLegendElement;
+ querySelector(selectors: "li"): HTMLLIElement;
+ querySelector(selectors: "line"): SVGLineElement;
+ querySelector(selectors: "lineargradient"): SVGLinearGradientElement;
+ querySelector(selectors: "link"): HTMLLinkElement;
+ querySelector(selectors: "listing"): HTMLPreElement;
+ querySelector(selectors: "map"): HTMLMapElement;
+ querySelector(selectors: "mark"): HTMLElement;
+ querySelector(selectors: "marker"): SVGMarkerElement;
+ querySelector(selectors: "marquee"): HTMLMarqueeElement;
+ querySelector(selectors: "mask"): SVGMaskElement;
+ querySelector(selectors: "menu"): HTMLMenuElement;
+ querySelector(selectors: "meta"): HTMLMetaElement;
+ querySelector(selectors: "metadata"): SVGMetadataElement;
+ querySelector(selectors: "meter"): HTMLMeterElement;
+ querySelector(selectors: "nav"): HTMLElement;
+ querySelector(selectors: "nextid"): HTMLUnknownElement;
+ querySelector(selectors: "nobr"): HTMLElement;
+ querySelector(selectors: "noframes"): HTMLElement;
+ querySelector(selectors: "noscript"): HTMLElement;
+ querySelector(selectors: "object"): HTMLObjectElement;
+ querySelector(selectors: "ol"): HTMLOListElement;
+ querySelector(selectors: "optgroup"): HTMLOptGroupElement;
+ querySelector(selectors: "option"): HTMLOptionElement;
+ querySelector(selectors: "p"): HTMLParagraphElement;
+ querySelector(selectors: "param"): HTMLParamElement;
+ querySelector(selectors: "path"): SVGPathElement;
+ querySelector(selectors: "pattern"): SVGPatternElement;
+ querySelector(selectors: "picture"): HTMLPictureElement;
+ querySelector(selectors: "plaintext"): HTMLElement;
+ querySelector(selectors: "polygon"): SVGPolygonElement;
+ querySelector(selectors: "polyline"): SVGPolylineElement;
+ querySelector(selectors: "pre"): HTMLPreElement;
+ querySelector(selectors: "progress"): HTMLProgressElement;
+ querySelector(selectors: "q"): HTMLQuoteElement;
+ querySelector(selectors: "radialgradient"): SVGRadialGradientElement;
+ querySelector(selectors: "rect"): SVGRectElement;
+ querySelector(selectors: "rt"): HTMLElement;
+ querySelector(selectors: "ruby"): HTMLElement;
+ querySelector(selectors: "s"): HTMLElement;
+ querySelector(selectors: "samp"): HTMLElement;
+ querySelector(selectors: "script"): HTMLScriptElement;
+ querySelector(selectors: "section"): HTMLElement;
+ querySelector(selectors: "select"): HTMLSelectElement;
+ querySelector(selectors: "small"): HTMLElement;
+ querySelector(selectors: "source"): HTMLSourceElement;
+ querySelector(selectors: "span"): HTMLSpanElement;
+ querySelector(selectors: "stop"): SVGStopElement;
+ querySelector(selectors: "strike"): HTMLElement;
+ querySelector(selectors: "strong"): HTMLElement;
+ querySelector(selectors: "style"): HTMLStyleElement;
+ querySelector(selectors: "sub"): HTMLElement;
+ querySelector(selectors: "sup"): HTMLElement;
+ querySelector(selectors: "svg"): SVGSVGElement;
+ querySelector(selectors: "switch"): SVGSwitchElement;
+ querySelector(selectors: "symbol"): SVGSymbolElement;
+ querySelector(selectors: "table"): HTMLTableElement;
+ querySelector(selectors: "tbody"): HTMLTableSectionElement;
+ querySelector(selectors: "td"): HTMLTableDataCellElement;
+ querySelector(selectors: "template"): HTMLTemplateElement;
+ querySelector(selectors: "text"): SVGTextElement;
+ querySelector(selectors: "textpath"): SVGTextPathElement;
+ querySelector(selectors: "textarea"): HTMLTextAreaElement;
+ querySelector(selectors: "tfoot"): HTMLTableSectionElement;
+ querySelector(selectors: "th"): HTMLTableHeaderCellElement;
+ querySelector(selectors: "thead"): HTMLTableSectionElement;
+ querySelector(selectors: "title"): HTMLTitleElement;
+ querySelector(selectors: "tr"): HTMLTableRowElement;
+ querySelector(selectors: "track"): HTMLTrackElement;
+ querySelector(selectors: "tspan"): SVGTSpanElement;
+ querySelector(selectors: "tt"): HTMLElement;
+ querySelector(selectors: "u"): HTMLElement;
+ querySelector(selectors: "ul"): HTMLUListElement;
+ querySelector(selectors: "use"): SVGUseElement;
+ querySelector(selectors: "var"): HTMLElement;
+ querySelector(selectors: "video"): HTMLVideoElement;
+ querySelector(selectors: "view"): SVGViewElement;
+ querySelector(selectors: "wbr"): HTMLElement;
+ querySelector(selectors: "x-ms-webview"): MSHTMLWebViewElement;
+ querySelector(selectors: "xmp"): HTMLPreElement;
querySelector(selectors: string): Element;
+ querySelectorAll(selectors: "a"): NodeListOf;
+ querySelectorAll(selectors: "abbr"): NodeListOf;
+ querySelectorAll(selectors: "acronym"): NodeListOf;
+ querySelectorAll(selectors: "address"): NodeListOf;
+ querySelectorAll(selectors: "applet"): NodeListOf;
+ querySelectorAll(selectors: "area"): NodeListOf;
+ querySelectorAll(selectors: "article"): NodeListOf;
+ querySelectorAll(selectors: "aside"): NodeListOf;
+ querySelectorAll(selectors: "audio"): NodeListOf;
+ querySelectorAll(selectors: "b"): NodeListOf;
+ querySelectorAll(selectors: "base"): NodeListOf;
+ querySelectorAll(selectors: "basefont"): NodeListOf;
+ querySelectorAll(selectors: "bdo"): NodeListOf;
+ querySelectorAll(selectors: "big"): NodeListOf;
+ querySelectorAll(selectors: "blockquote"): NodeListOf;
+ querySelectorAll(selectors: "body"): NodeListOf;
+ querySelectorAll(selectors: "br"): NodeListOf;
+ querySelectorAll(selectors: "button"): NodeListOf;
+ querySelectorAll(selectors: "canvas"): NodeListOf;
+ querySelectorAll(selectors: "caption"): NodeListOf;
+ querySelectorAll(selectors: "center"): NodeListOf;
+ querySelectorAll(selectors: "circle"): NodeListOf;
+ querySelectorAll(selectors: "cite"): NodeListOf;
+ querySelectorAll(selectors: "clippath"): NodeListOf;
+ querySelectorAll(selectors: "code"): NodeListOf;
+ querySelectorAll(selectors: "col"): NodeListOf;
+ querySelectorAll(selectors: "colgroup"): NodeListOf;
+ querySelectorAll(selectors: "datalist"): NodeListOf;
+ querySelectorAll(selectors: "dd"): NodeListOf;
+ querySelectorAll(selectors: "defs"): NodeListOf;
+ querySelectorAll(selectors: "del"): NodeListOf;
+ querySelectorAll(selectors: "desc"): NodeListOf;
+ querySelectorAll(selectors: "dfn"): NodeListOf;
+ querySelectorAll(selectors: "dir"): NodeListOf;
+ querySelectorAll(selectors: "div"): NodeListOf;
+ querySelectorAll(selectors: "dl"): NodeListOf;
+ querySelectorAll(selectors: "dt"): NodeListOf;
+ querySelectorAll(selectors: "ellipse"): NodeListOf;
+ querySelectorAll(selectors: "em"): NodeListOf;
+ querySelectorAll(selectors: "embed"): NodeListOf;
+ querySelectorAll(selectors: "feblend"): NodeListOf;
+ querySelectorAll(selectors: "fecolormatrix"): NodeListOf;
+ querySelectorAll(selectors: "fecomponenttransfer"): NodeListOf;
+ querySelectorAll(selectors: "fecomposite"): NodeListOf;
+ querySelectorAll(selectors: "feconvolvematrix"): NodeListOf;
+ querySelectorAll(selectors: "fediffuselighting"): NodeListOf;
+ querySelectorAll(selectors: "fedisplacementmap"): NodeListOf;
+ querySelectorAll(selectors: "fedistantlight"): NodeListOf;
+ querySelectorAll(selectors: "feflood"): NodeListOf;
+ querySelectorAll(selectors: "fefunca"): NodeListOf;
+ querySelectorAll(selectors: "fefuncb"): NodeListOf;
+ querySelectorAll(selectors: "fefuncg"): NodeListOf;
+ querySelectorAll(selectors: "fefuncr"): NodeListOf;
+ querySelectorAll(selectors: "fegaussianblur"): NodeListOf;
+ querySelectorAll(selectors: "feimage"): NodeListOf;
+ querySelectorAll(selectors: "femerge"): NodeListOf;
+ querySelectorAll(selectors: "femergenode"): NodeListOf;
+ querySelectorAll(selectors: "femorphology"): NodeListOf;
+ querySelectorAll(selectors: "feoffset"): NodeListOf;
+ querySelectorAll(selectors: "fepointlight"): NodeListOf;
+ querySelectorAll(selectors: "fespecularlighting"): NodeListOf;
+ querySelectorAll(selectors: "fespotlight"): NodeListOf;
+ querySelectorAll(selectors: "fetile"): NodeListOf;
+ querySelectorAll(selectors: "feturbulence"): NodeListOf;
+ querySelectorAll(selectors: "fieldset"): NodeListOf;
+ querySelectorAll(selectors: "figcaption"): NodeListOf;
+ querySelectorAll(selectors: "figure"): NodeListOf;
+ querySelectorAll(selectors: "filter"): NodeListOf;
+ querySelectorAll(selectors: "font"): NodeListOf;
+ querySelectorAll(selectors: "footer"): NodeListOf;
+ querySelectorAll(selectors: "foreignobject"): NodeListOf;
+ querySelectorAll(selectors: "form"): NodeListOf;
+ querySelectorAll(selectors: "frame"): NodeListOf;
+ querySelectorAll(selectors: "frameset"): NodeListOf;
+ querySelectorAll(selectors: "g"): NodeListOf;
+ querySelectorAll(selectors: "h1"): NodeListOf;
+ querySelectorAll(selectors: "h2"): NodeListOf;
+ querySelectorAll(selectors: "h3"): NodeListOf;
+ querySelectorAll(selectors: "h4"): NodeListOf;
+ querySelectorAll(selectors: "h5"): NodeListOf;
+ querySelectorAll(selectors: "h6"): NodeListOf;
+ querySelectorAll(selectors: "head"): NodeListOf;
+ querySelectorAll(selectors: "header"): NodeListOf;
+ querySelectorAll(selectors: "hgroup"): NodeListOf;
+ querySelectorAll(selectors: "hr"): NodeListOf;
+ querySelectorAll(selectors: "html"): NodeListOf;
+ querySelectorAll(selectors: "i"): NodeListOf;
+ querySelectorAll(selectors: "iframe"): NodeListOf;
+ querySelectorAll(selectors: "image"): NodeListOf;
+ querySelectorAll(selectors: "img"): NodeListOf;
+ querySelectorAll(selectors: "input"): NodeListOf;
+ querySelectorAll(selectors: "ins"): NodeListOf;
+ querySelectorAll(selectors: "isindex"): NodeListOf;
+ querySelectorAll(selectors: "kbd"): NodeListOf;
+ querySelectorAll(selectors: "keygen"): NodeListOf;
+ querySelectorAll(selectors: "label"): NodeListOf;
+ querySelectorAll(selectors: "legend"): NodeListOf;
+ querySelectorAll(selectors: "li"): NodeListOf;
+ querySelectorAll(selectors: "line"): NodeListOf;
+ querySelectorAll(selectors: "lineargradient"): NodeListOf;
+ querySelectorAll(selectors: "link"): NodeListOf;
+ querySelectorAll(selectors: "listing"): NodeListOf;
+ querySelectorAll(selectors: "map"): NodeListOf;
+ querySelectorAll(selectors: "mark"): NodeListOf;
+ querySelectorAll(selectors: "marker"): NodeListOf;
+ querySelectorAll(selectors: "marquee"): NodeListOf;
+ querySelectorAll(selectors: "mask"): NodeListOf;
+ querySelectorAll(selectors: "menu"): NodeListOf;
+ querySelectorAll(selectors: "meta"): NodeListOf;
+ querySelectorAll(selectors: "metadata"): NodeListOf;
+ querySelectorAll(selectors: "meter"): NodeListOf;
+ querySelectorAll(selectors: "nav"): NodeListOf;
+ querySelectorAll(selectors: "nextid"): NodeListOf;
+ querySelectorAll(selectors: "nobr"): NodeListOf;
+ querySelectorAll(selectors: "noframes"): NodeListOf;
+ querySelectorAll(selectors: "noscript"): NodeListOf;
+ querySelectorAll(selectors: "object"): NodeListOf;
+ querySelectorAll(selectors: "ol"): NodeListOf;
+ querySelectorAll(selectors: "optgroup"): NodeListOf;
+ querySelectorAll(selectors: "option"): NodeListOf;
+ querySelectorAll(selectors: "p"): NodeListOf;
+ querySelectorAll(selectors: "param"): NodeListOf;
+ querySelectorAll(selectors: "path"): NodeListOf;
+ querySelectorAll(selectors: "pattern"): NodeListOf;
+ querySelectorAll(selectors: "picture"): NodeListOf;
+ querySelectorAll(selectors: "plaintext"): NodeListOf;
+ querySelectorAll(selectors: "polygon"): NodeListOf;
+ querySelectorAll(selectors: "polyline"): NodeListOf;
+ querySelectorAll(selectors: "pre"): NodeListOf;
+ querySelectorAll(selectors: "progress"): NodeListOf;
+ querySelectorAll(selectors: "q"): NodeListOf;
+ querySelectorAll(selectors: "radialgradient"): NodeListOf;
+ querySelectorAll(selectors: "rect"): NodeListOf;
+ querySelectorAll(selectors: "rt"): NodeListOf;
+ querySelectorAll(selectors: "ruby"): NodeListOf;
+ querySelectorAll(selectors: "s"): NodeListOf;
+ querySelectorAll(selectors: "samp"): NodeListOf;
+ querySelectorAll(selectors: "script"): NodeListOf;
+ querySelectorAll(selectors: "section"): NodeListOf;
+ querySelectorAll(selectors: "select"): NodeListOf;
+ querySelectorAll(selectors: "small"): NodeListOf;
+ querySelectorAll(selectors: "source"): NodeListOf;
+ querySelectorAll(selectors: "span"): NodeListOf;
+ querySelectorAll(selectors: "stop"): NodeListOf;
+ querySelectorAll(selectors: "strike"): NodeListOf;
+ querySelectorAll(selectors: "strong"): NodeListOf;
+ querySelectorAll(selectors: "style"): NodeListOf;
+ querySelectorAll(selectors: "sub"): NodeListOf;
+ querySelectorAll(selectors: "sup"): NodeListOf;
+ querySelectorAll(selectors: "svg"): NodeListOf;
+ querySelectorAll(selectors: "switch"): NodeListOf;
+ querySelectorAll(selectors: "symbol"): NodeListOf;
+ querySelectorAll(selectors: "table"): NodeListOf;
+ querySelectorAll(selectors: "tbody"): NodeListOf;
+ querySelectorAll(selectors: "td"): NodeListOf;
+ querySelectorAll(selectors: "template"): NodeListOf;
+ querySelectorAll(selectors: "text"): NodeListOf;
+ querySelectorAll(selectors: "textpath"): NodeListOf;
+ querySelectorAll(selectors: "textarea"): NodeListOf;
+ querySelectorAll(selectors: "tfoot"): NodeListOf;
+ querySelectorAll(selectors: "th"): NodeListOf;
+ querySelectorAll(selectors: "thead"): NodeListOf;
+ querySelectorAll(selectors: "title"): NodeListOf;
+ querySelectorAll(selectors: "tr"): NodeListOf;
+ querySelectorAll(selectors: "track"): NodeListOf;
+ querySelectorAll(selectors: "tspan"): NodeListOf;
+ querySelectorAll(selectors: "tt"): NodeListOf;
+ querySelectorAll(selectors: "u"): NodeListOf;
+ querySelectorAll(selectors: "ul"): NodeListOf;
+ querySelectorAll(selectors: "use"): NodeListOf;
+ querySelectorAll(selectors: "var"): NodeListOf;
+ querySelectorAll(selectors: "video"): NodeListOf;
+ querySelectorAll(selectors: "view"): NodeListOf;
+ querySelectorAll(selectors: "wbr"): NodeListOf;
+ querySelectorAll(selectors: "x-ms-webview"): NodeListOf;
+ querySelectorAll(selectors: "xmp"): NodeListOf;
querySelectorAll(selectors: string): NodeListOf;
}
@@ -17711,18 +18085,21 @@ interface WindowSessionStorage {
interface WindowTimers extends Object, WindowTimersExtension {
clearInterval(handle: number): void;
clearTimeout(handle: number): void;
+ setInterval(handler: (...args: any[]) => void, timeout: number): number;
setInterval(handler: any, timeout?: any, ...args: any[]): number;
+ setTimeout(handler: (...args: any[]) => void, timeout: number): number;
setTimeout(handler: any, timeout?: any, ...args: any[]): number;
}
interface WindowTimersExtension {
clearImmediate(handle: number): void;
- setImmediate(expression: any, ...args: any[]): number;
+ setImmediate(handler: (...args: any[]) => void): number;
+ setImmediate(handler: any, ...args: any[]): number;
}
interface XMLHttpRequestEventTarget {
onabort: (ev: Event) => any;
- onerror: (ev: Event) => any;
+ onerror: (ev: ErrorEvent) => any;
onload: (ev: Event) => any;
onloadend: (ev: ProgressEvent) => any;
onloadstart: (ev: Event) => any;
@@ -17746,6 +18123,13 @@ interface StorageEventInit extends EventInit {
storageArea?: Storage;
}
+interface Canvas2DContextAttributes {
+ alpha?: boolean;
+ willReadFrequently?: boolean;
+ storage?: boolean;
+ [attribute: string]: boolean | string | undefined;
+}
+
interface NodeListOf extends NodeList {
length: number;
item(index: number): TNode;
@@ -17795,6 +18179,177 @@ interface ClipboardEventInit extends EventInit {
interface IDBArrayKey extends Array {
}
+interface RsaKeyGenParams extends Algorithm {
+ modulusLength: number;
+ publicExponent: Uint8Array;
+}
+
+interface RsaHashedKeyGenParams extends RsaKeyGenParams {
+ hash: AlgorithmIdentifier;
+}
+
+interface RsaKeyAlgorithm extends KeyAlgorithm {
+ modulusLength: number;
+ publicExponent: Uint8Array;
+}
+
+interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm {
+ hash: AlgorithmIdentifier;
+}
+
+interface RsaHashedImportParams {
+ hash: AlgorithmIdentifier;
+}
+
+interface RsaPssParams {
+ saltLength: number;
+}
+
+interface RsaOaepParams extends Algorithm {
+ label?: BufferSource;
+}
+
+interface EcdsaParams extends Algorithm {
+ hash: AlgorithmIdentifier;
+}
+
+interface EcKeyGenParams extends Algorithm {
+ typedCurve: string;
+}
+
+interface EcKeyAlgorithm extends KeyAlgorithm {
+ typedCurve: string;
+}
+
+interface EcKeyImportParams {
+ namedCurve: string;
+}
+
+interface EcdhKeyDeriveParams extends Algorithm {
+ public: CryptoKey;
+}
+
+interface AesCtrParams extends Algorithm {
+ counter: BufferSource;
+ length: number;
+}
+
+interface AesKeyAlgorithm extends KeyAlgorithm {
+ length: number;
+}
+
+interface AesKeyGenParams extends Algorithm {
+ length: number;
+}
+
+interface AesDerivedKeyParams extends Algorithm {
+ length: number;
+}
+
+interface AesCbcParams extends Algorithm {
+ iv: BufferSource;
+}
+
+interface AesCmacParams extends Algorithm {
+ length: number;
+}
+
+interface AesGcmParams extends Algorithm {
+ iv: BufferSource;
+ additionalData?: BufferSource;
+ tagLength?: number;
+}
+
+interface AesCfbParams extends Algorithm {
+ iv: BufferSource;
+}
+
+interface HmacImportParams extends Algorithm {
+ hash?: AlgorithmIdentifier;
+ length?: number;
+}
+
+interface HmacKeyAlgorithm extends KeyAlgorithm {
+ hash: AlgorithmIdentifier;
+ length: number;
+}
+
+interface HmacKeyGenParams extends Algorithm {
+ hash: AlgorithmIdentifier;
+ length?: number;
+}
+
+interface DhKeyGenParams extends Algorithm {
+ prime: Uint8Array;
+ generator: Uint8Array;
+}
+
+interface DhKeyAlgorithm extends KeyAlgorithm {
+ prime: Uint8Array;
+ generator: Uint8Array;
+}
+
+interface DhKeyDeriveParams extends Algorithm {
+ public: CryptoKey;
+}
+
+interface DhImportKeyParams extends Algorithm {
+ prime: Uint8Array;
+ generator: Uint8Array;
+}
+
+interface ConcatParams extends Algorithm {
+ hash?: AlgorithmIdentifier;
+ algorithmId: Uint8Array;
+ partyUInfo: Uint8Array;
+ partyVInfo: Uint8Array;
+ publicInfo?: Uint8Array;
+ privateInfo?: Uint8Array;
+}
+
+interface HkdfCtrParams extends Algorithm {
+ hash: AlgorithmIdentifier;
+ label: BufferSource;
+ context: BufferSource;
+}
+
+interface Pbkdf2Params extends Algorithm {
+ salt: BufferSource;
+ iterations: number;
+ hash: AlgorithmIdentifier;
+}
+
+interface RsaOtherPrimesInfo {
+ r: string;
+ d: string;
+ t: string;
+}
+
+interface JsonWebKey {
+ kty: string;
+ use?: string;
+ key_ops?: string[];
+ alg?: string;
+ kid?: string;
+ x5u?: string;
+ x5c?: string;
+ x5t?: string;
+ ext?: boolean;
+ crv?: string;
+ x?: string;
+ y?: string;
+ d?: string;
+ n?: string;
+ e?: string;
+ p?: string;
+ q?: string;
+ dp?: string;
+ dq?: string;
+ qi?: string;
+ oth?: RsaOtherPrimesInfo[];
+ k?: string;
+}
+
declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
interface ErrorEventHandler {
@@ -17868,7 +18423,7 @@ declare var msCredentials: MSCredentials;
declare var name: string;
declare var navigator: Navigator;
declare var offscreenBuffering: string | boolean;
-declare var onabort: (ev: Event) => any;
+declare var onabort: (ev: UIEvent) => any;
declare var onafterprint: (ev: Event) => any;
declare var onbeforeprint: (ev: Event) => any;
declare var onbeforeunload: (ev: BeforeUnloadEvent) => any;
@@ -18018,10 +18573,13 @@ declare function dispatchEvent(evt: Event): boolean;
declare function removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void;
declare function clearInterval(handle: number): void;
declare function clearTimeout(handle: number): void;
+declare function setInterval(handler: (...args: any[]) => void, timeout: number): number;
declare function setInterval(handler: any, timeout?: any, ...args: any[]): number;
+declare function setTimeout(handler: (...args: any[]) => void, timeout: number): number;
declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number;
declare function clearImmediate(handle: number): void;
-declare function setImmediate(expression: any, ...args: any[]): number;
+declare function setImmediate(handler: (...args: any[]) => void): number;
+declare function setImmediate(handler: any, ...args: any[]): number;
declare var sessionStorage: Storage;
declare var localStorage: Storage;
declare var console: Console;
@@ -18165,6 +18723,8 @@ type RTCIceGatherCandidate = RTCIceCandidate | RTCIceCandidateComplete;
type RTCTransport = RTCDtlsTransport | RTCSrtpSdesTransport;
type payloadtype = number;
type IDBValidKey = number | string | Date | IDBArrayKey;
+type BufferSource = ArrayBuffer | ArrayBufferView;
+type MouseWheelEvent = WheelEvent;
/////////////////////////////
/// WorkerGlobalScope APIs
/////////////////////////////
diff --git a/lib/lib.dom.d.ts b/lib/lib.dom.d.ts
index 673bd34ee3c..117168cb9d1 100644
--- a/lib/lib.dom.d.ts
+++ b/lib/lib.dom.d.ts
@@ -20,7 +20,7 @@ and limitations under the License.
/////////////////////////////
interface Algorithm {
- name?: string;
+ name: string;
}
interface AriaRequestEventInit extends EventInit {
@@ -867,6 +867,7 @@ interface UIEventInit extends EventInit {
}
interface WebGLContextAttributes {
+ failIfMajorPerformanceCaveat?: boolean;
alpha?: boolean;
depth?: boolean;
stencil?: boolean;
@@ -935,7 +936,7 @@ interface ApplicationCache extends EventTarget {
oncached: (ev: Event) => any;
onchecking: (ev: Event) => any;
ondownloading: (ev: Event) => any;
- onerror: (ev: Event) => any;
+ onerror: (ev: ErrorEvent) => any;
onnoupdate: (ev: Event) => any;
onobsolete: (ev: Event) => any;
onprogress: (ev: ProgressEvent) => any;
@@ -2305,7 +2306,7 @@ declare var DeviceRotationRate: {
interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEvent {
/**
- * Sets or gets the URL for the current document.
+ * Sets or gets the URL for the current document.
*/
readonly URL: string;
/**
@@ -2333,7 +2334,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
*/
applets: HTMLCollectionOf;
/**
- * Deprecated. Sets or retrieves a value that indicates the background color behind the object.
+ * Deprecated. Sets or retrieves a value that indicates the background color behind the object.
*/
bgColor: string;
/**
@@ -2361,19 +2362,19 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
*/
designMode: string;
/**
- * Sets or retrieves a value that indicates the reading order of the object.
+ * Sets or retrieves a value that indicates the reading order of the object.
*/
dir: string;
/**
- * Gets an object representing the document type declaration associated with the current document.
+ * Gets an object representing the document type declaration associated with the current document.
*/
readonly doctype: DocumentType;
/**
- * Gets a reference to the root node of the document.
+ * Gets a reference to the root node of the document.
*/
documentElement: HTMLElement;
/**
- * Sets or gets the security domain of the document.
+ * Sets or gets the security domain of the document.
*/
domain: string;
/**
@@ -2397,7 +2398,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
*/
images: HTMLCollectionOf;
/**
- * Gets the implementation object of the current document.
+ * Gets the implementation object of the current document.
*/
readonly implementation: DOMImplementation;
/**
@@ -2405,11 +2406,11 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
*/
readonly inputEncoding: string | null;
/**
- * Gets the date that the page was last modified, if the page supplies one.
+ * Gets the date that the page was last modified, if the page supplies one.
*/
readonly lastModified: string;
/**
- * Sets or gets the color of the document links.
+ * Sets or gets the color of the document links.
*/
linkColor: string;
/**
@@ -2417,7 +2418,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
*/
links: HTMLCollectionOf;
/**
- * Contains information about the current URL.
+ * Contains information about the current URL.
*/
readonly location: Location;
msCSSOMElementFloatMetrics: boolean;
@@ -2426,7 +2427,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
* Fires when the user aborts the download.
* @param ev The event.
*/
- onabort: (ev: Event) => any;
+ onabort: (ev: UIEvent) => any;
/**
* Fires when the object is set as the active element.
* @param ev The event.
@@ -2442,19 +2443,19 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
* @param ev The event.
*/
onbeforedeactivate: (ev: UIEvent) => any;
- /**
- * Fires when the object loses the input focus.
+ /**
+ * Fires when the object loses the input focus.
* @param ev The focus event.
*/
onblur: (ev: FocusEvent) => any;
/**
- * Occurs when playback is possible, but would require further buffering.
+ * Occurs when playback is possible, but would require further buffering.
* @param ev The event.
*/
oncanplay: (ev: Event) => any;
oncanplaythrough: (ev: Event) => any;
/**
- * Fires when the contents of the object or selection have changed.
+ * Fires when the contents of the object or selection have changed.
* @param ev The event.
*/
onchange: (ev: Event) => any;
@@ -2464,7 +2465,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
*/
onclick: (ev: MouseEvent) => any;
/**
- * Fires when the user clicks the right mouse button in the client area, opening the context menu.
+ * Fires when the user clicks the right mouse button in the client area, opening the context menu.
* @param ev The mouse event.
*/
oncontextmenu: (ev: PointerEvent) => any;
@@ -2488,12 +2489,12 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
* @param ev The event.
*/
ondragend: (ev: DragEvent) => any;
- /**
+ /**
* Fires on the target element when the user drags the object to a valid drop target.
* @param ev The drag event.
*/
ondragenter: (ev: DragEvent) => any;
- /**
+ /**
* Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation.
* @param ev The drag event.
*/
@@ -2504,23 +2505,23 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
*/
ondragover: (ev: DragEvent) => any;
/**
- * Fires on the source object when the user starts to drag a text selection or selected object.
+ * Fires on the source object when the user starts to drag a text selection or selected object.
* @param ev The event.
*/
ondragstart: (ev: DragEvent) => any;
ondrop: (ev: DragEvent) => any;
/**
- * Occurs when the duration attribute is updated.
+ * Occurs when the duration attribute is updated.
* @param ev The event.
*/
ondurationchange: (ev: Event) => any;
/**
- * Occurs when the media element is reset to its initial state.
+ * Occurs when the media element is reset to its initial state.
* @param ev The event.
*/
onemptied: (ev: Event) => any;
/**
- * Occurs when the end of playback is reached.
+ * Occurs when the end of playback is reached.
* @param ev The event
*/
onended: (ev: MediaStreamErrorEvent) => any;
@@ -2528,9 +2529,9 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
* Fires when an error occurs during object loading.
* @param ev The event.
*/
- onerror: (ev: Event) => any;
+ onerror: (ev: ErrorEvent) => any;
/**
- * Fires when the object receives focus.
+ * Fires when the object receives focus.
* @param ev The event.
*/
onfocus: (ev: FocusEvent) => any;
@@ -2554,12 +2555,12 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
*/
onkeyup: (ev: KeyboardEvent) => any;
/**
- * Fires immediately after the browser loads the object.
+ * Fires immediately after the browser loads the object.
* @param ev The event.
*/
onload: (ev: Event) => any;
/**
- * Occurs when media data is loaded at the current playback position.
+ * Occurs when media data is loaded at the current playback position.
* @param ev The event.
*/
onloadeddata: (ev: Event) => any;
@@ -2569,22 +2570,22 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
*/
onloadedmetadata: (ev: Event) => any;
/**
- * Occurs when Internet Explorer begins looking for media data.
+ * Occurs when Internet Explorer begins looking for media data.
* @param ev The event.
*/
onloadstart: (ev: Event) => any;
/**
- * Fires when the user clicks the object with either mouse button.
+ * Fires when the user clicks the object with either mouse button.
* @param ev The mouse event.
*/
onmousedown: (ev: MouseEvent) => any;
/**
- * Fires when the user moves the mouse over the object.
+ * Fires when the user moves the mouse over the object.
* @param ev The mouse event.
*/
onmousemove: (ev: MouseEvent) => any;
/**
- * Fires when the user moves the mouse pointer outside the boundaries of the object.
+ * Fires when the user moves the mouse pointer outside the boundaries of the object.
* @param ev The mouse event.
*/
onmouseout: (ev: MouseEvent) => any;
@@ -2594,12 +2595,12 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
*/
onmouseover: (ev: MouseEvent) => any;
/**
- * Fires when the user releases a mouse button while the mouse is over the object.
+ * Fires when the user releases a mouse button while the mouse is over the object.
* @param ev The mouse event.
*/
onmouseup: (ev: MouseEvent) => any;
/**
- * Fires when the wheel button is rotated.
+ * Fires when the wheel button is rotated.
* @param ev The mouse event
*/
onmousewheel: (ev: WheelEvent) => any;
@@ -2621,7 +2622,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
onmspointerover: (ev: MSPointerEvent) => any;
onmspointerup: (ev: MSPointerEvent) => any;
/**
- * Occurs when an item is removed from a Jump List of a webpage running in Site Mode.
+ * Occurs when an item is removed from a Jump List of a webpage running in Site Mode.
* @param ev The event.
*/
onmssitemodejumplistitemremoved: (ev: MSSiteModeEvent) => any;
@@ -2636,24 +2637,24 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
*/
onpause: (ev: Event) => any;
/**
- * Occurs when the play method is requested.
+ * Occurs when the play method is requested.
* @param ev The event.
*/
onplay: (ev: Event) => any;
/**
- * Occurs when the audio or video has started playing.
+ * Occurs when the audio or video has started playing.
* @param ev The event.
*/
onplaying: (ev: Event) => any;
onpointerlockchange: (ev: Event) => any;
onpointerlockerror: (ev: Event) => any;
/**
- * Occurs to indicate progress while downloading media data.
+ * Occurs to indicate progress while downloading media data.
* @param ev The event.
*/
onprogress: (ev: ProgressEvent) => any;
/**
- * Occurs when the playback rate is increased or decreased.
+ * Occurs when the playback rate is increased or decreased.
* @param ev The event.
*/
onratechange: (ev: Event) => any;
@@ -2663,22 +2664,22 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
*/
onreadystatechange: (ev: ProgressEvent) => any;
/**
- * Fires when the user resets a form.
+ * Fires when the user resets a form.
* @param ev The event.
*/
onreset: (ev: Event) => any;
/**
- * Fires when the user repositions the scroll box in the scroll bar on the object.
+ * Fires when the user repositions the scroll box in the scroll bar on the object.
* @param ev The event.
*/
onscroll: (ev: UIEvent) => any;
/**
- * Occurs when the seek operation ends.
+ * Occurs when the seek operation ends.
* @param ev The event.
*/
onseeked: (ev: Event) => any;
/**
- * Occurs when the current playback position is moved.
+ * Occurs when the current playback position is moved.
* @param ev The event.
*/
onseeking: (ev: Event) => any;
@@ -2694,7 +2695,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
onselectionchange: (ev: Event) => any;
onselectstart: (ev: Event) => any;
/**
- * Occurs when the download has stopped.
+ * Occurs when the download has stopped.
* @param ev The event.
*/
onstalled: (ev: Event) => any;
@@ -2705,7 +2706,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
onstop: (ev: Event) => any;
onsubmit: (ev: Event) => any;
/**
- * Occurs if the load operation has been intentionally halted.
+ * Occurs if the load operation has been intentionally halted.
* @param ev The event.
*/
onsuspend: (ev: Event) => any;
@@ -2724,7 +2725,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
*/
onvolumechange: (ev: Event) => any;
/**
- * Occurs when playback stops because the next frame of a video resource is not available.
+ * Occurs when playback stops because the next frame of a video resource is not available.
* @param ev The event.
*/
onwaiting: (ev: Event) => any;
@@ -2758,7 +2759,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
*/
title: string;
readonly visibilityState: string;
- /**
+ /**
* Sets or gets the color of the links that the user has visited.
*/
vlinkColor: string;
@@ -2948,7 +2949,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
createExpression(expression: string, resolver: XPathNSResolver): XPathExpression;
createNSResolver(nodeResolver: Node): XPathNSResolver;
/**
- * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
+ * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
* @param root The root element or node to start traversing on.
* @param whatToShow The type of nodes or elements to appear in the node list
* @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter.
@@ -2957,11 +2958,11 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
createNodeIterator(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): NodeIterator;
createProcessingInstruction(target: string, data: string): ProcessingInstruction;
/**
- * Returns an empty range object that has both of its boundary points positioned at the beginning of the document.
+ * Returns an empty range object that has both of its boundary points positioned at the beginning of the document.
*/
createRange(): Range;
/**
- * Creates a text string from the specified value.
+ * Creates a text string from the specified value.
* @param data String that specifies the nodeValue property of the text node.
*/
createTextNode(data: string): Text;
@@ -2976,7 +2977,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
*/
createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): TreeWalker;
/**
- * Returns the element for the specified x coordinate and the specified y coordinate.
+ * Returns the element for the specified x coordinate and the specified y coordinate.
* @param x The x-offset
* @param y The y-offset
*/
@@ -3004,7 +3005,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
* Returns a reference to the first object with the specified value of the ID or NAME attribute.
* @param elementId String that specifies the ID value. Case-insensitive.
*/
- getElementById(elementId: string): HTMLElement;
+ getElementById(elementId: string): HTMLElement | null;
getElementsByClassName(classNames: string): HTMLCollectionOf;
/**
* Gets a collection of objects based on the value of the NAME or ID attribute.
@@ -3214,7 +3215,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
* @param replace Specifies whether the existing entry for the document is replaced in the history list.
*/
open(url?: string, name?: string, features?: string, replace?: boolean): Document;
- /**
+ /**
* Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document.
* @param commandId Specifies a command identifier.
*/
@@ -3236,7 +3237,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
queryCommandSupported(commandId: string): boolean;
/**
* Retrieves the string associated with a command.
- * @param commandId String that contains the identifier of a command. This can be any command identifier given in the list of Command Identifiers.
+ * @param commandId String that contains the identifier of a command. This can be any command identifier given in the list of Command Identifiers.
*/
queryCommandText(commandId: string): string;
/**
@@ -3252,12 +3253,12 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
webkitCancelFullScreen(): void;
webkitExitFullscreen(): void;
/**
- * Writes one or more HTML expressions to a document in the specified window.
+ * Writes one or more HTML expressions to a document in the specified window.
* @param content Specifies the text and HTML tags to write.
*/
write(...content: string[]): void;
/**
- * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window.
+ * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window.
* @param content The text and HTML tags to write.
*/
writeln(...content: string[]): void;
@@ -3479,7 +3480,7 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelec
readonly scrollWidth: number;
readonly tagName: string;
innerHTML: string;
- getAttribute(name?: string): string | null;
+ getAttribute(name: string): string | null;
getAttributeNS(namespaceURI: string, localName: string): string;
getAttributeNode(name: string): Attr;
getAttributeNodeNS(namespaceURI: string, localName: string): Attr;
@@ -3689,6 +3690,7 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelec
webkitRequestFullscreen(): void;
getElementsByClassName(classNames: string): NodeListOf;
matches(selector: string): boolean;
+ closest(selector: string): Element | null;
addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
@@ -3985,12 +3987,12 @@ interface HTMLAnchorElement extends HTMLElement {
*/
target: string;
/**
- * Retrieves or sets the text of the object as a string.
+ * Retrieves or sets the text of the object as a string.
*/
text: string;
type: string;
urn: string;
- /**
+ /**
* Returns a string representation of an object.
*/
toString(): string;
@@ -4092,7 +4094,7 @@ interface HTMLAreaElement extends HTMLElement {
*/
host: string;
/**
- * Sets or retrieves the host name part of the location or URL.
+ * Sets or retrieves the host name part of the location or URL.
*/
hostname: string;
/**
@@ -4128,7 +4130,7 @@ interface HTMLAreaElement extends HTMLElement {
* Sets or retrieves the window or frame at which to target content.
*/
target: string;
- /**
+ /**
* Returns a string representation of an object.
*/
toString(): string;
@@ -4219,7 +4221,7 @@ interface HTMLBodyElement extends HTMLElement {
onbeforeprint: (ev: Event) => any;
onbeforeunload: (ev: BeforeUnloadEvent) => any;
onblur: (ev: FocusEvent) => any;
- onerror: (ev: Event) => any;
+ onerror: (ev: ErrorEvent) => any;
onfocus: (ev: FocusEvent) => any;
onhashchange: (ev: HashChangeEvent) => any;
onload: (ev: Event) => any;
@@ -4394,7 +4396,7 @@ interface HTMLButtonElement extends HTMLElement {
* Overrides the target attribute on a form element.
*/
formTarget: string;
- /**
+ /**
* Sets or retrieves the name of the object.
*/
name: string;
@@ -4411,7 +4413,7 @@ interface HTMLButtonElement extends HTMLElement {
* Returns a ValidityState object that represents the validity states of an element.
*/
readonly validity: ValidityState;
- /**
+ /**
* Sets or retrieves the default or selected value of the control.
*/
value: string;
@@ -4448,9 +4450,9 @@ interface HTMLCanvasElement extends HTMLElement {
* Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas.
* @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl");
*/
- getContext(contextId: "2d"): CanvasRenderingContext2D;
- getContext(contextId: "experimental-webgl"): WebGLRenderingContext;
- getContext(contextId: string, ...args: any[]): CanvasRenderingContext2D | WebGLRenderingContext;
+ getContext(contextId: "2d", contextAttributes?: Canvas2DContextAttributes): CanvasRenderingContext2D | null;
+ getContext(contextId: "webgl" | "experimental-webgl", contextAttributes?: WebGLContextAttributes): WebGLRenderingContext | null;
+ getContext(contextId: string, contextAttributes?: {}): CanvasRenderingContext2D | WebGLRenderingContext | null;
/**
* Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing.
*/
@@ -4460,7 +4462,7 @@ interface HTMLCanvasElement extends HTMLElement {
* @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image.
*/
toDataURL(type?: string, ...args: any[]): string;
- toBlob(): Blob;
+ toBlob(callback: (result: Blob | null) => void, ... arguments: any[]): void;
}
declare var HTMLCanvasElement: {
@@ -4518,7 +4520,7 @@ declare var HTMLDirectoryElement: {
interface HTMLDivElement extends HTMLElement {
/**
- * Sets or retrieves how the object is aligned with adjacent text.
+ * Sets or retrieves how the object is aligned with adjacent text.
*/
align: string;
/**
@@ -4558,7 +4560,7 @@ interface HTMLElement extends Element {
readonly offsetParent: Element;
readonly offsetTop: number;
readonly offsetWidth: number;
- onabort: (ev: Event) => any;
+ onabort: (ev: UIEvent) => any;
onactivate: (ev: UIEvent) => any;
onbeforeactivate: (ev: UIEvent) => any;
onbeforecopy: (ev: ClipboardEvent) => any;
@@ -4586,7 +4588,7 @@ interface HTMLElement extends Element {
ondurationchange: (ev: Event) => any;
onemptied: (ev: Event) => any;
onended: (ev: MediaStreamErrorEvent) => any;
- onerror: (ev: Event) => any;
+ onerror: (ev: ErrorEvent) => any;
onfocus: (ev: FocusEvent) => any;
oninput: (ev: Event) => any;
oninvalid: (ev: Event) => any;
@@ -5136,7 +5138,7 @@ interface HTMLFrameSetElement extends HTMLElement {
* Fires when the object loses the input focus.
*/
onblur: (ev: FocusEvent) => any;
- onerror: (ev: Event) => any;
+ onerror: (ev: ErrorEvent) => any;
/**
* Fires when the object receives focus.
*/
@@ -5659,9 +5661,9 @@ interface HTMLInputElement extends HTMLElement {
/**
* Returns a FileList object on a file type input object.
*/
- readonly files: FileList;
+ readonly files: FileList | null;
/**
- * Retrieves a reference to the form that the object is embedded in.
+ * Retrieves a reference to the form that the object is embedded in.
*/
readonly form: HTMLFormElement;
/**
@@ -6381,7 +6383,7 @@ interface HTMLMetaElement extends HTMLElement {
*/
scheme: string;
/**
- * Sets or retrieves the URL property that will be loaded after the specified time has elapsed.
+ * Sets or retrieves the URL property that will be loaded after the specified time has elapsed.
*/
url: string;
}
@@ -6630,7 +6632,7 @@ declare var HTMLOptionElement: {
create(): HTMLOptionElement;
}
-interface HTMLOptionsCollection extends HTMLCollection {
+interface HTMLOptionsCollection extends HTMLCollectionOf {
length: number;
selectedIndex: number;
add(element: HTMLOptionElement | HTMLOptGroupElement, before?: HTMLElement | number): void;
@@ -6644,7 +6646,7 @@ declare var HTMLOptionsCollection: {
interface HTMLParagraphElement extends HTMLElement {
/**
- * Sets or retrieves how the object is aligned with adjacent text.
+ * Sets or retrieves how the object is aligned with adjacent text.
*/
align: string;
clear: string;
@@ -6746,10 +6748,10 @@ interface HTMLScriptElement extends HTMLElement {
*/
defer: boolean;
/**
- * Sets or retrieves the event for which the script is written.
+ * Sets or retrieves the event for which the script is written.
*/
event: string;
- /**
+ /**
* Sets or retrieves the object that is bound to the event script.
*/
htmlFor: string;
@@ -6758,7 +6760,7 @@ interface HTMLScriptElement extends HTMLElement {
*/
src: string;
/**
- * Retrieves or sets the text of the object as a string.
+ * Retrieves or sets the text of the object as a string.
*/
text: string;
/**
@@ -6779,7 +6781,7 @@ interface HTMLSelectElement extends HTMLElement {
autofocus: boolean;
disabled: boolean;
/**
- * Retrieves a reference to the form that the object is embedded in.
+ * Retrieves a reference to the form that the object is embedded in.
*/
readonly form: HTMLFormElement;
/**
@@ -6794,7 +6796,7 @@ interface HTMLSelectElement extends HTMLElement {
* Sets or retrieves the name of the object.
*/
name: string;
- options: HTMLCollectionOf;
+ readonly options: HTMLOptionsCollection;
/**
* When present, marks an element that can't be submitted without a value.
*/
@@ -6805,7 +6807,7 @@ interface HTMLSelectElement extends HTMLElement {
selectedIndex: number;
selectedOptions: HTMLCollectionOf;
/**
- * Sets or retrieves the number of rows in the list box.
+ * Sets or retrieves the number of rows in the list box.
*/
size: number;
/**
@@ -6831,7 +6833,7 @@ interface HTMLSelectElement extends HTMLElement {
/**
* Adds an element to the areas, controlRange, or options collection.
* @param element Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection.
- * @param before Variant of type Object that specifies an element to insert before, or null to append the object to the collection.
+ * @param before Variant of type Object that specifies an element to insert before, or null to append the object to the collection.
*/
add(element: HTMLElement, before?: HTMLElement | number): void;
/**
@@ -7026,7 +7028,7 @@ interface HTMLTableElement extends HTMLElement {
*/
border: string;
/**
- * Sets or retrieves the border color of the object.
+ * Sets or retrieves the border color of the object.
*/
borderColor: any;
/**
@@ -7321,7 +7323,7 @@ declare var HTMLTextAreaElement: {
interface HTMLTitleElement extends HTMLElement {
/**
- * Retrieves or sets the text of the object as a string.
+ * Retrieves or sets the text of the object as a string.
*/
text: string;
}
@@ -7590,7 +7592,7 @@ interface IDBDatabase extends EventTarget {
readonly name: string;
readonly objectStoreNames: DOMStringList;
onabort: (ev: Event) => any;
- onerror: (ev: Event) => any;
+ onerror: (ev: ErrorEvent) => any;
version: number;
onversionchange: (ev: IDBVersionChangeEvent) => any;
close(): void;
@@ -7693,7 +7695,7 @@ declare var IDBOpenDBRequest: {
interface IDBRequest extends EventTarget {
readonly error: DOMError;
- onerror: (ev: Event) => any;
+ onerror: (ev: ErrorEvent) => any;
onsuccess: (ev: Event) => any;
readonly readyState: string;
readonly result: any;
@@ -7715,7 +7717,7 @@ interface IDBTransaction extends EventTarget {
readonly mode: string;
onabort: (ev: Event) => any;
oncomplete: (ev: Event) => any;
- onerror: (ev: Event) => any;
+ onerror: (ev: ErrorEvent) => any;
abort(): void;
objectStore(name: string): IDBObjectStore;
readonly READ_ONLY: string;
@@ -7858,7 +7860,7 @@ declare var MSApp: MSApp;
interface MSAppAsyncOperation extends EventTarget {
readonly error: DOMError;
oncomplete: (ev: Event) => any;
- onerror: (ev: Event) => any;
+ onerror: (ev: ErrorEvent) => any;
readonly readyState: number;
readonly result: any;
start(): void;
@@ -8218,7 +8220,7 @@ declare var MSStreamReader: {
interface MSWebViewAsyncOperation extends EventTarget {
readonly error: DOMError;
oncomplete: (ev: Event) => any;
- onerror: (ev: Event) => any;
+ onerror: (ev: ErrorEvent) => any;
readonly readyState: number;
readonly result: any;
readonly target: MSHTMLWebViewElement;
@@ -8754,7 +8756,7 @@ interface Node extends EventTarget {
contains(child: Node): boolean;
hasAttributes(): boolean;
hasChildNodes(): boolean;
- insertBefore(newChild: Node, refChild: Node): Node;
+ insertBefore(newChild: Node, refChild: Node | null): Node;
isDefaultNamespace(namespaceURI: string | null): boolean;
isEqualNode(arg: Node): boolean;
isSameNode(other: Node): boolean;
@@ -8763,7 +8765,6 @@ interface Node extends EventTarget {
normalize(): void;
removeChild(oldChild: Node): Node;
replaceChild(newChild: Node, oldChild: Node): Node;
- contains(node: Node): boolean;
readonly ATTRIBUTE_NODE: number;
readonly CDATA_SECTION_NODE: number;
readonly COMMENT_NODE: number;
@@ -9299,7 +9300,7 @@ declare var RTCDTMFToneChangeEvent: {
interface RTCDtlsTransport extends RTCStatsProvider {
ondtlsstatechange: ((ev: RTCDtlsTransportStateChangedEvent) => any) | null;
- onerror: ((ev: Event) => any) | null;
+ onerror: ((ev: ErrorEvent) => any) | null;
readonly state: string;
readonly transport: RTCIceTransport;
getLocalParameters(): RTCDtlsParameters;
@@ -9354,7 +9355,7 @@ declare var RTCIceCandidatePairChangedEvent: {
interface RTCIceGatherer extends RTCStatsProvider {
readonly component: string;
- onerror: ((ev: Event) => any) | null;
+ onerror: ((ev: ErrorEvent) => any) | null;
onlocalcandidate: ((ev: RTCIceGathererEvent) => any) | null;
createAssociatedGatherer(): RTCIceGatherer;
getLocalCandidates(): RTCIceCandidate[];
@@ -9413,7 +9414,7 @@ declare var RTCIceTransportStateChangedEvent: {
}
interface RTCRtpReceiver extends RTCStatsProvider {
- onerror: ((ev: Event) => any) | null;
+ onerror: ((ev: ErrorEvent) => any) | null;
readonly rtcpTransport: RTCDtlsTransport;
readonly track: MediaStreamTrack | null;
readonly transport: RTCDtlsTransport | RTCSrtpSdesTransport;
@@ -9433,7 +9434,7 @@ declare var RTCRtpReceiver: {
}
interface RTCRtpSender extends RTCStatsProvider {
- onerror: ((ev: Event) => any) | null;
+ onerror: ((ev: ErrorEvent) => any) | null;
onssrcconflict: ((ev: RTCSsrcConflictEvent) => any) | null;
readonly rtcpTransport: RTCDtlsTransport;
readonly track: MediaStreamTrack;
@@ -9454,7 +9455,7 @@ declare var RTCRtpSender: {
}
interface RTCSrtpSdesTransport extends EventTarget {
- onerror: ((ev: Event) => any) | null;
+ onerror: ((ev: ErrorEvent) => any) | null;
readonly transport: RTCIceTransport;
addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
@@ -11494,18 +11495,24 @@ declare var StyleSheetPageList: {
}
interface SubtleCrypto {
- decrypt(algorithm: string | Algorithm, key: CryptoKey, data: ArrayBufferView): PromiseLike;
- deriveBits(algorithm: string | Algorithm, baseKey: CryptoKey, length: number): PromiseLike